Skip to content
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

Proposal: Dictionary of common Attribute/Label definitions #855

Closed
justinfoote opened this issue Aug 21, 2020 · 1 comment
Closed

Proposal: Dictionary of common Attribute/Label definitions #855

justinfoote opened this issue Aug 21, 2020 · 1 comment
Labels
area:semantic-conventions Related to semantic conventions release:after-ga Not required before GA release, and not going to work on before GA spec:miscellaneous For issues that don't match any other spec label

Comments

@justinfoote
Copy link
Member

Hey all,
In a recent PR regarding metric semantic conventions, we repeatedly diverted the conversation to these topics:

  • There's a lot of duplication between the labels in the HTTP metric semantic convention and the attributes in the HTTP tracing semantic convention.
  • If we remove that duplication and reference the tracing convention from the metrics convention, it implies some connection between the underlying span and metric data structures.
  • Labels and attributes have different restrictions on value types. Does it even make sense to use the same key for a metric label and a span attribute if their value is different (for example, http.response_code of "200" on a label or 200 on an attribute).

I propose that we solve this issue by creating a single data dictionary that can be referenced from all semantic conventions. This will clarify what each attribute name signifies, so we don't have to redefine the same names in multiple places.

We use a system like this at New Relic. We've even made this data dictionary publicly-available and searchable. Check it out here: https://docs.newrelic.com/attribute-dictionary?attribute_name=traceId

In this example, because the definition of traceId exists in a single place, when it is included in a spec for Spans, Transactions, and Logs, each spec does not need to include a full definition of the attribute.

At the moment, OpenTelemetry has defined traceId in at least two places:

Field: TraceId

Type: byte sequence.

Description: Request trace id as defined in W3C Trace Context. Can be set for logs that are part of request processing and have an assigned trace id. This field is optional.

TraceId is the identifier for a trace. It is worldwide unique with practically sufficient probability by being made as 16 randomly generated bytes. TraceId is used to group all spans for a specific trace together across all processes.

I propose something like this, in a big table of all attributes:

Name Description Serialization Example
traceId The identifier for a trace. It is worldwide unique with practically sufficient probability by being made as 16 randomly generated bytes. TraceId is used to group all spans for a specific trace together across all processes, and to correlate other data points to those spans. Byte Sequence 8ac95d01265752b841aa418a0ed4cb48

In addition, I think such a document could include details about how to convert each value to a String to be used as a label (or in other places where a value must be coerced to a String):

Name Description Serialization Example String Representation
traceId The identifier for a trace. It is worldwide unique with practically sufficient probability by being made as 16 randomly generated bytes. TraceId is used to group all spans for a specific trace together across all processes, and to correlate other data points to those spans. Byte Sequence 8ac95d01265752b841aa418a0ed4cb48
http.status_code HTTP response status code. Integer 200 "200"
@justinfoote justinfoote added the spec:miscellaneous For issues that don't match any other spec label label Aug 21, 2020
@andrewhsu andrewhsu added release:after-ga Not required before GA release, and not going to work on before GA area:semantic-conventions Related to semantic conventions labels Aug 25, 2020
@justinfoote justinfoote changed the title Proposal: Attribute/Label Dictionary Proposal: Dictionary of common Attribute/Label definitions Aug 25, 2020
@jsuereth jsuereth moved this to Blockers for HTTP semconv stability in Semantic Conventions + Instrumentation Stability WG Nov 16, 2022
@austinlparker
Copy link
Member

We believe this has already been accomplished by the semantic conventions SIG. If you believe this determination to be in error, please comment and we will re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:semantic-conventions Related to semantic conventions release:after-ga Not required before GA release, and not going to work on before GA spec:miscellaneous For issues that don't match any other spec label
Development

No branches or pull requests

3 participants