Skip to content

Inconsistent hierarchy and naming between MeterRegistry.Config and MeterRegistryConfig #3859

Open
@climategadgets

Description

@climategadgets

Describe the bug

  • Most registry constructors have an argument named config of types that are ultimately inherited from MeterRegistryConfig;
  • MeterRegistry has a method named config().

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 and MeterRegistryConfig 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions