Skip to content
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

Use OpenMetrics format for exposing exemplars #3449

Open
bastianeicher opened this issue Jul 15, 2022 · 6 comments · May be fixed by #5929
Open

Use OpenMetrics format for exposing exemplars #3449

bastianeicher opened this issue Jul 15, 2022 · 6 comments · May be fixed by #5929
Labels
enhancement New feature or request

Comments

@bastianeicher
Copy link

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:

  • When a counter or histogram metric is updated, automatically capture Activity.Current (always keeping the latest value per metric).
  • PrometheusExporterMiddleware and PrometheusExporterHttpServer check the Accept header of incoming scrape requests. If this contains application/openmetrics-text; version=1.0.0, append the capture activity/trace IDs to metrics as specified by OpenMetrics.

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.

@bastianeicher bastianeicher added the enhancement New feature or request label Jul 15, 2022
@cijothomas
Copy link
Member

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
Copy link
Author

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
Copy link
Member

Yes. But Exemplars feature itself is not implemented.

Copy link
Contributor

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.

@github-actions github-actions bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label Sep 25, 2024
@bastianeicher
Copy link
Author

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.

@github-actions github-actions bot removed the Stale Issues and pull requests which have been flagged for closing due to inactivity label Sep 26, 2024
@saul saul linked a pull request Oct 27, 2024 that will close this issue
8 tasks
@saul
Copy link

saul commented Oct 27, 2024

I've just raised #5929 for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants