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

Global error handler cleanup - Counter and Observable counter creation #2234

Merged
merged 7 commits into from
Oct 24, 2024

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Oct 24, 2024

Fixes #
Design discussion issue (if applicable) #

Changes

Please provide a brief description of the changes here.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@lalitb lalitb requested a review from a team as a code owner October 24, 2024 04:35
instrument_name = builder.name.as_ref(),
message = "Measurements from this counter will be ignored.",
reason = format!("{}", err)
);
Copy link
Member Author

Choose a reason for hiding this comment

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

Cijo's comment:
otel_error!(
name: "InstrumentCreationFailed",
meter_name = self.scope.name.as_ref(),
instrument_name = builder.name.as_ref(),
message = "Measurements from this instrument will be ignored."
reason = fmt(err))

^ I prefer this version. Please see if this is better for end users.

Copy link
Member Author

Choose a reason for hiding this comment

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

Utkarsh comment:
change
"Measurements from this instrument will be ignored." to
""Measurements from this counter will be ignored.",

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 16.00000% with 21 lines in your changes missing coverage. Please review.

Project coverage is 79.5%. Comparing base (80dc298) to head (d2d462f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-sdk/src/metrics/meter.rs 16.0% 21 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2234     +/-   ##
=======================================
- Coverage   79.6%   79.5%   -0.1%     
=======================================
  Files        121     121             
  Lines      21094   21113     +19     
=======================================
  Hits       16805   16805             
- Misses      4289    4308     +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

instrument_name = builder.name.as_ref(),
message = "Measurements from this counter will be ignored.",
reason = format!("{}", err)
);
Copy link
Member

Choose a reason for hiding this comment

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

2024-10-24T05:32:23.524520Z ERROR main opentelemetry_sdk meter_name="mylibraryname" instrument_name="-my_counter" Measurements from this counter will be ignored. reason="Invalid instrument configuration: instrument name must start with an alphabetic character"

^ This is what we get when I used fmt module. The reason is a slightly extra verbose:
Current: Invalid instrument configuration: instrument name must start with an alphabetic character
Proposal: Instrument name must start with an alphabetic character

This is a minor thing we can change in the future.

name: "InstrumentCreationFailed",
meter_name = self.scope.name.as_ref(),
instrument_name = builder.name.as_ref(),
message = "Measurements from this observable counter will be ignored.",
Copy link
Member

Choose a reason for hiding this comment

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

nit: if we are doing different message for each kind of instrument, then for observable, we need to call out that the registered callbacks will not be invoked.

Copy link
Member Author

@lalitb lalitb Oct 24, 2024

Choose a reason for hiding this comment

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

This is good point. Have updated it - Callbacks for this observable counter will not be invoked.

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

Left a nit suggestion, but LGTM for merging.

@TommyCpp TommyCpp merged commit 45b4f82 into open-telemetry:main Oct 24, 2024
24 of 25 checks passed
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.

4 participants