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

Use alwaysOn() sampler #42

Merged
merged 3 commits into from
Nov 23, 2020
Merged

Use alwaysOn() sampler #42

merged 3 commits into from
Nov 23, 2020

Conversation

mateuszrzeszutek
Copy link
Contributor

Will always export the trace, even if the incoming b3 headers do not contain the x-b3-sampled one

@mateuszrzeszutek mateuszrzeszutek requested review from iNikem and a user November 20, 2020 17:10
@@ -42,5 +43,9 @@ public void configure(TracerSdkManagement tracerManagement) {
if (jdbcSpanLowCardinalityNameEnabled()) {
tracerManagement.addSpanProcessor(new JdbcSpanRenamingProcessor());
}

tracerManagement.updateActiveTraceConfig(tracerManagement.getActiveTraceConfig().toBuilder()
.setSampler(Sampler.alwaysOn())
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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.

Comment on lines +31 to +33
return "open-telemetry-docker-dev.bintray.io/java/smoke-springboot-jdk"
+ jdk
+ ":20201105.347264626";
Copy link
Contributor Author

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.

Copy link
Contributor

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.

@iNikem iNikem merged commit cfe687f into main Nov 23, 2020
@iNikem iNikem deleted the use-always-on-sampler branch November 23, 2020 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants