prometheus-plugs
prometheus-plugs copied to clipboard
Change http_request_<duration> for PlugPipelineInstrumenter
Hey,
I tried switching from :microseconds
to :seconds
since Prometheus suggests to use second
as base unit. The problem is, the config setting only changes the metric name but not the buckets and value. While defining custom buckets is not a big deal, the reported value is still in microseconds.
Or do I miss something here?
I see the same thing... shouldn't the diff take into account the duration_unit?
Looking at https://github.com/deadtrickster/prometheus-plugs/blob/72fa654abd1222ee298e13051035d874fcaa1adf/lib/prometheus/plug_pipeline_instrumenter.ex#L150-L151
Shouldn't that instead be
diff = :erlang.convert_time_unit(stop - start, :native, duration_unit)