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

Convert Prometheus Exporter to Pull MetricReader #1953

Merged
merged 18 commits into from
Feb 5, 2023

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Feb 3, 2023

Fixes #1941

Changes

Changes are as explained here - #1941 (comment)

Prometheus Exporter now implements MetricReader class, instead of PushMetricExporter. And the metrics is collected only when the actual http pull request is received from Prometheus agent to fetch the metrics. Earlier metrics were fetched periodically by PeriodicMetricReader and stored into intermediate storage, from where the Prometheus agent used to pull the data. This resulted in duplicate entries of data in the intermediate storage.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@lalitb lalitb requested a review from a team February 3, 2023 01:15
@lalitb lalitb marked this pull request as draft February 3, 2023 01:15
@lalitb lalitb changed the title Convert Prometheus Exporter to pull metric reader Convert Prometheus Exporter to pull MetricReader Feb 3, 2023
@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Merging #1953 (3bd879d) into main (9200d0c) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1953   +/-   ##
=======================================
  Coverage   87.12%   87.12%           
=======================================
  Files         165      165           
  Lines        4596     4596           
=======================================
  Hits         4004     4004           
  Misses        592      592           
Impacted Files Coverage Δ
.../include/opentelemetry/sdk/metrics/metric_reader.h 50.00% <ø> (ø)

@lalitb lalitb marked this pull request as ready for review February 3, 2023 07:55
@lalitb
Copy link
Member Author

lalitb commented Feb 3, 2023

This is ready for review now. @esigo - you know this code best, so would need your help in review :)

@lalitb lalitb changed the title Convert Prometheus Exporter to pull MetricReader Convert Prometheus Exporter to Pull MetricReader Feb 3, 2023
Copy link
Member

@esigo esigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix :)
changes look good just had one comment on the unit test

exporters/prometheus/test/exporter_utils_test.cc Outdated Show resolved Hide resolved
@lalitb lalitb enabled auto-merge (squash) February 5, 2023 17:26
@lalitb lalitb merged commit c4c8ee0 into open-telemetry:main Feb 5, 2023
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.

prometheus duplicate metrics
2 participants