Tips & tricks

Below we’ve added a few tips & tricks for using dashboards.


Cloud vs. self-hosted

Our dashboard guide takes outset in the free Cloud editions of Grafana and InfluxDB. These make it easy to get started and may suffice for smaller use cases. In particular, the free Grafana cloud option is scalable if you only need 5 dashboards and 3 users.

The free InfluxDB Cloud is a bit more limited as outlined here - in particular, you’re only allowed to write 5 MB every 5 minutes, which will be a bottleneck for some use cases. To scale for more devices you can select a usage-based InfluxDB cloud solution or self-host InfluxDB. You can find pricing for the use based cloud here. Self-hosting is also fairly easy e.g. via docker, but outside the scope of our docs for now.

While self-hosted solutions are outside the scope of this guide, we have a very basic ‘get started’ guide that you can check out here.


Where to run CANedge InfluxDB Writer script

If you’re running a MinIO S3 server on a PC/laptop, it would make sense to deploy the dashboard-writer script on the same system to minimize latency when fetching files. Similarly, if you’re running an AWS S3 server, it could make sense to deploy the script on an EC2 instance in the same region. For test purposes, of course, you can run the script where it is most convenient.


Optimizing the written data

When setting up your dashboard it may be tempting to “push everything” at max frequency to your InfluxDB database. This is possible, but you’ll quickly hit the free limits - and you’ll typically not need your data at e.g. 1 ms frequency. The script makes it easy to resample your data to a specific frequency, which can drastically reduce the storage required per device. Further, you can limit the number of signals you push by adding a speicfic list up front.


Connect null values

When you zoom in on a chart, you will eventually encounter ‘null values’, i.e. points where no data is available. By default this will cause the chart to display points rather than lines. If you want to “connect the dots” in this scenario, open the panel and find the settings “Stacking and null value”, then set the “Null value” to “connected”.


Optionally enable millisecond resolution data

By default, your dashboard display is capped at 1 second as the max resolution when zooming in. However, you can go beyond this by pushing your data at a higher frequency and adjusting your panels. In your Python script, you can disable resampling to use the “raw” sampling rate. Further, when editing a Grafana panel you can click Query options to set the “Min interval” to e.g. 1 ms.

Note that this may increase the load time of your dashboard, so consider if it is relevant to your use case. Further, if you’re using the free InfluxDB Cloud account, there is a cap of writing 5 MB per 5 min to the DB, hence pushing “raw frequency data” can take a very long time.