@@ -195,8 +195,8 @@ public void startAndBlock() {
195195
196196 // Start the orchestration span BEFORE execution so child spans
197197 // (activities, timers) are nested under it. Use setSpanId() to give
198- // all dispatches the same span ID — Jaeger deduplicates by span ID,
199- // keeping the latest end time (matching .NET's SetSpanId pattern).
198+ // all dispatches the same span ID for deduplication
199+ // (matching .NET's SetSpanId pattern).
200200 Span orchestrationSpan = null ;
201201 TraceContext orchestrationSpanContext = null ;
202202 if (orchTraceCtx != null ) {
@@ -205,11 +205,11 @@ public void startAndBlock() {
205205 orchSpanAttrs .put (TracingHelper .ATTR_TASK_NAME , orchName );
206206 orchSpanAttrs .put (TracingHelper .ATTR_INSTANCE_ID , orchestratorRequest .getInstanceId ());
207207
208- Instant spanStartTime = null ;
209- if ( startedHistoryEvent != null && startedHistoryEvent . hasTimestamp ()) {
210- spanStartTime = DataConverter . getInstantFromTimestamp (
211- startedHistoryEvent .getTimestamp ());
212- }
208+ // Use ExecutionStartedEvent timestamp so the orchestration span
209+ // covers the full lifecycle from creation to completion
210+ Instant spanStartTime = startedHistoryEvent . hasTimestamp ()
211+ ? DataConverter . getInstantFromTimestamp ( startedHistoryEvent .getTimestamp ())
212+ : null ;
213213
214214 orchestrationSpan = TracingHelper .startSpanWithStartTime (
215215 TracingHelper .TYPE_ORCHESTRATION + ":" + orchName ,
@@ -227,7 +227,7 @@ public void startAndBlock() {
227227 && orchestratorRequest .getOrchestrationTraceContext ().getSpanID ().getValue () != null
228228 && !orchestratorRequest .getOrchestrationTraceContext ().getSpanID ().getValue ().isEmpty ()) {
229229 orchSpanId = orchestratorRequest .getOrchestrationTraceContext ().getSpanID ().getValue ();
230- } else if ( orchTraceCtx != null ) {
230+ } else {
231231 // Derive from parent span ID by hashing with instance ID
232232 String parentSpanId = TracingHelper .extractSpanIdFromTraceparent (
233233 orchTraceCtx .getTraceParent ());
0 commit comments