Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
!!! DO NOT MERGE !!!
(intended for discussion only)
Which problem is this PR solving?
This is a prototype of shared/common attributes - attributes that are applied to all spans and log records. The immediate use cases are for the Web SDK where a number of attributes are relevant across many traces and events. Example attributes are session ID, page URL, window width/height.
Background
Originally, we wanted to capture these as resource attributes (see this OTEP), but it has become apparent that this would likely not get accepted.
Another alternative proposed solution was to capture these as "context" attributes (see this OTEP). This prototype includes a mechanism for context attributes. However, the primary use case for client telemetry is global attributes, which cannot be implemented using context.
Short description of the changes
The prototype introduces a new package
shared-attributes
, which includessetGlobalAttributes()
,getGlobalAttributes()
getGlobalAttributes()
and add the attributes to each signalsetContextAttributes()
,getContextAttributes()
The main files to focus on are:
This prototype also comes with a web example app that shows how it might be used
Open Questions