Open jack-berg opened 1 month ago
hi @jack-berg ,
I am working on this by validating the exemplar label runes length in Otel2PrometheusConverter#convertExemplar
. (hopefully that's the right direction, do correct me if wrong)
However, when i tried writing the test case by creating a sample Metric data with exemplar, I noticed that io.prometheus.metrics.expositionformats.PrometheusTextFormatWriter#writeCounter
is not writing the exemplar labels to the output stream. Do you think this is a bug?
I could not find any tests validating whether exemplar objects's labels are being validated anywhere during otel 2 prometheus conversion.
To use exemplars we need to use OpenMetrics exposition format writer. ref: https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#exemplars-experimental
To use exemplars we need to use OpenMetrics exposition format writer. ref: https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#exemplars-experimental
Yup.
@fstab is this actually an issue with prometheus/client_java? Should the OpenMetricTextFormatWriter
limits the characters in exemplar labels to 128 like the golang implementation?
Originally posted by @myeongseok-rpls in https://github.com/open-telemetry/opentelemetry-java-instrumentation/discussions/12411
As discussed in the issue, prometheus has a limit on the allowed characters in exemplars. The java prometheus exporter should not produce exemplars which violate this limit. Currently, the limit appears to be hard coded to 128 characters.