Skip to main content

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

tip

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

  1. Open the link Grafana in the left sidebar.

  2. 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.

  3. Open the link Explore in the menu.

  4. In the query editor, open the data-source picker.

  5. Select the data source that starts with device_metric. The other one contains the usage data of your Workspace.

  6. Click Select table.

  7. 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.

  8. Because we want to know when the Device took the measurement, select the "time" Column.

  9. Click the + button to add another column.

  10. Choose the second column. Select value.

  11. Grafana shows only the last 50 records by default. To change this, click Order and erase the Limit.

  12. Expand the options of the big Run query button in the top-right corner. Select 5s to automatically refresh the query every 5 seconds.

  13. 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.

note

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.