-
Notifications
You must be signed in to change notification settings - Fork 834
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
Implement thread.id and thread.name semantic attributes #1554
Conversation
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.
Thanks!
3d3ad9e
to
59a4c21
Compare
Codecov Report
@@ Coverage Diff @@
## master #1554 +/- ##
============================================
+ Coverage 91.54% 91.61% +0.06%
Complexity 976 976
============================================
Files 116 116
Lines 3514 3517 +3
Branches 304 304
============================================
+ Hits 3217 3222 +5
+ Misses 204 203 -1
+ Partials 93 92 -1
Continue to review full report at Codecov.
|
Shouldn't |
That's a great idea -- I initially planned to set them somewhere in |
I don't think this should be baked into the core SDK. Not all users will want it, and it can be added just fine in a SpanProcessor's OnStart. E.g. you would call |
Why should we give users in this particular place a control over semantic conventions? I can understand "there should not be semantic conventions in SDK at all", but not some specific handling of this convention. Also, I find it puzzling that so much functionality across different issues is being proposed to be handled by SpanProcessor. Spec says
I read it as there is no guarantee that span modifications of any single SpanProcessor will reach all exporters. |
Unfortunately in can't be done this way in current Java SDK: |
There is no requirement that this semantic convention is added to all spans, nor should there be IMHO.
Oh good catch, this sentence is very confusing. You could interpret it in such a way that a span instance has to be created per registered SpanProcessor. That's not how this is meant however (at least for OnStart), if you look at the git blame / PR behind it. This was even discussed with exactly "thread name" as example 😄 Please read open-telemetry/opentelemetry-specification#338 (comment) and before. I will create an issue/PR to clarify or remove this sentence. |
That should be an easy PR. According to @bogdandrutu's comments at open-telemetry/opentelemetry-specification#669 (comment), he would like to see |
Okay, so we have two options here: a) Add b) Implement a
Again, since I'm new to OTel world I'd like to rely on your judgement here. |
Option three is just implement attribute setting in instrumentation repo as you planned at the beginning. |
No, my concern is different. But I just realised that my concern is about |
These two steps need to be done anyway (best in a separate PR) to make opentelemetry-java conform to the spec. |
My 2 cents: we shouldn't have the SDK add these attributes automatically. We need to be very careful when we add attributes, because that can translate into data-storage cost for users, depending on their backend. And, if the user has zero control over that, it would be a bad thing. |
This small PR implements two new semantic attributes, added in open-telemetry/opentelemetry-specification#789