Skip to content

Commit

Permalink
Fix incorrect span activation for local activities (#910)
Browse files Browse the repository at this point in the history
What changed?

span is incorrectly activated for local activities, this is already activated in activity worker

[cadence-java-client/src/main/java/com/uber/cadence/internal/worker/LocalActivityWorker.java](https://github.com/uber/cadence-java-client/blob/95cb139ff9947db730186369a4f4ed34578f85c8/src/main/java/com/uber/cadence/internal/worker/LocalActivityWorker.java#L137)
  • Loading branch information
shijiesheng authored Jun 12, 2024
1 parent 5caf971 commit ad20d97
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,14 @@ public Span spanForExecuteLocalActivity(Task task) {
// retrieve spancontext from params
SpanContext parent = extract(params.getContext());

Span span =
tracer
.buildSpan(EXECUTE_LOCAL_ACTIVITY)
.ignoreActiveSpan()
.addReference(References.FOLLOWS_FROM, parent)
.withTag(TAG_WORKFLOW_ID, params.getWorkflowExecution().getWorkflowId())
.withTag(TAG_WORKFLOW_RUN_ID, params.getWorkflowExecution().getRunId())
.withTag(TAG_ACTIVITY_TYPE, params.getActivityType().getName())
.start();
tracer.activateSpan(span);
return span;
return tracer
.buildSpan(EXECUTE_LOCAL_ACTIVITY)
.ignoreActiveSpan()
.addReference(References.FOLLOWS_FROM, parent)
.withTag(TAG_WORKFLOW_ID, params.getWorkflowExecution().getWorkflowId())
.withTag(TAG_WORKFLOW_RUN_ID, params.getWorkflowExecution().getRunId())
.withTag(TAG_ACTIVITY_TYPE, params.getActivityType().getName())
.start();
}

public void inject(Map<String, byte[]> headers) {
Expand Down

0 comments on commit ad20d97

Please sign in to comment.