-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Document and provide a way to disable global state modification by Collector #4971
Labels
priority:p2
Medium
Comments
9 tasks
@mx-psi will you be able to work on this one? |
Sure :) |
Closed
Removed the TraceProvider global #5138, working on the MeterProvider next. |
👍 will focus just on the gRPC logger then |
#5146 fixed the MeterProvider. |
#5272 fixed the grpc logger temporarily. I am going to close this for now and we should reopen if the temporary fix is reverted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
On initialization, the Collector modifies global state from external dependencies in a number of ways; for example (probably not an exhaustive list!):
opentelemetry-collector/service/internal/telemetrylogs/logger.go
Line 76 in 52f8669
opentelemetry-collector/service/telemetry.go
Line 213 in f980c9e
opentelemetry-collector/service/collector.go
Line 215 in 52f8669
All of these provide useful features, but it makes it difficult to use the Collector as a library: in the grpc logger example in particular, it can lead to data races since the logger access is not atomic, in the global providers it may interact in unexpected ways with other parts of a codebase.
Describe the solution you'd like
The Collector's documentation will explicitly state any global state modifications of externally accessible structs. It also provides an option to disable these modifications. In the cases listed above, something like #4970 would work, since it could be the telemetry provider's responsibility to modify global telemetry state.
The text was updated successfully, but these errors were encountered: