Prometheus Alertmanager notifications to Mattermost

Route Prometheus alerts into Mattermost channels with Alertmanager's native receiver, using an incoming webhook, a secret webhook file and resolved notifications. Learn the setup sequence and failure points.

On this page

How Alertmanager posts Prometheus alerts into Mattermost channels

If your team already runs self-hosted Prometheus and Mattermost and wants alerts to land in a channel, the core answer is simple: Alertmanager's mattermost_configs receiver posts each notification through a Mattermost incoming webhook. Alertmanager does not connect to Mattermost with a bot account, a token or a user login. The webhook URL, which has the form <generated key>, is the only credential involved, and it is created in Mattermost for one target channel. Prometheus itself never talks to Mattermost. It sends firing alerts to Alertmanager, and Alertmanager's routing decides which receiver, and therefore which channel, handles each alert.

Two optional settings shape how messages look in the channel. The channel override can direct a receiver to a channel other than the one the webhook was created for, although the incoming webhook itself still posts to a single channel, so confirm in your Mattermost version how the override behaves before you rely on it. The username override sets the display name on posts, which helps separate alerts from a monitoring system from messages written by people. The receiver also sends resolved notifications by default, because send_resolved defaults to true. Teams that want only firing alerts in a channel must set it to false explicitly, and should decide that before go-live so the channel does not fill with recovery messages they did not expect.

Because the webhook is a bearer secret, anyone holding the URL can post to the channel. Store it with webhook_url_file rather than inline webhook_url, since the two options are mutually exclusive and the file keeps the key out of the main configuration. Restrict who can read that file on the Alertmanager host, and plan a rotation step: regenerate the webhook in Mattermost, update the file, reload Alertmanager and confirm a test alert arrives. Record which channel each webhook belongs to, because a rotated or deleted webhook silently stops delivery, and check that Alertmanager's own alert delivery is monitored, as the Alertmanager documentation describes its cluster and grouping behavior in the Alertmanager documentation.

What you need before configuring the Mattermost receiver

The Alertmanager Mattermost receiver needs three things to be in place before any configuration: a Mattermost server with an incoming webhook, a Prometheus and Alertmanager pair on a supported release line, and a network path that lets Alertmanager reach Mattermost. Each card below is a decision or check that, if skipped, usually shows up later as silent alerts or a broken notification path.

Mattermost server with incoming webhooks enabled

Confirm that the Mattermost server is reachable and that incoming webhooks are enabled by a system administrator. Mattermost incoming webhooks post into one channel through a URL that contains a generated key, so the webhook must be created from the channel that will receive alerts. Ask the Mattermost administrator who owns the server, which version it runs, and whether a Mattermost support plan applies. Plan the upgrade path for the server alongside this integration rather than treating the webhook as a one-time setup.

Incoming webhooks docs

Supported Prometheus and Alertmanager versions

Confirm which Prometheus release line you run before you copy any configuration. The current long-term support line is 3.13, released July 1, 2026 and supported until July 31, 2027, while LTS 3.5 reached end of life on July 31, 2026. Minor releases receive bug fixes for only about six weeks, so a fixed minor version can fall out of support quickly. Check that Alertmanager is at a release that includes the mattermost_configs receiver before writing the configuration.

Release cycle docs

HTTPS reachability from Alertmanager

Alertmanager sends each notification from its own host, so that host needs outbound HTTPS access to the Mattermost server and must be able to resolve its name. Check egress rules, proxies and any firewall that separates the monitoring network from the chat network, especially in segmented or air-gapped sites. Test the route from the Alertmanager host itself, because a successful test from a workstation does not prove the monitoring host can connect.

A dedicated target channel and named owner

Choose one channel for alerts and name the person or team that owns it. Because a webhook posts to a single channel, separate critical paging alerts from informational ones by creating separate webhooks, or decide up front that one channel receives everything. Record who may create or rotate webhooks, who can change channel membership, and who responds when the channel goes quiet, since a silent channel can hide a broken receiver.

Secret storage for the webhook URL

Treat the webhook URL as a credential, since anyone holding it can post to the channel. Decide where the URL will live on the Alertmanager host, such as a root-owned file read by the Alertmanager service account, and confirm that your configuration management can deploy it without placing it in version control. Plan a rotation step so that a leaked URL can be revoked and replaced without rewriting the whole Alertmanager configuration.

How an alert travels from Prometheus to a Mattermost channel

The path starts when Prometheus evaluates alert rules and sends firing alerts to Alertmanager, which groups and routes them to the mattermost_configs receiver. That receiver calls the Mattermost incoming webhook, and the Mattermost server posts the message to one channel. The webhook URL is the secret trust boundary: anyone holding it can post, so the diagram marks it explicitly. Check the receiver's webhook_url_file reference, the channel override, and whether resolved notifications arrive as expected.

Alert flow from rule evaluation to a channel post, with the webhook URL marked as the secret.

Configuring the incoming webhook and Alertmanager receiver

This sequence connects one Mattermost channel to Alertmanager through an incoming webhook, with the webhook URL kept in a file, so that firing and resolved alerts reach the channel. Each step ends with a check you can run before relying on the route.

  1. Create the incoming webhook in the target channel

    A Mattermost system or channel administrator with permission to manage integrations creates an incoming webhook and selects the channel that will receive alerts. Mattermost generates a URL of the form hooks followed by a generated key. Treat this URL as a secret, because anyone who holds it can post to the channel. Confirm the webhook appears in the integrations list and is tied to the channel you intended, not a channel with broad membership by accident.

  2. Store the webhook URL in a file on the Alertmanager host

    Copy the generated URL into a plain text file on the host that runs Alertmanager, such as a path under its configuration directory. Restrict the file so only the account running Alertmanager can read it, for example with owner-only permissions. Keeping the URL out of the main configuration file means the configuration can be shared, reviewed and stored in version control without exposing the secret. Check the file with a read as the Alertmanager service account before continuing.

  3. Add the mattermost_configs receiver

    In the Alertmanager configuration, add a receiver with a mattermost_configs block that points webhook_url_file at the file you created. Use webhook_url_file rather than webhook_url, because the two options are mutually exclusive and the file approach keeps the secret out of the configuration. Give the receiver a clear name, such as one tied to the team that owns the channel. Validate the file with amtool before reloading, and confirm it reports no errors.

  4. Set optional channel and username overrides

    Add channel and username fields only where they serve a purpose. The channel override lets a receiver post to a channel other than the webhook's default, but the webhook itself still limits where posts can go, so confirm the target channel in a test before depending on it. The username override sets the sender name shown in the channel, which helps responders tell Alertmanager posts apart from human messages. Validation passing with the overrides in place is the check for this step.

  5. Confirm send_resolved behavior

    Review the send_resolved setting on the receiver. Alertmanager's documented default is true, so resolved notifications are sent unless you turn them off. Decide whether your channel should show recovery messages, and set the value explicitly so the behavior is visible in the configuration. The check is that the effective configuration, as shown after validation or in the Alertmanager status view, matches the choice you made.

  6. Route a test alert to the receiver

    Add a route in the Alertmanager configuration that sends a clearly labeled test alert to the new receiver, or send a synthetic alert through the Alertmanager API from a host you control. Use a label such as a test name so responders recognize it as non-production traffic. The check is that a firing message appears in the Mattermost channel with the expected sender name and content. If nothing appears, check the route matchers and the webhook file's read permissions first.

  7. Reload Alertmanager and confirm the resolved message

    Reload the Alertmanager configuration so the new receiver takes effect, using the reload method for your installation. Then resolve the test alert, either by stopping the condition that triggered it or by letting it expire, and confirm a resolved message reaches the channel when send_resolved is on. Record the receiver name, the webhook file location and the test results in your runbook so the next person can repeat the sequence.

Why webhook_url_file keeps the endpoint out of configuration

The Mattermost incoming webhook URL is a credential. Mattermost's documentation says to treat the /hooks/<generated key> endpoint as a secret, because anyone who holds it can post to the channel it is bound to. Alertmanager's mattermost_configs receiver accepts that URL in one of two keys, webhook_url or webhook_url_file, and the two are mutually exclusive, so a configuration must name exactly one. Choosing webhook_url_file lets the alerting configuration reference a path on disk while the secret itself lives in a separate file, which is the design decision this section is about.

The reason this matters in practice is that Alertmanager configuration tends to leave the controlled environment. It is copied into Git repositories, rendered by configuration management, pasted into tickets, and printed in support bundles or logs when someone troubleshoots routing. Inline webhook_url values travel with all of those copies. With webhook_url_file, the file is the only place the key appears, so the reader's team can restrict it to the account that runs Alertmanager and keep the rest of the configuration shareable. Confirm how your Alertmanager build and its configuration tooling handle the file path before relying on this in automation, and check that your review tooling does not echo the file contents anywhere.

File ownership, permissions and rotation are the reader's responsibility to design, and the Alertmanager and Mattermost docs do not prescribe them for this case. Decide which service account reads the file, who may write it, and where the file is provisioned from, such as a secrets manager that renders it at deploy time. Define a rotation procedure before the first incident: generate a new incoming webhook in the Mattermost channel, update the file, reload Alertmanager, send a test alert, and then disable the old webhook. Ask your security team whether rotation is triggered by staff changes, a schedule, or suspected exposure, and record who owns each step.

Mapping Alertmanager fields to Mattermost message behavior

This table maps each mattermost_configs field in Alertmanager to what it controls on the Mattermost side, and where the behavior depends on your Mattermost version or your routing tree. Read it before writing the receiver, then confirm each row against a test alert in a non-production channel.

Alertmanager field or conceptWhat it controls in MattermostWhat to test in your own version
webhook_url or webhook_url_fileThe incoming webhook that receives posts. Mattermost keys the endpoint to one channel, and anyone holding the URL can post to it.Confirm the post lands in the intended channel and that the URL is read from the file, not echoed in logs or config dumps.
webhook_url_fileReads the webhook URL from a file on the Alertmanager host, so the secret stays out of the main configuration file.Confirm file permissions restrict reads to the Alertmanager service account and that a rotated key is picked up after reload.
channelOverrides the channel the webhook posts to, if the webhook permits it and the override is set.Confirm whether your Mattermost version and webhook settings honor the override, since a post may otherwise go to the webhook's default channel.
usernameSets the display name shown as the sender of alert posts.Confirm the name appears in the post and check whether your server allows username overrides on incoming webhooks.
send_resolvedControls whether a recovery message is posted when an alert clears. The Alertmanager default is true.Confirm recovery posts appear, are distinguishable from firing posts, and are not suppressed by channel or webhook settings.
Routing tree and receiversDecides which alerts reach which receiver, and therefore which Mattermost channel. Grouping and inhibition change what is posted and how often.Trace sample labels through the route tree and confirm each severity or team label lands in the channel the owning team reads.
Grouping and repeat behaviorBundles related alerts into fewer posts and repeats notifications on the configured interval.Confirm the post volume during a burst of alerts is acceptable for the channel and that silences suppress posts as expected.

Securing the webhook and the alert path

An Alertmanager-to-Mattermost route is only as secure as the webhook URL it carries and the data it puts in front of readers. The cards below cover how to protect that URL, who can read the configuration, how traffic to Mattermost is protected, what alert content should stay out of channels, and how to keep alerts flowing when one Alertmanager fails.

Treat the webhook URL as a secret

A Mattermost incoming webhook posts to one channel, and the URL contains the generated key. Anyone holding that URL can post to the channel, so a leaked key lets someone inject fake alerts or noise into an on-call channel. Confirm who created the webhook in Mattermost, keep the URL out of tickets, chat logs and shared screenshots, and record which channel each key targets so a leak can be traced.

Incoming webhooks docs

Rotate webhooks on a planned schedule

Rotation means creating a new incoming webhook, updating the Alertmanager configuration with the new URL, reloading Alertmanager, confirming a test alert arrives, and then removing the old webhook. Plan the change window with the team that owns the channel, because a missed update silently drops notifications. Ask your team to define who approves rotation after a suspected exposure and how fast it must happen.

Keep the URL in a file, not the config

The webhook_url_file key lets Alertmanager read the URL from a file at runtime, so the value stays out of the main configuration file. The webhook_url and webhook_url_file keys are mutually exclusive, so set only one. Store the file with owner-only permissions for the Alertmanager service account, and keep it out of version control and container images.

Restrict who can read configuration

Anyone who can read the Alertmanager configuration or the secret file can copy the webhook. Limit read access to the Alertmanager service account and a small operations group, and review who can edit the configuration because a change can redirect alerts to another channel. Audit access to configuration repositories, configuration management variables and the hosts or pods that mount the file.

Encrypt traffic to the Mattermost server

Alertmanager posts alert content to the Mattermost webhook endpoint over HTTP(S), and the webhook key travels with each request. Use an https URL for the Mattermost server, make sure its certificate chains to a CA that Alertmanager's host trusts, and avoid disabling certificate checks to get past a failure. Confirm the TLS version and certificate lifecycle with your security team before go-live.

Keep sensitive data out of alert labels

Alertmanager sends labels and annotations into the channel as text, so a label that carries a customer identifier, token, hostname pattern or internal account name is visible to everyone who can read the channel. Review alert rules and templates for sensitive values, keep detailed diagnostics in the monitoring system, and link to a restricted runbook instead. Confirm that the channel's membership matches the data it will receive.

Run Alertmanager as a cluster

A single Alertmanager instance is a single point of failure for notifications. Alertmanager supports clustering through its --cluster flags, and the Alertmanager docs say Prometheus should be configured with every Alertmanager instance rather than a load balancer in front of them. Test failover by stopping one instance during a test alert, and confirm that each alert is delivered once to Mattermost.

Alertmanager docs

Why alerts fail to reach Mattermost and how to fix them

This table pairs each common failure with its likely cause and the fix to try first, for Alertmanager notifications posted to a Mattermost channel. Work down the rows when alerts are missing, land in the wrong place, or stop arriving after a change. Most failures trace back to the webhook URL, the configuration file, or a reload that never happened.

Symptom or caseLikely causeFix
Notifications stop after the webhook is regenerated or deletedThe hooks/ key in the incoming webhook URL was regenerated or the webhook was removed, so Mattermost rejects posts to the old URLCreate a new incoming webhook, replace the contents of the webhook file, and reload Alertmanager so it reads the new value
Config fails validation with both webhook_url and webhook_url_file setAlertmanager treats these two keys as mutually exclusive, so a receiver that sets both is rejectedKeep only webhook_url_file in the receiver, pointing to a file readable by the Alertmanager process
Posts go to an unexpected channel or fail for a channel overrideThe channel override does not match an existing channel name, or the webhook is bound to one channel and the override does not apply as expectedCheck the channel name in Mattermost, confirm the webhook's target channel, and test with a single receiver before routing more alerts
Resolved messages never appearsend_resolved is set to false on the receiver, or the receiver is not used for the matching routeRemove send_resolved: false or set it to true (the documented default), then trigger a test alert and clear it to confirm recovery posts
TLS certificate or proxy errors in Alertmanager logsAlertmanager does not trust the Mattermost certificate authority, or an outbound proxy setting blocks or rewrites the requestConfirm the certificate chain, add the internal CA to the trust store used by Alertmanager, and check proxy settings for the Mattermost hostname
Config change has no effectAlertmanager was not reloaded after editing the configuration or webhook file, so it still runs the previous valuesValidate the file with amtool, then reload Alertmanager and check the logs for the reload result
Webhook file not found or permission deniedThe path in webhook_url_file is relative to a different working directory, or the service user cannot read the fileUse an absolute path, set file ownership and mode so only the Alertmanager service user can read it, and restart or reload to confirm
Alerts post but notifications are noisy or duplicatedSeveral Alertmanager instances each send to the same receiver, or grouping settings are too narrowReview the cluster setup and route grouping, then confirm each alert group produces one message per change

Questions teams ask before setting up Alertmanager to Mattermost

Does sending Prometheus alerts to Mattermost cost a license?

Prometheus and Alertmanager carry no license fee for the integration itself. Prometheus is licensed under Apache-2.0 and has no paid enterprise edition, so the cost comes from the servers that run Prometheus and Alertmanager, the storage for metrics, and the people who build and maintain the alert rules and routing. Mattermost is a separate question: the incoming webhook used here is part of the Mattermost server, so its cost depends on how your organization licenses and hosts Mattermost. Confirm with your Mattermost plan and your own infrastructure team which costs apply to your setup.

How long does a basic Alertmanager to Mattermost setup take to confirm?

A basic setup depends less on the configuration than on access: an administrator must create the incoming webhook, a channel must exist, and someone must confirm that a test alert reaches the right place. The configuration itself is a single mattermost_configs receiver with a webhook_url_file and a route that sends alerts to it. Duration depends on how quickly your Mattermost and monitoring teams can grant access and agree on which channel receives which alerts. Ask any partner for a written timeline based on your scope, and treat a test alert firing and resolving in the channel as the confirmation point.

What does our team need to provide before the setup starts?

You need a running Prometheus and Alertmanager, a Mattermost server your team can reach from the Alertmanager host, and an administrator who can create incoming webhooks. Gather these inputs before work begins:

  • The Mattermost channel names for each alert category or team
  • Who may create and rotate the webhook, and where the webhook secret will be stored
  • The alert routes you want, including severity levels and any receivers already in use
  • Network rules that allow the Alertmanager host to reach the Mattermost server
  • A named owner who will respond when a notification fails
Can our own team set this up without outside help?

Yes, many teams that already run Prometheus can set up a single receiver themselves, because the documented configuration is short. Outside help tends to matter when routing grows across many teams, when alerts need grouping and inhibition rules, or when the webhook secret must be handled under a formal security process. Your team should be comfortable editing the Alertmanager configuration, reloading it, and reading its logs. Confirm that someone on your team can own the configuration after go-live, because the setup is only useful if alerts keep arriving as services change.

Does our Mattermost plan level change how this integration works?

The incoming webhook used for Alertmanager notifications is a standard Mattermost feature, so the basic integration does not depend on a specific plan. Plan level matters for the rest of the environment: SSO and directory sync start at the Professional plan, and high availability clustering starts at Enterprise, according to Mattermost's pricing page. If your Mattermost server runs as a high availability cluster, the webhook and its target channel must still be reachable through the load balancer, and file storage must be shared across nodes. Check the current plan details with Mattermost before you rely on any feature.

When should we bring in outside help for alert design or high availability?

Bring in outside help when the alerting design affects many teams, when you need a high availability Alertmanager cluster, or when the alerting path must meet audit or change control requirements. Alertmanager can run as a cluster using its --cluster flags, and Prometheus should point at every Alertmanager instance rather than a load balancer, which is a detail teams often miss. A fixed-scope engagement lets you agree deliverables in writing, including routing design, configuration, a failover test and a runbook. Ask for a quote based on that written scope rather than a general estimate.

Is the webhook URL safe to store in the Alertmanager configuration?

Treat the webhook URL as a secret, because Mattermost's documentation states that anyone holding the incoming webhook endpoint can post to its channel. Avoid placing the URL directly in the configuration file, where it may be copied into version control or shared during troubleshooting. Instead, store it in a file on the Alertmanager host with tight file permissions and reference it with webhook_url_file. Note that webhook_url and webhook_url_file are mutually exclusive, so the configuration must use one or the other. Rotate the webhook if the file is exposed.

Keeping alert routing reliable after go-live

The alert route is only as reliable as its last review, so plan a recurring check of the mattermost_configs receiver after every Alertmanager upgrade and every Mattermost upgrade. Confirm that webhook_url_file still points at the mounted secret, that the channel and username overrides still match channels that exist, and that send_resolved is set the way your on-call process expects. Mattermost releases a new server version in binary form on the 16th of each month, so align the review with that date and read the release notes for any change to incoming webhooks. Track which Mattermost line you run: v11.7 is the current Extended Support Release, with support ending 2027-05-15, while the monthly releases end support sooner. Confirm the support end date for your line on the Mattermost server releases page before each planning cycle.

Prometheus and Alertmanager have their own support clocks. Under the Prometheus release cycle, a minor release generally stops receiving bug fixes six weeks after it ships, so pin the version you run to a supported line and record the date you last reviewed it. If you run the long-term support line, confirm its end-of-support date (LTS 3.13 is supported until July 31, 2027, according to the Prometheus release cycle page) and plan the move to the next line well before then. Whenever you change a label, rename a team, or move a channel, send a test alert through each route that matches the change. Confirm the expected channel and message text, and confirm that a resolved notification arrives. Route tests should be a standing checklist item, not a one-time go-live task.

Prometheus local storage is a single node that is not clustered or replicated, so the alert path and the alert history are separate concerns. Mattermost messages show what was posted to a channel, but they are not a record of the rule evaluations that produced them. If you need that history for incident reviews or audits, plan remote write to an external long-term store, or define how you retain the 15-day default local data and alert logs. Decide who owns that retention, how long it lasts, and how it is restored. Ask DeployOpen or your own team to confirm the backup and recovery approach for the Prometheus host, because the storage docs treat it like any other single-node database.

How DeployOpen scopes and delivers Mattermost alert routing

DeployOpen plans Prometheus Alertmanager notifications to Mattermost as a fixed-scope piece of work inside infrastructure you control. The engagement covers the receiver configuration, the webhook secret handling, channel routing and the test evidence your operations team needs before alerts reach people on call.

How we scope

  • Confirm which Prometheus and Alertmanager instances, alert rules and receivers the written scope covers
  • Agree which Mattermost team and channels each alert category will post to, and who owns each channel
  • Record the Alertmanager and Mattermost versions in use and the network path between them
  • Define how the incoming webhook secret is stored, rotated and kept out of version control

How we build

  • Configure the mattermost_configs receiver with webhook_url_file so the webhook URL stays in a protected file
  • Set channel and username overrides per route, and decide where send_resolved should stay enabled
  • Test firing and resolving sample alerts through each route before production routing is switched on
  • Check that Alertmanager grouping and silences behave as expected for the alerts Mattermost will receive

How we hand over

  • Deliver the Alertmanager configuration, file permission settings and a route-to-channel reference table
  • Provide a written test record showing firing, grouped and resolved notifications for each route
  • Document the webhook rotation steps and who must be told when a webhook is regenerated
  • Walk the operations team through troubleshooting for failed posts and missing resolved messages

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover
  • Retainer scope can cover Alertmanager and Mattermost upgrade checks, which we agree in writing
  • Review the alert routing again when new Prometheus rules, teams or channels are added
  • Quotes follow from the written scope, so ask for each component and recurring item to be listed separately

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.