open-telemetry / opentelemetry-dotnet

The OpenTelemetry .NET Client
https://opentelemetry.io
Apache License 2.0
3.23k stars 764 forks source link

Use OpenMetrics format for exposing exemplars #3449

Open bastianeicher opened 2 years ago

bastianeicher commented 2 years ago

Feature Request

The OpenMetrics specification extends the Prometheus format with - among other things - support for exemplars. All recent versions of Prometheus support this out of the box and it provides a great way to correlate metrics with traces.

I'd imagine an implementation like this:

I believe this would provide great value because it would make integration between two of OpenTelemetry's pillars, tracing and metrics, just work (tm) out of the box.

If you feel that this would be a good fit and could give me some pointers as to the right places in the code to integrate such functionality, I'd be happy to whip up a proof-of-concept PR.

cijothomas commented 2 years ago

This feels like a specification issue. Every language implementations follow the OTel specification https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/prometheus.md

Also - Exemplars are not yet implemented in OpenTelemetry .NET

bastianeicher commented 2 years ago

The specification you linked to says:

A Prometheus Exporter MAY support OpenMetrics Text Format, including the Exemplars.

So basically my feature request would be to implement this optional part of the specification in OpenTelemetry .NET.

cijothomas commented 2 years ago

Yes. But Exemplars feature itself is not implemented.

github-actions[bot] commented 1 month ago

This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day.

bastianeicher commented 1 month ago

I still think this would be a very valuable addition to opentelemetry-dotnet. This library supports both metrics and traces, so a technology for connecting them, namely exemplars, seems like a prefect fit.

saul commented 2 weeks ago

I've just raised #5929 for this