-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expose telemetry attributes via a factory option #13832
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
base: main
Are you sure you want to change the base?
Conversation
8434f40
to
8f46e78
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13832 +/- ##
==========================================
+ Coverage 91.38% 91.42% +0.04%
==========================================
Files 647 646 -1
Lines 42597 42676 +79
==========================================
+ Hits 38927 39018 +91
+ Misses 2845 2835 -10
+ Partials 825 823 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e202999
to
6826937
Compare
49e741d
to
2b879c5
Compare
45e7b57
to
b92ee45
Compare
b92ee45
to
9e9a3da
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.
It would be good to have an issue motivating this and #13827. It's a bit difficult to understand for me right now what the end goal is
It sounds like the goal is to remove the dependency on the "official" SDK in packages that shouldn't rely on it like
(Code link for the part which imports the trace SDK) I think there are probably ways to remove this dependency chain without splitting Moreover, since One possible solution would be to expect components to only rely on the OTel API, never SDK-specific methods, and drop the SDK-specific TracerProvider wrapper in componentattribute. This would however break the It may also be possible to allow access to SDK-specific methods through our wrappers without making the wrappers depend on the SDK code-wise. I think I tried a generic-based approach at one point and it didn't work, but maybe it's possible with some reflection/unsafe magic? I can try to look into it. Ideally this might even allow accessing SDK-specific methods from other SDKs. |
After searching for a bit, it seems what I wanted to do with I think that, unless we're willing to give up on injecting component-identifying attributes, or on being able to build the Collector without dependencies on the official SDK, our best option would be to:
I think this would be fairly reasonable, since I don't think we currently make any promises about passing the telemetry providers to components as-is. It might constitute a breaking chance however. |
The impetus for me was the otelzap bridges dependency. This brought over a slew of concerns.
Was the goal to allow changing scope attributes after component creation? That doesn't seem like a requirement we'd want to go after to me, is there a use case I am missing?
If you're going to build a full collector, import the service module and deal with the dependencies. That's not the case for most components however, and it's possible to build your own binary without the service module.
Is this PR not a possible solution as well?
I don't follow, sorry. |
I posted a response in the issue thread to keep the discussion organized. Hopefully it clarifes my concerns about the approach in these two PRs, and better explains why the trace provider wrapper currently depends on the trace SDK. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Use a factory option to set immutably the telemetry attributes on the component on creation, rather than regenerating metric/trace/log providers when those change.
This PR builds on #13827 - refactoring all the way to remove dependency on the OpenTelemetry SDK for components.