micrometer-metrics / micrometer

An application observability facade for the most popular observability tools. Think SLF4J, but for observability.
https://micrometer.io
Apache License 2.0
4.46k stars 984 forks source link

Add KeyValuesProvider #5112

Open jonatan-ivanov opened 4 months ago

jonatan-ivanov commented 4 months ago

KeyValuesProvider is a component that could be used to provide (probably static) metadata, a collection of KeyValue instances, something like this:

interface KeyValuesProvider {
    KeyValues getKeyValues();
}

This component can be used to provide extra information about the application (or certain components inside of it) and the environment (framework, runtime, process, os, host, deployment, infrastructure, etc). For example:

KeyValuesProvider should be integrated with the Observation and Metrics API so that the KeyValues can be attached to Observations and Meters too. Further integration can be added with MeterBinders so that Meters can be created using this metadata (see JvmInfoMetrics).

It would be desirable to be able to surface this data on http endpoint for example like Spring Boot Actuator's info endpoint (i.e.: integrate it with InfoContributor).

vasantteja commented 4 months ago

Hey @jonatan-ivanov This sounds interesting. I can work on this if you are fine with it.