-
Notifications
You must be signed in to change notification settings - Fork 303
Baggage E2E "working" #8699
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
Baggage E2E "working" #8699
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 67 metrics, 4 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.49.0-SNAPSHOT~882611bdc7, baseline=1.49.0-SNAPSHOT~9f6519428f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.014 s) : 0, 1014113
Total [baseline] (10.48 s) : 0, 10480324
Agent [candidate] (1.015 s) : 0, 1014565
Total [candidate] (10.595 s) : 0, 10595071
section appsec
Agent [baseline] (1.155 s) : 0, 1154737
Total [baseline] (10.711 s) : 0, 10711015
Agent [candidate] (1.155 s) : 0, 1155312
Total [candidate] (10.685 s) : 0, 10685448
section iast
Agent [baseline] (1.136 s) : 0, 1136195
Total [baseline] (10.851 s) : 0, 10850994
Agent [candidate] (1.138 s) : 0, 1137696
Total [candidate] (10.877 s) : 0, 10876962
section profiling
Agent [baseline] (1.258 s) : 0, 1257872
Total [baseline] (10.829 s) : 0, 10828965
Agent [candidate] (1.259 s) : 0, 1259325
Total [candidate] (10.834 s) : 0, 10834111
gantt
title petclinic - break down per module: candidate=1.49.0-SNAPSHOT~882611bdc7, baseline=1.49.0-SNAPSHOT~9f6519428f
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (675.747 ms) : 0, 675747
BytebuddyAgent [candidate] (676.498 ms) : 0, 676498
GlobalTracer [baseline] (241.766 ms) : 0, 241766
GlobalTracer [candidate] (241.607 ms) : 0, 241607
AppSec [baseline] (55.151 ms) : 0, 55151
AppSec [candidate] (55.081 ms) : 0, 55081
Debugger [baseline] (6.225 ms) : 0, 6225
Debugger [candidate] (6.198 ms) : 0, 6198
Remote Config [baseline] (716.729 µs) : 0, 717
Remote Config [candidate] (711.206 µs) : 0, 711
Telemetry [baseline] (10.929 ms) : 0, 10929
Telemetry [candidate] (10.842 ms) : 0, 10842
section appsec
BytebuddyAgent [baseline] (692.248 ms) : 0, 692248
BytebuddyAgent [candidate] (691.749 ms) : 0, 691749
GlobalTracer [baseline] (237.831 ms) : 0, 237831
GlobalTracer [candidate] (238.52 ms) : 0, 238520
IAST [baseline] (22.183 ms) : 0, 22183
IAST [candidate] (21.787 ms) : 0, 21787
AppSec [baseline] (175.246 ms) : 0, 175246
AppSec [candidate] (175.524 ms) : 0, 175524
Debugger [baseline] (5.884 ms) : 0, 5884
Debugger [candidate] (5.918 ms) : 0, 5918
Remote Config [baseline] (633.225 µs) : 0, 633
Remote Config [candidate] (643.565 µs) : 0, 644
Telemetry [baseline] (8.202 ms) : 0, 8202
Telemetry [candidate] (8.536 ms) : 0, 8536
section iast
BytebuddyAgent [baseline] (789.205 ms) : 0, 789205
BytebuddyAgent [candidate] (790.069 ms) : 0, 790069
GlobalTracer [baseline] (230.14 ms) : 0, 230140
GlobalTracer [candidate] (230.58 ms) : 0, 230580
IAST [baseline] (22.696 ms) : 0, 22696
IAST [candidate] (22.803 ms) : 0, 22803
AppSec [baseline] (56.355 ms) : 0, 56355
AppSec [candidate] (56.344 ms) : 0, 56344
Debugger [baseline] (5.879 ms) : 0, 5879
Debugger [candidate] (5.963 ms) : 0, 5963
Remote Config [baseline] (582.979 µs) : 0, 583
Remote Config [candidate] (609.313 µs) : 0, 609
Telemetry [baseline] (7.916 ms) : 0, 7916
Telemetry [candidate] (7.897 ms) : 0, 7897
section profiling
BytebuddyAgent [baseline] (662.316 ms) : 0, 662316
BytebuddyAgent [candidate] (663.354 ms) : 0, 663354
GlobalTracer [baseline] (378.832 ms) : 0, 378832
GlobalTracer [candidate] (380.486 ms) : 0, 380486
AppSec [baseline] (55.027 ms) : 0, 55027
AppSec [candidate] (54.149 ms) : 0, 54149
Debugger [baseline] (6.193 ms) : 0, 6193
Debugger [candidate] (6.178 ms) : 0, 6178
Remote Config [baseline] (695.339 µs) : 0, 695
Remote Config [candidate] (655.173 µs) : 0, 655
Telemetry [baseline] (8.192 ms) : 0, 8192
Telemetry [candidate] (8.156 ms) : 0, 8156
ProfilingAgent [baseline] (96.518 ms) : 0, 96518
ProfilingAgent [candidate] (96.16 ms) : 0, 96160
Profiling [baseline] (96.543 ms) : 0, 96543
Profiling [candidate] (96.184 ms) : 0, 96184
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.49.0-SNAPSHOT~882611bdc7, baseline=1.49.0-SNAPSHOT~9f6519428f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.008 s) : 0, 1007983
Total [baseline] (8.661 s) : 0, 8661262
Agent [candidate] (1.013 s) : 0, 1013284
Total [candidate] (8.637 s) : 0, 8637384
section iast
Agent [baseline] (1.144 s) : 0, 1144073
Total [baseline] (9.257 s) : 0, 9256703
Agent [candidate] (1.137 s) : 0, 1136756
Total [candidate] (9.243 s) : 0, 9242823
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.144 s) : 0, 1144071
Total [baseline] (9.27 s) : 0, 9269713
Agent [candidate] (1.137 s) : 0, 1136681
Total [candidate] (9.177 s) : 0, 9177224
section iast_TELEMETRY_OFF
Agent [baseline] (1.132 s) : 0, 1132147
Total [baseline] (9.207 s) : 0, 9207126
Agent [candidate] (1.135 s) : 0, 1134867
Total [candidate] (9.236 s) : 0, 9235715
gantt
title insecure-bank - break down per module: candidate=1.49.0-SNAPSHOT~882611bdc7, baseline=1.49.0-SNAPSHOT~9f6519428f
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (672.012 ms) : 0, 672012
BytebuddyAgent [candidate] (674.705 ms) : 0, 674705
GlobalTracer [baseline] (239.611 ms) : 0, 239611
GlobalTracer [candidate] (241.125 ms) : 0, 241125
AppSec [baseline] (54.45 ms) : 0, 54450
AppSec [candidate] (54.775 ms) : 0, 54775
Debugger [baseline] (6.858 ms) : 0, 6858
Debugger [candidate] (6.91 ms) : 0, 6910
Remote Config [baseline] (714.888 µs) : 0, 715
Remote Config [candidate] (718.724 µs) : 0, 719
Telemetry [baseline] (10.736 ms) : 0, 10736
Telemetry [candidate] (11.43 ms) : 0, 11430
section iast
BytebuddyAgent [baseline] (796.151 ms) : 0, 796151
BytebuddyAgent [candidate] (789.275 ms) : 0, 789275
GlobalTracer [baseline] (230.104 ms) : 0, 230104
GlobalTracer [candidate] (230.248 ms) : 0, 230248
IAST [baseline] (22.714 ms) : 0, 22714
IAST [candidate] (22.891 ms) : 0, 22891
AppSec [baseline] (56.86 ms) : 0, 56860
AppSec [candidate] (56.524 ms) : 0, 56524
Debugger [baseline] (5.994 ms) : 0, 5994
Debugger [candidate] (5.942 ms) : 0, 5942
Remote Config [baseline] (607.393 µs) : 0, 607
Remote Config [candidate] (599.686 µs) : 0, 600
Telemetry [baseline] (8.11 ms) : 0, 8110
Telemetry [candidate] (7.941 ms) : 0, 7941
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (792.426 ms) : 0, 792426
BytebuddyAgent [candidate] (790.126 ms) : 0, 790126
GlobalTracer [baseline] (232.804 ms) : 0, 232804
GlobalTracer [candidate] (229.888 ms) : 0, 229888
IAST [baseline] (23.247 ms) : 0, 23247
IAST [candidate] (22.766 ms) : 0, 22766
AppSec [baseline] (57.176 ms) : 0, 57176
AppSec [candidate] (56.21 ms) : 0, 56210
Debugger [baseline] (6.068 ms) : 0, 6068
Debugger [candidate] (5.837 ms) : 0, 5837
Remote Config [baseline] (611.314 µs) : 0, 611
Remote Config [candidate] (582.197 µs) : 0, 582
Telemetry [baseline] (8.126 ms) : 0, 8126
Telemetry [candidate] (7.865 ms) : 0, 7865
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (785.889 ms) : 0, 785889
BytebuddyAgent [candidate] (788.175 ms) : 0, 788175
GlobalTracer [baseline] (229.849 ms) : 0, 229849
GlobalTracer [candidate] (230.352 ms) : 0, 230352
IAST [baseline] (22.283 ms) : 0, 22283
IAST [candidate] (22.297 ms) : 0, 22297
AppSec [baseline] (56.498 ms) : 0, 56498
AppSec [candidate] (56.287 ms) : 0, 56287
Debugger [baseline] (5.904 ms) : 0, 5904
Debugger [candidate] (5.941 ms) : 0, 5941
Remote Config [baseline] (602.937 µs) : 0, 603
Remote Config [candidate] (602.265 µs) : 0, 602
Telemetry [baseline] (7.768 ms) : 0, 7768
Telemetry [candidate] (7.822 ms) : 0, 7822
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 18 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.49.0-SNAPSHOT~882611bdc7, baseline=1.49.0-SNAPSHOT~9f6519428f
dateFormat X
axisFormat %s
section baseline
no_agent (1.366 ms) : 1346, 1385
. : milestone, 1366,
appsec (1.751 ms) : 1728, 1775
. : milestone, 1751,
appsec_no_iast (1.747 ms) : 1723, 1771
. : milestone, 1747,
code_origins (1.67 ms) : 1643, 1697
. : milestone, 1670,
iast (1.54 ms) : 1516, 1565
. : milestone, 1540,
profiling (1.529 ms) : 1505, 1552
. : milestone, 1529,
tracing (1.522 ms) : 1497, 1547
. : milestone, 1522,
section candidate
no_agent (1.352 ms) : 1333, 1372
. : milestone, 1352,
appsec (1.731 ms) : 1708, 1754
. : milestone, 1731,
appsec_no_iast (1.739 ms) : 1715, 1763
. : milestone, 1739,
code_origins (1.676 ms) : 1649, 1703
. : milestone, 1676,
iast (1.522 ms) : 1499, 1545
. : milestone, 1522,
profiling (1.528 ms) : 1505, 1551
. : milestone, 1528,
tracing (1.501 ms) : 1476, 1525
. : milestone, 1501,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.49.0-SNAPSHOT~882611bdc7, baseline=1.49.0-SNAPSHOT~9f6519428f
dateFormat X
axisFormat %s
section baseline
no_agent (384.279 µs) : 364, 404
. : milestone, 384,
iast (528.554 µs) : 506, 552
. : milestone, 529,
iast_FULL (741.249 µs) : 718, 765
. : milestone, 741,
iast_GLOBAL (575.266 µs) : 552, 598
. : milestone, 575,
iast_HARDCODED_SECRET_DISABLED (524.471 µs) : 501, 547
. : milestone, 524,
iast_INACTIVE (470.224 µs) : 448, 493
. : milestone, 470,
iast_TELEMETRY_OFF (509.894 µs) : 487, 533
. : milestone, 510,
tracing (473.293 µs) : 451, 496
. : milestone, 473,
section candidate
no_agent (393.018 µs) : 373, 413
. : milestone, 393,
iast (523.894 µs) : 500, 547
. : milestone, 524,
iast_FULL (741.594 µs) : 718, 765
. : milestone, 742,
iast_GLOBAL (572.231 µs) : 549, 596
. : milestone, 572,
iast_HARDCODED_SECRET_DISABLED (528.892 µs) : 507, 551
. : milestone, 529,
iast_INACTIVE (474.987 µs) : 452, 498
. : milestone, 475,
iast_TELEMETRY_OFF (521.655 µs) : 499, 545
. : milestone, 522,
tracing (464.393 µs) : 443, 486
. : milestone, 464,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.49.0-SNAPSHOT~882611bdc7, baseline=1.49.0-SNAPSHOT~9f6519428f
dateFormat X
axisFormat %s
section baseline
no_agent (15.054 s) : 15054000, 15054000
. : milestone, 15054000,
appsec (15.028 s) : 15028000, 15028000
. : milestone, 15028000,
iast (19.136 s) : 19136000, 19136000
. : milestone, 19136000,
iast_GLOBAL (18.196 s) : 18196000, 18196000
. : milestone, 18196000,
profiling (15.007 s) : 15007000, 15007000
. : milestone, 15007000,
tracing (15.067 s) : 15067000, 15067000
. : milestone, 15067000,
section candidate
no_agent (14.972 s) : 14972000, 14972000
. : milestone, 14972000,
appsec (15.044 s) : 15044000, 15044000
. : milestone, 15044000,
iast (18.457 s) : 18457000, 18457000
. : milestone, 18457000,
iast_GLOBAL (18.128 s) : 18128000, 18128000
. : milestone, 18128000,
profiling (14.987 s) : 14987000, 14987000
. : milestone, 14987000,
tracing (15.054 s) : 15054000, 15054000
. : milestone, 15054000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.49.0-SNAPSHOT~882611bdc7, baseline=1.49.0-SNAPSHOT~9f6519428f
dateFormat X
axisFormat %s
section baseline
no_agent (1.469 ms) : 1458, 1481
. : milestone, 1469,
appsec (2.37 ms) : 2323, 2417
. : milestone, 2370,
iast (2.156 ms) : 2097, 2216
. : milestone, 2156,
iast_GLOBAL (2.198 ms) : 2138, 2258
. : milestone, 2198,
profiling (2.003 ms) : 1956, 2050
. : milestone, 2003,
tracing (1.99 ms) : 1944, 2036
. : milestone, 1990,
section candidate
no_agent (1.471 ms) : 1460, 1483
. : milestone, 1471,
appsec (2.37 ms) : 2323, 2417
. : milestone, 2370,
iast (2.154 ms) : 2094, 2213
. : milestone, 2154,
iast_GLOBAL (2.199 ms) : 2140, 2259
. : milestone, 2199,
profiling (2.014 ms) : 1966, 2062
. : milestone, 2014,
tracing (1.971 ms) : 1925, 2016
. : milestone, 1971,
|
Kafka / producer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
Kafka / consumer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
f3af363
to
7b258fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates context propagation throughout various instrumentation modules to utilize the new datadog.context API. In particular, the changes replace direct span propagation with Context.current().with(span) (or similar calls via Java8BytecodeBridge) and adjust extraction methods accordingly.
- Updated Axis2, AWS SQS/SNS, AWS SDK, EventBridge, Armeria gRPC, Apache HTTPClient/HTTPAsyncClient, and Akka HTTP instrumentation to use the new context propagation style.
- Removed obsolete AgentPropagation extraction methods and modified context injection calls across multiple modules to enhance consistency.
Reviewed Changes
Copilot reviewed 90 out of 90 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
dd-java-agent/instrumentation/axis-2/AxisTransportInstrumentation.java | Switching injection to use Context.current().with(span) for header propagation. |
dd-java-agent/instrumentation/aws-java-sqs-2.0/TracingIterator.java | Updates context extraction and span activation in AWS SQS 2.0 instrumentation. |
dd-java-agent/instrumentation/aws-java-sqs-2.0/SqsInterceptor.java | Modified context propagation to include new Context API. |
dd-java-agent/instrumentation/aws-java-sqs-1.0/TracingIterator.java | Similar context extraction modifications for AWS SQS 1.0 instrumentation. |
dd-java-agent/instrumentation/aws-java-sns-2.0/SnsInterceptor.java | Updated injection to use Context.current().with(span) in SNS 2.0. |
dd-java-agent/instrumentation/aws-java-sns-1.0/SnsInterceptor.java | Implemented the new context based propagation for SNS 1.0. |
dd-java-agent/instrumentation/aws-java-sdk-2.2/TracingExecutionInterceptor.java | Changed propagation to use Java8BytecodeBridge.getCurrentContext().with(span) for AWS SDK 2.2. |
dd-java-agent/instrumentation/aws-java-sdk-1.11.0/TracingRequestHandler.java | Updated context propagation and error handling in AWS SDK 1.11.0 instrumentation. |
dd-java-agent/instrumentation/aws-java-eventbridge-2.0/EventBridgeInterceptor.java | Updated context injection using datadog.context API. |
dd-java-agent/instrumentation/armeria-grpc/server/TracingServerInterceptor.java | Switched to new context extraction and scope activation using Context.with(span).attach(). |
dd-java-agent/instrumentation/armeria-grpc/client/ClientCallImplInstrumentation.java | Updated context injection in client instrumentation for Armeria gRPC. |
dd-java-agent/instrumentation/apache-httpclient-5/* & apache-httpclient-4/* | Updated HTTP client instrumentation to inject context using the new API calls. |
dd-java-agent/instrumentation/apache-httpasyncclient-4/DelegatingRequestProducer.java | Applied similar context propagation changes for async HTTP instrumentation. |
dd-java-agent/instrumentation/akka-http/* | Updated both Akka HTTP 10.6 and 10.0 instrumentation to use Context-based context propagation. |
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecorator.java | Replaced deprecated extraction with Propagators.defaultPropagator().extract() using Java8BytecodeBridge.getRootContext(). |
Comments suppressed due to low confidence (1)
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecorator.java:129
- [nitpick] Consider verifying if using Java8BytecodeBridge.getRootContext() here is consistent with other modules that use Context.current(), to maintain a uniform context base across the codebase.
return Propagators.defaultPropagator().extract(Java8BytecodeBridge.getRootContext(), carrier, getter);
@@ -85,7 +93,7 @@ public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall( | |||
DECORATE.onCall(span, call); | |||
|
|||
final ServerCall.Listener<ReqT> result; | |||
try (AgentScope scope = activateSpan(span)) { | |||
try (AgentScope scope = (AgentScope) extractedContext.with(span).attach()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Casting the result of attach() to AgentScope may be risky if the context API changes. Consider using a dedicated method for obtaining an AgentScope directly to avoid potential ClassCastExceptions.
try (AgentScope scope = (AgentScope) extractedContext.with(span).attach()) { | |
try (AgentScope scope = getAgentScopeFromContext(extractedContext, span)) { |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General
Left few comments about root vs curent as base context for extraction. This will change the context tracking behavior.
HttpServerDecor should move away from spanContext to context. It will help getting thing smoother. (if not completely smooth, I might consider providing a method to retrieve a span context context but I would prefer waiting for decorator refactoring first)
Also, avoid initializing a context variable to null, set it to root instead. Context API should provide a certain level of null safety, so better leverage it!
Context API
It feels like the byte code helper might be a bit more concise for readability concern.
DSM
About DSM, it's pretty annoying that most of the injection points create a dumb DataStreamsContext dsmContext = DataStreamsContext.fromTags(CLIENT_PATHWAY_EDGE_TAGS);
, then we have to create another context from, and most of the time, it will be dropped by the DSM propagator if the span has no DSM context or DSM is disabled.
It's really sub-optimal 😭
...rap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecorator.java
Show resolved
Hide resolved
DECORATE.afterStart(span); | ||
DECORATE.onRequest(span, request, request, extractedContext); | ||
DECORATE.onRequest(span, request, request, extractedSpanContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like HttpServerDecorator
(DECORATE
here) should migrate from AgentSpan.Context
to Context
.
This should greatly simplify the related instrumentation calls.
...ava-sdk-1.11.0/src/main/java/datadog/trace/instrumentation/aws/v0/TracingRequestHandler.java
Show resolved
Hide resolved
...-sdk-2.2/src/main/java/datadog/trace/instrumentation/aws/v2/TracingExecutionInterceptor.java
Show resolved
Hide resolved
@@ -84,7 +85,7 @@ public AmazonWebServiceRequest beforeMarshalling(AmazonWebServiceRequest request | |||
private Context newContext(AmazonWebServiceRequest request, String queueUrl) { | |||
AgentSpan span = newSpan(request); | |||
DataStreamsContext dsmContext = DataStreamsContext.fromTags(getTags(queueUrl)); | |||
return span.with(dsmContext); | |||
return Java8BytecodeBridge.getCurrentContext().with(span).with(dsmContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't SqsInterceptor
it's own class and not injected?
Did you observe bytecode issue when using direct calls to the context API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I did? I don't remember tbh but I can locally revert and see what happens
// This span is finished when Request.recycle() is called by RequestInstrumentation. | ||
DECORATE.afterStart(span); | ||
|
||
req.setAttribute(DD_SPAN_ATTRIBUTE, span); | ||
req.setAttribute(CorrelationIdentifier.getTraceIdKey(), GlobalTracer.get().getTraceId()); | ||
req.setAttribute(CorrelationIdentifier.getSpanIdKey(), GlobalTracer.get().getSpanId()); | ||
return scope; | ||
return (AgentScope) extractedContext.with(span).attach(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same about changing type to AutoClosable
@@ -294,7 +295,9 @@ public void setProduceCheckpoint( | |||
|
|||
DataStreamsContext dsmContext = fromTags(sortedTags); | |||
this.propagator.inject( | |||
span.with(dsmContext), carrier, DataStreamsContextCarrierAdapter.INSTANCE); | |||
Context.current().with(span).with(dsmContext), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should update the activeSpan()
call above to get current context instead,
Then check for active span,
Then inject as is with DSM context.
@@ -486,7 +487,8 @@ public <C> void inject(final SpanContext spanContext, final Format<C> format, fi | |||
if (carrier instanceof TextMap) { | |||
final AgentSpanContext context = converter.toContext(spanContext); | |||
AgentSpan span = fromSpanContext(context); | |||
defaultPropagator().inject(span, (TextMap) carrier, TextMapSetter.INSTANCE); | |||
defaultPropagator() | |||
.inject(Context.current().with(span), (TextMap) carrier, TextMapSetter.INSTANCE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think with should inject current here. Better stick with the provided arguments only.
@@ -2369,11 +2369,13 @@ public boolean isTracePropagationExtractFirst() { | |||
} | |||
|
|||
public boolean isBaggageExtract() { | |||
return tracePropagationStylesToExtract.contains(TracePropagationStyle.BAGGAGE); | |||
return tracePropagationStylesToExtract.contains(TracePropagationStyle.BAGGAGE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may switch the test (the equality before). It will get evaluated first and is cheaper than the contains
test.
} | ||
|
||
public boolean isBaggageInject() { | ||
return tracePropagationStylesToInject.contains(TracePropagationStyle.BAGGAGE); | ||
return tracePropagationStylesToInject.contains(TracePropagationStyle.BAGGAGE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same perf related comment
What Does This Do
Motivation
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]