Logged history and live values from the Data Logger (historian) are plotted on Grafana dashboards without setting up a separate database. Grafana's Infinity data source reads MergenHub's JSON addresses with a read-only access key (Bearer Token). No user name or password is handed to Grafana.
Before you start
| Needed | Why |
|---|---|
| The tags are logged in a log group | History is read from the Data Logger log groups. |
| An administrator with the Server settings permission | They create the access key. |
| The key owner has the Data Logger read permission | The key reads the tags its owner can see; it cannot exceed the owner's permissions. |
| The Grafana server can reach MergenHub over the network | With HTTPS off the key works only from the local network. |
1. Create an access key
- On the Settings › Data Bridge home page press Open on the Grafana card.
- Give the key a name (e.g. "Grafana production board"), pick how long it is valid; Create key.
- Copy the key right away: it is never shown again. It is filled into the example addresses and the test command on the page; the test command checks the connection before you move to Grafana.
2. Add the Infinity data source
- In Grafana install the Infinity data source plugin and add it as a new data source.
- Authentication = Bearer Token; paste the key.
- Allowed hosts = the MergenHub address (e.g.
http://10.0.0.5:8090). Save.
3. Build the panel
- Pick Infinity as the panel's data source; Type = JSON, Source = URL.
- Address:
http://10.0.0.5:8090/config/v1/analytics/history?tags=TAG1,TAG2&from=${__from}&to=${__to}&maxPoints=${__maxDataPoints}
- Add the columns:
time→ Timestamp,value→ Number,tag→ String. Every tag becomes its own line.
${__from} and ${__to} are Grafana's own variables: when the dashboard's time range changes, so does the query. ${__maxDataPoints} limits the number of points to the panel width.
Addresses
| Address | Returns |
|---|---|
GET …/analytics/tags | Tags with logged history and their groups. ?live=true: all live tags |
GET …/analytics/current?tags=A,B | Live value, quality, time (for a table or gauge panel) |
GET …/analytics/history?tags=A,B&from=&to=&maxPoints= | History in long format: each row is tag, time, value |
- Up to 50 tags per request; up to 10,000 points per tag (long ranges are thinned out).
- Time: unix ms, unix seconds, ISO 8601 or relative (
now,now-6h,now-7d). The last 24 hours if omitted.
Common problems
| Symptom | Cause and fix |
|---|---|
| Empty result | The tag is not logged in a log group or there is no data in the range. Query it on the Data Logger page to check. |
| 403 | The key is used for another address or its owner lacks the permission. Report keys cannot read these addresses. |
| Grafana does not send the request | Allowed hosts in Infinity does not contain the MergenHub address. |
| Cannot connect from the internet | HTTPS is off. Turn on HTTPS in Settings for outside access; see Publishing on a domain. |
Related: Power BI and Excel · Historian (data logging) · Data Bridge · Manual: Grafana and Power BI
MergenHub