Tags Query Format for Graphite-Based Dashboard Variable

I am using Grafana 5.0.3 and Graphite 1.2.0-dev. We are recording metrics using Graphite’s tags feature, so that they each have the format “prefix.metric-name;env=dev;host=server1”. I can add data series to my graphs (for example) based on specific tag values (e.g. seriesByTag('name=prefix.heap.committed', env=dev'), but what I’d like to do is to use the templating feature and define a Variable for each tag that will present me with a list of possible values based on the data (e.g. seriesByTag('name=account-search.heap.committed', 'env=${Environment:regex}')).

However, I cannot figure out what the “tags query” should look like in the Query Options/Query field of the Variable editor. Essentially, I want the results of http://graphite-url/tags/env.

Can anyone point to examples or documentation of how to accomplish this?

use tag_values(env), you can also pass additional filters to only return values for the specified tag that occur in series matching the filter like tag_values(env, name=~account.*)

That works perfectly, thankyou!

1 Like

Hi, I am recording metrics with tags just as you do but I cannot graph them using seriesByTag function every time I try to use the function it disappears and nothing happens.

I am recording metrics with this command echo "web.apache.proc_count;host=hostname; $proc_count -1" | nc -q0 $SERVER $PORT

Can you help me please?