Open
Description
Describe the bug
- Most registry constructors have an argument named
config
of types that are ultimately inherited fromMeterRegistryConfig
; MeterRegistry
has a method namedconfig()
.
Expected behavior
According to the Principle of least astonishment, it is expected that MeterRegistry.config()
will return the same object that is provided to the constructor.
Actual behavior
MeterRegistry.config()
returns an object of class MeterRegistry$Config
that has nothing to do with configurations inherited from MeterRegistryConfig
.
Additional context
MeterRegistry$Config
andMeterRegistryConfig
are not navigable from each other- It is not possible to retrieve the configuration submitted to subclasses of
MeterRegistry
, this hinders troubleshooting, especially in environments with complex autowiring happening in third party dependencies.
Desired resolution
Make MeterRegistryConfig
and MeterRegistry$Config
either belong to the same hierarchy, or at least make MakeRegistryConfig
subclasses navigable from meter registry instances available via introspection.