-
Notifications
You must be signed in to change notification settings - Fork 301
Supporting Baggage for Instrumentations used in Weblog Tests #8773
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
base: master
Are you sure you want to change the base?
Conversation
...rap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecorator.java
Show resolved
Hide resolved
/* Verify whether we have only span contexts or more contexts */ | ||
public ContextScope activateScope(Context context, AgentSpan span) { | ||
Baggage baggage = Baggage.fromContext(context); | ||
if (baggage == null) { |
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.
@mcculls This is what I understood when you mentioned that we can only use span context if it is the only context that was extracted. Let me know if I interpreted that idea correctly here. 😃
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.
This part feels weird to me. Would need to discuss with @mcculls
- It will drop any other context data than baggage (like DSM or other product)
- If there is no data in context, context will be root, and
root.with(span)
is equals tospan
(no allocation, no perf cost) so this will always be save to usecontext.with(span).attach()
nitpick: And on the semantic side, you are not activating a scope, you are activating a context, which activation results in a scope
BenchmarksStartupLoadDacapo |
...rap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecorator.java
Show resolved
Hide resolved
/* Verify whether we have only span contexts or more contexts */ | ||
public ContextScope activateScope(Context context, AgentSpan span) { | ||
Baggage baggage = Baggage.fromContext(context); | ||
if (baggage == null) { |
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.
This part feels weird to me. Would need to discuss with @mcculls
- It will drop any other context data than baggage (like DSM or other product)
- If there is no data in context, context will be root, and
root.with(span)
is equals tospan
(no allocation, no perf cost) so this will always be save to usecontext.with(span).attach()
nitpick: And on the semantic side, you are not activating a scope, you are activating a context, which activation results in a scope
...c/main/java/datadog/trace/instrumentation/azure/functions/AzureFunctionsInstrumentation.java
Outdated
Show resolved
Hide resolved
...mcat-5.5/src/main/java/datadog/trace/instrumentation/tomcat/TomcatServerInstrumentation.java
Outdated
Show resolved
Hide resolved
e2d8ef7
to
81a9768
Compare
What Does This Do
This PR migrates context propagation from Span contexts to generic Contexts for the instrumentations used in weblog tests (Tomcat on the server-side and okhttp3 on the client-side). This allows us to verify that we can properly propagate generic contexts end-to-end through System-tests verification.
Additionally, this PR introduces more helper methods in the
HttpServerDecorator
in order to reduce repetitive code in the instrumentation advice layer and ensure consistency among how we handle instrumentations.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]