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

4.x ServerCdiExtension creates metrics observers using its provider, even though the metrics extension already added it to the server #7980

Closed
tjquinno opened this issue Nov 9, 2023 · 0 comments · Fixed by #8008
Assignees
Labels
4.x Version 4.x bug Something isn't working MP server
Projects
Milestone

Comments

@tjquinno
Copy link
Member

tjquinno commented Nov 9, 2023

Environment Details

  • Helidon Version: 4.0.0
  • Helidon SE or Helidon MP MP
  • JDK version:
  • OS:
  • Docker version (if applicable):

Problem Description

With metrics the CDI extension creates the metrics observer using special settings beyond what might be in the normal place in configuration and then adds it to the server.

But even so, the ServerCdiExtension triggers creation of another metrics observer (because the metrics observer provider is on the class path) even though the metrics CDI extension already created one.

This duplication causes the global meter registry to be overwritten, discarding previously-registered meters and proceeding with incorrect configuration settings for the meter registry.

Steps to reproduce

cd microprofile/metrics
mvn test -Dtest=BadGaugeTest -Dmaven.surefire.debug # or any test that starts the server

Set a breakpoint at the MetricsObserver constructor.
It will be invoked twice, first from the MetricsCdiExtension and then from ServerCdiExtension gathering all observers via their providers.

@tjquinno tjquinno added bug Something isn't working MP server 4.x Version 4.x labels Nov 9, 2023
@tjquinno tjquinno added this to Triage in Backlog via automation Nov 9, 2023
@tjquinno tjquinno changed the title 4.x ServerCdiExtension creates all observers using their providers, even if a observers have already been added to the server 4.x ServerCdiExtension creates all observers using their providers, even if observers have already been added to the server Nov 9, 2023
@tjquinno tjquinno moved this from Triage to Normal priority in Backlog Nov 15, 2023
@tjquinno tjquinno self-assigned this Nov 15, 2023
@tjquinno tjquinno moved this from Normal priority to Sprint Scope in Backlog Nov 15, 2023
@tjquinno tjquinno added this to the 4.0.1 milestone Nov 15, 2023
@tjquinno tjquinno changed the title 4.x ServerCdiExtension creates all observers using their providers, even if observers have already been added to the server 4.x ServerCdiExtension creates metrics observers using its provider, even though the metrics extension already added it to the server Nov 15, 2023
Backlog automation moved this from Sprint Scope to Closed Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x bug Something isn't working MP server
Projects
Backlog
  
Closed
1 participant