-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Component(s)
No response
What happened?
Description
Original report: istio/istio#47397
The prometheus exporter fails to gather metrics if the description differs between two metrics with the same name.
Steps to Reproduce
With a prometheus receiver, scrape two endpoints with the same metric name, but different HELP (description). Use the prometheus exporter to export the metrics.
Expected Result
No error. Per the OTel specification:
Exporters MUST drop entire metrics to prevent conflicting TYPE comments, but SHOULD NOT drop metric points as a result of conflicting UNIT or HELP comments. Instead, all but one of the conflicting UNIT and HELP comments (but not metric points) SHOULD be dropped. If dropping a comment or metric points, the exporter SHOULD warn the user through error logging.
I.e. we should be accepting the conflicting description, choosing one description to keep, and one to drop, and warning the user.
Actual Result
The prometheus exporter fails incoming scrapes.
Collector version
Don't know
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
No response
Log output
2023-09-29T15:24:02.049Z error [email protected]/log.go:23 error gathering metrics: 2 error(s) occurred:
* collected metric istio_build label:{name:"app" value:"istiod"} label:{name:"cluster" value:"glooplatform-central"} label:{name:"component" value:"pilot"} label:{name:"install_operator_istio_io_owning_resource" value:"unknown"} label:{name:"instance" value:"10.108.2.7:15014"} label:{name:"istio" value:"istiod"} label:{name:"istio_io_rev" value:"1-18"} label:{name:"job" value:"istiod-metrics"} label:{name:"namespace" value:"istio-system"} label:{name:"operator_istio_io_component" value:"Pilot"} label:{name:"pod_name" value:"istiod-1-18-5f7964bccd-jlfwh"} label:{name:"pod_template_hash" value:"5f7964bccd"} label:{name:"sidecar_istio_io_inject" value:"false"} label:{name:"tag" value:"1.18.2-solo"} gauge:{value:1} has help "Istio component build info" but should have ""
* collected metric istio_build label:{name:"app" value:"istiod"} label:{name:"cluster" value:"glooplatform-east"} label:{name:"component" value:"pilot"} label:{name:"install_operator_istio_io_owning_resource" value:"unknown"} label:{name:"instance" value:"10.104.3.14:15014"} label:{name:"istio" value:"istiod"} label:{name:"istio_io_rev" value:"1-18"} label:{name:"job" value:"istiod-metrics"} label:{name:"namespace" value:"istio-system"} label:{name:"operator_istio_io_component" value:"Pilot"} label:{name:"pod_name" value:"istiod-1-18-7d66654c46-c5frb"} label:{name:"pod_template_hash" value:"7d66654c46"} label:{name:"sidecar_istio_io_inject" value:"false"} label:{name:"tag" value:"1.18.2-solo"} gauge:{value:1} has help "Istio component build info" but should have ""
{"kind": "exporter", "data_type": "metrics", "name": "prometheus"}
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*promLogger).Println
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/log.go:23
github.com/prometheus/client_golang/prometheus/promhttp.HandlerForTransactional.func1
github.com/prometheus/[email protected]/prometheus/promhttp/http.go:144
net/http.HandlerFunc.ServeHTTP
net/http/server.go:2109
net/http.(*ServeMux).ServeHTTP
net/http/server.go:2487
go.opentelemetry.io/collector/config/confighttp.(*decompressor).wrap.func1
go.opentelemetry.io/collector/config/[email protected]/compression.go:111
net/http.HandlerFunc.ServeHTTP
net/http/server.go:2109
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.(*Handler).ServeHTTP
go.opentelemetry.io/contrib/instrumentation/net/http/[email protected]/handler.go:212
go.opentelemetry.io/collector/config/confighttp.(*clientInfoHandler).ServeHTTP
go.opentelemetry.io/collector/config/[email protected]/clientinfohandler.go:28
net/http.serverHandler.ServeHTTP
net/http/server.go:2947
net/http.(*conn).serve
net/http/server.go:1991
### Additional context
_No response_