Customize your dashboard

With your first Grafana-BigQuery dashboard in place, you can now start customizing.

Grafana has a tutorial on panels, so we mainly focus on some of the basics. You can also find inspiration via our dashboard playgrounds.


Templates - getting started

We recommend that you load the dynamic dashboard template as your starting point.

For inspiration, see also the templates in our Grafana-Athena customization section. These can be quickly modified for use with Grafana-BigQuery.


Variables

The dashboard template uses variables. These allow end users of the dashboard to dynamically control certain values, e.g. the device, message and signal.


Create a new panel

The BigQuery data source uses standard SQL to query data[1].

To create a new panel, click ‘Add/Visualization’ (top middle) and paste a query as below:

SELECT
    TIMESTAMP_MILLIS(DIV(UNIX_MILLIS(t), $__interval_ms) * $__interval_ms) as time,
    AVG(MySignal) as AVG_mysignal
FROM
    ${dataset}.tbl_${device:csv}_MyMessage
WHERE
    $__timeFilter(t)
GROUP BY
    time
ORDER BY
    time asc

Simply replace MyMessage with your message name (e.g. CAN2_gnssspeed) and mysignal with a signal (e.g. Speed) from that message[2]. You can also query multiple signals/aggregations:

AVG(MySignal1) as AVG_mysignal1, MAX(MySignal2) as MAX_mysignal2

Transformations

Grafana transformations allow you to transform your data to create e.g. calculated signals, filters and more. In the GPS/IMU templates, transformations are e.g. used to filter which signals are shown in certain panels - as well as scale speed (m/s) to speed (km/h).


[1]Note that the BigQuery query does not leverage partition pruning, in contrast to our Grafana-Athena and Grafana-Synapse integrations. This is because the YYYY/MM/DD partition structure produced by the MF4 decoder is not supported by BigQuery. However, BigQuery does use the time filter to some extent for partition pruning, ensuring that the query speed remains high and that the ‘data scanned’ does not e.g. include folders that lie outside the period of interest.
[2]If in doubt on message/signal names, you can browse them via the variable dropdowns. Note that message names are case sensitive in BigQuery