-
Notifications
You must be signed in to change notification settings - Fork 35
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
Use alwaysOn() sampler #42
Conversation
@@ -42,5 +43,9 @@ public void configure(TracerSdkManagement tracerManagement) { | |||
if (jdbcSpanLowCardinalityNameEnabled()) { | |||
tracerManagement.addSpanProcessor(new JdbcSpanRenamingProcessor()); | |||
} | |||
|
|||
tracerManagement.updateActiveTraceConfig(tracerManagement.getActiveTraceConfig().toBuilder() | |||
.setSampler(Sampler.alwaysOn()) |
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.
The SDK itself defaults to alwaysOn. Is the otel agent doing something different?
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.
The SDK actually defaults to
private static final Sampler DEFAULT_SAMPLER = Sampler.parentBased(Sampler.alwaysOn());
which works slightly different: for spans whose parent is not sampled it also returns the "not sampled" flag
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.
aha! You are totally correct. I conflated the two in my head.
return "open-telemetry-docker-dev.bintray.io/java/smoke-springboot-jdk" | ||
+ jdk | ||
+ ":20201105.347264626"; |
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'm not entirely sure that this change is OK, but it seems that the latest
image is simply too new, something related to @WithSpan must have changed.
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.
Yes, it got moved to a different package, and a different artifact in the past couple of weeks.
Will always export the trace, even if the incoming b3 headers do not contain the
x-b3-sampled
one