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

Add Prometheus Exporter for Exemplars #4178

Draft
wants to merge 43 commits into
base: main
Choose a base branch
from

Conversation

czhang771
Copy link

Description

Fixes # 2407

Started working on adding exemplars to the Prometheus exporter.

Note: the Prometheus exporter seems to be implemented differently in Python compared to Java and Dotnet and uses Metric Families and a custom collector rather than directing converting the OTEL types to Prometheus types.
My current attempt focuses on the Histogram and adds the exemplars to each bucket for the histogram although I am not sure if this is the best way to go about it.

Relevant Resources:
Prometheus Metric Protofiles: https://github.com/prometheus/client_model/blob/master/io/prometheus/client/metrics.proto
Java Prometheus Exporter: https://github.com/open-telemetry/opentelemetry-java/tree/main/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus
Metric Family Class Types: https://github.com/postmates/prometheus_client_python/blob/bed7432fad70a16acff5e7b03a65eb9ec350d3e6/prometheus_client/metrics_core.py#L178
Custom Collectors in Prometheus: https://prometheus.github.io/client_python/collector/custom/

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

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

Successfully merging this pull request may close these issues.

3 participants