Variable interpolation all the way down
Apply Grafana-style variable interpolation to all panel settings.
This outlines various details about how the functionality for interpolating values into panel settings has been improved through variables originating from different kinds of sources.
As of now, the interpolation machinery honors the well known Grafana dashboard variables as well as request parameters (prefixed by
"request_") and data point fields (prefixed by
1. Pull variables from dashboard variables
This enables the interpolation of dashboard variables into each of the panel control settings (source, commit).
An example would be to have a variable called “countrycode” which gets populated by a database query defined by an SQL statement.
country_code AS __value,
country_name AS __text
Then, assigning a value like that to the JSON endpoint URL panel control setting, the machinery would interpolate the selected value assigned to the
$countrycode variable appropriately.
2. Pull variables from data point fields
Add basic variable interpolation based on keys from
dataPoint. Saying that, all metric values have been added to the data point beforehand by prefixing them with
If there’s a field called
station_id in the current data point, using this inside a panel control option is easy by addressing it with
3. Pull variables from URL request parameters
All request parameters from the request URL are now available in the variable interpolation dictionary, prefixed by
"request_". This enables using request variables in all panel control options (source, commit).
So, when invoking the dashboard with query parameters like
you would be able to use these variables from inside panel control options by assigning them appropriately.
4. Override panel control options with URL request parameters
By using request parameters prefixed with “
panel-”, it is possible to override the panel control options at runtime (source, commit).
# Disable zoom control.
# Add clickthrough-link, interpolating the geohash value.
# Interpolate a custom request variable into
# the `clickthroughUrl` setting at runtime.