Multiple time units in one time series graph in Grafana

Viewed 532

I have two metrics which i want to show on the time series panel:

histogram_quantile(
    0.95, 
    rate(correction_ms_bucket[1m])
)


histogram_quantile(
    0.95, 
    rate(request_time_bucket[1m])
)

The problem is that my panel has unit Time/milliseconds but the request_time_bucket metric is seconds (i can't change the metric itself since it is legacy metric and something depends on it's format already).

Is there any way to cast it or perhaps to control units for each query?

1 Answers

In this particular case, seconds can be simply multiplied to milliseconds:

histogram_quantile(
    0.95, 
    rate(request_time_bucket[1m])
) * 1000

And no other change is required.

In other cases (when dealing with completely different units) it is possible to create "overrides" for default values:

example

In the example above "latency" time series has a different axis (so that it appears on the right side of the panel) and unit (milliseconds).

Related