Можно ли изменить формирование выходных данных таймера для micrometer
В данный момент с эндпойнта /actuator/prometheus я получаю вот такой ответ для таймера:
...
# HELP MY_NAME_seconds
# TYPE MY_NAME_seconds summary
MY_NAME_seconds_count{application="MyApplication",smth="else",} 520.0
MY_NAME_seconds_sum{application="MyApplication",smth="else",} 1249.024
# HELP MY_NAME_seconds_max
# TYPE MY_NAME_seconds_max gauge
...
Создаю его таким образом: Metrics.timer(operation, tags).record(endTime - startTime, TimeUnit.MILLISECONDS); Есть ли возможность поменять MY_NAME_seconds_count на MY_NAME_millis_count?
Ответы (1 шт):
Такой ответ получил от поддержки micrometer:
Generally I'd say this isn't necessary. The value of the metric is a floating point seconds value. If you want to display ms on a chart you can safely multiply the time series by 1000 There is a healthy principle of using base units whenever possible. Seconds is a base unit, which makes it easier to scale the time series in either direction (either down to millis or up to minutes) The word 'seconds' comes from that convention in the Prometheus ecosystem. Other ecosystems may suggest that this is redundant Naming convention can set on a registry under registry.config()