open-feature/go-sdk-contrib

Suspected Issue: OpenTelemetry hook does not work with Prometheus Metrics exporter

Opened this issue · 0 comments

I have a basic OpenTelemetry setup for my application.
This includes a metrics provider with a Prometheus exporter.

Adding the metrics hook yields the following error.

An error has occurred while serving metrics:

error collecting metric Desc{fqName: "feature_flag_evaluation_active_count", help: "active flag evaluations counter", constLabels: {}, variableLabels: {feature_flag_key,otel_scope_name,otel_scope_version}}: cannot inject exemplar into Gauge, Summary or Untyped

I can investigate further with a simpler example but I was surprised to see this not immediately work.

Perhaps Prometheus and OpenFeature metrics do not get along?
https://github.com/prometheus/client_golang/blob/a934c3595116c0a1d5b21318718d8a0ab9d7c009/prometheus/metric.go#L207-L208

I can provide additional context if needed.