How Mattermost monitoring with Prometheus and Grafana works
Prometheus collects metrics from the Mattermost metrics endpoint, and Grafana visualizes them. A team running self-hosted Mattermost needs this visibility once the server carries enough load that message delays, connection problems or database strain are no longer obvious from user complaints alone. Prometheus is the collector and store, Grafana is the view. Prometheus pulls samples over HTTP on a schedule, keeps them in its local time series database, and answers PromQL queries. Grafana connects to Prometheus as a data source and renders the Mattermost dashboards on top of those queries. Neither tool sends alerts about Mattermost on its own in this design; alert rules and routing are a separate decision.
Both projects are open source and carry no paid edition of Prometheus. Prometheus is licensed under Apache-2.0, and Grafana's licensing has a different history: in 2021 Grafana Labs moved Grafana to AGPLv3 and offers Grafana Enterprise as a commercial option. Your cost is therefore the infrastructure, storage, implementation effort and the people who run the stack, not a license fee for Prometheus itself. Confirm the Grafana edition and license terms you will use with your own compliance team before rollout. The Grafana Labs licensing page is the starting point for that review.
Plan this stack when more than one person depends on Mattermost health, when you run a high availability cluster and need to see every node, or when an auditor or security team asks how availability is measured. Prometheus is not a fit where every event must be counted exactly, so treat it as a reliability signal rather than a billing or audit record. Decide early where Prometheus runs, how long metrics are retained, and who owns the Grafana instance. Those choices shape the rest of the build, which is covered in the sections below.
Choosing a monitoring layout for your Mattermost deployment
This table compares monitoring layouts for Mattermost by deployment shape, who runs each one, and how retention and storage behave. Read each row against your own node count and retention requirement, then choose the layout whose storage and ownership you can support. The main takeaway is that Prometheus local storage is single-node, so the monitoring server itself needs the same care as any database.
| Layout | When it fits | Who runs it | Retention and storage trade-off |
|---|---|---|---|
| Single application server, Prometheus on the same host | One Mattermost server with no clustering, and a small team that accepts shared failure domains | Usually the same administrator who runs Mattermost, with time split between both | Default 15-day retention is cheap to keep, but a host failure loses both the app and its metrics history |
| Single application server, separate monitoring server | One Mattermost server where you want metrics to survive an application host failure | A platform or ops team that already runs Linux servers and backups | Adds a second host to patch and back up, and the monitoring server's own disk sets how much history you keep |
| Multi-node cluster, Prometheus scraping every node | Mattermost high availability clusters, which the product documents only on Enterprise and Enterprise Advanced plans | A platform team that owns service discovery, scrape configuration and alert routing | Each node adds series to store, so the retention window you choose drives disk use directly |
| Multi-node cluster, separate monitoring server with remote storage | Clusters that need history beyond the local retention window or that must keep data off the monitoring host | A team that operates a long-term storage system in addition to Prometheus | Prometheus local storage is not clustered or replicated, so long-term copies depend on remote write to a separate system you must confirm |
| Retention set by time | When compliance or incident review needs a fixed number of days of history | The administrator who sets the retention flag and checks disk use | Time-based limits are predictable, but confirm the disk size is enough for your node count and series volume |
| Retention set by size | When disk is fixed and you want Prometheus to stop before the volume fills | The administrator who sizes the volume and watches for early data loss | Size limits can drop older data sooner than your reviewers expect, so confirm the window you actually keep |
| Grafana placement | Grafana can share the Prometheus host for small teams or run separately for access control | Whoever owns dashboards and user access | Grafana configuration needs its own database for production, so a separate host adds another store to back up |
Setting up the Mattermost metrics endpoint and scrape targets
This sequence turns on the Mattermost metrics endpoint on every node, confirms each node answers, points Prometheus at all of them, and connects Grafana to the result. It ends with dashboards showing live data from the whole cluster. Run it in a test environment first, and confirm the configuration keys against the Mattermost docs for your running version.
Confirm the running version and its docs
The platform team records the exact Mattermost server version on every node, since the metrics settings and their key names belong to that version's documentation. Open the Mattermost server releases page and the deployment docs for that version, and note the configuration file location used by each node. Check that all nodes run the same version before changing anything, because a mixed cluster makes metrics hard to compare and troubleshoot. Done when you have a written list of node names, versions and config file paths, and every node reports the same version.
Enable the metrics endpoint on each node
Using the configuration method that your version documents, turn on the metrics setting and set the address the endpoint listens on. Make the change on every node, not only one, and expect each application server to expose its own metrics. Apply it with the restart or reload method your version and deployment type require. Limit the listen address to the monitoring network, and confirm with the docs whether the endpoint needs authentication. Done when every node shows metrics enabled and its listen address is reachable from the Prometheus host.
Confirm each node answers on metrics
From the monitoring host, request the metrics path on each node's listen address and check that the response contains Mattermost metric data. Test nodes one at a time, including any node you can reach directly, because a load balancer can hide a node that is down. Run the same request from the network segment Prometheus will use, since a firewall rule that works from an administrator laptop can still block the scraper. Done when every node returns metrics on the first attempt and the response includes the metric families you expect.
Install Prometheus on a separate monitoring host
The platform team installs Prometheus on a host separate from the Mattermost nodes, so a failure in the application tier does not also take monitoring down. Prometheus stores data in a local time series database, and its storage docs state that local storage is not clustered or replicated, so plan disk size and retention up front. The default retention is 15 days, and you can configure it by time or size. Done when the Prometheus web interface loads and its status page shows the configuration file you intend to use.
Configure Prometheus to scrape every node
Add a scrape job for Mattermost in
prometheus.ymlwith one target for every node. Use static configuration for a fixed node list, or service discovery if your platform publishes node addresses. Set the metrics path and scrape interval to match what you confirmed earlier, and give each target a clear node label for dashboard filtering. Reload Prometheus, then open the targets page. Done when every Mattermost node appears as a target in the up state. In a maintenance window or test environment, stop one node to confirm it shows as down.Load the Mattermost dashboards into Grafana
Install Grafana with a production-grade database, since the installation docs say SQLite does not scale for production. Define the Prometheus data source and the Mattermost dashboards as provisioning files in YAML or JSON, so the setup is repeatable and can be kept in version control. Point the data source at the Prometheus server address, and confirm the dashboard JSON comes from Mattermost's published dashboards for your version. Done when the data source test passes and the dashboards appear in their folder.
Verify data arrives in Grafana
Open a Mattermost dashboard and confirm panels show data for every node, with the node selector listing all expected names. Run
upin Explore to confirm Prometheus sees each target. Generate some activity, such as posting in a test channel and signing in with a test account, and check that the related panels change. Set the time range to cover the period since scraping started, because new panels stay empty until samples arrive. Done when all nodes appear in the selector, panels are populated, and the activity test produces a visible change. Record the dashboard versions and Prometheus job names in your runbook.
Why every cluster node needs its own scrape target
A load balancer address alone hides node-level problems. In a Mattermost high availability cluster, requests reach several application servers through redundant load balancers, so a single scrape of the balanced endpoint returns whichever node happened to answer. If one application server is slow, leaking memory, or failing its database connections, the user-facing service may still look healthy while users on that node see errors. Prometheus needs a separate scrape target for each application server so that each node's metrics, up or down state, and resource use are visible under its own instance label. Confirm the metrics endpoint and its authentication settings on every node before you rely on the dashboards, since the same configuration has to be correct everywhere.
Prometheus finds targets either through service discovery or through a static list in its configuration file. Static configuration is simpler to review and works well for a small, stable set of servers, with each node listed under a targets entry in a scrape job. Service discovery suits environments where nodes are created and replaced automatically, such as autoscaling groups or Kubernetes, because the target list follows the infrastructure. Decide which model fits your change process before you build the job, and confirm the exact discovery mechanism your platform supports with the Prometheus configuration reference. Either way, the scrape job must cover every application server, not only the one behind the load balancer name.
Scrape targets go stale whenever nodes change. A node added to the cluster without a matching target produces no data and no alert, so capacity problems on the new server stay invisible. A node removed but still listed produces a down target that can drown out real failures. Assign ownership for updating targets as part of the same runbook that adds or removes a cluster node, and review the target list after each Mattermost upgrade or infrastructure change. Alerts on the up series for each Mattermost target help catch drift, and the matching alert rules are covered in the performance alerting section of this group.
How Prometheus, Grafana and Mattermost nodes connect
The diagram starts at the Mattermost application nodes, each of which exposes a metrics endpoint inside the monitoring network. Prometheus pulls from every node, not from a load balancer, and writes samples to its own local time series storage. Grafana queries Prometheus for dashboard panels and keeps its own configuration in a separate database. Alertmanager receives alerts from Prometheus. Check that the metrics endpoint requires authentication and that the monitoring network only admits Prometheus, Grafana and operators.
Prometheus pulls from every Mattermost node and feeds Grafana and Alertmanager inside the monitoring network.
Protecting the metrics endpoint and monitoring stack
Metrics, dashboards and alert data describe how your Mattermost is built and how it behaves, so they need the same access control as the chat server itself. The cards below cover the Mattermost metrics endpoint, the network placement of Prometheus and Alertmanager, and the Grafana settings that reduce exposure of the dashboard layer.
Require authentication on the metrics endpoint
The Mattermost metrics endpoint exposes operational detail about your server, including performance and usage patterns. Confirm in your Mattermost version's configuration reference which setting controls endpoint access, then test that an unauthenticated request is refused from outside the monitoring network. Prometheus must be configured to present credentials when it scrapes, and those credentials should be stored in a secrets mechanism rather than in plain scrape configuration files.
- HA plan level
- Enterprise
Keep Prometheus off public networks
Prometheus has no built-in user management, so its web interface and API should be reachable only from the monitoring network and from the people who run it. Place Prometheus behind private addressing or a restricted bastion, and limit inbound scrapes to the Mattermost nodes and the Prometheus host. Review the Prometheus security model before you decide which controls belong in front of it, because the project expects operators to provide network and access protection.
Prometheus security modelRestrict access to the Grafana dashboards
Grafana dashboards reveal service health, user activity trends and infrastructure layout, so public exposure creates risk even when the data looks harmless. Put Grafana behind your existing identity provider or reverse proxy, disable anonymous access, and map viewer, editor and admin roles to groups your identity team manages. Confirm which authentication methods your Grafana edition supports before you commit to an approach, because some options such as SAML and SCIM are limited to the Enterprise and Cloud editions.
Grafana authentication docsApply Grafana security hardening settings
Grafana's hardening guidance covers secure and SameSite cookies, a Content Security Policy, Trusted Types, and domain verification against DNS rebinding. Enable each setting that your Grafana version supports, then test the dashboards in every browser your administrators use, since a strict policy can break plugins or embedded panels. Record each setting as configuration under version control so the baseline survives upgrades.
Grafana hardening docsHide the Grafana version from anonymous users
A visible Grafana version on the login page or in unauthenticated responses lets an attacker match your deployment to known vulnerabilities. The hardening guidance recommends hiding the version from unauthenticated users, so confirm the relevant setting in your release and check the login page and API responses from an outside host. Pair this with a regular patch schedule, because hiding the version does not remove the need to apply fixes.
Protect Prometheus and Alertmanager data
Prometheus local storage is not clustered or replicated, so its data directory holds the only copy of recent metrics unless you use remote storage. Restrict filesystem permissions on the data directory, encrypt the disk or volume that holds it, and decide how long metrics must be retained. Alertmanager stores silences and notification state, and its cluster peers and receiver credentials need the same protection, so store webhook tokens and email passwords in a secrets store.
- Default retention
- 15 days
Which Mattermost plan includes what for monitoring
Mattermost sells its Professional, Enterprise and Enterprise Advanced plans as prepaid annual subscriptions priced by seat licenses. The pricing page lists no public prices and directs buyers to contact sales, so you cannot compare tiers on list price alone. A monitoring project should start from the capabilities each tier includes, then get a written quote from Mattermost for the seat count and term you need. Your cost picture has several parts: the Mattermost subscription itself, the Prometheus and Grafana infrastructure, storage, and the people who run them. Only the subscription is set by Mattermost.
- Quote basis: Ask for pricing tied to a specific seat count, term and plan level in writing.
- Recurring cost: Subscriptions are annual, so plan renewals alongside the monitoring stack's ongoing run costs.
- Open-source components: Prometheus and Grafana carry no license fee for their core projects, but you pay for hosts, storage and operators.
- Scope of the quote: Confirm whether support, upgrades and any monitoring-related features are included or priced separately.
- Renewal terms: Ask how price changes are handled at renewal.
Before you sign, confirm the written quote lists every capability your monitoring design depends on.
The Professional plan is the entry tier in the pricing page's comparison. According to that page, it includes SSO (SAML, OIDC, OAuth) and AD/LDAP user sync. Those identity features matter for monitoring because they control who can sign in to Mattermost and to the operations tools around it. The pricing page, as supplied, does not tie high availability clustering or FIPS 140-3 compliance to this tier, so a single-node Mattermost with self-hosted Prometheus and Grafana is the deployment shape to plan for here.
- Identity access: SSO and directory sync are included from this tier, according to the pricing page.
- Single-node scope: High availability clustering is not listed for this tier, so metrics planning should assume one application server.
- No air-gapped option: Air-gapped deployment is listed only for Enterprise Advanced.
- Metrics access: The pricing page does not state whether the metrics endpoint is available at this tier.
- Next step: Ask Mattermost in writing whether metrics access is included at Professional.
Confirm the metrics endpoint and any support terms with Mattermost before you commit the monitoring design to this tier.
The Enterprise plan adds the features that change how you monitor a clustered deployment. According to the pricing page, it includes high availability clustering and FIPS 140-3 compliance. Mattermost high availability requires redundant application servers, redundant database servers and redundant load balancers, and it is available only on Enterprise and Enterprise Advanced. That means every node in the cluster becomes a scrape target, and your Prometheus design must cover each one.
- Cluster scope: High availability is listed from this tier, so plan a scrape target for every application node.
- Database layer: Read replicas and search replicas are part of the high availability design, so monitor the primary and replicas separately.
- Shared storage: Cluster nodes need shared file storage, which your monitoring should also watch.
- Compliance: FIPS 140-3 compliance is listed from this tier, relevant if your evidence collection depends on it.
- Metrics access: Confirm with Mattermost whether the metrics endpoint is included at this tier.
Check the cluster architecture and the metrics entitlement in your quote before you size the Prometheus scrape configuration.
Enterprise Advanced is the top tier on the pricing page. It includes everything listed for the lower tiers, plus air-gapped deployment. For monitoring, this matters when the Mattermost servers, Prometheus, Grafana and their storage must run in networks with no internet egress. Your monitoring stack then has to be fully self-hosted, with local package mirrors, local time series storage and no external dashboard or alerting services. The pricing page does not describe monitoring-specific features at this tier beyond the platform capabilities listed.
- Air-gapped operation: Plan Prometheus, Alertmanager and Grafana installs and updates from internal sources.
- Local storage: Prometheus local storage is not clustered or replicated, so plan backup and retention on your own infrastructure.
- Offline alerting: Alert routes must reach internal receivers only.
- Plan scope: Confirm which monitoring-related features are included at this tier, since the pricing page lists only platform capabilities.
- Support model: Ask how Mattermost supports metrics questions in a disconnected environment.
Confirm in writing with Mattermost what this tier includes for metrics access before you design an air-gapped monitoring stack.
Limits to confirm before you build
Prometheus and Grafana are open source, so the limits below come from their architecture and release model rather than from a license fee. Each one shapes the monitoring design for a Mattermost cluster, and each has a question to settle with your team before the build starts.
Local storage is not clustered
Prometheus keeps its time series on local disk, and the storage docs state that this storage is not clustered or replicated. Losing a node loses that node's history unless you plan for it. Confirm who owns backups of the data directory, whether a second Prometheus will scrape the same targets, and whether remote write to long-term storage is part of the design.
Prometheus storage docsDefault 15 day retention
Prometheus keeps data for 15 days by default, and retention can be set by time or by size. Capacity planning and any incident review that looks back further than that window depend on this setting. Confirm how far back your team needs Mattermost metrics, who approves a longer window, and how much disk that window requires on the Prometheus host.
Reliability over precision
The Prometheus docs say it favors reliability over precision and is not a good choice where 100% accuracy is required, such as per-request billing. Mattermost metrics are suited to operational trends and alerts. Confirm that no business or billing decision will rely on these counters, and document where exact per-event records should come from instead.
Grafana HA needs a shared database
Grafana high availability runs two or more active-active servers behind a load balancer with a shared MySQL or PostgreSQL database. SQLite does not scale for production, so the default cannot serve an HA pair. Alerting also needs extra configuration to avoid duplicate notifications, and Grafana Live has HA limitations. Confirm the database, the alert routing design and whether live features are needed.
Grafana HA docsMonthly and LTS release cycles
Prometheus starts a new minor release cycle every 6 weeks, and minor releases generally stop receiving bug fixes after that period. Its LTS line receives fixes for one year. Grafana ships minor releases every other month and patch releases at least monthly. Confirm which release channel each component follows, who applies patches, and how upgrades are tested against your Mattermost dashboards.
Prometheus release cycleQuestions buyers ask about Mattermost monitoring
What drives the cost of monitoring Mattermost with Prometheus and Grafana?
The cost comes from four places: infrastructure, storage, implementation and the people who run the stack afterward. Prometheus and Grafana are open source and carry no license fee for the projects themselves, so the spend is servers or cloud capacity for the monitoring tier, disk for metrics history, and the labor to configure scraping, dashboards, alerts and access. Storage grows with the number of cluster nodes and the retention period you choose, since Prometheus keeps 15 days by default and retention can be set by time or size. Ask any partner for a quote that lists each component separately, including who pays for hosting, who builds the dashboards and who maintains them after go-live.
How long does a Prometheus and Grafana setup for Mattermost take?
Duration depends mainly on how many Mattermost application servers you run, how many environments need monitoring, and whether you already operate Prometheus or Grafana. A single server with a metrics endpoint is a much smaller job than a high availability cluster where every node must be scraped and the dashboards must reflect all of them. Mattermost high availability requires redundant application servers, database servers and load balancers, so the scrape design and dashboard variables must cover each of those tiers. Ask for a timeline tied to a written scope with a named node count, and confirm whether alerting is included.
What does our team need to provide for this engagement?
You will need to supply access to the Mattermost servers, the network paths for scraping, and the hosts where Prometheus and Grafana will run. Your team should also confirm which metrics endpoint settings are permitted in your Mattermost configuration, which network segments can reach the metrics port, and who owns the alert destinations. Grafana's security hardening guidance recommends requiring authentication for the metrics endpoint, so your identity and secrets owners should be involved early. Expect to name a technical owner who can approve changes to scrape configuration and dashboards.
Can our own team set up Mattermost monitoring without outside help?
Yes, a capable platform team can do this in-house, because Prometheus and Grafana are documented open-source projects with packages, Docker images and Helm charts. The work is well defined: enable the metrics endpoint in Mattermost, scrape each node, load the Mattermost dashboards and secure the Grafana instance. The harder parts are sizing the monitoring servers, keeping scrape targets correct as nodes change, and deciding who acts on alerts. If your team lacks time or experience with PromQL and Grafana provisioning, a fixed-scope engagement can cover the build while your staff take over the running system.
Which Grafana edition do we need for SAML login?
SAML is not available in the open-source edition of Grafana. According to the Grafana authentication docs, SAML, team sync, active sync and SCIM provisioning are available only in Grafana Enterprise and Grafana Cloud, while all editions support LDAP, generic OAuth, Entra ID, Okta, GitHub, GitLab and Google OAuth, auth proxy and JWT. If your security policy requires SAML for dashboard access, you will need to price Grafana Enterprise or select an OAuth or OIDC path your identity provider supports. Grafana Cloud pricing is listed on Grafana's pricing page, and the Enterprise tier has a minimum commitment stated there, so confirm current terms directly with Grafana Labs.
What recurring work follows go-live for this monitoring stack?
Monitoring needs continuing care as the platform changes. Prometheus publishes a new minor release cycle every 6 weeks, and a minor release generally stops receiving bug fixes after those 6 weeks, so you must plan upgrades or move to the long-term support line. Grafana releases patches at least monthly and supports each minor release for 9 months. Mattermost also ships a new server version each month, and dashboard panels may need adjustment when metric names change. Retention is a recurring task: local Prometheus storage is not clustered or replicated, so you must size disks, set retention limits and decide whether to send samples to long-term storage through remote write.
Is Prometheus suitable for exact per-request billing or audit counts?
No. The Prometheus documentation says it values reliability over precision and is not a good choice where 100% accuracy is required, such as per-request billing. Use it to watch trends, rates and alert conditions for operations. If you need exact records of user actions or messages for compliance, use the Mattermost audit and logging features and a system built for that purpose. Ask your architect to document which questions the dashboards answer and which must come from another source.
Do we need Mattermost Enterprise to monitor the cluster?
The answer depends on your deployment and your plan. Mattermost high availability clustering is available only on the Enterprise and Enterprise Advanced plans according to the Mattermost pricing page, so a multi-node cluster implies that plan level. Confirm with Mattermost which metrics and endpoints each plan exposes, because a single-node installation can be monitored without a cluster license. Plan prices are not public, so request a written quote from Mattermost that matches your seat count and deployment model.
Keeping Prometheus and Grafana current after go-live
Plan upgrades for the monitoring stack before go-live, because Prometheus and Grafana move on different cadences and both need a maintenance window. Prometheus starts a new minor release cycle every 6 weeks, and a minor release generally stops receiving bug fixes after those 6 weeks. That is too short for a monitoring server that your operations team depends on, so most teams run the long-term support line instead. The current Prometheus LTS line is 3.13, released July 1, 2026 and supported until July 31, 2027, and LTS releases receive bug fixes for one year. Confirm which line you deploy, record its end-of-support date, and schedule the move to the next LTS line before that date arrives. Track the Prometheus GitHub releases page for patch versions within your line.
Grafana follows a different pattern. According to Grafana's upgrade guidance, major releases arrive once a year in April or May, minor releases every other month, and patch releases at least monthly. Each minor release is supported for 9 months, and the last minor release of a major version for 15 months. Patch releases often carry security fixes, so assign someone to read the grafana/grafana releases page each month and decide whether a patch can wait for the next window. Also review the Grafana security hardening settings after each major upgrade, since default behavior and recommended controls can change between versions. Verify that your dashboards, provisioned data sources and alert rules still load after each upgrade in a staging copy.
Read the Mattermost server release schedule alongside both cadences. Mattermost publishes server binaries on the 16th of each month, and its Extended Support Releases give longer support windows for the server itself. Use those dates to pick Grafana and Prometheus maintenance windows that do not coincide with a Mattermost upgrade, so that a failed change can be traced to one component. Confirm the Mattermost version you run against the metrics endpoint documentation before each upgrade, since metric names and dashboard panels can depend on the server version. Keep a written calendar that lists each component, its current version, its end-of-support date and the owner who approves each change.

