---
title: Alert
description: What an alert is in Prefactor, who can raise one, and how threshold
  rules raise and clear alerts for you.
editUrl: true
head: []
template: doc
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

An alert is a notice on one agent instance that something needs attention. It stays active until the cause goes away, then clears and stays on the instance as history.

Each alert has a name, a severity of Critical, Error, Warning, or Info, and a payload with the details behind it. An alert is either raised or cleared. While it is raised, the instance's Alerts tab shows it as active. Once it clears, it keeps its raised and cleared times, so you can see how long the problem lasted. Raising an alert that is already raised updates it instead of creating a second one, and raising it again shortly after it clears reopens the same alert.

Two parties raise alerts. Your agent's integration raises the alerts only it can know about, such as a failed validation or an unreachable downstream service. Each name must be declared in the agent's [activity schema](/platform/concepts/activity-schema), and the payload has to match the schema declared for that name. Prefactor raises the alerts it can see itself: runs that take too long, runs that go quiet, and runs that keep failing.

## Threshold rules

Threshold rules tell Prefactor what "too long" and "too many" mean for an [agent](/platform/concepts/agent). Each agent has four rules. All four are off until you turn them on, and each has a limit and a severity.

### Running duration

The rule raises "Agent instance running too long" (`prefactor:instance_running_too_long`) when an active instance has been running for the limit or longer. The limit is in minutes, and the alert clears when the instance finishes.

### Inactivity

The rule raises "Agent instance inactive" (`prefactor:instance_inactive`) when an active instance goes the limit without recording a new [span](/platform/concepts/span). The limit is in minutes, counted from the instance's start if it hasn't recorded any span yet. The alert clears when the instance records another span or finishes.

### Failed instances

The rule raises "Failed live instances" (`prefactor:failed_instance_count`) when the number of failed instances reaches the limit. Prefactor raises one alert for the whole agent, on its most recent failed instance. The count covers every failed live instance the agent has ever had, with no time window, so in practice the alert clears only when you raise the limit or turn the rule off.

### Completed duration

The rule raises "Agent instance completed too slowly" (`prefactor:instance_completed_too_long`) when a completed instance took longer than the limit from start to finish. The limit is in minutes, with a built-in 10 percent margin: with a limit of 10 minutes, a run raises the alert only if it takes longer than 11 minutes. Each slow instance gets its own alert. When you turn the rule on, Prefactor also checks instances that completed earlier and raises an alert for each one that exceeded the limit. Those alerts don't send [Slack notifications](/platform/notifications).

### How rules run

Prefactor checks the rules every minute and again whenever a live instance changes status, so an alert can lag its cause by about a minute. Rules look only at instances with the **Live** purpose, so evaluation and smoke-test runs never raise alerts. Rules also skip the sample agents Prefactor creates for demos. When you change a limit or severity, the next check updates the alerts that still apply and clears the rest. Turning a rule off clears the alerts it raised. The four alert names are reserved, so your own agent can't raise them.

Rules only raise alerts. They never stop or end a run.

## In the Admin UI

- [Agent page › Alerts tab](/admin-ui/agent/alerts) — turn rules on, set limits and severities.
- [Agent instance page › Alerts tab](/admin-ui/agent-instance/alerts) — the alerts raised on one run, with their payloads and history.
- [Account page › Integrations tab](/admin-ui/account/integrations) — send a Slack message whenever an alert is raised or cleared.

## Related concepts

- [Agent](/platform/concepts/agent) — threshold rules belong to an agent.
- [Instance](/platform/concepts/instance) — every alert is raised on one instance, and the rules measure instance runs.
- [Activity schema](/platform/concepts/activity-schema) — declares the alert names and payload shapes your own agent can raise.
- [Span](/platform/concepts/span) — the inactivity rule watches for new spans.