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
Durations measured as difference between start and end erlang:monotonic_times in so called native time units. native time units are meaningless and have to be converted using erlang:convert_time_unit. However as erlang:convert_time_unit documentation warns:
You may lose accuracy and precision when converting between time units.
In order to minimize such loss, collect all data at native time unit and do the
conversion on the end result.
The idea is that set_duration/observe_duration functions always work with native time units and conversion is delayed until scraping/retrieving value. To implement this, metric needs to know desired time unit. Users can specify desired time unit explicitly via duration_unit or mplicitly via metric name ((preferred, since prometheus best practices insists on <name>_duration_<unit> metric name format).
Possible units:
microseconds;
milliseconds;
seconds;
minutes;
hours;
days;
Histogram will internally convert buckets bounds to native units if duration_unit is provided. It will convert it back when scraping or retrieving value.
The text was updated successfully, but these errors were encountered:
this looks excellent. so creating a histogram via prometheus_histogram:new({thing_duration_milliseconds, ...}) will automatically report that metric as an (integer) millisecond, converted from native units?
yep! and if you're not instrumenting directly e.g. Elli gives you 'standard' tuple soyou can turn this off with duration_unit: false. Also duration in the name isn't needed.
Durations measured as difference between start and end
erlang:monotonic_time
s in so called native time units. native time units are meaningless and have to be converted usingerlang:convert_time_unit
. However aserlang:convert_time_unit
documentation warns:The idea is that
set_duration/observe_duration
functions always work with native time units and conversion is delayed until scraping/retrieving value. To implement this, metric needs to know desired time unit. Users can specify desired time unit explicitly viaduration_unit
or mplicitly via metric name ((preferred, since prometheus best practices insists on<name>_duration_<unit>
metric name format).Possible units:
Histogram will internally convert buckets bounds to native units if duration_unit is provided. It will convert it back when scraping or retrieving value.
The text was updated successfully, but these errors were encountered: