We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The global TextMapPropagator, MeterProvider, and TracerProvider can be set as many times as the user wants to call the appropriate set method.
TextMapPropagator
MeterProvider
TracerProvider
opentelemetry-go/internal/global/state.go
Line 62 in fd9de7e
opentelemetry-go/internal/metric/global/metric.go
Line 53 in fd9de7e
Line 85 in fd9de7e
The global ErrorHandler can only be set once. Subsequent calls to SetErrorHandler are ignored.
ErrorHandler
SetErrorHandler
opentelemetry-go/handler.go
Lines 73 to 84 in fd9de7e
This inconsistent behavior needs to be made consistent.
The text was updated successfully, but these errors were encountered:
My opinion: we should allow setting as many times as the user wants to call the appropriate set method.
Why? Even for the sake of unit testing. Example: https://github.com/open-telemetry/opentelemetry-go-contrib/blob/00f202e858996b1600131b021e810d17f93fb6d6/instrumentation/github.com/emicklei/go-restful/otelrestful/restful_test.go#L149-L176
Just to confirm. Is it possible to get a "current" value to be able to make some set+revert logic?
Sorry, something went wrong.
Yes. There should be a corresponding Get* function for any Set* function (e.g. this)
Get*
Set*
MrAlias
Successfully merging a pull request may close this issue.
Description
The global
TextMapPropagator
,MeterProvider
, andTracerProvider
can be set as many times as the user wants to call the appropriate set method.opentelemetry-go/internal/global/state.go
Line 62 in fd9de7e
opentelemetry-go/internal/metric/global/metric.go
Line 53 in fd9de7e
opentelemetry-go/internal/global/state.go
Line 85 in fd9de7e
The global
ErrorHandler
can only be set once. Subsequent calls toSetErrorHandler
are ignored.opentelemetry-go/handler.go
Lines 73 to 84 in fd9de7e
Expected behavior
This inconsistent behavior needs to be made consistent.
The text was updated successfully, but these errors were encountered: