opentelemetry-java
opentelemetry-java copied to clipboard
Fix serialization of arrays in prometheus exporter
For protocols that do not natively support non-string values, non-string values SHOULD be represented as JSON-encoded strings.
but it looks like the Prometheus exporter calls only Object.toString()
:
https://github.com/open-telemetry/opentelemetry-java/blob/9ac678e81bce7c12820acdb846d22d7957b8b15f/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/Serializer.java#L502
Just FYI: I started working on a PR for #5940, and that will replace the Serializer
class. I'm confident I can get the PR done next week.
Quick update: If #6015 gets merged this code will be moved to Otel2PrometheusConverter.convertAttributes()
. Still the same issue though, #6015 also calls value.toString()
.