Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrument Mulesoft 4.5.0+ #7981

Merged
merged 24 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change parent-child propagatoin
  • Loading branch information
amarziali committed Nov 29, 2024
commit 05fe29d8d7fae8c04f1b2a9b48be01286c1450d1
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ public static void onExit(
} else if (arg instanceof EventContext) {
// This means that we are in the constructor for ChildContext and we should copy the span
// from the parent EventContext which is the first argument.
spanState = contextStore.get((EventContext) arg);
if (spanState != null) {
spanState = spanState.copy();
} else {
spanState = new SpanState(activeSpan(), null);
final SpanState parentState = contextStore.get((EventContext) arg);
if (parentState != null) {
spanState = new SpanState(parentState.getEventContextSpan(), null);
}
// TODO: remove me
System.err.println("CHILD CREATED " + " " + activeSpan() + " " + spanState);
}

contextStore.put(zis, spanState);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ public SpanState withSpanContextSpan(AgentSpan spanContextSpan) {
return this;
}

public SpanState copy() {
return new SpanState(eventContextSpan, previousState).withSpanContextSpan(spanContextSpan);
@Override
public String toString() {
return "SpanState{"
+ "eventContextSpan="
+ eventContextSpan
+ ", previousState="
+ previousState
+ ", spanContextSpan="
+ spanContextSpan
+ '}';
}
}