Connect a Grafana stack to the observability plugin
- graal Agentic Platform
- Version 0.30 (actuelle)
- Open source · Apache 2.0
- Source : graalsystems/tranibor-agents@983db67
For an organisation administrator. Procedure connector.mcp.observability-grafana, version 1, reviewed 2026-11-25 against the vendor’s own pages. It applies to the connector type mcp/observability-grafana.
It ships with the plugin observability-grafana 0.1.0: its source. In the console, once the plugin is installed, it opens with How to set this up on the connector of the plugin’s server, and on Library › Plugins.
Addresses are written <api_url>, <public_url> and <org> here: the console shows the same text with your deployment’s own.
Before you start
Section intitulée « Before you start »- A Grafana (OSS, Enterprise or Cloud) you administer, with Grafana-managed alerting, a Prometheus or Mimir datasource and, for logs, a Loki datasource.
- The
observabilityplugin (the agent, the template) and theobservability-grafanaplugin (this server) installed in your organisation (Catalogue, Plugins); the second requires the first. The server runs in the platform; there is nothing to host. A plugin that brings a server needs a second person’s approval. - A Grafana the platform can reach. See Reaching the system below.
- A project from the template
alert-triage, and a person of theon-callgroup to review its work items. - What this procedure has not been run against. The plugin was written from Grafana’s documentation
and checked on a seeded fake, not on a live stack. Its live suite (
server/tests/live) is skipped until you setTRANIBOR_LIVE_GRAFANA_URLandTRANIBOR_LIVE_GRAFANA_TOKEN: run it against a test stack before you trust the plugin in production. See What is not confirmed.
Reaching the system
Section intitulée « Reaching the system »- A public Grafana works now: a Grafana URL that the platform’s servers can reach over the internet
(
https://grafana.example.com), withbase_urlas the one allowed host. - A private Grafana does not, yet. Today a plugin server cannot reach a private address (ADR 0096 section 8). It needs ADR 0224 section 6 (private CIDRs or an outpost), which is not available. This plugin does not work around it: no tunnel, no proxy to host, no relaxed check on the URL. If your Grafana is private, wait for that, or expose it deliberately (with its own access control) before you install the plugin.
At Grafana
Section intitulée « At Grafana »- The service account. Administration, Users and access, Service accounts, Add service
account: name
tranibor-observability, role Viewer. Viewer reads alert rules, alerts, silences, datasources, dashboards and annotations, and may run queries. - Writes, only if you want them. The plugin creates silences and adds annotations. Viewer cannot.
Either give the service account the Editor role, or (Grafana Enterprise and Cloud, custom roles)
a custom role with exactly:
alert.instances:read,alert.instances:create,alert.instances:write(silences), andannotations:create+annotations:readscoped to organization annotations. Without them the server returnsforbiddenon those three tools and everything else keeps working. The rights of the silence routes come from Grafana’s own permission checks (theauthorization.gopage above), not from a documentation page. - The token. On the service account, Add service account token; set an expiry (90 days or less) and copy it once. It is typed in Tranibor below and sealed there.
- The organization. If the service account lives in another organization than the one you want to
read, note its numeric id (sent as
X-Grafana-Org-Id). - The webhook contact point. Alerting, Contact points, Add contact point, integration
Webhook: URL = the trigger URL of In Tranibor step 3, HTTP method
POST, Authorization header schemeBearerand credentials = the trigger’s token. Then point a notification policy at it (for instance forseverity=~"critical|warning"), grouped byalertnameso one work item covers one alert. Set Max alerts to a small number; the trigger reads the first alert and the group’s common labels.
Permissions
Section intitulée « Permissions »| Tool | Grafana route | Needs |
|---|---|---|
| get_provider (no call), list_firing_alerts, list_silences | GET /api/alertmanager/grafana/api/v2/alerts, /silences |
Viewer (alert.instances:read) |
| get_alert_rule | GET /api/v1/provisioning/alert-rules/{rule_id} |
Viewer (alert.rules:read) |
| list_sources, query_metrics, query_logs | GET /api/datasources, POST /api/ds/query |
Viewer (datasources:query) |
| list_dashboards, get_dashboard | GET /api/search, /api/dashboards/uid/{uid} |
Viewer (dashboards:read) |
| list_annotations | GET /api/annotations |
Viewer (annotations:read) |
| create_silence, expire_silence | POST /api/alertmanager/grafana/api/v2/silences, DELETE …/silence/{id} |
Editor (alert.instances:create, :write) |
| add_annotation | POST /api/annotations |
Editor (annotations:create) |
The server never creates, edits or deletes a rule, a contact point, a dashboard or a datasource, and it
expires only silences it created itself (createdBy tranibor-observability-grafana).
What is not confirmed
Section intitulée « What is not confirmed »Everything below is in a code comment of server/src/tranibor_observability_grafana/client.py too.
/api/ds/querybodies and frames. The route and itsqueries[]shape (datasource.uid,refId,from/to,expr,intervalMs,maxDataPoints) come from the data source API page; the frame layout the server reads for Prometheus (time and value columns, a__name__-less label set) and Loki (time and line columns) is from the documented response shape and Grafana’s source, and was not checked on a live stack. If a datasource answers a different layout, the metric and log tools return empty series: the live suite fails on it.- Alerts, silences and their routes (
/api/alertmanager/grafana/api/v2/alerts,/silences,/silence/{id}) follow the Alertmanager v2 API, which Grafana implements; no narrative page of the docs describes them (the one we tried answers 404), the route and its rights are read from Grafana’s source (authorization.go). - The alert rule route (
/api/v1/provisioning/alert-rules/{rule_id}) is documented, and marked deprecated in favour of the App Platformrules.alerting.grafana.appAPI. A future Grafana may remove it. - The dashboard route (
/api/dashboards/uid/{uid}) is the legacy one; the current docs describe the newer/apisroute. The legacy route is in Grafana’s merged OpenAPI document. - The rule id of an alert (
rule_idinlist_firing_alerts). The server reads, in this order, the__alert_rule_uid__label, arule_uidannotation, then the rule uid in the generator URL (/alerting/grafana/<uid>/view). Which of the three a live Grafana carries on every alert was not confirmed; an alert with none has an emptyrule_id, and the agent says so rather than guess. get_provider’s sources come fromGRAFANA_DATASOURCES, or, when it is empty, from the datasources the token sees whose type is Prometheus-like or Loki (the type names are inserver/src/tranibor_observability_grafana/tools.py); they were not checked against every datasource plugin.- The narrower custom role of step 2 is inferred from the permissions in Grafana’s source, not from a
documentation page. If a write fails with
forbidden, use Editor.
In Tranibor
Section intitulée « In Tranibor »-
Catalogue, Plugins,
observability-grafana, Configure: type the fields above.base_urlis the only host the server may reach. Setdatasourcesto the uids it may query if you want a narrower list than “every Prometheus-type and Loki datasource the token sees”. -
Create a project from the template
alert-triageof theobservabilityplugin (workflowalert-triage, internal tracker). Name the connector instance after the Grafana it serves (grafana-prod):get_providersays that name to the agent. -
The trigger (a template cannot ship one; ADR 0113 of the core). In the project’s configuration:
triggers:- name: grafana-alerttitle: "{/commonLabels/alertname}: {/commonAnnotations/summary}"body: "Triage the firing alert {/commonLabels/alertname} (severity {/commonLabels/severity}). Started at {/alerts/0/startsAt}. Rule: {/alerts/0/generatorURL}"key: /groupKeyfields:alertname: /commonLabels/alertnameseverity: /commonLabels/severitystarts_at: /alerts/0/startsAtwhen: { /status: ["firing"] }workflow: alert-triagewhenignoresresolvednotifications;keygives one work item per Grafana group while it runs. Mint the trigger’s token (Settings, the project’s triggers; shown once) and give Grafana the URLhttps://<your tranibor>/api/v1/webhooks/triggers/<org>/<project>/grafana-alert. -
Fire it once by hand with a payload you type (the console’s fire box) before Grafana sends one.
- In Grafana, on the contact point, Test: a work item opens and the agent runs.
- The report cites the rule, a metric value with its time, and the annotations. Read it: a claim without a number or a time behind it is a defect, report it.
- A silence the agent proposes opens an approval for a person. Approve a short silence on a test
alert; check it in Grafana (Alerting, Silences) under
createdBytranibor-observability-grafana, then expire it there (or let it end).
When it fails
Section intitulée « When it fails »unauthorized: the token is wrong or expired. Issue another and type it again.forbiddenoncreate_silence,expire_silenceoradd_annotation: the service account is a Viewer. See step 2.not_foundon a rule or dashboard: the id is from another organization; setorg_id.- A query is refused as outside the allow-list: add the datasource’s uid to
datasources, or empty it (the error sayssource ... allow-list). - A silence is refused: its matchers must be exact, include
alertname, match at least one firing alert and at most 25, and last no longer thanmax_silence_minutes. The agent proposes it again, or you decide it in Approvals. - No work item opens: check the trigger’s token, that the notification policy reaches the contact point, and the project’s Received events card, which records each delivery and why it was ignored.
| Field | What to put in it |
|---|---|
base_url |
https://grafana.example.com, without a trailing slash (https is required) |
datasources |
optional: the uids of the Prometheus, Mimir and Loki datasources the agent may query (they are the sources get_provider lists) |
max_lines |
the most log lines one query returns (default 200, at most 1000) |
max_range_hours |
the widest window of one metric or log query (default 6, at most 24) |
max_silence_minutes |
the longest silence the plugin may create (default 120, at most 1440) |
org_id |
the organization id, only if the service account is not in the organization you want to read |
token |
the service account’s token, typed once |
Network egress
Section intitulée « Network egress »Hosts the platform must be allowed to reach:
<your Grafana host>