-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix delegation for global MeterProviders #5828
Fix delegation for global MeterProviders #5828
Conversation
Can you add a unit test that fails before the fix, and passes after? |
You will also need to sign the CLA. |
Working with my company to get CLA approval. Also where should I put the unit test? internal/global/meter_test.go or is there a better spot? |
internal/global/meter_test.go is great |
Hello folks, sorry to jump in, @MrAlias kindly pointed me to this PR while discussing a problem I had with the recent release of opentelemetry. While this fix indeed solves the broken delegation problem in our case, the setup we have had the system panicking because it went through this line of code which is not followed by a Since the code has been there for a while I assume this is the desired behavior, but it does look suspicious to me, so I wanted to put this on your radar. |
I had to add the unit test to sdk/metric/meter_test.go to have enough context to repro the issue in the unit test. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5828 +/- ##
=====================================
Coverage 84.5% 84.6%
=====================================
Files 272 272
Lines 22736 22779 +43
=====================================
+ Hits 19224 19272 +48
+ Misses 3169 3165 -4
+ Partials 343 342 -1 |
I can confirm that this fixes a regression related to #5754 #5758 #5780 in https://github.com/lightstep/otel-launcher-go. Without this fix, SetMeterProvider() would reach a panic, e.g.,
and with this PR, the issue is resolved. |
This is my first time contributing, should I update the branch locally and push or do it in github? |
Either is fine. Pushing the update branch button on github is usually less work, but can't resolve conflicts if there are any |
@sarathsp06, can you please confirm if it is also fixing #5852? |
It does . This would fix the problem |
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
👋 We are eager to see this go into a release. Since the OTel Collector always bumps its dependencies to the latest OTel-Go dependency, we now have a situation where anyone with a recent Collector and a custom OTel-Go SDK is blocked from using new Collector releases until after an OTel-Go release. Please and thank you! |
ETA on a hot fix release? This regression has impact on your users upgrading to the current released version. |
Fixes #5827
Fixes #5852