-
Notifications
You must be signed in to change notification settings - Fork 667
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
Remove implicit dependency on TracerProvider from Tracer #1181
Comments
@codeboten submitted PR #1295 |
thanks! |
@robwknox Just wondering if in addition to @owais 's suggestion, you considered adding to the So in
we would have
I know the specifications on TracerProvider does not include these fields. However, this solution would require Custom Implementations of |
@NathanielRN I like the suggestion (and it would mimic go's impl) but the snag I see is that |
@robwknox
How come this is the case? We already pass in these variables as part of |
In order to accomplish the type hinting of the new fields @NathanielRN is suggesting for the |
@robwknox
|
Today, the main tracer implementation accept a source argument during initialization which refers to the tracer provider instance. The tracer then stores a reference to the source (tracer provider) and uses it to access a number of different things such as sampler, resource, span processor and soon ID generator. This implicitly couples SDK tracer and tracer provider implementations. Anyone implementing a custom tracer provider must satisfy such undocumented tracer provider interface/behavior.
I propose we make all tracer dependencies explicitly to the tracer during initialization. Each dependency can be it's own argument to
Tracer.__init__
or we can bundle up all such dependencies into a single object and pass that in. This will de-couple tracer and tracer provider and allow users to implement one or the other without any surprises.discussion: #1153 (comment)
The text was updated successfully, but these errors were encountered: