-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Avoid overriding configuration of tracer provider #1633
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1633 +/- ##
=====================================
Coverage 77.1% 77.2%
=====================================
Files 128 128
Lines 6735 6742 +7
=====================================
+ Hits 5196 5205 +9
+ Misses 1288 1286 -2
Partials 251 251
|
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.
Looks good overall, minor documentation fixes needed.
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 looks good to me, though as @MrAlias mentioned in Slack it would be good if we went one step further and avoided exporting the TracerProvider.ApplyConfig
method and related Config
struct. It looks like they're only used in a couple places that should be able to be rewritten using the new options.
Tracking this topic here so the scope of this PR isn't overloaded. |
62a661b
to
665fcb0
Compare
It seems to be unrelated. Waiting time for reconnection maybe not enough sometimes.
|
@ijsong it looks like |
This change adds `WithDefaultSampler` and `WithSpanLimits` to the tracer provider and removed `WithConfig` from it. Before this change, `WithConfig` is the only way to set sampler or limits of a span. However, it is prone to misuse, since `WithConfig` can override tracing configurations that are configured by `WithResource` or `WithIDGenerator`. Thus to fix this, it adds new functional options - `WithDefaultSampler` and `WithSpanLimits` and removes `WithConfig`. Resolves open-telemetry#1631.
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
18ec5ad
to
4117ec1
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.
We might need to write a tool to prevent changes to the released changelog.
@@ -56,6 +56,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm | |||
| Windows | 1.14 | amd64 | | |||
| Windows | 1.15 | 386 | | |||
| Windows | 1.14 | 386 | | |||
- Added `WithDefaultSampler` and `WithSpanLimits` to tracer provider. (#1633) |
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 seems it is the wrong place to put this changelog.
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.
Sorry to not have checked carefully.
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.
That is fine. This should be handled by an automatic tool, which lowers everyone's mental burden. ;)
This change adds
WithDefaultSampler
andWithSpanLimits
to the tracer provider and removedWithConfig
from it.Before this change,
WithConfig
is the only way to set sampler or limits of a span. However, it is prone to misuse, sinceWithConfig
can override tracing configurations that are configured byWithResource
orWithIDGenerator
. Thus to fix this, it adds new functional options -WithDefaultSampler
andWithSpanLimits
and removesWithConfig
.Resolves #1631.