0

my issue is that I'm using Grafana to make a dashboard, and I'm trying to make a connection between an IoT platform and Grafana, I have data stored there, and I want to make Grafana read that data so I can make a separate dashboard.

Here is a command that I used in the Ubuntu Terminal to read historical data from that IoT platform:

curl -X GET \
  -H "Authorization: Bearer ${JWT}" \
  "http://localhost:8000/history/device/25c6b5/history?lastN=3&attr=temperature"

I tried to find how Grafana can read that data, but so far, I only found how to use cURL to read data from Grafana, does Grafana has support to read data from other sources using cURL?

Andreas Jägle
  • 11,632
  • 3
  • 31
  • 31
  • Maybe you can add some details about the IoT platform you are using and give some samples of the data structures that platform returns and the dashboards you want to create? – Andreas Jägle Sep 28 '20 at 18:05

2 Answers2

0

Generally, Grafana works best with databases and data sources that are supported by technology-specific data source plugins like e.g. Postgres, InfluxDB, Prometheus or elasticsearch and also for specific services like Github issues or Azure Monitor.

But there are also more generic plugins that might work in your case. If the API returns JSON data, you might check one of the JSON data source plugins that allow to specify JSON Path expressions to select the desired data from the payload your API returns.

If this solution is getting too complicated or doesn't work due to e.g. specific authentication issues to the data source, you might also consider implementing a small service that handles the authentication and conversion and returns the data on some specific REST endpoints as specified in the docs. That service might also handle specific authentication mechanisms.

The latter approach might also allow to use additional queries for e.g. a list of IoT devices that can be as template variables for device specific filtering.

Please be aware that instrumenting existing APIs might end up in performance issues if your intermediate service needs to do several calls to the IoT platform. In those cases, a dedicated pipeline that moves the IoT data into a well-supported data store might be a more performant solution.

Andreas Jägle
  • 11,632
  • 3
  • 31
  • 31
-1

No. Instrument your IoT platform with something like Prometheus or InfluxDB

trallnag
  • 2,041
  • 1
  • 17
  • 33