Should library-specific attributes be added to semantic conventions? #1218
Labels
area:telemetry
enhancement
New feature or request
experts needed
This issue or pull request is outside an area where general approvers feel they can approve
triage:needs-triage
Area(s)
area:telemetry
Is your change request related to a problem? Please describe.
Note: I am primarily working on JS so those are the examples I'll be using, but this is likely to be relevant across languages.
As we look toward stabilizing instrumentations, we are revisiting attributes generated by instrumentation libraries. Most attributes are defined in semantic conventions, like http attributes and db attributes. Others, however, are library-specific and provide necessary value (e.g. for ExpressJS
express.type: middleware
orexpress.name: jsonParser
).The specification states "Stable instrumentations authored by OpenTelemetry SHOULD NOT produce telemetry that is
not described by OpenTelemetry semantic conventions." This was discussed in comments on the spec PR that added this statement, and at the time it was determined that the term SHOULD (vs. MUST) allowed for deviation.
At this point we have generally kept (or sought) consistency in directory structure and naming for those other (src/enums/AttributeNames), but it's unclear whether this is still a sufficient approach long-term.
Describe the solution you'd like
I don't think there is an "ideal" solution. There are likely to be a few options to consider with different tradeoffs. It is unfeasible to have all library-specific attributes listed in the attribute registry in semantic conventions. But there is a desire for consistency and stability.
Describe alternatives you've considered
There may be some commonalities that can be extracted out (an attribute with a value of
middleware
is not uncommon). For others, we may consider a prefix to avoid possible naming collisions (e.g.oteljs.layer.name:jsonParser
?). It may be that each language has a separate semantic conventions package for library-specific attributes, and that is used as a guide for other instrumentation authors in the same language as well?Additional context
Other issues and PRs suggest this may have just been a lower priority as we've all been focusing on the general attributes (valid), and it's been kicked down the road until it was necessary to address. I think that time is coming upon us. This (now closed) otep PR seems like it was intended to take steps toward addressing this, but ultimately it had too far-reaching a scope. A similar issue exists for library-specific metric semantic conventions, and it was included in the working group project plan and proposal.
The text was updated successfully, but these errors were encountered: