-
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
Support a global MeterProvider in go.opentelemetry.io/otel
#3818
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To avoid the import cycle, the otel/metric package needs to not import otel. To achieve this, the error handling implementation is moved to the otel/internal/global package where both can import the needed functionality.
go.opentelemetry.io/otel
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3818 +/- ##
=======================================
- Coverage 81.7% 81.7% -0.1%
=======================================
Files 167 170 +3
Lines 12453 12474 +21
=======================================
+ Hits 10175 10192 +17
- Misses 2063 2067 +4
Partials 215 215
|
Follow up to this PR: #3819 |
jmacd
approved these changes
Feb 28, 2023
dmathieu
approved these changes
Mar 1, 2023
Merged
MrAlias
added a commit
to MrAlias/opentelemetry-go
that referenced
this pull request
Apr 11, 2023
…pen-telemetry#3818)" This reverts commit 8139361.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3816
The current support of a global
MeterProvider
is provided bygo.opentelemetry.io/otel/metric/global
. In the process of releasing thego.opentelemetry.io/otel/metric
as stable, this functionality is being moved togo.opentelemetry.io/otel
.go.opentelemetry.io/otel/metric/global
. This will be removed in thev1.15.0
release after the release candidate phases publish this change.otel
package tootel/internal/global
. This is done to resolve the import cycle ofotel/internal/metric
depending on this error handling functionality.otel/metric/global
intootel
.MeterProvider()
function is renamed toGetMeterProvider()
to matchGetTracerProvider()
otel/metric/global
package anymore.This approach wraps the existing functionality in
otel/metric/global
with the added functionality inotel
. The opposite (moving the functionality tootel
and wrappingotel/metric/global
withotel
) cannot be implemented without an import cycle (otel
importsotel/metric
and the wrap would meanotel/metric/global
would importotel
). Also,otel
cannot depend on the underlying implementation inotel/metric/internal/global
because that internal package is a sub-directory ofotel
.