How do I label the X-axis of a histogram so that it’s clear whether the bins are showing seconds, milliseconds, or whatever?
I can label the Y-axis (which for a histogram is rather less important than the X-axis, I think), but I don’t see where to label the units of the X-axis. I can’t imagine this is missing - it’s such a basic feature for any type of graph to be able to label the axes…
I don’t think it’s possible to set up custom labels of the X-axis in the graph panel (unless you make a relevant query returning both labels and values from your data source), but you can always add the relevant information in the panel title.
Hm, I can’t quite work out what you mean I should do, or what the result is
supposed to be.
Can you give me a specific example of what to enter in which field (or the
equivalent JSON, if that’s easier without having to do screenshots), in order
to get a label on the X-axis telling me what the units of measurement are, in
the same way as I can get a label on the Y-axis by filling in the “Label” field
for the “Left Y” sectiosn of the “Axes” tab?
Sorry, I don’t have a dashboard with a histogram I can use to explain what I mean, but using ‘Alias’ is not a solution to labeling the x-axis; it’s a clunky workaround that would at least get a unit representation in the labels of each bucket.
In the example I gave, specifying ‘{{metric}} (sec)’ in the ‘Alias’ field of the metric you are graphing would lead to the metric name being displayed below each bucket with ’ (sec)’ tagged onto the end of the metric name.
There are other internal Grafana fields you can specify if ‘{{metric}}’ is not what you are labeling the buckets with.
If your suggestion results in the unit being appended to every bucket label on
the X-axis, then I prefer my current workaround, which is to include the unit
name in the panel title.
Most of my histogram panels currently have 12 bucket labels across a width of
400 pixels, so I’m very happy to maintain the gap between the numbers instead
of filling each one with “sec”