public interface MetricNamingStrategy<T>
Modifier and Type | Method and Description |
---|---|
MetricKey |
derivedMetricKey(MetricKey key,
String derivedComponent)
Creates a derived metric key from an existing metric key.
|
MetricKey |
metricKey(T metricName)
Converts an implementation-specific metric name (e.g.
|
MetricKey metricKey(T metricName)
metricName
- the implementation-specific metricMetricKey derivedMetricKey(MetricKey key, String derivedComponent)
Some metrics may include multiple components derived from the same underlying source of data – e.g. a Meter may expose multiple rates and a counter – in which case it may be desirable to create a new metric key derived from the primary one, with a different name for each component of the metric.
Some metrics may be derived from others by the collector itself, e.g. a delta metric might be created from a cumulative counter, or a cumulative metric might be created from a histogram.
This method exists so each strategy can define its own convention for how to name derived metrics keys.
The resulting key should have the same labels as the input key, and its name new name will typically be composed of the input key name and the component name.
key
- the input metric key used to construct the derived keyderivedComponent
- the name to use for the derived component of the input metric