You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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
Environment Details
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
Set a breakpoint at the
MetricsObserver
constructor.It will be invoked twice, first from the
MetricsCdiExtension
and then fromServerCdiExtension
gathering all observers via their providers.The text was updated successfully, but these errors were encountered: