Skip to content
KOPAIDocs
Dashboard

Guides

An alert rule watches one metric in your Kopai Cloud workspace. When the metric crosses the line you set and stays there, Kopai posts a message to your Slack channel. When the metric recovers, Kopai posts a second message. Both link to an incident page that shows the metric around the alert, what the service was doing, and what to check first.

A rule reads like a sentence. For example: “Tell me when the average of http.server.duration for checkout-api goes above 800 ms and stays there for 5 minutes.”

You can write rules in the dashboard’s editor, as this page shows first, or have an AI assistant create them.

  • A Kopai Cloud workspace that receives metrics. A rule watches one metric of type Gauge, Sum, Histogram or Summary. It cannot watch traces or logs. Kopai Cloud covers sending telemetry.
  • The owner or admin role. Members can see rules, incidents and where alerts are sent, but cannot change them.
  • A Slack channel for alerts. Every alert in the workspace posts to this one channel.

Kopai posts alerts to one Slack channel per workspace. Kopai calls it the Slack target.

  1. Open Alerting › Targets in the dashboard sidebar.
  2. Click Add to Slack. Slack asks which channel the Kopai alerts app may post to. Pick your alert channel and allow it.
  3. Slack sends you back to Kopai. The page shows the target with the badge Untested.
  4. Click Send test message. A message that reads TEST · Kopai alert target check · no action needed appears in the channel, and the badge changes to Delivering.

The Kopai alerts app asks Slack for one permission: to post to the channel you pick. It cannot read your messages. Kopai stores the channel’s webhook address encrypted and never shows it in full again.

Three other things you can do on this page:

  • Use a webhook you made yourself. Create an incoming webhook in Slack for the channel. Its URL starts with https://hooks.slack.com/services/. Before a target is connected, click Paste a webhook URL instead and paste the URL. On a connected target, the button is Paste a URL instead.
  • Move alerts to another channel. Click Reconnect Slack and pick the new channel. Send a test message afterwards.
  • Stop posting. Click Remove. Kopai keeps checking the rules and keeps the alerts in the history, but posts nothing until you connect a target again. The Kopai alerts app stays installed in your Slack workspace until you remove it there.

Open Alerting › Rules and click New alert. The editor has five parts.

  1. Which service? Pick the service to watch, or keep any service. The next part offers the metrics that this service reports.

  2. What should trigger it? Fill in the blanks of the sentence:

    Tell me when the average of http.server.duration for checkout-api goes above 800 ms and stays there for 5 minutes

    Under the sentence, Kopai reads the rule back in plain words (“In other words: …”). Check that it says what you mean.

  3. How urgent is it? Pick Heads-up, Needs attention or Critical. Urgency marks the Slack message. It does not change where the message goes.

  4. Who should know? This part shows the Slack target from Step 1.

  5. Name it. Give the alert a name and a one-line summary, or keep the suggestions. Under What should the person who gets this do first?, write the first thing to check. Kopai shows this note in the Slack message and on the incident page.

Click Save alert. The rule appears in the list with the status On, and Kopai starts checking it. To save a rule without starting it, turn off Turn on as soon as it’s saved first; the rule is then saved as Paused.

The measure is the number Kopai compares with your threshold. Which measures the editor offers depends on the metric’s type:

Metric type Measures
Gauge the average, the lowest value, the highest value
Sum that only counts up (a counter) the increase, the rate per second
Sum that goes up and down the average, the lowest value, the highest value
Histogram p50, p90, p95 or p99, the average, the number of observations, the number of observations per second
Summary the quantiles the metric sends, for example p95

p95 is the value that 95% of the observations stay under. Kopai looks at the metric’s last day of data and offers only the measures that fit it. The editor does not offer exponential histograms.

In the sentence, Add a condition keeps only the datapoints where an attribute has one exact value, for example http.route is /checkout. A rule can have up to 10 conditions, the service included.

A rule computes one value across everything its conditions match, and raises one alert. To get a separate alert for each of three services, create three rules.

With the default timing, Kopai does this for every rule:

  1. Every minute, it computes the measure over the last 5 minutes. The window ends 2 minutes in the past, so datapoints that arrive late are counted.
  2. When the value crosses the threshold, Kopai waits. The alert fires only when the value has stayed past the threshold for 5 minutes in a row. Kopai then posts the FIRING message.
  3. When the value has stayed back on the good side of the threshold for 5 minutes, Kopai posts the RESOLVED message.

With these defaults, a problem reaches Slack about 15 minutes after it starts, at worst. This is an estimate, not a guarantee. The editor shows the estimate for your own settings under Advanced timing, where you can change them:

Setting Default Choices What it does
stays there for (in the sentence) 5 minutes no time, or 1, 2, 5, 10, 15, 30 or 60 minutes How long the value must stay past the threshold before the alert fires. With no time, the alert fires at once.
Measure over the last 5 minutes 1, 2, 5, 10, 15, 30 or 60 minutes, or 6 hours The window the measure is computed over. It cannot be shorter than Check every.
Check every 1 minute 1, 2, 5, 10, 15, 30 or 60 minutes How often Kopai checks the rule.
Allow late data for 2 minutes 1, 2, 5, 10 or 15 minutes How far in the past the window ends, so slow-arriving datapoints are counted.
Keep firing for 5 minutes no time, or 1, 2, 5, 10, 15, 30 or 60 minutes How long the value must stay recovered before the alert resolves.

Shorter times reach Slack sooner and fire more often on short spikes.

A FIRING message looks like this in Slack:

KopaiAPP12:11 PM

FIRING · checkout memory · Checkout API memory above 90%

🔴 FIRING

checkout memory
Checkout API memory above 90%

Observed value
average 93.5
Threshold
above 90 (value > 90)
Metric
system.memory.utilization (Gauge)
Aggregation
average (AVG) over a 5 min (300 s) window
Filters
resource attribute service.name = checkout-api datapoint attribute state = used
Window (UTC)
2026-10-13T12:04:00Z to 2026-10-13T12:09:00Z, offset 2 min (120 s)

Runbook note
Restart the pod. Then check the heap dump.

Severity: criticalCondition first met: 2026-10-13T12:06:00ZFired at: 2026-10-13T12:11:00Z

  • The rule’s name links to the incident page.
  • The coloured bar shows the urgency: red for Critical, orange for Needs attention, blue for Heads-up. A RESOLVED message is green.
  • Aggregation is the rule’s measure and its window. Filters are the rule’s service and conditions. Runbook note is what you wrote under “What should the person who gets this do first?”.
  • Condition first met is the time the value first crossed the threshold. Fired at is later, because the value has to stay there first.
  • A histogram percentile is an estimate, so Kopai writes it with ≈, for example p95 ≈ 480 ms. When the value falls in the histogram’s last bucket, Kopai can only say that it is above that bucket’s edge, and writes p95 > 1 s.
  • The message mentions no one. Who gets a notification depends on each person’s Slack settings for the channel.

Kopai posts once when the alert fires and once when it resolves. The RESOLVED message is a new message in the channel, not a reply in a thread. It links to the same incident page and adds a Resolve reason:

Resolve reason in Slack What happened
recovered (the condition stopped being met) The value went back to the good side of the threshold and stayed there.
no_data (no data arrived for the rule) The metric stopped arriving. This can be the problem getting worse, not a recovery.
rule_changed (what the rule measures was changed) Someone changed the rule’s service, metric, measure, conditions or window.
rule_disabled (the rule was disabled) Someone paused the rule.
rule_deleted (the rule was deleted) Someone deleted the rule.
tenant_inactive (the tenant is no longer active) The workspace is no longer active.

Each alert has one incident page. The FIRING and the RESOLVED message both link to it. In the dashboard, the Last fired column of the Rules list opens a rule’s latest incident. The page shows:

  • A headline in plain words, such as “checkout-api has been slow for 12 min.”, with the time the metric crossed the threshold, its peak, and the time it came back.
  • The metric around it: a chart with the stretch before the incident in grey and the incident in colour.
  • The service during the incident, when the rule watches one service: requests per minute, failed requests and the slowest 5% of requests, compared with the time before. Below that, the operations that got worse the most and the error logs the service wrote. For a rule on any service, a breakdown of the metric by its attributes takes this place.
  • What to do: your runbook note.
  • Take it yourself: Open traces and Open logs open the incident’s time range.
  • Hand it to your agent: Copy the brief copies a description of the incident. Paste it into your coding agent, or post it in the alert’s Slack thread if Claude is in that channel.

To see every time a rule fired, open the rule and choose the Incidents tab.

  • Pause or resume a rule with the switch in the Status column of the Rules list. Pausing a rule resolves its open alert.
  • Edit a rule by opening it. Changing the service, the metric, the measure, the conditions or the window resolves a firing alert, and the rule starts over. Changing the threshold, the other timing or the text keeps the alert firing.
  • Delete a rule from the menu at the end of its row. Kopai resolves its open alert and keeps its past events in the history.
  • A rule marked Stale failed its last three checks, for example because its query timed out. Kopai keeps checking it, and the mark clears after the next check that works. A stale rule posts nothing to Slack.

You don’t have to fill in the editor yourself. An AI assistant can create a rule for you, or prepare one for you to review.

The Kopai connector gives an AI assistant tools for your workspace. It is an MCP server, and MCP is the protocol that assistants use to call tools. It works with Claude, Claude Code and other MCP hosts. Connect it once, then ask in plain words:

  • “Alert me when the average response time of checkout-api stays above 800 ms for 5 minutes.”
  • “Would that alert have fired in the last 7 days?”
  • “Is anything firing right now?”
  • “Pause the checkout memory alert.”

With the connector’s tools, the assistant can find the metric, check whether a rule already watches it, estimate how often the new rule would have fired over the last 24 hours or 7 days, and create the rule. The estimate is not a replay of real checks.

What the assistant may do depends on how it is connected:

Connection The assistant can
Signed in as an owner or admin Read rules and alerts, and create, change, pause and resume rules
Signed in as a member Read rules and alerts
A CLI token, whatever your role Read rules and alerts
An agent token, used by Claude in Slack Read rules and alerts, and create rules only if an owner allows it
  • A rule the assistant creates is yours. Kopai records you as its creator, as if you had saved it in the editor. It shows in the Rules list like any other rule.
  • The assistant gets back a link to the rule in the editor. Ask for it to check what the assistant made.
  • No tool deletes a rule or changes the Slack target. Do that in the dashboard.
  • An assistant that may not create rules can still prepare one. Ask it to build a pre-filled link in the format described next. The assistant encodes the rule itself, so this works best with one that can run code, such as a coding agent.

Connect AI Assistants explains how to connect an assistant.

A pre-filled link opens the New alert editor with a rule already filled in. An assistant, a script or a teammate can make one. Kopai saves nothing until an owner or admin clicks Save alert, and a link can never change an existing rule.

The link is the editor’s address plus the rule as JSON, encoded with base64url and without padding:

https://app.kopai.app/alerts/rules/new?draft=<payload>

For example, save this rule as rule.json:

rule.json
{
"name": "checkout-api slow responses",
"metricName": "http.server.duration",
"metricType": "Histogram",
"aggregation": "AVG",
"filters": [
{ "scope": "resource", "key": "service.name", "value": "checkout-api" }
],
"comparison": "gt",
"threshold": 800,
"forSeconds": 300,
"severity": "warning",
"summary": "Average http.server.duration for checkout-api above 800 ms for 5 minutes"
}

Then build the link:

Terminal window
node -e 'console.log("https://app.kopai.app/alerts/rules/new?draft=" + Buffer.from(JSON.stringify(require("./rule.json"))).toString("base64url"))'

Open the link, and sign in if the dashboard asks. The editor shows the rule with the notice “This alert was filled in from a link. Check it and press Save; nothing is saved until you do.”

The threshold is in the metric’s own unit. http.server.duration reports milliseconds, so 800 means 800 ms. For a metric that reports seconds, such as http.server.request.duration, write 0.8.

A rule in a link can carry these fields. Leave out the ones you don’t need, and the editor uses its defaults:

Field Value
name The alert’s name, up to 120 characters.
metricName, metricType The metric and its type: Gauge, Sum, Histogram or Summary. Always send the type. Without it, the editor reads the metric as a Gauge and says so.
aggregation The measure: AVG, MIN, MAX, INCREASE, RATE or QUANTILE. For a histogram, INCREASE is the number of observations and RATE is the number of observations per second.
quantile Only with QUANTILE: a number between 0 and 1, such as 0.95 for p95.
filters The service and the conditions, as a list of up to 10 { "scope", "key", "value" }. The scope is resource or datapoint. The service is the resource filter with the key service.name.
comparison, threshold gt, gte, lt or lte, and a number in the metric’s own unit.
forSeconds, windowSeconds, intervalSeconds, offsetSeconds, keepFiringForSeconds The timing settings, in whole seconds, such as 300 for 5 minutes. A value that the editor’s dropdown does not list shows there as an extra choice.
severity critical, warning or info.
summary, runbookNote The summary, up to 200 characters on one line, and the note about what to do first, up to 2,000 characters.
enabled Only true. A rule from a link starts turned on, and you can pause it after you save it.
  • The payload has at most 8,192 characters. The editor refuses a longer link whole.
  • The editor says what it could not use. A field that is not in the table, or a value of the wrong kind, is left out and named above the form.
  • A member can open the link, but cannot save.

Claude can also look into the alerts that your rules produce. There are two ways:

  • In Slack, with Claude Tag. Claude watches your alert channel, answers each alert in its thread with the likely cause, and proposes new rules as pre-filled links. This needs a Claude Team or Enterprise plan. See On-Call with Claude in Slack.
  • On a schedule. Claude checks Kopai on a timer, for example every hour, and reports what is firing and the likely cause. This works from Claude Code, without Slack, and on Claude’s paid individual plans too. See Scheduled Checks with Claude.
  • One metric per rule. A rule cannot watch traces, logs or exponential histograms.
  • One Slack channel per workspace. Urgency does not send a message somewhere else.
  • Two messages per alert: one when it fires and one when it resolves. Kopai sends no reminders while an alert keeps firing. You cannot snooze an alert or resolve it by hand; to stop a noisy rule, pause it.
  • Kopai retries a message for 24 hours. If Slack does not accept a message in that time, Kopai drops it. The alert stays in the history.
  • Text lengths: a name has up to 120 characters, a summary up to 200 on one line, and a runbook note up to 2,000. A metric name has up to 255 characters. In a condition, the attribute name has up to 256 characters and its value up to 1,024.

The page says “This Slack link does not belong to this tab.” The Slack link is older than ten minutes, or you finished in another browser tab. Click Add to Slack again and finish in the same tab.

The page says “Slack didn’t complete the connection.” Slack refused the connection. Read the hint under the message, then click Add to Slack again. If your browser blocks site data, click Paste a webhook URL instead.

The target’s badge is Failing. The last five delivery attempts in a row failed. Retries of the same message count too. Usually someone deleted the webhook in Slack or removed the Kopai alerts app. Click Send test message to see Slack’s answer, then click Reconnect Slack.

The editor refuses the measure you picked. When you save, Kopai checks the metric’s last day of data. A counter takes the increase or the rate per second. A Sum that goes up and down takes the average, the lowest or the highest value. A Summary takes only the quantiles it sends. Pick the measure that the message names.

A rule never fires. Check that the metric still arrives for the service and conditions you picked, because no data never fires an alert. Then check the timing: the value must stay past the threshold for the whole stays there for time.

An alert is under Recent events, but no message came. No Slack target was connected when the alert fired, or Slack did not accept the message for 24 hours. Open Alerting › Targets, connect Slack and send a test message.

The page says “Alerting is paused”. The workspace is not active, so Kopai does not check its rules and you cannot change them. Email hello@kopai.app if you did not expect this.

Each Slack message carries the rule’s name, summary, runbook note, conditions, metric, values and times. Anyone who can read the channel sees them, so choose the channel with that in mind. Kopai keeps a copy of each message it sends. The Privacy Policy describes this under “Alert Destinations”.

Next steps