-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
Context: open-telemetry/opentelemetry-go#5111
I am in the process of adding exemplar support to the OpenTelemetry-go prometheus exporter. We currently use testutil.GatherAndCompare for most of our testing, as it makes it easy to tell if the output is correct.
However, since GatherAndCompare currently uses the Prometheus text format, and the Prometheus text format doesn't support exemplars, I can't test using the same mechanism. Assuming exemplars aren't coming to the text format soon, the options to resolve this are:
- Re-implement GatherAndCompare in my own tests, and make it use OpenMetrics text format, instead of the Prometheus text format.
- Write unit test assertions on the go-protobuf types from
prometheus.Metric.Write()to check for exemplars separately. - Extend testutil to support gathering the OpenMetrics text format.
Before I move forward with 1 or 2, I figured I would check to see if extending testutil to support my use-case makes sense to maintainers.