Prometheus agent mode for edge and multi-cluster collection

Agent mode turns a Prometheus instance into a scrape-and-forward collector that remote writes to central storage. It removes local queries, rules and alerting, so it fits sites that need collection, not a full monitoring server.

On this page

When Prometheus agent mode fits edge and multi-cluster estates

Agent mode suits a team running many Kubernetes clusters, plants or branch sites that need one central view but cannot, or should not, keep a full monitoring stack at every location. In agent mode, Prometheus scrapes targets and remote writes the samples to central storage. It does not keep a local time series database for queries, evaluate rules or send alerts. Choose it when the local site needs to collect metrics reliably and the decisions about dashboards, rules and paging happen in one central place.

Prometheus collects by pulling metrics over HTTP from targets found through service discovery or static configuration, and it is queried with PromQL. The project is licensed under Apache-2.0, so there is no license fee to pay for the software. Costs come from the infrastructure that runs collectors and central storage, from the storage itself, from implementation work, and from the people who operate the estate. Those people costs are usually the largest and the least visible, so ask a partner to price them explicitly.

Before you adopt the pattern, list what the sites will lose. Local queries stop working during a WAN outage unless you accept buffering and a delay, and alerts that must fire even when the link to the center is down need a home at the site. Confirm with your own engineers which alert rules are safe to evaluate only centrally. Also confirm how your central storage handles late samples from many senders, since reliability of the write path becomes the main concern. The Prometheus docs say the project values reliability over precision, so agree with your risk owners which metrics can tolerate small gaps and which cannot.

Then run a small pilot at two sites with the same scrape configuration you plan to use everywhere. Measure how many series each agent produces, how much disk the write-ahead buffer uses during a simulated link outage, and whether the central side keeps up. Those results, not a generic rule of thumb, should drive sizing and the decision between agent mode and a full server per site.

Agent mode or a full server per site: how to choose

A small number of large sites usually justifies a full Prometheus server at each location. The local server keeps scraping, evaluating rules and sending alerts while the WAN link is down, and operators can run PromQL against the site during an incident without depending on the central environment. The cost is that every site becomes a stateful system you patch, back up and monitor. Local storage is a single node, not clustered or replicated, so each server needs its own storage plan, retention settings and recovery procedure. Expect to run an Alertmanager path per site or agree on a central one, and plan how those two options behave during partitions.

  • Operator load: each full server needs upgrades, disk monitoring, retention tuning and restore testing at its own site.
  • Alert location: rules evaluate locally, so paging keeps working during a WAN outage if the local Alertmanager can reach the on-call channel.
  • Local queries: operators keep PromQL access to recent data at the site, which matters most when the central system is unreachable.
  • Central view: you still need remote write or federation to bring data into a central store for long-term queries and cross-site dashboards.
  • Duplicate data: if both local and central systems evaluate the same rules, plan for duplicate or conflicting alerts.

Confirm with your network team how often each site loses its WAN link and for how long, because that outage pattern decides whether local evaluation is worth its operating cost.",

How agent instances forward samples to central storage

The diagram starts with targets inside each site or cluster, which a local agent scrapes over the site network. The agent does not keep a queryable history; it sends samples through remote write over TLS across the trust boundary to a central long-term store. Separately, each Prometheus server points at every instance of a central Alertmanager cluster rather than a load balancer. Check that the site-to-center path is encrypted, authenticated and allowed through firewalls, and that the agents' own alerting and queries are handled centrally.

Site agents scrape locally and remote write samples across the trust boundary to central storage.

How to set up agent mode across sites

This sequence takes a set of edge sites or clusters from scrape-only collection to a central store that receives every sample, with buffered data that survives a WAN outage. Each step ends with a check so the team knows the site is ready before it moves on.

  1. Confirm the release line and agent mode behavior

    Before any configuration, the platform owner picks the Prometheus release line the fleet will run and reads the release cycle page to confirm which minor release is current, which line is under long-term support, and how long each receives bug fixes. Agent mode is then tested in a lab with the exact version that will ship to every site, so that all agents share one version. Done means the chosen version is written down, every site image pins it, and the team has confirmed in the release notes which flags and remote write behaviors apply to that version.

  2. Define the central remote write receiver

    The central team sets up the long-term storage system that will accept samples over the remote write protocol and decides how it authenticates senders. Options include TLS with client certificates or HTTP basic authentication, and basic authentication should never travel without TLS because credentials would be sent in cleartext. Each site gets its own identity so a single site can be revoked without touching the others. Done means a test sender with a site identity can write one sample and the receiver logs it with the correct identity.

  3. Configure scrape jobs and discovery per site

    Each site's agent gets its scrape configuration, using static targets or the service discovery method that suits its environment, such as Kubernetes discovery inside a cluster or file-based discovery at a remote site with no API access. Relabeling rules are kept identical across sites so series names and label sets match in the central store. Done means the agent's targets page shows the expected targets as up, and a sample count per job matches what the team expects for that site.

  4. Set external labels that identify each site

    Every agent sets external labels such as a site or cluster identifier, which are attached to samples when they leave the site. Without them, series from different sites collide in the central store and queries cannot be filtered by location. The team agrees on label names and value formats in advance and checks them against the naming standard used for the rest of the estate. Done means a query at the central store returns series from each site with the correct site label and no series arrive without one.

  5. Enable TLS and credentials for remote write

    The remote write section on each agent is updated with the endpoint, the TLS settings including the certificate authority and client certificate, and the site credentials created in the second step. Secrets are loaded from files or a secrets manager rather than written in plain configuration where the platform allows it. The team confirms that the agent reaches the receiver only over TLS and that the minimum TLS version on both sides is at least 1.2, as the Prometheus security model describes. Done means the agent reports successful remote write and the receiver rejects a request with a wrong or missing credential.

  6. Verify samples arrive centrally

    The operator compares the agent's remote write metrics with the samples the receiver stores for the same period, checking that the site label is present and that no series are missing for the expected jobs. The team also runs a small set of known queries at the central store and compares results with the agent's own view of the same targets. Any gap is traced to scrape errors, relabeling drops or authentication failures before going further. Done means each site's sample flow matches the expected targets and the team has a record of the baseline.

  7. Simulate a WAN loss and confirm buffered data recovers

    In a test window, the team blocks the route between one site's agent and the central receiver for a defined period agreed with the site owner, then restores it. The agent's remote write queue should hold samples while the link is down and send them after reconnection. The operator checks the agent's queue and failure metrics during the outage and confirms that the central store fills the gap once traffic resumes, with no duplicate or missing series for the outage window. The team should also confirm with the vendor or release notes how long the agent's local buffer lasts and what happens when it fills, since that limit determines how long a real outage can run. Done means the gap closes in the central store and the test result is filed with the site runbook.

What drives agent sizing and cost

Agent mode cost is less about the agent binary and more about how much data each site produces, how far it has to travel, and how many agents your team must keep running. The cards below separate what you pay once during design and rollout from what recurs through infrastructure, upgrades and on-call.

Active series per site

Active series are the main input to memory, CPU and WAL size on each agent, and they vary widely between a single cluster and a branch with a few hosts. Measure the active series each site produces today, including the effect of labels added by relabeling, before you size anything. Ask a partner to quote sizing from measured series counts for each site class, not from a single average. Series counts also set how much data crosses the WAN every day, so they affect the link cost as well.

Scrape interval and target count

Every target scraped at every interval adds samples per second, and the product of targets and frequency sets the write load an agent sends upstream. Tighter intervals on a small set of critical targets cost far less than a fast interval applied across every exporter at a site. Review your scrape configuration per job and record the target count and interval for each. Ask for the quote to state the assumed interval and target count so you can compare it with your own numbers.

Remote write throughput and WAN bandwidth

Agents buffer samples in their write-ahead log and send them through remote write, so a slow or interrupted WAN link builds a queue that must drain later. Check the sustained upload capacity of each site's link, the behavior during an outage, and how much local disk the buffer can use before samples are lost. Remote write tuning settings determine how quickly the queue drains once the link recovers. Ask your partner to show the expected sustained throughput per site and the buffer size it implies.

Central receiver capacity

All agents across every site send to the same central store, so the receiver becomes the shared bottleneck. Its ingestion rate, query load, storage growth and the number of tenants or clusters it accepts all grow as you add sites. Confirm the receiver's supported ingestion limits with its vendor or project and load test with the combined write rate of your largest sites plus a growth margin. Ask the partner to state which receiver is assumed and what happens to the agents when it is unavailable.

Operator effort to run many agents

Each agent is another process to deploy, configure, upgrade and monitor, and the effort grows with the number of sites rather than with the data volume. Recurring work includes upgrades that follow the release cycle, configuration drift across sites, certificate and credential rotation, and on-call response when a remote agent stops shipping data. Count how many agents your team can realistically keep current and factor the time for that work into the comparison. Ask the partner to separate one-time rollout effort from the recurring support hours they expect each quarter.

One-time versus recurring cost

One-time costs include design, configuration templates, the first rollout to each site, and testing of the receiver and failure modes. Recurring costs include infrastructure for the central store and the WAN, cloud or hardware refresh, upgrades, retainer or internal support, and on-call. Because Prometheus is open source under Apache-2.0, the license adds no per-agent fee, so the spend is on people and infrastructure. Ask for a quote that lists each cost as one-time or recurring, with the component it covers.

Configuration options and when each fits

This table compares the main choices for an edge or multi-cluster collection design: agent mode against a full server per site, remote write tuning, site identity, scrape timing, transport security and where Alertmanager runs. Read each row against the site's need for local queries and alerting, and confirm exact flag and config key names in the official Prometheus docs before you publish or deploy.

OptionWhen it fitsTrade-off
Agent mode versus full server per siteSites that only scrape and forward samples to a central store, with little need to query locallyAgent mode gives up local queries, recording and alerting rules, and local alert evaluation
Full server per siteSites that must keep answering queries or firing alerts during a WAN outageEach site needs its own storage, retention, upgrades and backups to run
Remote write queue and batching tuningLinks with high sample rates or variable latency where the default queue backs upLarger queues and batches use more memory and can delay data after an outage; confirm setting names in the remote write docs
External labels for site identityAny multi-site design, so central queries can filter or group by site, cluster or regionLabels must be set consistently at every site; a missing or duplicate label makes series hard to separate centrally
Scrape interval per siteRemote sites on slow links, or sites where a longer interval keeps sample volume and bandwidth in checkLonger intervals lower resolution and can hide short spikes; shorter intervals raise bandwidth and storage cost
TLS and authentication on remote writeAny remote write path that crosses a network you do not fully controlCertificate rotation and secret distribution add ongoing work; basic authentication without TLS exposes credentials
Alertmanager placementCentral Alertmanager when alert rules run in a central store; local Alertmanager only if a site evaluates its own rulesAgent mode does not evaluate alert rules, so site-level alerting needs a separate server or a central rule path

Securing agents, remote write and central receivers

Every agent is an HTTP surface that scrapes targets and accepts configuration, and every remote write path carries metrics off site. The controls below cover transport, authentication, admin endpoints, the missing single sign-on layer and exporter misuse, and they should be checked at each edge site and at the central receiver alike.

TLS and client certificates

Prometheus supports TLS and client certificate authentication with TLS 1.2 as the minimum. Use it on the remote write path between each agent and the central receiver, so metrics and credentials do not cross the WAN in cleartext. Check that every agent verifies the receiver's certificate, that client certificates are issued per site, and that rotation has a documented owner and procedure before the first expiry.

Security model

Basic auth only over TLS

HTTP basic authentication uses bcrypt-hashed passwords, but without TLS the credentials travel in cleartext. Treat basic auth as acceptable only when the connection is already encrypted end to end. Confirm that no agent or receiver endpoint is reachable over plain HTTP, including health and metrics paths on alternate ports, and record which credentials are shared between sites and which are unique.

Admin APIs off by default

Admin HTTP APIs are disabled by default. The --web.enable-admin-api flag enables destructive operations such as deleting series, and --web.enable-lifecycle enables reload and shutdown endpoints. Keep both off on edge agents unless a runbook needs them. If a reload is needed, use a configuration management pipeline that is authorized to call it, and audit who can reach the endpoint at all.

No built-in single sign-on

Prometheus has no built-in single sign-on, and its security model notes there is no built-in CSRF protection on mutating endpoints. Place an authenticating reverse proxy in front of the web UI and API on each site or on the central query tier, and connect it to your identity provider. Confirm that direct access to the backend port is blocked so the proxy cannot be bypassed.

Exporter abuse through URL parameters

Exporters such as SNMP and Blackbox take their targets from URL parameters. Anyone with HTTP access to them can make the exporter send requests to arbitrary endpoints, which at an edge site may reach internal services that the site was never meant to expose. Restrict exporter access to the local Prometheus agent, limit the destinations each exporter may probe, and review which jobs pass targets through parameters.

Segmented networks for agents

Agents are still HTTP surfaces, so their location matters as much as their configuration. Place each agent on a segmented network that allows scrape traffic to its targets, outbound remote write to the receiver, and nothing else. Restrict inbound access to the agent's web port to administrators and the proxy, and confirm that the receiver accepts writes only from known agent identities.

Questions buyers ask about agent mode rollouts

How does running Prometheus agent mode cost compare with a managed Prometheus service?

Prometheus is Apache-2.0 licensed, so the software itself has no license fee. The cost of agent mode is the infrastructure that runs the agents, the central storage that receives remote write, the network traffic between sites, and the people who build and operate both. A managed service bills for ingestion, storage and queries, so the comparison depends on sample volume, series count, retention and how many sites you run. Ask any provider for the pricing model in writing, then model it against your own series counts and retention. Agent mode also keeps a small local footprint per site, which lowers per-site hardware compared with a full server, but it does not remove the central storage cost.

How long does an agent mode rollout take, and what drives the duration?

Duration depends mainly on the number of sites and clusters, how many distinct exporters and service discovery configurations each site needs, how standard the sites are, and how much of the central receiving side is new to your team. Other drivers are change approval windows, the number of network paths that must be opened, and how long you spend validating that every expected series arrives centrally. A pilot site followed by a repeatable configuration template usually shortens the later rollouts. Ask a partner for a timeline tied to a written list of sites, scrape targets and acceptance checks, not a generic duration.

What does the client team need to provide for agent mode, such as network paths and certificates?

Agent mode needs a working path from each site to the central remote write endpoint, usually allowed through the firewall for the agent's outbound connection, plus DNS resolution for that endpoint. Each site also needs reachable scrape targets on the local network. On the security side, you need a certificate authority or an approved process to issue client certificates or credentials for remote write, and a plan for rotating them. Your team should also supply the list of exporters, service discovery sources, label conventions and the owner of the central storage. Confirm these requirements with your network, security and platform teams before the work is scoped.

Can our internal team roll out Prometheus agent mode alone?

Yes, a team with Kubernetes or Linux operations experience and some Prometheus knowledge can run agent mode alone, especially for a few sites with similar configuration. The harder parts are usually the central receiving side, cardinality control across many sites, and tuning remote write so a WAN interruption does not cause data loss or memory pressure. Check whether your team has done remote write tuning, certificate rotation across sites and scrape troubleshooting at scale. Where those skills are thin, a fixed-scope engagement can cover design, build and handover while your team keeps ownership of the running system.

What happens to alerting when the WAN link between a site and central storage is down?

Agent mode does not evaluate rules or send alerts, so an alert for a site cannot fire from the agent while the WAN is down. Alerting depends on the central Prometheus or other rule evaluator reading the data, which stops receiving new samples during the outage. The practical answer is to design for that gap: use an alert on missing data (such as absent series or stale targets) evaluated centrally, add a dead man's switch or heartbeat, and where a site must alert locally, run a small full Prometheus server or an independent check there. Also confirm how much data the agent buffers in its write-ahead log during an outage, and test the behavior by cutting the link in a non-production environment.

What should we ask a partner to include in a fixed-scope quote for agent mode?

A fixed-scope quote should state the written list of sites, clusters and scrape targets in scope, along with the configuration design for each agent and the central receiving components. It should name the deliverables, including configuration as code, sizing notes, runbooks, dashboards or alerts for the agents themselves, and the acceptance checks used to prove that expected series arrive. Ask for the assumptions about network paths, certificates, and client responsibilities, what happens if those assumptions change, and how the work is priced and invoiced. Also ask what is one-time and what recurs, such as upgrades, retainers, and support, and how handover to your team is handled. DeployOpen agrees scope, deliverables and timelines in writing before work starts, and quotes follow from that written scope.

Keeping agents on a supported release line

Agents at the edge need a release plan before they need a configuration plan. Prometheus starts a new minor release cycle every 6 weeks, and a minor release generally stops receiving bug fixes once those 6 weeks have passed, so a fleet pinned to a minor version can fall out of support within a single quarter. For fleets that must stay stable for longer, the long-term support (LTS) lines receive bug fixes for one year. The current LTS line is 3.13, released July 1, 2026 and supported until July 31, 2027, and the LTS 3.5 line reached end of life on July 31, 2026. Put the LTS end date in the fleet's upgrade calendar, and confirm the current dates on the Prometheus release cycle page before you commit to a line.

Upgrading a handful of agents is routine, but upgrading dozens of agents across sites is a rollout with its own sequence. Start with one site that is representative of the others, then move the rest in waves so that a problem affects a bounded group of sites. Before each move, check remote write compatibility with the central receiver, since the agent and the receiver are upgraded on different schedules and must agree on the protocol and on the labels and metadata they exchange. Ask the receiver's vendor or project which Prometheus versions and remote write settings it has been tested against, and keep a rollback path to the previous agent build for every site. Record each agent's version in your inventory so that an agent running an unsupported line is visible before it becomes an audit finding.

Agent mode also changes what an upgrade can break. An agent holds no long-term data and runs no local rules or alerts, so a failed upgrade usually shows up as missing samples in central storage rather than as a local outage. Watch the central side during each wave: sample counts per site, remote write failures and lag, and the time since each agent last sent data. Confirm with your receiver operator how long it can hold samples during an outage, because that window decides how much data you can recover if an agent restart or upgrade goes wrong.

How DeployOpen scopes and delivers agent mode rollouts

DeployOpen plans, implements, documents and supports self-hosted open-source platforms inside the client's own infrastructure, including the central Prometheus servers and the agent fleets that feed them. For agent mode, the work starts with a written map of which sites scrape locally, which central store receives samples, and which alerting and query duties stay on full servers.

How we scope

  • Inventory every edge site and cluster, its target count, network path to the central store and whether it must keep working during a WAN outage
  • Record which functions stay local (queries, rules, alerting) and which move to central storage or a full server, in writing before build
  • Agree the fixed scope, deliverables and timeline in writing before work starts; ongoing support is available as a retainer
  • Ask for a quote that itemizes agent configuration, remote write endpoints, central storage sizing, testing and handover documentation

How we build

  • Deploy agents from configuration managed as code, with one reviewed template per site type and per-site overrides kept small
  • Configure remote write with queue settings tested against the expected WAN latency and bandwidth limits of each edge location
  • Set external labels consistently so every agent's samples can be identified, filtered and deduplicated at the central store
  • Test restart behavior, WAL replay after failure and the central store's behavior when an edge site goes silent

How we hand over

  • Document the sites, agents, remote write targets, labels and the functions that remain on each full server or central system
  • Deliver a runbook covering agent upgrades, configuration rollout, target onboarding and checks that a site has stopped sending data
  • Provide the alert rules and dashboards that detect stalled remote write and missing sites, with the tests used to verify them
  • Walk through the handover with the operations team so they can run upgrades inside their own change process

How we support

  • Support covers agent version upgrades on the Prometheus release cycle and planned moves between long-term support lines
  • Retainers can include scheduled retesting after configuration changes, new sites or changes to the central storage tier
  • Ask the support provider which releases are covered and how security fixes are delivered to agents in air-gapped or firewalled sites
  • Confirm who owns alert routing, on-call response and the Alertmanager cluster, since agent mode does not evaluate alerts locally

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.