Component(s)
exporter/prometheus
What happened?
Description
Currently, prometheusreceiver supports native histograms, but prometheusexporter cannot expose them (because Prometheus cannot expose native histograms in text format yet).
Steps to Reproduce
- Instrument your code with native histograms
- Scrape the metrics with
prometheusreceiver by following the instructions here: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/f5d54da37ae664e1a0b6934a61d38f1afab5501f/receiver/prometheusreceiver/README.md#prometheus-native-histograms
Expected Result
prometheusexporter should expose native histograms
Actual Result
Logs via debugexporter:
{"level":"error","ts":1718965637.50062,"caller":"[email protected]/accumulator.go:94","msg":"failed to translate metric","kind":"exporter","data_type":"metrics","name":"prometheus","data_type":"\u0004","metric_name":"gloo_mesh_translation_time_sec","stacktrace":"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*lastValueAccumulator).addMetric
\tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/accumulator.go:94
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*lastValueAccumulator).Accumulate
\tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/accumulator.go:71
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*collector).processMetrics
\tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/collector.go:88
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*prometheusExporter).ConsumeMetrics
\tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/prometheus.go:85
go.opentelemetry.io/collector/exporter/exporterhelper.(*metricsRequest).Export
\tgo.opentelemetry.io/collector/[email protected]/exporterhelper/metrics.go:59
go.opentelemetry.io/collector/exporter/exporterhelper.(*timeoutSender).send
\tgo.opentelemetry.io/collector/[email protected]/exporterhelper/timeout_sender.go:49
go.opentelemetry.io/collector/exporter/exporterhelper.(*baseRequestSender).send
\tgo.opentelemetry.io/collector/[email protected]/exporterhelper/common.go:37
go.opentelemetry.io/collector/exporter/exporterhelper.(*metricsSenderWithObservability).send
\tgo.opentelemetry.io/collector/[email protected]/exporterhelper/metrics.go:158
--
Collector version
v0.103.0
Environment information
N/A
OpenTelemetry Collector configuration
receivers:
prometheus:
config:
global:
evaluation_interval: 1m
scrape_interval: 15s
scrape_timeout: 15s
scrape_protocols: [ PrometheusProto, OpenMetricsText1.0.0, OpenMetricsText0.0.1, PrometheusText0.0.4 ]
scrape_configs:
<your targets exposing native histograms>
...
pipelines:
metrics/test:
receivers:
- prometheus
exporters:
- debug
- prometheus
Log output
{"level":"error","ts":1718965637.50062,"caller":"[email protected]/accumulator.go:94","msg":"failed to translate metric","kind":"exporter","data_type":"metrics","name":"prometheus","data_type":"\u0004","metric_name":"gloo_mesh_translation_time_sec","stacktrace":"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*lastValueAccumulator).addMetric
\tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/accumulator.go:94
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*lastValueAccumulator).Accumulate
\tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/accumulator.go:71
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*collector).processMetrics
\tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/collector.go:88
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*prometheusExporter).ConsumeMetrics
\tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/prometheus.go:85
go.opentelemetry.io/collector/exporter/exporterhelper.(*metricsRequest).Export
\tgo.opentelemetry.io/collector/[email protected]/exporterhelper/metrics.go:59
go.opentelemetry.io/collector/exporter/exporterhelper.(*timeoutSender).send
\tgo.opentelemetry.io/collector/[email protected]/exporterhelper/timeout_sender.go:49
go.opentelemetry.io/collector/exporter/exporterhelper.(*baseRequestSender).send
\tgo.opentelemetry.io/collector/[email protected]/exporterhelper/common.go:37
go.opentelemetry.io/collector/exporter/exporterhelper.(*metricsSenderWithObservability).send
\tgo.opentelemetry.io/collector/[email protected]/exporterhelper/metrics.go:158
--
Additional context
No response
Component(s)
exporter/prometheus
What happened?
Description
Currently,
prometheusreceiversupports native histograms, butprometheusexportercannot expose them (because Prometheus cannot expose native histograms in text format yet).Steps to Reproduce
prometheusreceiverby following the instructions here: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/f5d54da37ae664e1a0b6934a61d38f1afab5501f/receiver/prometheusreceiver/README.md#prometheus-native-histogramsExpected Result
prometheusexportershould expose native histogramsActual Result
Logs via
debugexporter:Collector version
v0.103.0
Environment information
N/A
OpenTelemetry Collector configuration
Log output
{"level":"error","ts":1718965637.50062,"caller":"[email protected]/accumulator.go:94","msg":"failed to translate metric","kind":"exporter","data_type":"metrics","name":"prometheus","data_type":"\u0004","metric_name":"gloo_mesh_translation_time_sec","stacktrace":"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*lastValueAccumulator).addMetric \tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/accumulator.go:94 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*lastValueAccumulator).Accumulate \tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/accumulator.go:71 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*collector).processMetrics \tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/collector.go:88 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*prometheusExporter).ConsumeMetrics \tgithub.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/prometheus.go:85 go.opentelemetry.io/collector/exporter/exporterhelper.(*metricsRequest).Export \tgo.opentelemetry.io/collector/[email protected]/exporterhelper/metrics.go:59 go.opentelemetry.io/collector/exporter/exporterhelper.(*timeoutSender).send \tgo.opentelemetry.io/collector/[email protected]/exporterhelper/timeout_sender.go:49 go.opentelemetry.io/collector/exporter/exporterhelper.(*baseRequestSender).send \tgo.opentelemetry.io/collector/[email protected]/exporterhelper/common.go:37 go.opentelemetry.io/collector/exporter/exporterhelper.(*metricsSenderWithObservability).send \tgo.opentelemetry.io/collector/[email protected]/exporterhelper/metrics.go:158 --Additional context
No response