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
The MP metrics doc refers to the RegistryFactory which used to be public in SE and MP in 3.x but is now package private in MP and gone from SE.
We might need to make the class public again and make at least the static getInstance() method (no args) and the instance method getRegistry(String) method public. It's reasonable for an application to determine a scope name for a metric registry at runtime and need to be able to retrieve it.
(If the developer knows the scope at build-time, s/he can use injection to obtain the corresponding MetricRegistry.)
The text was updated successfully, but these errors were encountered:
What you say is true for SE. This issue addresses MP, which still uses separate MP MetricRegistry instances for each scope as in the MP Metrics spec.
Previously, users could invoke RegistryFactory.getInstance().getRegistry(registryType) from SE or MP code to get the MetricRegistry for a particular type (now called scope). RegistryFactory has moved into helidon-microprofile-metrics in 4.0 and is currently package-private.
Currently the developer of an MP app can use injection to get a reference to a MetricRegistry if the scope name is known at compile-time, but there is no way to retrieve a given scope's MetricRegistry programmatically.
There are no public elements on RegistryFactory currently in 4.0, so one way we could allow this use case would be to change the RegistryFactory class to public and add a single static method:
public static MetricRegistry getRegistry(String scopeName) {
return getInstance().getRegistry(scopeName);
}
This would not expose any of the existing methods or their types publicly while keeping an API close to what Helidon 3 developers had used previously.
Environment Details
Problem Description
The MP metrics doc refers to the
RegistryFactory
which used to be public in SE and MP in 3.x but is now package private in MP and gone from SE.We might need to make the class public again and make at least the static
getInstance()
method (no args) and the instance methodgetRegistry(String)
method public. It's reasonable for an application to determine a scope name for a metric registry at runtime and need to be able to retrieve it.(If the developer knows the scope at build-time, s/he can use injection to obtain the corresponding
MetricRegistry
.)The text was updated successfully, but these errors were encountered: