Open paivagustavo opened 1 year ago
I explored trying to get prometheus to expose the Unit types, and it looks like the library doesn't do this yet https://github.com/prometheus/client_golang/issues/684.
This doesn't look to be required for GA, moving to the post-GA project.
Note from SIG meeting: this will likely depend on the underlying Prometheus library supporting OpenMetrics before we want to also support it.
You can use OpenMetrics today with the prometheus exporter. In the example, you can change this line: https://github.com/open-telemetry/opentelemetry-go/blob/0e874c3468c2cbc5bbaf075537be6c0f2152b5ef/example/prometheus/main.go#L93
To:
http.Handle("/metrics", HandlerFor(prometheus.DefaultGatherer, HandlerOpts{EnableOpenMetrics: true}))
I don't think this blocks the prometheus exporter GA. Adding UNIT metadata to the exporter after the go client has support can be done as an addition later.
Problem Statement
Prometheus exporter only expose metrics using the Prometheus format, which is a subset of the OpenMetrics format. Ideally, we should be able to specify an option to export metrics using the OpenMetrics format.
Given that we don't expose an OpenMetrics format, we lose information about metric's units, which make some required processing of Prometheus metric to OTLP as the specs define to be skipped, e..g, unit suffixes added by the otel-go are not able to be removed due to the lack of unit information as a limitation of the prometheus format.
Proposed Solution
A
prometheus.WithOpenMetrics()
option to enable the OpenMetrics format, which should contains unit metadata and implement the OTLP Metric points to Prometheus.Alternatives
Another alternative would always enable this behavior, but having an option to enable/disabled can be useful.