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

[EXPORTER] Add config options to prometheus exporter #3104

Merged
merged 7 commits into from
Oct 21, 2024

Conversation

psx95
Copy link
Contributor

@psx95 psx95 commented Oct 16, 2024

Fixes #2453

Changes

Added the following optional configuration options (booleans) to the prometheus exporter:

  • without_units : controls whether to add unit suffixes (e.g. _seconds) to the metric names.
  • without_type_suffix: controls whether to add type suffixes (e.g. _total) to the metric names.
  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

Copy link

netlify bot commented Oct 16, 2024

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit 0f75727
🔍 Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/67156e23a6204800088d7273

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.91%. Comparing base (497eaf4) to head (0f75727).
Report is 144 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3104      +/-   ##
==========================================
+ Coverage   87.12%   87.91%   +0.79%     
==========================================
  Files         200      195       -5     
  Lines        6109     6133      +24     
==========================================
+ Hits         5322     5391      +69     
+ Misses        787      742      -45     

see 98 files with indirect coverage changes

@psx95 psx95 marked this pull request as ready for review October 16, 2024 21:39
@psx95 psx95 requested a review from a team as a code owner October 16, 2024 21:39
@psx95 psx95 changed the title Add optional config to prometheus exporter Add config options to prometheus exporter Oct 16, 2024
@psx95 psx95 force-pushed the update-prometheus-exporter branch from 359f751 to 19d20cf Compare October 17, 2024 14:29
Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

Thanks.

Copy link
Member

@marcalff marcalff 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.

Please fix minor comments on the code flow.
Will approve after that.

exporters/prometheus/src/exporter_utils.cc Outdated Show resolved Hide resolved
exporters/prometheus/src/exporter_utils.cc Outdated Show resolved Hide resolved
@marcalff marcalff changed the title Add config options to prometheus exporter [EXPORTER] Add config options to prometheus exporter Oct 20, 2024
@psx95 psx95 force-pushed the update-prometheus-exporter branch from 012384a to 618f850 Compare October 20, 2024 20:53
@psx95
Copy link
Contributor Author

psx95 commented Oct 20, 2024

Thanks for the reviews! I made the requested changes.

I sometimes find double negatives in if conditions a little unreadable, hopefully the small comments on top would make things clear.

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

@marcalff marcalff added the ok-to-merge The PR is ok to merge (has two approves or raised by a maintainer/approver and has one approve) label Oct 21, 2024
@marcalff marcalff merged commit b1488cd into open-telemetry:main Oct 21, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-merge The PR is ok to merge (has two approves or raised by a maintainer/approver and has one approve)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EXPORTER] Add optional configuration for prometheus exporter
3 participants