open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.02k stars 2.33k forks source link

prometheus receiver not support openmetrics #14160

Closed songjiayang closed 2 years ago

songjiayang commented 2 years ago

What happened?

## Description

I use prometheus golang SDK to export metrics with exemplars like:

a_bucket{le="0.5"} 10 # {traceID="xxx"}

the collector configuration like:

receivers:
  prometheus:
    config:
      scrape_configs:
      - job_name: 'exemplar-app'
        scrape_interval: 10s
        static_configs:
        - targets: ['app:8080']

processors:
  batch:

exporters:
  prometheus:
    endpoint: "0.0.0.0:8889"
    namespace: "test"
    enable_open_metrics: true

  logging:
    logLevel: debug

extensions:
  health_check:
  pprof:
  zpages:

service:
  extensions: [health_check,pprof,zpages]
  pipelines:
    metrics:
      receivers: [prometheus]
      processors: [batch]
      exporters: [prometheus]

Steps to Reproduce

Example curl command:

curl -H 'Accept: application/openmetrics-text; version=0.0.1' http://localhost:8889/metrics

output like:

a_bucket{le="0.5"} 10

the exemplars missed.



### Collector version

v0.60.0
github-actions[bot] commented 2 years ago

Pinging code owners: @Aneurysm9 @dashpole. See Adding Labels via Comments if you do not have permissions to add labels yourself.

evan-bradley commented 2 years ago

From what I understand, exemplars are not yet supported in the Prometheus receiver. Please see this issue: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/8353