Grafana and Prometheus alerts in Matrix with Hookshot webhooks

Route Alertmanager and Grafana alerts into Matrix rooms through Hookshot generic webhooks so on-call teams receive alerts on a self-hosted channel. This page covers the method, prerequisites, setup sequence, and failure points.

On this page

How Grafana and Prometheus alerts reach a Matrix room through Hookshot

Hookshot generic webhooks are the supported way to get Grafana and Prometheus alerts into a Matrix room. Hookshot is a bridge-style service that accepts an HTTP webhook from a sending service and posts the message into a room you have connected to it. For an on-call team moving off a SaaS chat tool, that means the alert path ends on your own homeserver, with the room, the sender and the message history all under your control. The rest of the chain is split across four components, and each one should keep a single job. Prometheus evaluates alert rules against the metrics it scrapes. Alertmanager receives the firing alerts from Prometheus and handles grouping, inhibition and silences. Grafana can also evaluate alert rules against its own data sources and send notifications through its contact points. Hookshot sits at the end and only delivers the message to Matrix.

That division matters because Hookshot posts messages but does not replace alert routing logic. Deciding which alerts page whom, how repeated alerts are grouped, when a silence applies and which severity goes to which room belongs in Alertmanager or Grafana configuration. If you send everything to one Hookshot webhook and expect Hookshot to sort it, you will rebuild routing in a place that was not designed for it. Before building, decide which system is the source of truth for each alert family, and confirm in the Hookshot documentation which webhook payload format the generic webhook accepts, since that determines whether you need a translation step between Alertmanager or Grafana and the room.

What you need in place before connecting alerts to Matrix

Alert routing touches four systems: a Matrix homeserver with Hookshot, Prometheus with Alertmanager, Grafana, and the network and certificates between them. Confirm each one before you write a single webhook, because most failed alert deliveries trace back to a version mismatch, an unreachable endpoint or a bot that is not in the room.

Matrix homeserver and Hookshot versions

Confirm which Synapse release your homeserver runs and check the Synapse GitHub releases page for the current release and its upgrade notes before choosing a Hookshot version. Synapse 1.143.0 and later require PostgreSQL 14 or newer, and 1.142.0 and later require Python 3.10 or newer, so confirm those floors against your host. Match the Hookshot release to the Matrix features you use, and record both versions in your change log so a later upgrade has a known starting point.

Synapse releases

Prometheus and Alertmanager release lines

Pick the Prometheus line you will run before you build the alert pipeline. The LTS line receives bug fixes for one year, while regular minor releases stop receiving fixes after about six weeks, so a non-LTS install needs a regular upgrade rhythm. Check the release cycle page for the current LTS line and its end-of-life date, and confirm the Alertmanager version you deploy alongside it, since the webhook payload shape your receiver parses is the contract you must test.

Minor release cycle
6 weeks
Prometheus release cycle

Grafana production database

Grafana stores its configuration in SQLite by default, and its installation docs state that SQLite does not scale for production. Plan MySQL 8.0 or later, or PostgreSQL 12 or later, before you create alert rules you depend on, because alert rules, contact points and notification policies live in that database. If you plan two or more active Grafana servers, the high availability guidance also requires additional alerting configuration to avoid duplicate notifications into the same Matrix room.

Grafana installation docs

Network paths to Hookshot

Map each sender to the Hookshot generic webhook listener: Alertmanager and Grafana must reach Hookshot over a route your firewall and reverse proxy allow, and Hookshot must reach the homeserver's client API. Test each hop with a manual request from the sender's own network segment, not from your workstation. Alertmanager runs in your cluster or host, so confirm egress rules, DNS names and any proxy settings that Grafana's outbound notifications pass through.

TLS certificates for each endpoint

Issue valid certificates for the Hookshot webhook hostname and for the homeserver's public name, and confirm that Grafana and Alertmanager trust the issuing authority. Self-signed certificates often work in a lab and fail in production when the sender runs in a container with a different trust store. Record the expiry dates and assign renewal ownership, since an expired certificate stops alerts silently on the sending side.

Dedicated bot account and room membership

Create a dedicated Matrix bot account for Hookshot, not a person's login, and invite it to each alert room with permission to post. Keep alert rooms separate from general chat so on-call notifications are not buried, and decide whether those rooms are encrypted, because Hookshot's behavior in encrypted rooms needs confirming before go-live. Store the bot's access credentials in your secrets manager and restrict who can read the webhook tokens that Hookshot issues.

Configuring Hookshot webhooks and alert senders in order

This sequence connects Hookshot's generic webhook feature to a dedicated Matrix room, points Alertmanager and Grafana at that route, and proves each path with a test message. Each step closes with a check you can run before an on-call rotation depends on the route.

  1. Enable generic webhooks in Hookshot

    A Hookshot administrator turns on the generic webhooks feature in the Hookshot configuration file and restarts the bridge service. Hookshot runs as an application service on your homeserver, so confirm that its registration file is loaded by Synapse before you go further, following the Hookshot documentation. The step is done when the service starts without configuration errors in its logs and the bot user responds to a direct message from an administrator account.

  2. Create a webhook connection in the target room

    A room administrator creates or chooses a dedicated alerts room, invites the Hookshot bot, and runs the room command that creates a generic webhook connection. Confirm the exact command syntax and any room encryption limits in the Hookshot documentation before you run it. The step is done when the bot posts a confirmation in the room that names the new connection. Keep the alerts room separate from general team chat so that on-call members are the only people who need to act on its messages.

  3. Capture the webhook URL and token

    Copy the generated webhook URL and token from the bot's reply, then store both in your secrets manager so they can be rotated without editing every sender. Send a plain test message with curl, using a placeholder such as <webhook-url> and the token the documentation specifies for authentication. The step is done when the test message appears in the target room within a few seconds. If nothing appears, check the bot's logs for rejected requests before changing the Alertmanager or Grafana configuration.

  4. Configure the Alertmanager receiver

    Add a receiver with a webhook_configs entry that points at the Hookshot URL and send only the alerts that belong in this room, using label-based routes. Prometheus should send alerts to every Alertmanager instance, so apply the same receiver to each one if you run a cluster. Validate the file with amtool check-config before reloading. The step is done when Alertmanager shows the receiver as active and a test alert routed through it appears in the Matrix room. Confirm with the Hookshot documentation how the posted body is formatted, because the message layout depends on it.

  5. Add a Grafana webhook contact point

    In Grafana alerting, create a contact point of the webhook type with the same Hookshot URL and authentication details, then add a notification policy that routes the alerts you want to that contact point. You can define the same resources as YAML provisioning files if your team keeps configuration in version control. If you run Grafana in high availability, follow the Grafana guidance on preventing duplicate notifications before you enable the route. The step is done when the contact point's test notification arrives in the room.

  6. Fire a test alert through both paths

    Create a temporary test alert rule in Prometheus and a temporary test rule in Grafana, trigger each one, and confirm that the firing message reaches the Matrix room through its route. Then let each alert resolve and check that the resolution message arrives if your templates send one. Remove both test rules when you finish, and record the room, the routes and the observed message formats in your runbook. The step is done when both paths have delivered firing and resolved messages and the test rules are gone.

How the webhook payloads map to readable room messages

The key point for this section is that Hookshot does not interpret Alertmanager or Grafana payloads as alerts. A generic webhook in Hookshot accepts an HTTP POST, and the body is handled according to the webhook configuration for that connection, so the readability of a room message depends on what the sender posts and what Hookshot is configured to render. Each sender has its own JSON shape, and the Alertmanager grouped payload (with fields such as status, groupLabels, commonLabels and an alerts array) is not the same as Grafana's notification payload. Before building anything, confirm the body format, the expected fields and how the generic webhook handles them against the Hookshot documentation for the version you run, using the Matrix Hookshot documentation as the starting point.

Grouped Alertmanager notifications arrive as one request covering several alerts, so a single room message may carry several firing or resolved alerts. Confirm how Hookshot renders an array of alerts, whether it posts one message per request or one per alert, and whether a resolved notification clearly reads as resolved in the room. Grafana's payload has a different structure and uses its own alert state values, so a shared template will not fit both. Templating inside Hookshot is limited compared with a general transformation layer, so the practical choice is often between a small translation service that reshapes each payload into a fixed message and a sender-side template. Test both senders with a firing and a resolved alert, and record which fields survive into the room.

Plan the translation step as part of the build, not as an afterthought. Decide who owns the mapping, where it runs inside your infrastructure, and how a change in Alertmanager or Grafana versions is detected, since a field rename would silently produce empty messages. Keep test payloads captured from each sender in version control so the on-call channel can be checked after upgrades. Ask your DeployOpen team, or confirm with the Hookshot maintainers, which fields are guaranteed in each sender's payload and which ones may be omitted in a given release.

Mapping alert fields, labels and room targets

This table traces each alert field from Alertmanager or Grafana, through a Hookshot generic webhook, into a Matrix message. Read the middle column to see where a value is set, and the last column for what your team must verify in its own Hookshot and alerting versions. The main takeaway is that the target room is set by the webhook URL in the sending system's receiver, so room routing lives in alerting configuration, not in the message body.

FieldWhere it originatesWhat appears in Matrix and what to confirm
Alert status (firing or resolved)Status value in the Alertmanager or Grafana webhook payloadShown in the message text if your template includes it. Confirm whether resolved notifications post as separate messages.
SeverityA label set on the alert rule, commonly named severityAppears only if the template reads the label. Confirm the exact label name your rules use and how it is rendered.
Alert nameThe alertname label in Alertmanager, or the rule title in GrafanaUsually the message heading. Confirm which key your payload template maps to the heading.
Summary and descriptionAnnotations on the alert rule, such as summary and descriptionUsually the message body. Confirm both annotation keys exist in your rules and appear in your template.
Grouped alertsAlertmanager groups alerts; Grafana may bundle alerts in one notificationOne webhook call can carry several alerts. Confirm how Hookshot renders multi-alert payloads in your version.
Dashboard or silence linksGenerator or external URL fields in the payloadShown only if the template includes them. Confirm the field names your version sends before relying on links.
Target room IDGeneric webhook created for a room in Hookshot, identified by its URLNot read from the alert. Treat the webhook URL as a secret and confirm how Hookshot issues it for an encrypted room.

Securing webhook tokens, endpoints and alert content

Alerts pass through four places: the Grafana or Prometheus sender, the Hookshot listener, the Matrix room, and the bot account that posts into it. Each one needs its own control for tokens, network exposure, transport encryption, account permissions and content review. The cards below cover those controls and the checks that confirm they hold.

Generating and rotating webhook tokens

Each generic webhook connection in Hookshot is authorized by a token, so a leaked token lets anyone post into the linked room. Give each sender its own connection and token rather than sharing one across Grafana and Alertmanager. Record who holds each token and which room it feeds, and set a rotation schedule agreed with your security team. When rotating, add the new token to the sender, confirm alerts still arrive, then retire the old one. Confirm the exact token and secret handling in the current Hookshot documentation before you write the procedure.

Hookshot docs

Restricting the listener to sender networks

The Hookshot webhook listener should accept traffic only from the networks where Alertmanager and Grafana run. Bind it to an internal interface, then allow the listener port only from those sender addresses at the host or network firewall. Do not expose the listener on the public internet just to reach a sender in another cloud account; use a private route or a reverse proxy with an allowlist instead. Test the restriction from an address outside the allowlist and confirm the connection is refused.

TLS on every hop

Alerts cross several hops: Prometheus to Alertmanager, Alertmanager or Grafana to Hookshot, Hookshot to the Synapse homeserver, and Synapse to the client. Encrypt each hop that leaves a single host, and verify certificates in the sender configuration instead of disabling verification to get a connection working. Plan certificate issuance and renewal in the internal certificate authority or public CA you already run. Check each hop with a test alert and a certificate inspection tool.

Least-privilege bot accounts

Hookshot posts through a Matrix bot account, so that account's permissions define the blast radius of a compromise. Create a dedicated bot user for alerts, give it membership only in the alert rooms it needs, and avoid server admin rights. Use the room power levels to keep it from changing room settings or inviting users. Review its joined rooms during each access review, since a bot that accumulates rooms over time becomes a wider exposure.

Sensitive content in alert annotations

Alert annotations and labels are copied into the message body, so anything written there reaches every member of the room and the room's history. Review alert rules for hostnames, internal IP addresses, customer identifiers, query text, connection strings and credentials embedded in summaries. Move detail that only responders need into a link to a restricted dashboard, and keep secrets out of templates entirely. Ask the room owners which members can read history before you decide what an alert may say.

Grafana side hardening settings

Grafana sends the alerts, so its configuration affects this path too. Review the security hardening settings for secure and SameSite cookies, a Content Security Policy, Trusted Types, hiding the version from unauthenticated users and domain verification against DNS rebinding. Require authentication for the metrics endpoint, and restrict who can edit contact points, since those hold the webhook targets. Keep Grafana on a supported minor release, because the project publishes a fixed support window for each one.

Security hardening docs

Prometheus and Alertmanager endpoints

Prometheus and Alertmanager expose HTTP endpoints that reveal metrics, configuration and alert state, so they need the same access control as other internal services. Follow the Prometheus security model guidance on who can reach the web interface and API, and restrict Alertmanager's API to the senders and operators who need it. Do not leave the Alertmanager receiver configuration readable by people who do not manage alerting. Confirm the access rules with a request from an unauthorized network segment.

Prometheus security model

Two alert paths reach one Matrix room through Hookshot

The diagram starts in the monitoring network, where Prometheus rules fire into Alertmanager and Grafana alert rules fire into a contact point. Both paths post to a Hookshot generic webhook endpoint, which relays the message into a Matrix room on the homeserver. The subgraphs mark the trust boundary between the monitoring network and the Matrix network, which is where you decide what crosses, over which listener, and with which token. Check that the webhook is reachable only from the monitoring side and that the room receives the alert once, not twice.

Prometheus and Grafana alerts both post through Hookshot into one Matrix room.

Why alerts fail to appear in the Matrix room

This table lists the failures that most often stop Grafana and Prometheus alerts from reaching a Hookshot-connected Matrix room, with the likely cause and the check or fix for each. Work down the rows in order, since token and room membership problems are the cheapest to rule out first.

SymptomLikely causeCheck or fix
No messages, no errors in HookshotWebhook token was rotated or copied incorrectlyRegenerate the generic webhook token in the room connection, update the Grafana or Alertmanager receiver, and send a test request before waiting for a real alert.
Requests return an authorization errorWebhook URL or token points at a different connection or roomConfirm the connection belongs to the intended room and that the webhook path in the sender matches the one Hookshot generated.
Hookshot accepts the post but nothing appearsBot account is not joined to the target roomInvite the bot user to the room, accept the invite from the bot account, and confirm its membership before testing again.
Alerts stop only in one roomRoom is end-to-end encrypted and the bridge does not handle it in your setupConfirm encryption support for your Hookshot version and room type, or route alerts to an unencrypted on-call room. Verify this in your own environment before relying on it.
Alertmanager sends to only some instancesAlertmanager targets placed behind a load balancerPoint Prometheus at every Alertmanager instance rather than a load balancer, and check that each instance appears in the target list.
Duplicate alert messages in Grafana HATwo or more active Grafana servers each evaluate and notifyApply the alerting configuration the Grafana high availability guidance describes to avoid duplicate notifications, and test with one known alert rule.
Sender logs show certificate or trust errorsHookshot or the sender does not trust the internal certificate authorityAdd the internal CA to the sender's trust store, confirm the certificate chain and hostname, and avoid disabling verification as a workaround.
Timeouts or connection refused from the alert senderFirewall or network policy blocks the Hookshot listener or Matrix homeserverTest reachability from the Grafana or Alertmanager host to the Hookshot port and the homeserver, then review firewall and egress rules on both sides.

Questions teams ask before connecting alerts to Matrix

What does it cost to connect Grafana and Prometheus alerts to Matrix?

The software is free to use, so the cost is labor, infrastructure and ongoing operations. Prometheus is licensed under Apache-2.0 and has no paid edition, and Grafana OSS is licensed under AGPLv3, so license fees do not apply to the core path. You pay for the people who design the alert routing, build the Hookshot service and Matrix room setup, and maintain them after go-live, plus the servers or virtual machines that run each component. Ask any quote to separate one-time work (design, build, testing, handover) from recurring work (upgrades, patching, on-call changes, retention tuning). Each line should name who does the work, whether it is DeployOpen or your team, and what the written scope covers.

How long does an alert routing project take, and what makes it longer?

Duration depends mostly on how many alert sources, rooms and teams are involved, and on how much of the surrounding platform is new to you. A single Alertmanager receiver posting into one room is a small build. Duration grows with each additional Grafana instance, each Prometheus or Alertmanager cluster, each room with its own escalation rules, and any requirement for encrypted rooms or a high-availability Grafana setup. Grafana's high availability guidance notes that alerting needs extra configuration to avoid duplicate notifications, which often adds a testing cycle. Ask for a milestone plan in the written scope so you can see where time goes before work starts.

What does our team need to provide for this integration?

Plan to supply access and decisions, not just time. You will need a running Matrix homeserver that Hookshot can join, a bot account or appservice registration for Hookshot, and a clear list of target rooms and the teams that own them. On the monitoring side, you need admin access to Prometheus, Alertmanager and Grafana, plus a test alert path so each route can be verified. Security teams should decide where secrets such as webhook tokens are stored and who can rotate them. Your on-call leads should confirm the routing rules, severity mapping and silence policy. Missing any of these usually adds rework rather than extra build time.

Can our in-house team build this without outside help?

Yes, if your team already runs Prometheus, Alertmanager and a Matrix homeserver and has someone comfortable with YAML, HTTP webhooks and the Hookshot configuration reference in the Hookshot documentation. The work is mostly configuration, but it touches three systems that often have different owners. The usual gap is operations: someone must own Hookshot upgrades, secret rotation and the room membership that makes alerts land. If no one on your team has time for that, a fixed-scope engagement can cover design and build, with the run model agreed in writing. Compare the internal estimate against that scope, not against a generic number.

Do we need Grafana Enterprise to send Grafana alerts to Matrix?

No. Grafana's webhook contact point can post alerts to an HTTP endpoint, and Hookshot's generic webhook support accepts those posts, so the path does not depend on the commercial edition. Grafana Labs relicensed Grafana, Loki and Tempo to AGPLv3 on April 20, 2021, and Grafana Enterprise is offered as a non-AGPL commercial option, according to the Grafana Labs licensing page. Enterprise matters for other reasons, such as SAML, team sync and SCIM provisioning, which the authentication docs list as Enterprise or Cloud features. Confirm with your Grafana version which contact point types and alert templates you need, since those change with releases.

How do alert volume and storage change the plan?

Alert volume affects the design more than the storage. Alertmanager groups, inhibits and silences alerts, so grouping rules decide how many messages reach a room during an incident. A flapping rule or a noisy cluster can flood a channel, which is why routing and grouping should be tested with realistic alert history before go-live. Storage is a separate question: Prometheus keeps local data for a default retention of 15 days, is not clustered or replicated, and should be managed like any other single-node database. Longer history needs remote write to external storage, which adds cost and an operations path. Ask for a sizing review that covers alert rate, retention and the Hookshot host, and confirm the figures from your own environment.

What goes wrong most often, and how is it caught?

The most common faults are silent: a webhook token that expired, a Hookshot bot that is not in the room, a TLS certificate that the Grafana or Alertmanager host does not trust, or a route that matches nothing. Prometheus documentation says it favors reliability over precision, so verify end to end rather than assuming delivery. Build a test alert for each route, a failure check that fires when Hookshot is unreachable, and a runbook entry for the case where Matrix is down. Prometheus should point at every Alertmanager instance rather than a load balancer, so confirm that wiring during testing. Retest after every Grafana, Prometheus and Hookshot upgrade.

Is the Hookshot webhook path secure enough for production alerts?

It can be, if the webhook endpoint is treated as an exposed service. Hookshot's generic webhooks let any service that can send an HTTP webhook post messages into a room, so the token that authenticates each sender and the network path must be controlled. Restrict who can create webhook connections, keep tokens in a secrets store, and avoid putting sensitive detail in alert text that reaches a broad room. Alert payloads can contain hostnames, query strings and labels, so review them against your data handling rules. Ask for a security review of the Hookshot host and its reverse proxy as part of the written scope.

How DeployOpen works on this

DeployOpen scopes Grafana and Prometheus alerting into Matrix rooms as a fixed-scope engagement, starting from the alert routes your on-call teams need. The work runs inside your own infrastructure, with the Matrix homeserver, Hookshot and the alert sources documented and handed over at the end.

How we scope

  • Inventory the Prometheus, Alertmanager and Grafana alert sources that should reach Matrix, and which teams own each one.
  • Agree the room layout, routing and escalation rules in writing before any configuration begins.
  • Confirm the Matrix homeserver, Hookshot deployment, network paths and encryption expectations for each target room.

How we build

  • Deploy and configure Hookshot generic webhook connections in the rooms named in the agreed scope.
  • Wire Alertmanager receivers and Grafana contact points to those webhooks, then test firing and resolved notifications.
  • Test failure paths, such as a Hookshot restart or an unreachable homeserver, and record the results against the scope.

How we hand over

  • Document webhook URLs, token storage, room mappings and routing rules so your team can change them safely.
  • Walk through alert testing and runbooks with the engineers who will receive and act on the alerts.
  • Deliver configuration as files your team controls, so changes can be reviewed and rolled back.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after the handover.
  • Plan upgrade checks for Hookshot, Alertmanager and Grafana releases before they reach the production alert path.
  • Confirm with your team which support hours and response expectations apply before the retainer starts.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.