Alert Management Skill
Use this skill to list, inspect, create, delete, enable, and disable Coralogix alert definitions using the cx alerts CLI commands.
CLI Commands
| Command |
Purpose |
Key flags |
cx alerts list |
List all alert definitions |
--name <filter> |
cx alerts get <id> |
Get a single alert definition by ID |
- |
cx alerts create |
Create an alert from a JSON definition |
--from-file <path> (default: stdin) |
cx alerts delete <id> |
Delete an alert |
- |
cx alerts enable <id> |
Enable an alert |
- |
cx alerts disable <id> |
Disable an alert |
- |
cx alerts events |
List events; use alert-version scoped endpoint when filtering |
--alert-version-id, --start, --end |
cx alerts event-stats |
Get alert event statistics |
- |
cx alerts suppression-rules list |
List suppression rules |
- |
cx alerts suppression-rules get <id> |
Get a suppression rule |
- |
cx alerts suppression-rules create |
Create a suppression rule |
--from-file <path> |
cx alerts suppression-rules update |
Update a suppression rule |
--from-file <path> |
cx alerts suppression-rules delete <id> |
Delete a suppression rule |
- |
Output format: append -o json or -o toon to list, get, and create commands for machine-readable output.
Multi-profile: use -p <profile> (repeatable) to target multiple profiles simultaneously.
Alert Types Reference
Coralogix supports 12 alert types:
| Type enum |
Human name |
Description |
ALERT_DEF_TYPE_LOGS_IMMEDIATE |
Logs Immediate |
Trigger on every matching log entry |
ALERT_DEF_TYPE_LOGS_THRESHOLD |
Logs Threshold |
Trigger when log count exceeds a threshold in a time window |
ALERT_DEF_TYPE_LOGS_ANOMALY |
Logs Anomaly |
ML-based anomaly detection on log volume |
ALERT_DEF_TYPE_LOGS_RATIO_THRESHOLD |
Logs Ratio Threshold |
Trigger on ratio between two log queries |
ALERT_DEF_TYPE_LOGS_NEW_VALUE |
Logs New Value |
Trigger when a new value appears in a field |
ALERT_DEF_TYPE_LOGS_UNIQUE_COUNT |
Logs Unique Count |
Trigger on unique value count threshold |
ALERT_DEF_TYPE_LOGS_TIME_RELATIVE_THRESHOLD |
Logs Time Relative |
Compare current vs past time window |
ALERT_DEF_TYPE_METRIC_THRESHOLD |
Metric Threshold |
Trigger when a PromQL expression crosses a threshold |
ALERT_DEF_TYPE_METRIC_ANOMALY |
Metric Anomaly |
ML-based anomaly detection on metrics |
ALERT_DEF_TYPE_TRACING_IMMEDIATE |
Tracing Immediate |
Trigger on every matching span |
ALERT_DEF_TYPE_TRACING_THRESHOLD |
Tracing Threshold |
Trigger when span count exceeds a threshold |
ALERT_DEF_TYPE_FLOW |
Flow |
Sequence-based alert combining multiple conditions |
Priority Levels
Always ask the user what priority to use when creating alerts:
| Priority |
Use case |
| P1 |
Critical - pages on-call immediately |
| P2 |
High - needs attention within the hour |
| P3 |
Medium - investigate during business hours |
| P4 |
Low - informational, check when convenient |
| P5 |
Info - logging/tracking only |
Create Workflow
- Ask the user what they want to alert on (logs, metrics, traces)
- Ask for priority (P1–P5)
- Build the JSON payload with
alertDefProperties - use the API wire format (see references/alert-schemas.md for all enum values)
- Tip: use
cx alerts get <existing-id> -o json to get a working template, modify it, and pipe into create
- Create using:
echo '<json>' | cx alerts create or cx alerts create --from-file alert.json
- Verify with
cx alerts list --name "<alert name>"
Important structural note: The type field is a string enum (e.g. "ALERT_DEF_TYPE_LOGS_THRESHOLD"), and the alert type config (e.g. "logsThreshold": {...}) is a sibling field at the same level - NOT nested inside type.
Example: Logs Threshold Alert
{
"alertDefProperties": {
"name": "High Error Rate",
"description": "Alert when error logs exceed threshold",
"priority": "ALERT_DEF_PRIORITY_P2",
"type": "ALERT_DEF_TYPE_LOGS_THRESHOLD",
"enabled": true,
"logsThreshold": {
"logsFilter": {
"simpleFilter": {
"luceneQuery": "severity:ERROR",
"labelFilters": {
"applicationName": [
{ "operation": "LOG_FILTER_OPERATION_TYPE_IS_OR_UNSPECIFIED", "value": "my-app" }
]
}
}
},
"rules": [{
"condition": {
"conditionType": "LOGS_THRESHOLD_CONDITION_TYPE_MORE_THAN_OR_UNSPECIFIED",
"threshold": 100,
"timeWindow": {
"logsTimeWindowSpecificValue": "LOGS_TIME_WINDOW_VALUE_MINUTES_5_OR_UNSPECIFIED"
}
}
}]
}
}
}
Example: Metric Threshold Alert
{
"alertDefProperties": {
"name": "CPU Usage Critical",
"priority": "ALERT_DEF_PRIORITY_P1",
"type": "ALERT_DEF_TYPE_METRIC_THRESHOLD",
"enabled": true,
"metricThreshold": {
"metricFilter": { "promql": "avg(cpu_usage_percent)" },
"rules": [{
"condition": {
"conditionType": "METRIC_THRESHOLD_CONDITION_TYPE_MORE_THAN_OR_UNSPECIFIED",
"threshold": 90,
"ofTheLast": { "dynamicDuration": "5m" },
"forOverPct": 100
}
}]
}
}
}
Example: Logs Immediate Alert
{
"alertDefProperties": {
"name": "OOM Killer Detected",
"description": "Alert immediately when OOM killer runs",
"priority": "ALERT_DEF_PRIORITY_P1",
"type": "ALERT_DEF_TYPE_LOGS_IMMEDIATE_OR_UNSPECIFIED",
"enabled": true,
"logsImmediate": {
"logsFilter": {
"simpleFilter": {
"luceneQuery": "\"Out of memory\" OR \"OOM\"",
"labelFilters": {}
}
}
}
}
}
Investigation Workflow
Find firing alerts
# List all alerts and look for ALERTING status
cx alerts list -o json | jq '.[] | select(.status == "ALERTING")'
# Filter by name
cx alerts list --name "error"
Inspect a specific alert
cx alerts get <alert-id>
cx alerts get <alert-id> -o json
Disable a noisy alert (temporary mute)
cx alerts disable <alert-id>
# Later, re-enable:
cx alerts enable <alert-id>
Suppression Rules
Manage alert suppression rules that mute alerts during maintenance windows or known noisy periods.
| Command |
Purpose |
cx alerts suppression-rules list |
List all suppression rules |
cx alerts suppression-rules get <id> |
Get a suppression rule by ID |
cx alerts suppression-rules create --from-file |
Create a suppression rule |
cx alerts suppression-rules update --from-file |
Update a suppression rule |
cx alerts suppression-rules delete <id> |
Delete a suppression rule |
# List suppression rules
cx alerts suppression-rules list -o json
# Create from template
cx alerts suppression-rules get <existing-id> -o json > suppression-rule.json
# Edit suppression-rule.json
cx alerts suppression-rules create --from-file suppression-rule.json
Key Principles
- Always ask for priority (P1–P5) when creating alerts - never assume
- Use
--name filter for large accounts with many alerts
- Use
-o json with jq for filtering and transformation
- Use
--from-file - to pipe JSON from stdin when constructing alerts programmatically
- Verify after create - always list or get the alert after creation to confirm
- Disable, don't delete - prefer disabling alerts over deletion for auditability
- Link to a specific alert -
cx alerts list prints only one "View in
Coralogix" link, to the alerts overview page, not a per-alert link. To
link a user to one specific alert, build <base>/alerts/<alert_id>,
where <base> is the console URL already seen in a `View in Coralogix:
Additional Resources
Reference Files
references/alert-schemas.md - Complete JSON schema reference for all 12 alert types: field names, enum values (condition types, time windows, filter operations), common sub-objects (logs filter, tracing filter, notification groups, activity schedules), and important gotchas
references/dataprime-reference.md - DataPrime query language reference for log-based and span-based alert conditions (filter syntax, operators, severity values)
references/logs-querying.md - Log data model, field discovery, and query patterns for building log alert conditions
references/promql-guidelines.md - PromQL reference for metric-based alert conditions (counters, gauges, histograms, threshold patterns)
references/spans-querying.md - Span data model, duration units, and query patterns for building tracing alert conditions
Related Skills
cx-cases - triage the cases that group alert events into investigations
cx-slos - the SLO definitions whose error-budget burn raises alerts
cx-observability-setup - setting up notification routing and webhook integrations for alerts
cx-telemetry-querying - investigate the telemetry behind a firing alert
1---2name: cx-alerts3description: This skill should be used when the user asks to "manage alerts", "create alert", "list alerts", "delete alert", "check alert status", "enable alert", "disable alert", "investigate firing alerts", "check which alerts are active", "find alerting rules", "set up an alert", "configure alerting", "mute an alert", "silence an alert", "see alert definitions", "check alert priority", or wants to manage Coralogix alert definitions using the cx CLI.4---56# Alert Management Skill78Use this skill to list, inspect, create, delete, enable, and disable Coralogix alert definitions using the `cx alerts` CLI commands.910## CLI Commands1112| Command | Purpose | Key flags |13|---|---|---|14| `cx alerts list` | List all alert definitions | `--name <filter>` |15| `cx alerts get <id>` | Get a single alert definition by ID | - |16| `cx alerts create` | Create an alert from a JSON definition | `--from-file <path>` (default: stdin) |17| `cx alerts delete <id>` | Delete an alert | - |18| `cx alerts enable <id>` | Enable an alert | - |19| `cx alerts disable <id>` | Disable an alert | - |20| `cx alerts events` | List events; use alert-version scoped endpoint when filtering | `--alert-version-id`, `--start`, `--end` |21| `cx alerts event-stats` | Get alert event statistics | - |22| `cx alerts suppression-rules list` | List suppression rules | - |23| `cx alerts suppression-rules get <id>` | Get a suppression rule | - |24| `cx alerts suppression-rules create` | Create a suppression rule | `--from-file <path>` |25| `cx alerts suppression-rules update` | Update a suppression rule | `--from-file <path>` |26| `cx alerts suppression-rules delete <id>` | Delete a suppression rule | - |2728**Output format:** append `-o json` or `-o toon` to `list`, `get`, and `create` commands for machine-readable output.2930**Multi-profile:** use `-p <profile>` (repeatable) to target multiple profiles simultaneously.3132## Alert Types Reference3334Coralogix supports 12 alert types:3536| Type enum | Human name | Description |37|---|---|---|38| `ALERT_DEF_TYPE_LOGS_IMMEDIATE` | Logs Immediate | Trigger on every matching log entry |39| `ALERT_DEF_TYPE_LOGS_THRESHOLD` | Logs Threshold | Trigger when log count exceeds a threshold in a time window |40| `ALERT_DEF_TYPE_LOGS_ANOMALY` | Logs Anomaly | ML-based anomaly detection on log volume |41| `ALERT_DEF_TYPE_LOGS_RATIO_THRESHOLD` | Logs Ratio Threshold | Trigger on ratio between two log queries |42| `ALERT_DEF_TYPE_LOGS_NEW_VALUE` | Logs New Value | Trigger when a new value appears in a field |43| `ALERT_DEF_TYPE_LOGS_UNIQUE_COUNT` | Logs Unique Count | Trigger on unique value count threshold |44| `ALERT_DEF_TYPE_LOGS_TIME_RELATIVE_THRESHOLD` | Logs Time Relative | Compare current vs past time window |45| `ALERT_DEF_TYPE_METRIC_THRESHOLD` | Metric Threshold | Trigger when a PromQL expression crosses a threshold |46| `ALERT_DEF_TYPE_METRIC_ANOMALY` | Metric Anomaly | ML-based anomaly detection on metrics |47| `ALERT_DEF_TYPE_TRACING_IMMEDIATE` | Tracing Immediate | Trigger on every matching span |48| `ALERT_DEF_TYPE_TRACING_THRESHOLD` | Tracing Threshold | Trigger when span count exceeds a threshold |49| `ALERT_DEF_TYPE_FLOW` | Flow | Sequence-based alert combining multiple conditions |5051## Priority Levels5253Always ask the user what priority to use when creating alerts:5455| Priority | Use case |56|---|---|57| P1 | Critical - pages on-call immediately |58| P2 | High - needs attention within the hour |59| P3 | Medium - investigate during business hours |60| P4 | Low - informational, check when convenient |61| P5 | Info - logging/tracking only |6263## Create Workflow64651. Ask the user what they want to alert on (logs, metrics, traces)662. Ask for priority (P1–P5)673. Build the JSON payload with `alertDefProperties` - use the **API wire format** (see `references/alert-schemas.md` for all enum values)684. **Tip:** use `cx alerts get <existing-id> -o json` to get a working template, modify it, and pipe into create695. Create using: `echo '<json>' | cx alerts create` or `cx alerts create --from-file alert.json`706. Verify with `cx alerts list --name "<alert name>"`7172**Important structural note:** The `type` field is a **string enum** (e.g. `"ALERT_DEF_TYPE_LOGS_THRESHOLD"`), and the alert type config (e.g. `"logsThreshold": {...}`) is a **sibling** field at the same level - NOT nested inside `type`.7374### Example: Logs Threshold Alert7576```json77{78 "alertDefProperties": {79 "name": "High Error Rate",80 "description": "Alert when error logs exceed threshold",81 "priority": "ALERT_DEF_PRIORITY_P2",82 "type": "ALERT_DEF_TYPE_LOGS_THRESHOLD",83 "enabled": true,84 "logsThreshold": {85 "logsFilter": {86 "simpleFilter": {87 "luceneQuery": "severity:ERROR",88 "labelFilters": {89 "applicationName": [90 { "operation": "LOG_FILTER_OPERATION_TYPE_IS_OR_UNSPECIFIED", "value": "my-app" }91 ]92 }93 }94 },95 "rules": [{96 "condition": {97 "conditionType": "LOGS_THRESHOLD_CONDITION_TYPE_MORE_THAN_OR_UNSPECIFIED",98 "threshold": 100,99 "timeWindow": {100 "logsTimeWindowSpecificValue": "LOGS_TIME_WINDOW_VALUE_MINUTES_5_OR_UNSPECIFIED"101 }102 }103 }]104 }105 }106}107```108109### Example: Metric Threshold Alert110111```json112{113 "alertDefProperties": {114 "name": "CPU Usage Critical",115 "priority": "ALERT_DEF_PRIORITY_P1",116 "type": "ALERT_DEF_TYPE_METRIC_THRESHOLD",117 "enabled": true,118 "metricThreshold": {119 "metricFilter": { "promql": "avg(cpu_usage_percent)" },120 "rules": [{121 "condition": {122 "conditionType": "METRIC_THRESHOLD_CONDITION_TYPE_MORE_THAN_OR_UNSPECIFIED",123 "threshold": 90,124 "ofTheLast": { "dynamicDuration": "5m" },125 "forOverPct": 100126 }127 }]128 }129 }130}131```132133### Example: Logs Immediate Alert134135```json136{137 "alertDefProperties": {138 "name": "OOM Killer Detected",139 "description": "Alert immediately when OOM killer runs",140 "priority": "ALERT_DEF_PRIORITY_P1",141 "type": "ALERT_DEF_TYPE_LOGS_IMMEDIATE_OR_UNSPECIFIED",142 "enabled": true,143 "logsImmediate": {144 "logsFilter": {145 "simpleFilter": {146 "luceneQuery": "\"Out of memory\" OR \"OOM\"",147 "labelFilters": {}148 }149 }150 }151 }152}153```154155## Investigation Workflow156157### Find firing alerts158159```bash160# List all alerts and look for ALERTING status161cx alerts list -o json | jq '.[] | select(.status == "ALERTING")'162163# Filter by name164cx alerts list --name "error"165```166167### Inspect a specific alert168169```bash170cx alerts get <alert-id>171cx alerts get <alert-id> -o json172```173174### Disable a noisy alert (temporary mute)175176```bash177cx alerts disable <alert-id>178# Later, re-enable:179cx alerts enable <alert-id>180```181182## Suppression Rules183184Manage alert suppression rules that mute alerts during maintenance windows or known noisy periods.185186| Command | Purpose |187|---|---|188| `cx alerts suppression-rules list` | List all suppression rules |189| `cx alerts suppression-rules get <id>` | Get a suppression rule by ID |190| `cx alerts suppression-rules create --from-file` | Create a suppression rule |191| `cx alerts suppression-rules update --from-file` | Update a suppression rule |192| `cx alerts suppression-rules delete <id>` | Delete a suppression rule |193194```bash195# List suppression rules196cx alerts suppression-rules list -o json197198# Create from template199cx alerts suppression-rules get <existing-id> -o json > suppression-rule.json200# Edit suppression-rule.json201cx alerts suppression-rules create --from-file suppression-rule.json202```203204## Key Principles205206- **Always ask for priority** (P1–P5) when creating alerts - never assume207- **Use `--name` filter** for large accounts with many alerts208- **Use `-o json` with `jq`** for filtering and transformation209- **Use `--from-file -`** to pipe JSON from stdin when constructing alerts programmatically210- **Verify after create** - always list or get the alert after creation to confirm211- **Disable, don't delete** - prefer disabling alerts over deletion for auditability212- **Link to a specific alert** - `cx alerts list` prints only one "View in213 Coralogix" link, to the alerts overview page, not a per-alert link. To214 link a user to one specific alert, build `<base>/alerts/<alert_id>`,215 where `<base>` is the console URL already seen in a `View in Coralogix:216 <base>/...` line printed by any `cx alerts` command this session - never217 fabricate `<base>` yourself.218219---220221## Additional Resources222223### Reference Files224225- **[`references/alert-schemas.md`](references/alert-schemas.md)** - Complete JSON schema reference for all 12 alert types: field names, enum values (condition types, time windows, filter operations), common sub-objects (logs filter, tracing filter, notification groups, activity schedules), and important gotchas226- **[`references/dataprime-reference.md`](references/dataprime-reference.md)** - DataPrime query language reference for log-based and span-based alert conditions (filter syntax, operators, severity values)227- **[`references/logs-querying.md`](references/logs-querying.md)** - Log data model, field discovery, and query patterns for building log alert conditions228- **[`references/promql-guidelines.md`](references/promql-guidelines.md)** - PromQL reference for metric-based alert conditions (counters, gauges, histograms, threshold patterns)229- **[`references/spans-querying.md`](references/spans-querying.md)** - Span data model, duration units, and query patterns for building tracing alert conditions230231### Related Skills232233- **`cx-cases`** - triage the cases that group alert events into investigations234- **`cx-slos`** - the SLO definitions whose error-budget burn raises alerts235- **`cx-observability-setup`** - setting up notification routing and webhook integrations for alerts236- **`cx-telemetry-querying`** - investigate the telemetry behind a firing alert