Skip to content

Rename WithDefaultSampler TracerProvider option to WithSampler and update docs #1702

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

Merged
merged 9 commits into from
Mar 18, 2021

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Mar 16, 2021

The term "DefaultSampler" comes from early ideas of this project where there would be overriding samplers lower in the trace SDK. This overriding does not exist and if it is going to be introduced in the future the sampler associated with the TracerProvider is already scoped based on that association (no need to scope with a name). This renames the TracerProvider option to not include this anachronism.

This does not rename the TracerProvider config which is being removed in #1693

The term "DefaultSampler" comes from early ideas of this project where
there would be overriding samplers lower in the trace SDK. This
overriding does not exist and if it is going to be introduced in the
future the sampler associated with the TracerProvider is already scoped
based on that association (no need to scope with a name). This renames
the TracerProvider option to not include this anachronism.
@seh
Copy link
Contributor

seh commented Mar 16, 2021

If one does not pass the WithSampler option, what is the default sampling behavior?

@MrAlias
Copy link
Contributor Author

MrAlias commented Mar 16, 2021

@seh ParentBased(AlwaysSample()):

DefaultSampler: ParentBased(AlwaysSample()),

@seh
Copy link
Contributor

seh commented Mar 16, 2021

Thanks for the reference. What do you think about mentioning that in the documentation for WithSampler? In other words, answer the "But what am I replacing here?" question at that point. Either that, or maybe cross-reference some other function where we document that default sampling behavior.

@MrAlias
Copy link
Contributor Author

MrAlias commented Mar 16, 2021

What do you think about mentioning that in the documentation for WithSampler?

SGTM

@MrAlias
Copy link
Contributor Author

MrAlias commented Mar 16, 2021

@seh PTAL: 5228b6c

Copy link
Contributor

@seh seh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Thank you for the extra documentation. I made one corrective suggestion, and asked one clarifying question.

MrAlias and others added 2 commits March 16, 2021 12:28
Co-authored-by: Steven E. Harris <seh@panix.com>
@MrAlias MrAlias changed the title Rename WithDefaultSampler TracerProvider option to WithSampler Rename WithDefaultSampler TracerProvider option to WithSampler and update docs Mar 16, 2021
@codecov
Copy link

codecov bot commented Mar 17, 2021

Codecov Report

Merging #1702 (76e75ec) into main (860d5d8) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #1702   +/-   ##
=====================================
  Coverage   77.8%   77.8%           
=====================================
  Files        130     130           
  Lines       7013    7013           
=====================================
+ Hits        5461    5463    +2     
+ Misses      1301    1299    -2     
  Partials     251     251           
Impacted Files Coverage Δ
sdk/trace/provider.go 83.0% <ø> (ø)
exporters/otlp/internal/otlptest/otlptest.go 74.5% <100.0%> (ø)
exporters/trace/jaeger/jaeger.go 93.7% <100.0%> (ø)
exporters/otlp/otlpgrpc/connection.go 88.7% <0.0%> (+1.8%) ⬆️

@MrAlias MrAlias merged commit 1d42be1 into open-telemetry:main Mar 18, 2021
@MrAlias MrAlias deleted the rename-withdefaultsampler branch March 18, 2021 16:34
@MrAlias MrAlias mentioned this pull request Mar 18, 2021
@pellared pellared added this to the untracked milestone Nov 8, 2024
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.

None yet

5 participants