-
Notifications
You must be signed in to change notification settings - Fork 897
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
API: Consistent tag/attribute/field/resource namespacing and structure #76
Labels
spec:resource
Related to the specification/resource directory
Milestone
Comments
This was referenced Jun 7, 2019
iredelmeier
added
the
spec:resource
Related to the specification/resource directory
label
Jul 30, 2019
We have decided to use the "Named" Tracer and Meter as a namespace. We have decided not to include resources in the v1.0 release. This can be closed. |
rockb1017
pushed a commit
to rockb1017/opentelemetry-specification
that referenced
this issue
Nov 18, 2021
Add gdi-admins team
carlosalberto
pushed a commit
to carlosalberto/opentelemetry-specification
that referenced
this issue
Oct 21, 2024
carlosalberto
pushed a commit
to carlosalberto/opentelemetry-specification
that referenced
this issue
Oct 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The OpenTelemetry Java prototype has, in various places, five different kinds of key:value. Spans have attributes, context has tags, metrics have fields, events have fields, and everything has resources. The current Resource definition is a structure containing a type name as well as a set of key:values, whereas all of the other places where key:values appear, there is no "type" parameter.
As an implementor, having to implement separate code paths for structurally-equivalent types increases code size and complexity.
As an instrumentor, having distinct types adds confusion because, depending on circumstances, I may want to apply the same key in any one of these five key:value locations. For example, at LightStep we have two classes of satellite, those dedicated to specific customers and those belonging to our public service, which may accept traffic from all customers. Dedicated satellites will apply an "organization" tag at the resource level, because it applies to all spans from a tracer, whereas public satellites will apply the same key as a span attribute, since it is a dynamic property.
This raises a question as to why there is a structural difference between resources and the other kinds of key:value, and there are a couple of related issues that I want to bring up.
In #62, a discussion of how to merge resources deterministically, with the observation that namespaces could help.
In #67, a request for structured field values, for OpenTracing compatibility, which are somehow similar to resource definitions.
This leads me to look for similarities, based on the observation that resource key:values and span attribute key:values ought to be the same kind of thing. In the current Resource definition, there is a "Type" field that acts as both a key name ("thing being monitored") and a schema name ("semantics of the data").
Take for example the current form of a k8s resource:
As in the OpenCensus model, this is logically expanded into three key values, where "k8s" describes what is being monitored and the structure of the data.
"k8s.cluster.name": "xy"
"k8s.namespace.name": "meta"
"k8s.pod.name":"a-b-6d8f45bbc8-2smm4"
We could address the discrepency between resource key:values (which have namespaces and structure) and attribute key:values (which do not) by separating the name from the type information and allowing structured field values. Let's use the Google precedent for encoding protobuf
Any
types. The example would be rewritten as:Here, we would have to adopt semantic conventions to interpret the data. Roughly, I'm imagining in this example:
These conventions, which support structured key:values and recognize the need for namespaces, helps address issue 62 and issue 67. To merge resources becomes no different than merging span attributes. Structured logging would be supported using structured values, as well.
In practice, it makes sense not to allow structured values everywhere. For context propagation (e.g., OpenTracing baggage), string values are enforced. For pre-aggregation fields (e.g., OpenCensus metrics), scalar values should be required. At the same time, it will be desireable to be able to refer to elements of structured values when defining aggregations. For example, to pre-aggregate by the deployment cluster name, use "resource.deployment#cluster.name" (i.e., "#" as a fragment separator).
The text was updated successfully, but these errors were encountered: