Semantic conventions should use int or double, not number #1274
Labels
area:semantic-conventions
Related to semantic conventions
priority:p2
Medium priority level
release:allowed-for-ga
Editorial changes that can still be added before GA since they don't require action by SIGs
spec:trace
Related to the specification/trace directory
What are you trying to achieve?
Easy mapping from semantic conventions to OTLP / sane handling in OpenTelemetry collector.
Additional context.
In the collector, we have logic to parse HTTP status code
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/master/exporter/awsxrayexporter/translator/http.go#L58
It calls
IntVal()
which is thepdata
, similar to OTLP, representation of data in the collector. But since the semantic convention only specifies numberhttps://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/http.md#common-attributes
It seems like currently, the only way to properly parse a number is to check both intval and doubleval. Is this intended? I guess the semantic convention types are supposed to match the OTLP types. This came up since currently JS populates all numeric attributes as double - this is probably because JS uses double for all numbers. This seems wrong, but with the spec as is, it technically is ok.
The text was updated successfully, but these errors were encountered: