Grafana — plant data on your dashboards
Logged history and live values are plotted in Grafana without setting up a separate database. Grafana's Infinity data source reads MergenHub's JSON addresses with a read-only access key.
How does it work?
MergenHub serves three JSON addresses: /config/v1/analytics/tags (logged tags), …/current (live values) and …/history (history in long format: tag, time, value). Grafana's ${__from} and ${__to} variables are used directly; the query follows the dashboard's time range.
Limits and security
Up to 50 tags per request and up to 10,000 points per tag (long ranges are thinned out). The key only reads, expires, stops working the moment it is deleted and cannot exceed its owner's permissions. With HTTPS off it works only from the local network.
A Grafana dashboard in four steps
- 01
Create an access key
On the Settings › Data Bridge home page press Open on the Grafana card; name the key, pick how long it is valid and press Create key. Copy it right away: it is never shown again.
- 02
Add the Infinity data source
Install the Infinity plugin in Grafana and add it as a data source. Authentication = Bearer Token → paste the key; Allowed hosts = the MergenHub address (e.g.
http://10.0.0.5:8090). - 03
Write the query
In the panel Type = JSON, Source = URL:
/config/v1/analytics/history?tags=TAG1,TAG2&from=${__from}&to=${__to}&maxPoints=${__maxDataPoints} - 04
Map the columns
time → Timestamp, value → Number, tag → String. Every tag becomes its own line. The test command on the Grafana page checks the connection beforehand.
Addresses
Tag list
…/analytics/tags: tags with logged history and their groups; ?live=true for all live tags.
Live value
…/analytics/current?tags=A,B: value, quality and time.
History
…/analytics/history?tags=A,B&from=&to=&maxPoints=: each row is tag, time, value.
Flexible format
Unix ms, unix seconds, ISO 8601 or relative (now, now-6h, now-7d). The last 24 hours if not given.
Data Logger
History is read from the Data Logger log groups, whichever store they write to: SQLite, SQL Server, MySQL, PostgreSQL or ODBC.
Empty result or 403
Empty result: the tag is not in a log group or there is no data in the range. 403: the key is used for another address or its owner lacks the permission.
MergenHub