Closed ghost closed 1 month ago
Basically, when it sees suffix like _microseconds it expects values to be native_time_unit. Please read here: https://hexdocs.pm/prometheus_ex/time.html#content
Hey @deadtrickster . In the documentation, this is what we can see:
Users can specify time unit explicitly via duration_unit or implicitly via
metric name (preferred, since prometheus best practices guide insists on
<name>_duration_<unit> metric name format).
I had a metric that contained milliseconds
in its name but it didn't have the duration_
part. This converts the metric value too. Is this the expected behaviour?
Thanks 😄
Cool question!
According to current code - yes that's expected. Does it disturb you? What is your metrics?
What is your metrics?
The metric was created to measure the time that certain queries take to run. Since they are pretty fast, I want the metric value to be in milliseconds as an Integer.
Does it disturb you?
No, it's no problem. Can you just update the docs?
Is this expected behavior ?
I declare a metric with a microseconds suffix :
And I then feed it a microseconds value (20481):
It is then silently converted to milliseconds - but the metric name still indicates microseconds.
The code in it's entirity can be seen here