Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

iot-for-all/iotc-grafana-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grafana data source plugin for Azure IoT Central

This sample plugin enables IoT Central as a Grafana data source. By leveraging the new IoT Central query API, you can use Grafana dashboards to visualize and analyze your IoT data.

alt-text

Setup instructions

  1. Clone this repository in the local directory where you want Grafana to look for local plugins.
  2. Set up Grafana to load plugins from your local directory.
  3. Configure your Grafana installation to allow the IoT Central plugin to be loaded as an unsigned plugin.
allow_loading_unsigned_plugins = microsoft-azure-iot-central
  1. In the plugin folder, run:
yarn install
yarn dev
  1. Restart your Grafana server. The Azure IoT Central plugin should now be available under data sources:

alt-text

  1. Configure the data source with you IoT Central application URL and an API token. The application URL can be found under Administration > Your application (e.g, <myapp>.azureiotcentral.com). API tokens can be created in the Administration > API tokens section of you IoT Central application.

Querying data

To start building dashboards with the newly added IoT Central data source, simply provide the desired query. The query syntax follows the IoT Central query API.

alt-text

Time range

By default, the plugin will override the time window of your query with the time range configured in the dashboard.

Timestamp field

If the timestamp field is being project, the plugin will automatically return it in the correct time format expected by Grafana. To convert other custom timestamp fields to the proper time format, use the Convert field type transformation available in the Transform tab.

Time series

Query results are returned as a single data frame. To easily split the data into multiple series, use the Prepare time series > Multi-frame time series transformation available under the Transformations tab.

alt-text

Complex values

By default, the plugin will flatten any complex values returned in the query result set. For instance, if the query returns a field location: { lat: 47.643567, lon: -122.129685}, the result set will contain location.lat: 47.643567 and location.lon: -122.129685.

About

Sample Grafana plugin for Azure IoT Central

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published