Skip to Content

How can an AI SRE see which values moved most during error spikes?

Tares gives an AI SRE agent the stats tool, which counts each value of one label in this window against the window before and lists the largest change first. During an error spike you see which values jumped instead of scrolling a busy stream. Every Tares agent has stats by default, next to the read tool, as part of the AI SRE workflow.

How it works

A Tares agent has two built-in tools by default, and both use the same Tares read path:

  • read returns one correlated timeline for an entity.
  • stats returns counts per value of one label, this window against the window before, largest change first.

Both tools cover the sources of the projects the agent’s run is for. If you want the agent to look at other sources, it names them with sources.

The point of stats is the busy stream. When a stream is noisy, reading lines only shows you the latest few, and those are rarely the ones that explain a spike. Stats compares two windows and ranks values by how much their count changed, so the values that moved most are at the top.

The label you count by comes from your source configuration. Each source declares labels with a name, a field and, for one of them, primary. Stats works on one of those labels at a time, for example a service label, an environment label or a status label, depending on what your sources carry.

By default the agent reads and concludes. It does not restart, deploy or ticket anything. Stats is a read, so using it never changes your systems. The full list of built-in tools and how external MCP servers extend them is on the Tools and MCP servers page.

Set it up

  1. Give your source a label for the value you want ranked. For an OpenTelemetry source, the service label reads from the resource attributes, and one label is marked primary:
- name: otel connector: otlp config: labels: - { name: service, field: resourceAttributes.service.name, primary: true }
  1. Check that the source belongs to a project the agent’s run is for. If it does not, have the agent name it with sources.
  2. Run your agent against the project. It already has stats, so you do not register anything.
  3. During an error spike, ask the agent which values of the label moved most. It calls stats on that label and gets this window against the window before, largest change first.
  4. Follow up on the top movers. Ask the agent to use read on the entity at the top of the list to get one correlated timeline for it.
  5. If you also want the agent to act on what it finds, register an MCP server under Settings → MCP servers and opt the agent in under External tools. Each run records the external tools it called.

Start with a label that has a small set of values. A label with few distinct values gives a short ranking that is easy to read at a glance.

What you get

  • A ranked view of the values that changed most between two windows, so a spike points at specific values instead of a wall of lines.
  • A better fit for a busy stream than reading lines, which shows only the latest few.
  • A natural next step: once stats shows the top movers, read gives you a correlated timeline for one entity.
  • Built-in tools that only read, so you can use them freely during an incident. The agent reads and concludes unless you connect external tools.
  • A record on each run of any external tools it called, shown under Runs, if you have opted the agent in to any.

When something else fits

  • If you need the full sequence of events for one entity, use the read tool, which returns a correlated timeline instead of counts.
  • If you want the agent to restart, deploy or ticket something, connect an external MCP server to that agent. Stats alone only reads and ranks.

Still stuck? Get help

Last updated on