Advanced Graphing (Part3): Right Y-axis & Log scales


#1

Right Y-Axis

Sometimes it’s useful to graph time series that differ by orders of magnitude but are still related or correlated. For example memory and CPU usage. Grafana allows you to assign series to a second (Right) Y-axis which can have separate unit & scale.

You can assign a series to the Right Y-Axis by clicking on the colored line icon to the left of the series name in the graph legend.

Example graph:

Log scale

Another way visualize series that differ by orders of magnitude is to use a logarithmic scales. This is really useful for data usage or latency measurements. The goal here is to avoid one series dominating and delegating all the others to the bottom of the graph.

Example with default linear scale:

As you can see in the above graph the used series is so much higher than the other series that you cannot distinguish between the other two as they are both delegated to the bottom pixels of the graph.

To switch to a logarithmic scale go into edit mode (just press e on keyboard while hovering over panel) and Axes tab.

Result:

Now all series are visible and we can actually see the difference between them.


#2

Another example of log scale usage.

Two metrics are displayed on a graph. Each metric has a normal value less than one and a spike to a hundred. Changing scale to log scale helps to visualize the data, but axes and toolip are not really informative:
image

To resolve it we first go to the Axes and hardcode Left-Y -> Decimals value as 4, thus forcing left-Y show four decimal places.
Then we go to Legend and hardcode Values -> Decimals value as 4, thus forcing a toolip to show four decimal places.

image


#3

yup, that’s totally intuitive. not.