-
Notifications
You must be signed in to change notification settings - Fork 821
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
refactor(attributes): move enums to @opentelemetry/semantic-conventions #1160
Conversation
Actually it looks like #718 already exists. I can close this in favor of that one if we are able to resolve the conflicts there |
Looks like #718 is stale since january |
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.
Nice 👍
re: #718 (review), was there ever alignment on this living in core vs api? I think there's a good case for it living in api, since these will primarily be useful for library / application owners using the APIs. I agree with const enum AttributeNames { ... }
const db = {
required: {
statement: AttributeNames.DB_STATEMENT,
}
} edit: looks like using |
Codecov Report
@@ Coverage Diff @@
## master #1160 +/- ##
==========================================
- Coverage 92.37% 92.17% -0.21%
==========================================
Files 119 120 +1
Lines 3447 3410 -37
Branches 700 697 -3
==========================================
- Hits 3184 3143 -41
- Misses 263 267 +4
|
Unfortunately const enum has a lot of issues. It also doesn't play well with some bundlers for some reason. I think it might make sense to have these constants live in a separate package. Also, the spec has been working on a code generator for semantic convention constants that we will eventually want to migrate over to use, so I would caution against pushing this into the API only to have it removed later. |
I agree code generation seems like a much better option than baking it into api and I imagine the same thinking applies to core as well. If so, this issue&PR should just be closed / changed to a tracking issue for that eventual addition. WDTY? |
For now, I would say if we're going to centralize the constants, we should do so in a new package |
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.
LGTM.
I will point out that the component
semantic convention was removed: open-telemetry/opentelemetry-specification#447. We can handle its removal separately.
Which problem is this PR solving?
Short description of the changes
@opentelemetry/semantic-conventions
package.https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/trace/semantic_conventions