-
Notifications
You must be signed in to change notification settings - Fork 599
Emit internal log for global meter provider #2331
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
Emit internal log for global meter provider #2331
Conversation
| **provider = Arc::new(new_provider); | ||
| otel_info!(name: "MeterProvider.GlobalSet", message = "Global meter provider is set. Meters can now be created using global::meter() or global::meter_with_scope()."); | ||
| } else { | ||
| otel_error!(name: "MeterProvider.GlobalSetFailed", message = "Global meter provider is not set due to lock poison. Meters created using global::meter() or global::meter_with_scope() will not function."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this (lock poison) is ever user-actionable... Maybe just state "OTel internal error occurred, report it at OpenTelemtry Github repo"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not user-actionable in its current form. If set_meter_provider returned a PoisonError, users could retrieve provider from this error object, reinitialize it to Noop and retry. In current form, it's better to log the error and instruct users to report it to the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will change it in next PR
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2331 +/- ##
=======================================
- Coverage 79.5% 79.5% -0.1%
=======================================
Files 123 123
Lines 21295 21297 +2
=======================================
+ Hits 16935 16936 +1
- Misses 4360 4361 +1 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nit comment to report error to Otel repo.
Continuing from #2330.
Also realized the
opentelemetrycrate did not internal-logs ff enabled by default, and fixed it.