Skip to content

observe_alerts_create

Create an alert rule for this product.

Tool

observe_alerts_create

Create an alert rule for this product.

Create an alert rule for this product. error_rate counts error events in the window; log_match counts log lines matching a Lucene expression, the same one observe_logs_search takes. The rule fires when the count reaches the threshold and resolves when it drops back below it; throttleMinutes is how long it stays quiet after firing. An expression that cannot be parsed is rejected here rather than failing silently on every evaluation.

Behavior

HTTP
POST /observe/alerts

Arguments

NameTypeRequiredDescription
kindstringerror_rate counts error events in the window; log_match counts log lines matching q
namestringWhat to call the rule, up to 200 characters
enabledbooleanfalse registers the rule without evaluating it
conditionobjectThe kind’s parameters
throttleMinutesintegerHow long after firing the rule stays quiet. Default 60, up to a week

Response

FieldTypeAlwaysDescription
idstringIdentifier of the rule
kindstringWhat the rule measures
namestringHuman name the rule was registered under
statestringfiring means the condition is met right now
enabledbooleanWhether the evaluator measures it every minute
conditionobjectThe kind’s parameters: threshold and window, plus q for log_match
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 timestamp of the last change
lastFiredAtstringISO 8601 time it last fired, or null
throttleMinutesnumberHow long after firing the rule stays quiet

Try it

Create an alert rule for this product.

When to use

Create an alert rule for this product. error_rate counts error events in the window; log_match counts log lines matching a Lucene expression, the same one observe_logs_search takes. The rule fires when the count reaches the threshold and resolves when it drops back below it; throttleMinutes is how long it stays quiet after firing. An expression that cannot be parsed is rejected here rather than failing silently on every evaluation.

Example

Ask your agent something like this:

Create an alert rule for this product.

The agent will invoke observe_alerts_create with these arguments:

{
  "kind": "<kind>",
  "name": "<name>",
  "condition": "<condition>"
}

Esc

Start typing to search the docs.

navigateselect