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

feat(metrics): add instrument validation to InstrumentBuilder. #884

Merged
merged 3 commits into from
Sep 30, 2022

Conversation

TommyCpp
Copy link
Contributor

  • spec describes some general rules on instrument configurations. This PR adds those validations and throws errors when any of them fails.
  • Fix document on some functions in InstrumentBuilder

[spec](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#general-characteristics) describes some general rule on instrument configurations. This PR add those validation and throw errors when any of them fails.
@TommyCpp TommyCpp requested a review from a team September 25, 2022 06:46
Nighly complains those to be unreachable pub. Upon inspection, I realized we don't need those to be `pub(crate)`.
@codecov
Copy link

codecov bot commented Sep 25, 2022

Codecov Report

Base: 66.7% // Head: 66.9% // Increases project coverage by +0.2% 🎉

Coverage data is based on head (bf02e00) compared to base (e5ef355).
Patch coverage: 94.3% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #884     +/-   ##
=======================================
+ Coverage   66.7%   66.9%   +0.2%     
=======================================
  Files        113     114      +1     
  Lines       8850    8913     +63     
=======================================
+ Hits        5903    5966     +63     
  Misses      2947    2947             
Impacted Files Coverage Δ
opentelemetry-api/src/metrics/mod.rs 11.3% <0.0%> (+7.3%) ⬆️
opentelemetry-api/src/metrics/instruments/mod.rs 98.2% <97.8%> (ø)
opentelemetry-api/src/testing/trace.rs 42.1% <100.0%> (ø)
opentelemetry-api/src/trace/span_context.rs 87.3% <100.0%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@jtescher jtescher left a comment

Choose a reason for hiding this comment

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

Looks great

@jtescher jtescher merged commit cde31ec into open-telemetry:main Sep 30, 2022
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.

2 participants