Adding default variables to a dashboard

I’ve authored a backend for a simple JSON datastore. It can take some query parameters that I configure with a query string that looks like:

{“topic”: “$topic”, “dc”: “$dc”}

where I’ve configured two variable, $dc and $topic that are pulled from my json datastore.

What I am wondering is if there’s a way for me to configure a thing (App? Panel? Dashboard?) that will automatically configure those variables if the datasource is used as a source for Annotations?

1 Like

What do you mean automatically? No there is no way to provide a default “template” for annotation queries that use your variables.

This was also discussed here: Default Template Variables for a New Dashboard

There is a feature request :

Thanks for the quick responses!

I’m trying to reduce toil involved with someone configuring Grafana to use eventmaster as a datasource. Mainly I’d like to have it negotiate what variable values should be available and auto-file the Query field in the annotation.

For example I just added these docs wherein I explain that one needs to add two variables and a query section in order to have filtering work. I’d love to be able to reuse those variables, and I believe that the relevant github issue #1959 would give me what I want.

Sorry for the duplicate post.

1 Like