You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PrometheusNamingConvention duplicates "_seconds" suffix with default configuration for Timer metrics #2320
That code has not changed since 1.0, but it does look potentially off. The intention was to support an alternate naming convention for timers that used an additional suffix before _seconds (see PrometheusDurationNamingConvention). It doesn't look like we consider the case for the default of a blank "" suffix and a meter name that already ends in seconds, which I believe is what this issue is reporting. I would say it is also best practice to not name Timers ending in seconds generally, anyways, though. We could still probably improve the logic and unit tests here.
/cc @checketts who added the PrometheusDurationNamingConvention.
Hi @shakuzen
First of all thanks for the fast response.
Actually, my issue is not about the naming of the metrics itself.
I used PrometheusNamingConvention to generate dashboards from the source code and different users are able to provide metric names either from Prometheus endpoint, or the ones they pass to the meter registry.
Of course, I can resolve it inside my own code, but it seems to me that behavior in PrometheusNamingConvention is not consistent for the Timers and Counters.
I'd be happy to contribute this feature but the change seems like breaking change to me, and I wonder whether it will be welcomed, and what is the process of such changes.
Activity
shakuzen commentedon Oct 29, 2020
That code has not changed since 1.0, but it does look potentially off. The intention was to support an alternate naming convention for timers that used an additional suffix before
_seconds(seePrometheusDurationNamingConvention). It doesn't look like we consider the case for the default of a blank""suffix and a meter name that already ends inseconds, which I believe is what this issue is reporting. I would say it is also best practice to not name Timers ending insecondsgenerally, anyways, though. We could still probably improve the logic and unit tests here./cc @checketts who added the
PrometheusDurationNamingConvention.Fetsivalen commentedon Oct 29, 2020
Hi @shakuzen
First of all thanks for the fast response.
Actually, my issue is not about the naming of the metrics itself.
I used PrometheusNamingConvention to generate dashboards from the source code and different users are able to provide metric names either from Prometheus endpoint, or the ones they pass to the meter registry.
Of course, I can resolve it inside my own code, but it seems to me that behavior in PrometheusNamingConvention is not consistent for the Timers and Counters.
I'd be happy to contribute this feature but the change seems like breaking change to me, and I wonder whether it will be welcomed, and what is the process of such changes.
checketts commentedon Oct 29, 2020
I can't recall why it was implemented as is. The
blamelooks like I just reformatted the code. So that isn't very helpful.It appears the current logic is intended to make the suffix
_duration_secondsor just_seconds, feel free to add the missing case @shakuzen mentioned.Fetsivalen commentedon Apr 2, 2021
Hi @shakuzen
are you going to merge this PR, or it isn't smth you'd like to have in micrometer and I should close this ticket?
Fixes micrometer-metrics#2320