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

Make InMemoryMetricReader not a bean #642

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

Azquelt
Copy link
Member

@Azquelt Azquelt commented Jul 31, 2024

While testing the metric test changes, I ran into an issue where the InMemoryMetricReader would not be registered correctly for the first test app. This turned out to be because Liberty was initializing OpenTelemetry before CDI was fully initialized.

This could be true for other runtimes as well, so I think we need to make the InMemoryMetricReader not depend on CDI.

I changed it to use a static singleton instance, which works in liberty, but I wasn't sure whether that would work for implementations using an embedded arquillian container. For this reason, I've also cleared the static instance when the reader is shut down, with the intention that each new app will get a new instance.

@Azquelt Azquelt changed the title Try making InMemoryMetricReader not a bean Make InMemoryMetricReader not a bean Aug 1, 2024
@Azquelt Azquelt merged commit 33812a9 into eclipse:main Aug 1, 2024
1 of 4 checks passed
@Azquelt Azquelt deleted the non-bean-metric-reader branch August 1, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants