Tutorial: Visualize Data in Spotflow Grafana
This tutorial will show you how to visualize your data sent from the Device in the integrated instance of Grafana.
Requirements
- If you are not registered to the Spotflow IoT Platform yet, Sign Up.
- You have already sent data to a Stream routed to the integrated instance of Grafana.
We've already configured the Stream default-stream
in the Stream Group default-stream-group
to route incoming data to the integrated instance of Grafana.
Follow Tutorial: Route Data to Spotflow Grafana to configure other streams.
Visualize Data in Spotflow Grafana
Open the link Grafana in the left sidebar.
The Home page of the integrated instance of Grafana will open in a new browser tab. It answers some common questions about how you can use it. Click the menu icon.
Open the link Explore in the menu.
In the query editor, open the data-source picker.
Select the data source that starts with
device_metric
. The other one contains the usage data of your Workspace.Click Select table.
The Platform creates a new table from each metric it receives in any Message. It also changes the name of the metric into the snake case. Select
humidity_percent
.Because we want to know when the Device took the measurement, select the
"time"
Column.Click the + button to add another column.
Choose the second column. Select
value
.Grafana shows only the last 50 records by default. To change this, click Order and erase the Limit.
Expand the options of the big Run query button in the top-right corner. Select 5s to automatically refresh the query every 5 seconds.
Scroll down to the query results. If the Device is still sending Messages, you'll see them appearing as rows in the Table and points in the Graph in real time.
If your program finished sending Messages, you can rerun it to see the data appearing in Grafana. You don't need to approve the Device this time because it's already registered.
What's next
- Feel free to explore the received data and create custom dashboards, as described in the official Grafana documentation.
- To learn more about the integrated instance of Grafana and the format it accepts, see the User Guide.
- To develop custom streaming applications, look at Egress Sinks.