-
Notifications
You must be signed in to change notification settings - Fork 890
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
Optional Metric Attributes #2077
Comments
Disucssed during the 11/2/2021 Spec SIG Meeting: For example:
@jsuereth suggested that for case 2, we can treat the data as different metrics data streams, so we don't mix different dimensions. @reyang if a SQL instrumentation library started with 4 dimensions, and later we decided to add another dimension, do we rename the instrumentation library or bump the major version? @jsuereth either way, but it should be a significant change. |
Summarizing what I understood to be the decisions made in yesterday's SIG:
@jsuereth, @bogdandrutu, @reyang, please correct me if I've missed or misinterpreted anything. |
@jsuereth this is what I was referring to. This says that optional attributes are OK and area implied in the metric data model. |
@tigrannajaryan Optional attributes are OK, but there's a line here to pay attention to:
This is in conflict with what's being proposed in the semantic-convention stability PR. It's ok across different resources or instrumentation libraries to have different optional attributes but not for the same instrumentation. |
Is this nuance enforceable in practice? I feel that it is going to be tricky to both communicate this nuance in the spec clearly and as a developer it will be also tricky to correctly follow the requirements of it. In any case I modified the semantic-convention stability PR to disallow this, so we are good there, but I think more clarification is necessary here. |
It's actually more that what we'd like to enforce is NOT enforceable in practice. This nuance basically says:
|
I think this is worth calling out directly somewhere. Otherwise we have too much implicit knowledge. |
A metric attribute is used to differentiate data points along a single dimension.
In some cases an attribute should be considered optional. In particular this is necessary for "usage" metrics (as defined here), but there may be other cases as well.
A metric with an optional attribute can be represented either as a set of data points, each with a different attribute value, or as a single data point without the attribute. In the latter case, the dimension is collapsed into a single "total" value, but the attribute itself should not be specified (i.e. should not take a value of "total" or similar). The omission of the attribute in the "total" case is necessary in order to support the notion that data points along a dimension should be meaningfully aggregatable. As a general rule, it follows that each resource should be characterized by a metric containing only "total" data points, or containing no "total" data points.
Additional context.
The OTel collector currently collects process metrics in two different cases. In one case, a "total" value is produced. In the other, values are differentiated by "state". The metric data model should support both use cases. This solution was proposed here and seconded here.
The text was updated successfully, but these errors were encountered: