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.
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.