Skip to main content

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's EXISTS_IN edge, whose identifier ({slug}-{id} by default) the project's alert rules carry in a label (service by 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 example service: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 the api_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 example service:my-api-V1StGXR8_Z5jdHi6B-myT).
  • workflow-steps — gather_metrics and metric_threshold run PromQL through a Prometheus data source. When the workflow gives the step a project, $project in the query is the project identifier, for example sum(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:

License

BSD-3-Clause.

Metadata

Release files for imbi-plugin-grafana 2.68.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imbi-plugin-grafana 2.68.0
File Size Uploaded Provenance Actions
imbi_plugin_grafana-2.68.0.tar.gz 19.3 kB With provenance Details for imbi_plugin_grafana-2.68.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for imbi-plugin-grafana 2.68.0
File Interpreter ABI Platform Actions
imbi_plugin_grafana-2.68.0-py3-none-any.whl Python 3 none any Details for imbi_plugin_grafana-2.68.0-py3-none-any.whl

Total release size: 35.8 kB

Release files / imbi_plugin_grafana-2.68.0.tar.gz

Download URL imbi_plugin_grafana-2.68.0.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9807549419e99c62b041540c1001a71cca6d34afd5d458c0fabe0e5f84d6a628
BLAKE2b-256 checksum
How to use checksums
dbd011cd053baa0abd8a4615a04667e05381ebc313fbd456fbb4de73bbab6f43
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 log

Release files / imbi_plugin_grafana-2.68.0-py3-none-any.whl

Download URL imbi_plugin_grafana-2.68.0-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aff705714e48d20a46af90e36fb3bca10061ce9993a12a269ad2f668a3b80b8c
BLAKE2b-256 checksum
How to use checksums
2a9e38648f78f2df2e813e29260eea8380d106a324b5abaddb90472ea7db29ce
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 log

Security for imbi-plugin-grafana 2.68.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.

Select from 2 files

Attestation for imbi_plugin_grafana-2.68.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page