What are you trying to achieve?
The resolution from https://github.com/open-telemetry/opentelemetry-specification/issues/948 is that "Label" should be renamed "Attribute" for consistency across OpenTelemetry. This has been discussed widely and there are no objections on the Metrics SIG to this renaming.
This renaming will introduce a breaking change for JSON-format exporters using OTLP v0.5, but will not introduce a binary-format incompatibility when this change is released as OTLP v0.6.
The specification will be updated to explain that although we use a single concept and term to describe attributes, sometimes we choose to limit their values to only strings. To address this across OpenTelemetry, we will specify how to handle the situation whenever requesting a string-valued attribute in a context where it would be prohibitively expensive to support. These cases are:
In both cases, I think a simple text-value replacement like "unrepresentable" would satisfy me.
Additional context.
Issue #948 contains a lengthy discussion of this topic. The terms "Attribute", "Label", "Tag", "Property", and "Association" are all very close in meaning, and we have come to agree that having more than one of these terms in use causes more trouble than it helps with.
The specification will be rewritten to state that although the attribute concept is universal, the exact representation of attributes varies by telemetry signal.
I think this can be a source of confusion. It probably depends on how exactly you define the 2 different "attributes" in the spec, in the API and the protocol, so it would be good to see some drafts of what your proposal looks like before we fully commit to it.
I am not sure I understand this motivation. For me there are 2 different concepts that do not belong to any signal (which is a major part of my confusion):
string values.Once we define these concepts, different signals can use one of them (that best fit the requirements). I am not sure what is the confusion, and not sure that making metrics using Attributes but limit the possible values set is better.
What is the problem that we solve if we rename the metrics key-values with Attributes but we support only String values, I think that is way more confusing. We should not do this change just to have same name with different behaviors, so far we do have consistent behavior for every of these usages.
Next steps, suggested from from today's Spec meeting:
We also briefly considered including TraceState in this discussion, but decided that since we couple it to W3C TraceState and it has quite a few special rules and because it will typically have values that consist of multiple sub-keys per vendor/entry (serialized as string) it does not make sense to allow non-string values there.
Not completely sure what the remaining questions are but:
Can metrics just be defined to only have "String Attributes"? Then anything else is dropped if it isn't a string. This gets rid of the multiple names for things while makes clear only strings are allowed.
Or is the issue that dropping isn't an option and thus have to define string representations of everything? Maybe reopen as an issue titled "How to Convert Non-String Attribute Values as Strings" :)
@bogdandrutu want to reassign this to me? I'm getting to work on a string conversion OTEP.
At the SIG today, we are going to move forwards at this time by:
We discussed this heavily today at the Metrics Data Model SiG. The three proposals discussed are here.
I'm including the "consensus proposal" of that group here for implementation (volunteered by @bogdandrutu ):
In this proposal, we alter OTLP to leverage the same KeyValue proto on metrics and drop the use of Label / StringKeyValue in the specification. The API/SDKs will export metric "Attributes" that have string keys and multi-typed values (can be anything supported by AnyValue in OTLP). The collector will not attempt to unify types between attributes of the same name.
If two attribute keys on the "same metric" are received that have different types, this is considered an error.
_Note: Metric identity specification may need more clarity in the (pending) data model specification._
toString method for attribute values anyway, leading to (possibly) disjoint handling OR a new specification on toString anyway. (Note: This is considered fine for OLTP data model, and we can/will work on this as part of Prometheus/OpenMetric compatibility).I wasn't able to make it to the Model SIG, what was actual blocker here?
Give opentelemetry-proto#283 is merged here, I think remaining work is in the metrics API specification. Does that sound right @reyang ?
The API spec is also done (addressed by #1557).
I'm closing this issue now.
Most helpful comment
Give opentelemetry-proto#283 is merged here, I think remaining work is in the metrics API specification. Does that sound right @reyang ?