Skip to content

Is every replica reporting? Monitoring coverage agents across a fleet

By Melih Sakarya · Published · 6 min read

Bu yazının Türkçesi →

CoverOps Agents screen, live fleet: service replicas marked up or idle, the list refreshing every five seconds

Short answer

A coverage number is only as complete as the processes behind it. When a service runs as five pods in two environments, you need to see that all five are reporting before you trust the run. Here is how the CoverOps live fleet shows every replica, how replicas merge in a run, and what to check after a rollout.

Short answer: before you trust a coverage number from a deployed system, check that every process behind it is reporting. In CoverOps that is one screen: the live fleet on Agents lists every replica of every service as its own row, marks it up when it reported in the last 90 seconds and idle otherwise, and refreshes every 5 seconds. Five pods of the orders service are five rows grouped under orders, each with its environment, language, IP and agent version. On the run page the same pods merge into one service card that says how many pods reported and lights up while the service is receiving traced traffic.

Why a missing replica matters

In a test environment that runs more than one copy of a service, a load balancer decides which pod handles each request. If one of five pods started without its agent, or with an agent that cannot reach the server, the requests routed to it are not measured. Nothing fails. The run still shows a coverage number for the service, built from the four pods that did report, and per-test chains that passed through the fifth pod stop there.

The same happens after a rollout that brought up pods from an image built without the agent, or with an old agent version. You only find out if you can see the fleet.

The live fleet

CoverOps Agents screen, live fleet: service replicas marked up or idle, the list refreshing every five seconds

The fleet panel opens folded to one line of cards: All, plus one card per runtime (Java, Node.js, .NET, Go, PHP, Python and others) with its up and total count. Click a card to open the table filtered to that runtime. When open, you can:

  • filter by service, pod, IP or environment;
  • show only replicas that are up;
  • group by service (the default), by environment, by language, or not at all.

Groups are ordered busiest first and their headers show up / total. Within a group, live rows come first. Each row has the status, service and pod, language, environment, IP, the version the agent announced at start-up, and the time of its last report.

Two details make the status trustworthy. First, an agent polls the server every flush cycle, and that poll counts as a heartbeat, so a service that is running but idle stays up even when it has no new coverage to send. Second, a replica that stops reporting simply ages out: it turns idle after 90 seconds and drops off the list after 7 days, so pods that a rollout replaced do not clutter the screen for long.

Up is not the same as live

The fleet answers "is the process alive and talking to CoverOps?". The run page answers a different question: "is this service receiving traced traffic right now?". Each service card there carries a green live mark when the service sent a trace frame in the last 10 seconds, and the mark fades 10 seconds after the last one.

Run detail service cards during a run: services flashing a green live mark while their coverage percentages change

Read together, they separate the two failure modes. A replica that is up on the fleet but whose service never goes live during the suite is alive and not being reached, or not traced. A service that goes live but has fewer pods than you deployed is missing replicas.

How replicas are told apart and merged

Every agent sends the replica it runs as on every report. It is COVERAGEOPS_INSTANCE, and by default the host name, which in Kubernetes is the pod name, so most clusters need nothing extra:

env:
  - name: COVERAGEOPS_ENVIRONMENT
    value: preprod
  - name: COVERAGEOPS_TRACE
    value: "true"
  # COVERAGEOPS_INSTANCE defaults to the host name: the pod name in Kubernetes

Inside a run, each pod is its own participant, because each counts from its own start. The run shows the service once, with the pods merged: a line any pod ran is covered. Within a run a participant's coverage only grows. Each upload is that process's running total, so two uploads of one pod are merged by taking the larger count per line, and a process that restarts mid-run keeps what it had covered before.

On the run page, a card that merged several replicas says N pods; hover it for their names. It also shows the agent version, or pre-versioning for agents too old to report one, which is the quickest way to catch a pod still running an old build.

Top of a CoverOps run: merged coverage across services and one card per application with its pod count

Environments

COVERAGEOPS_ENVIRONMENT names the environment on every report; when it is not set, the agent token's environment applies. Names are compared in lower case. One run or monitoring window can hold pods of several environments without mixing them, because each pod's report is its own. When a run holds more than one environment, the run page offers an Environment filter, and the fleet can be grouped by environment. One token can serve every environment.

Production is treated deliberately. Environment names starting with prod, production, prd or live count as production, and registering or reporting from one is accepted only when your account includes production monitoring. Without it, a pod labelled production is refused rather than quietly counted.

Other things the screen tells you

  • Trace sampling over 7 days. Per service: requests, the share whose code was recorded, routes, and routes that were never watched. Click the count to list those routes.
  • Registrations. Each token is tracking when it reported in the last 2 minutes. That is per token, not per replica; the fleet's 90-second rule is per replica.
  • Server-side settings. Tracing, sampling, flush interval and log level can be changed for the whole project and are applied by every agent on its next poll, without a restart. Turning tracing on only works for agents started with tracing woven in.

When CoverOps is unreachable

A fleet check is also a check that the monitoring does not hurt the service. Agents retry on their own thread, never on the application's: after the server's Retry-After or a growing random wait, at most 5 tries and 30 seconds per upload. Coverage is cumulative and goes whole on the next cycle; traces and per-test lines wait in bounded queues. At shutdown the last flush gets at most 10 seconds in all, so a pod never hangs on the way down.

A check after every rollout

  1. Open Agents, group by service, and turn on Only up. Compare each service's up count with the replica count you deployed.
  2. Group by environment and confirm no pod reports under the wrong one.
  3. Scan the version column for a pod still on an old agent.
  4. Start the suite, open the run, and watch each service card go live. A service that never does is not reached or not traced.

Limits

  • The fleet shows processes that report. A pod started without an agent is invisible to it; compare counts with what you deployed.
  • The list holds at most the 500 most recently seen replicas.
  • An agent too old to send its replica puts all its replicas into one shared participant.
  • Up means alive and talking to CoverOps, not that tests reached it. Use the run page for that.

This post is part of the series that starts with functional test coverage in distributed systems. For watching a run as it happens, see real-time code coverage. The agents guide lists every column and rule, and the deployed test coverage page has the product summary.

Related posts

  • Parallel functional tests and per-test coverage: what stays exact, what is shared

    Functional suites run in parallel to fit into CI, and every parallel test hits the same long-running services. Line counters cannot say which of two simultaneous requests ran a line. Here is what CoverOps keeps exact anyway, what it shares and labels, how each agent draws the line, and how to keep the shared part small.

  • Paralel fonksiyonel testlerde test bazında coverage: ne kesin kalır, ne paylaşılır

    Fonksiyonel suite'ler CI süresine sığmak için paralel koşar ve her paralel test aynı uzun ömürlü servislere gider. Satır sayaçları, aynı anda gelen iki istekten hangisinin bir satırı çalıştırdığını söyleyemez. CoverOps'un yine de neyi kesin tuttuğunu, neyi paylaştırıp işaretlediğini, her agent'ın sınırı nasıl çizdiğini ve paylaşılan kısmı nasıl küçük tutacağınızı anlatıyoruz.

  • Which test touched which service? Per-test coverage across microservices

    A coverage number per service tells you what the suite ran. It does not tell you what one test ran. Here is what a per-test footprint across microservices contains, where you read it, which parts are always exact, and what it is good for: failure diagnosis, test selection and finding the test that should exist.

See which tests reach your own code

We connect one of your services in a demo and show what your tests executed, and what they never reached.