imbi-plugin-grafana
The Grafana plugin for the Imbi
platform, distributed as a single Python package (imbi.plugins.grafana)
exposing one Integration (grafana) with four capabilities:
lifecycle— writes the project'sEXISTS_INedge, whose identifier ({slug}-{id}by default) the project's alert rules carry in a label (serviceby default), and a project link to the alert rules list searched by that label. The link key is the integration slug. Removes both on delete.webhook-actions— receives deliveries from a Grafana Alerting webhook contact point. imbi-gateway finds the project by the label value and records each delivery as an event. The label can hold the identifier or the bare project ID (for exampleservice:V1StGXR8_Z5jdHi6B-myT). It verifies the signature only when the webhook has a secret. The capability advertises no custom actions.analysis— Project Doctor checks that the edge and link exist and match the integration options, with a one-click repair. With theapi_token, it also checks that Grafana accepts the token, that alert rules carry the label with either value, and that a dashboard has the<label>:<value>tag (for exampleservice:my-api-V1StGXR8_Z5jdHi6B-myT).workflow-steps—gather_metricsandmetric_thresholdrun PromQL through a Prometheus data source. When the workflow gives the step a project,$projectin the query is the project identifier, for examplesum(rate(http_requests_total{service="$project"}[5m])). The metric label name can differ from the alert rule label.
Options: service_url (the Grafana URL, required), org_id (the
Grafana organization ID, required; the token must belong to it), and
label (the alert rule label that names the project, default
service).
The Imbi host discovers the package by scanning imbi.plugins.* and
reads the module-level PLUGIN attribute; there are no entry points.
All plugin base classes come from imbi.common.plugins.
The delivery
A Grafana webhook contact point sends its default JSON payload, one request for each notification group:
{
"receiver": "imbi",
"status": "firing",
"alerts": [
{
"status": "firing",
"labels": {"alertname": "5xx rate high", "service": "webform"},
"annotations": {"runbook_url": "https://imbi.example.com/..."},
"startsAt": "...",
"endsAt": "0001-01-01T00:00:00Z",
"values": {"B": 12.5},
"generatorURL": "...",
"fingerprint": "...",
"silenceURL": "..."
}
],
"groupLabels": {},
"commonLabels": {},
"commonAnnotations": {},
"externalURL": "https://grafana.example.com/",
"groupKey": "...",
"title": "...",
"state": "alerting",
"message": "..."
}
Signature
Turn on HMAC signature on the contact point. Grafana then sends the
hex HMAC-SHA256 of the raw body, keyed by the shared secret, in the
X-Grafana-Alerting-Signature header. Put the same secret in the
Secret field of the Imbi webhook. Leave the contact point's
Timestamp Header empty: with it set, Grafana signs
<timestamp>:<body> instead, which the gateway does not compute. When
the webhook has a secret, the gateway drops a delivery whose signature
is missing or does not match. When it has no secret, the gateway
processes each delivery unverified and logs a warning one time for
each webhook in each process.
The header name and prefix are the SIGNATURE_HEADER and
SIGNATURE_PREFIX constants in imbi.plugins.grafana.plugin.
Development
moon run root:setup # uv sync + pre-commit hooks
moon run grafana:test # coverage (fails under 85%)
moon run grafana:lint grafana:typecheck grafana:format # ruff + basedpyright + format check
Only the workflow steps and the live doctor checks call Grafana. They
need the optional api_token credential (a service account token with
the Viewer role) and send requests only to service_url. They use
these Grafana APIs:
-
GET /api/prometheus/grafana/api/v1/rules(doctor, alert rules) andGET /api/search(doctor, dashboards by tag) -
GET /api/datasources,GET /api/datasources/uid/:uid, andPOST /api/ds/query: https://grafana.com/docs/grafana/latest/developers/http_api/data_source/ -
The Prometheus query fields (
expr,range,instant): https://grafana.com/docs/grafana/latest/datasources/prometheus/query-editor/ and https://grafana.github.io/grafana-foundation-sdk/typescript/Reference/prometheus/object-dataquery
License
BSD-3-Clause.
Metadata
Release files for imbi-plugin-grafana 2.67.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| imbi_plugin_grafana-2.67.0.tar.gz | 19.3 kB | With provenance | Details for imbi_plugin_grafana-2.67.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| imbi_plugin_grafana-2.67.0-py3-none-any.whl | Python 3 | none | any | Details for imbi_plugin_grafana-2.67.0-py3-none-any.whl |
Total release size: 35.8 kB
Release files / imbi_plugin_grafana-2.67.0.tar.gz
| Download URL | imbi_plugin_grafana-2.67.0.tar.gz |
|---|---|
| Size | 19.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2af83f8940fb376b5c2127f5d23ef14fbcd478daeda4181837f82d57de56f609
|
|
BLAKE2b-256 checksum How to use checksums |
7924a64821d60a1ab5104c3ee70b8a5a4cb0f50a2a426d98b64089ce97b98241
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logRelease files / imbi_plugin_grafana-2.67.0-py3-none-any.whl
| Download URL | imbi_plugin_grafana-2.67.0-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a47812b43362bd428c5aaa3a1c49f076ff49320231b7d2677a4e3ec5cbf0750c
|
|
BLAKE2b-256 checksum How to use checksums |
5aa4ac2f56848a32e7d08d2cea7f82e99c834ef911c300e52a0e41ae9ca22f1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logSecurity for imbi-plugin-grafana 2.67.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for imbi_plugin_grafana-2.67.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.