Skip to content
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

Closed
mx-psi opened this issue Mar 8, 2022 · 6 comments
Closed
Assignees
Labels

Comments

@mx-psi
Copy link
Member

mx-psi commented Mar 8, 2022

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!):

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.

@dmitryax
Copy link
Member

@mx-psi will you be able to work on this one?

@mx-psi mx-psi self-assigned this Mar 21, 2022
@mx-psi
Copy link
Member Author

mx-psi commented Mar 21, 2022

Sure :)

@bogdandrutu
Copy link
Member

bogdandrutu commented Apr 4, 2022

Removed the TraceProvider global #5138, working on the MeterProvider next.

@mx-psi
Copy link
Member Author

mx-psi commented Apr 4, 2022

👍 will focus just on the gRPC logger then

@bogdandrutu
Copy link
Member

#5146 fixed the MeterProvider.

@mx-psi
Copy link
Member Author

mx-psi commented Apr 28, 2022

#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
Labels
Projects
None yet
Development

No branches or pull requests

3 participants