# Grafana integration

Dashboard and folder resource operations target the documented v1 /apis resource APIs and require Grafana 12 or later. Annotations and data sources use their own HTTP API contracts.

Canonical URL: https://opennodeflow.dev/wiki/integration-grafana/
JSON reference: https://opennodeflow.dev/wiki/integration-grafana/index.json
Source snapshot: 2026-10-23

Grafana contributes **14 operations** in the current source catalog. Its implementation family belongs to the **Grafana** pack. Add that pack to the chosen workspace before authoring with its definitions.

## Capabilities and boundaries

Dashboard and folder resource operations target the documented v1 /apis resource APIs and require Grafana 12 or later. Annotations and data sources use their own HTTP API contracts.

Use a scoped service-account token. For updates, obtain a fresh metadata.resourceVersion and include it in the desired document. Resource collection pagination uses metadata.continue; a dashboard title is not its stable resource identifier.

## Configure the connection

Use an authorized bearer credential stored under the secret name `GRAFANA_TOKEN` or a deliberate override.

The source default base origin is `https://grafana.example.com`. Domains under example.com/example.net are placeholders for your own API, not running public services. Use the exact provider API origin and trusted certificate chain. A connection profile can supply credentials and repeated target defaults; profile credentials take precedence over node secret-name overrides. These developer nodes do not obtain tokens or refresh grants.

Read the chosen operation's permission entry before granting the account access. Least required target permissions are preferable to a broad administrator credential.

## First bounded read

Start with **Grafana List Dashboards**, which is declared as a read. Its synthetic argument fixture is:

```json
{}
```

Replace the synthetic resource identifiers with an explicitly authorized target before any real read. An example is not an installed workflow and contains no credential values.

Set `maxPages:1` initially and inspect the result, `status`, selected direct fields and any `request_id`. Lists return `count`, `has_more` and optional `continuation`; not every provider resource is paginated. Keep the same resource/query scope when resuming. Optional outputs remain absent when the provider does not supply them. Wire only the fields present on the selected branch.

## Available operations

| Operation | Effect | API route |
| --- | --- | --- |
| [Grafana List Dashboards](/wiki/reference-dev-grafana-list-dashboards/) | read | `GET /apis/dashboard.grafana.app/v1/namespaces/{namespace}/dashboards` |
| [Grafana Get Dashboard](/wiki/reference-dev-grafana-get-dashboard/) | read | `GET /apis/dashboard.grafana.app/v1/namespaces/{namespace}/dashboards/{uid}` |
| [Grafana Create Dashboard](/wiki/reference-dev-grafana-create-dashboard/) | write | `POST /apis/dashboard.grafana.app/v1/namespaces/{namespace}/dashboards` |
| [Grafana Update Dashboard](/wiki/reference-dev-grafana-update-dashboard/) | write | `PUT /apis/dashboard.grafana.app/v1/namespaces/{namespace}/dashboards/{uid}` |
| [Grafana Delete Dashboard](/wiki/reference-dev-grafana-delete-dashboard/) | write | `DELETE /apis/dashboard.grafana.app/v1/namespaces/{namespace}/dashboards/{uid}` |
| [Grafana List Folders](/wiki/reference-dev-grafana-list-folders/) | read | `GET /apis/folder.grafana.app/v1/namespaces/{namespace}/folders` |
| [Grafana Get Folder](/wiki/reference-dev-grafana-get-folder/) | read | `GET /apis/folder.grafana.app/v1/namespaces/{namespace}/folders/{uid}` |
| [Grafana Create Folder](/wiki/reference-dev-grafana-create-folder/) | write | `POST /apis/folder.grafana.app/v1/namespaces/{namespace}/folders` |
| [Grafana Update Folder](/wiki/reference-dev-grafana-update-folder/) | write | `PUT /apis/folder.grafana.app/v1/namespaces/{namespace}/folders/{uid}` |
| [Grafana Delete Folder](/wiki/reference-dev-grafana-delete-folder/) | write | `DELETE /apis/folder.grafana.app/v1/namespaces/{namespace}/folders/{uid}` |
| [Grafana List Annotations](/wiki/reference-dev-grafana-list-annotations/) | read | `GET /api/annotations` |
| [Grafana Create Annotation](/wiki/reference-dev-grafana-create-annotation/) | write | `POST /api/annotations` |
| [Grafana List Data Sources](/wiki/reference-dev-grafana-list-data-sources/) | read | `GET /api/datasources` |
| [Grafana Get Data Source](/wiki/reference-dev-grafana-get-data-source/) | read | `GET /api/datasources/uid/{uid}` |

Each linked reference contains exact source arguments, named socket contracts, configuration schema, response shape and synthetic data. Source keys must be resolved to the installation's actual definition/version before graph editing.

## Bounds, changes and recovery

The shared developer adapter defaults to a 15-second request timeout, a 1 MiB response bound, one page and 1,000 accumulated items. Configurable maxima are 120 seconds, 3,000,000 response bytes, 20 pages and 5,000 items. Choose smaller limits where appropriate; an excessive response fails rather than becoming a silently complete list.

Read HTTP status and provider-specific success markers. Rejected authentication, permission failures and invalid requests need configuration correction. Rate limiting needs deliberate later scheduling. Same-origin/API-root continuation checks prevent sending credentials to an unrelated next link.

Write/delete operations require `confirmWrites:true` and ONF runtime `$retries:0`. Inspect the target and body before running. A timeout or lost response can follow a successful external action; reconcile the provider resource before repeating. HTTP 202 records acceptance, not completed work.

The reference is source-derived. Synthetic fixtures and isolated worker proof do not establish your account permissions, API availability or live delivery. See [shared setup](/wiki/integration-setup/) and [pack behavior](/wiki/library-packs/).

## Provider contract references

- [Provider reference 1](https://grafana.com/docs/grafana/latest/developer-resources/api-reference/http-api/dashboard/)
- [Provider reference 2](https://grafana.com/docs/grafana/latest/developer-resources/api-reference/http-api/folder/)
- [Provider reference 3](https://grafana.com/docs/grafana/latest/developer-resources/api-reference/http-api/annotations/)
- [Provider reference 4](https://grafana.com/docs/grafana/latest/developer-resources/api-reference/http-api/data_source/)

---

## Documentation provenance

- `../OpenNodeFlow-Library/docs/DEVELOPER-PACKS.md`
- `../OpenNodeFlow-Library/work/developer-packs-20261022/CONTRACT.md`
- `../OpenNodeFlow-Library/work/developer-packs-20261022/api-research.md`

This page describes maintained source, not a live inventory or an authorization to perform actions.
