-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address exporter/prometheus package name collision #3172
Comments
The previous version of the prometheus exporter did not need this because of how it was structured. It was possible to pass a prometheus Registry ( I think this is something that can be added to the new version. |
It was pointed out in #3135 that this approach would require the |
Documenting a few experiments:
|
Originally posted by @dashpole in #3168 (comment)
Currently, the prometheus exporter package name is guaranteed to conflict with an import of
"github.com/prometheus/client_golang/prometheus"
. This second import is required now because the prometheus exporter only returns aprometheus.Collector
that needs to be registered with that package. This is not ideal for users as they will always need to override a package name when they setup the exporter.Possible solutions
Rename the exporter
go.opentelemetry.io/otel/exporters/otelprometheus
has been proposed.Provide a registration method
The exporter could have a registration method that returns an
http.Handler
.Add a Must function
Add a
MustRegister
function that returns theExporter
after registering it with a passed prom registerer or the global oneThe text was updated successfully, but these errors were encountered: