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

Clarify "semantic conflicts" in the metrics spec #2710

Open
jmacd opened this issue Aug 4, 2022 · 0 comments
Open

Clarify "semantic conflicts" in the metrics spec #2710

jmacd opened this issue Aug 4, 2022 · 0 comments
Assignees
Labels
[label deprecated] triaged-accepted [label deprecated] Issue triaged and accepted by OTel community, can proceed with creating a PR spec:metrics Related to the specification/metrics directory

Comments

@jmacd
Copy link
Contributor

jmacd commented Aug 4, 2022

What are you trying to achieve?

There are several combinations of metric instrument and aggregator that OpenTelemetry has not given a formal specification for. Use of these combinations potentially allows unspecified behavior to become available to users.

OTel's metrics SDK spec should be updated to explain which combinations MUST/SHOULD be prevented.

These result from incompleteness in the data model.

  1. We do not have a GaugeHistogram data point type, so we cannot meaningfully define the use of Histogram with asynchronous instruments.
  2. We have not specified how to handle synchronous Gauge instruments, even though we have the appropriate data type.

Until the behavior of these aggregations/instruments is specified (histogram w/ async instrument, gauge w/ sync instrument) they should not be allowed.

There is a second, connected question that has come up in the SIGs implementing OTel metrics. When configuring an instrument with a non-standard aggregation, who is then responsible for range checks? Does the new pairing observe the range limits associated with the aggregator, or with the instrument? Consensus in the SIGs suggests that range limits should remain with the instrument. This implies that range checks SHOULD be performed based on the instrument kind, without considering its aggregation.

The possibility to use non-standard aggregations SHOULD NOT encourage violating the data model, particularly as it concerns Counter and Histogram instruments. Observe that if an UpDownCounter were allowed to be paired with a Monotonic Sum aggregator, it would potentially break the data model, so this combination needs to be avoided. OTOH there is nothing wrong with configuring a Counter with a NonMonotonic Sum aggregation: it changes interpretation but does not break the data model.

Additional context.

Here is an implementation of a semantic conflict checker for Lightstep's metrics SDK: https://github.com/lightstep/otel-launcher-go/blob/main/lightstep/sdk/metric/internal/viewstate/viewstate.go#L617

@jmacd jmacd added the spec:metrics Related to the specification/metrics directory label Aug 4, 2022
@rbailey7210 rbailey7210 added the [label deprecated] triaged-accepted [label deprecated] Issue triaged and accepted by OTel community, can proceed with creating a PR label Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[label deprecated] triaged-accepted [label deprecated] Issue triaged and accepted by OTel community, can proceed with creating a PR spec:metrics Related to the specification/metrics directory
Projects
None yet
Development

No branches or pull requests

4 participants