open-telemetry / opentelemetry-proto

OpenTelemetry protocol (OTLP) specification and Protobuf definitions
https://opentelemetry.io/docs/specs/otlp/
Apache License 2.0
545 stars 242 forks source link

Clarify what is the correlation between Sum/Gauge NumberDataPoint value and Exemplar value #319

Open bogdandrutu opened 2 years ago

bogdandrutu commented 2 years ago

Right now it is possible to construct a Gauge or Sum that contains a NumberDataPoint value with as "int" see: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/metrics/v1/metrics.proto#L339 and an Exemplar associated with that point that has a "double" value see https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/metrics/v1/metrics.proto#L533

Is this considered a bug? What should a service do when this case happens?

jsuereth commented 2 years ago

This is not a bug. We can comment on this in the data model specification.

While it is expected that a metric stream of "int" would have its measurements comprised of "int" as well (so exemplar + data point line up), it's not a requirement on the protocol.

Think this is worth opening some more language to outline what happens here, e.g. "services are free to convert double -> long" in that instance.