-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Description
What did you do?
Context: open-telemetry/opentelemetry-collector-contrib#30934
The OpenTelemetry collector can create multiple "prometheus receivers", which each has its own scrape manager. After #12958 if we pass prometheus.DefaultRegisterer to the scrape manager, we get duplicate registration errors. Thankfully (or, sadly), we aren't using the scrape metrics right now, so we can pass a no-op registerer. But we would like to be able to use these metrics in the future.
What did you expect to see?
No error when creating multiple scrapemanagers with the same registerer.
It looks like promhttp handles this by checking for an already registered error: https://github.com/prometheus/client_golang/blob/d69fe9a80254b8a262bb071cad63595fcbff6dab/prometheus/promhttp/http.go#L260, and using the existing instrument, if it is found.
What did you see instead? Under which circumstances?
N/A
System information
N/A
Prometheus version
v0.49.1
Prometheus configuration file
N/AAlertmanager version
N/A
Alertmanager configuration file
N/ALogs
N/A