skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
coralogix/cx-cli5.5k installs

cx-alerts

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.

How do I install this agent skill?

npx skills add https://github.com/coralogix/cx-cli --skill cx-alerts
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill manages Coralogix alert definitions and suppression rules using the cx CLI. It can read telemetry data, create or delete alert rules, and modify remote system configurations. It can run commands and manage remote infrastructure through the CLI, so use credentials with limited scope.

  • Socketpass

    No alerts

  • Snykfail

    Risk: CRITICAL · 2 issues

What does this agent skill do?

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

CommandPurposeKey flags
cx alerts listList all alert definitions--name <filter>
cx alerts get <id>Get a single alert definition by ID-
cx alerts createCreate 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 eventsList events; use alert-version scoped endpoint when filtering--alert-version-id, --start, --end
cx alerts event-statsGet alert event statistics-
cx alerts suppression-rules listList suppression rules-
cx alerts suppression-rules get <id>Get a suppression rule-
cx alerts suppression-rules createCreate a suppression rule--from-file <path>
cx alerts suppression-rules updateUpdate 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 enumHuman nameDescription
ALERT_DEF_TYPE_LOGS_IMMEDIATELogs ImmediateTrigger on every matching log entry
ALERT_DEF_TYPE_LOGS_THRESHOLDLogs ThresholdTrigger when log count exceeds a threshold in a time window
ALERT_DEF_TYPE_LOGS_ANOMALYLogs AnomalyML-based anomaly detection on log volume
ALERT_DEF_TYPE_LOGS_RATIO_THRESHOLDLogs Ratio ThresholdTrigger on ratio between two log queries
ALERT_DEF_TYPE_LOGS_NEW_VALUELogs New ValueTrigger when a new value appears in a field
ALERT_DEF_TYPE_LOGS_UNIQUE_COUNTLogs Unique CountTrigger on unique value count threshold
ALERT_DEF_TYPE_LOGS_TIME_RELATIVE_THRESHOLDLogs Time RelativeCompare current vs past time window
ALERT_DEF_TYPE_METRIC_THRESHOLDMetric ThresholdTrigger when a PromQL expression crosses a threshold
ALERT_DEF_TYPE_METRIC_ANOMALYMetric AnomalyML-based anomaly detection on metrics
ALERT_DEF_TYPE_TRACING_IMMEDIATETracing ImmediateTrigger on every matching span
ALERT_DEF_TYPE_TRACING_THRESHOLDTracing ThresholdTrigger when span count exceeds a threshold
ALERT_DEF_TYPE_FLOWFlowSequence-based alert combining multiple conditions

Priority Levels

Always ask the user what priority to use when creating alerts:

PriorityUse case
P1Critical - pages on-call immediately
P2High - needs attention within the hour
P3Medium - investigate during business hours
P4Low - informational, check when convenient
P5Info - logging/tracking only

Notifications: Cases by Default

Two separate things decide where an alert's notifications go:

  1. Routing labels (entityLabels) decide which Notification Center routers pick the alert up. They work the same way in both modes.
  2. The mode decides who sends the notification. It is set by one field: whether notificationGroup.router exists.

Cases are opened in both modes; the mode only changes where notifications come from.

ModeStored asWho notifies
Cases (default)no notificationGroup.routerThe alert sends no notifications itself; its Cases do, through router rules with entityType: "CASES"
Alerts (only when asked)notificationGroup.router presentThe alert sends its own notifications, through router rules with entityType: "ALERTS"

Rules for the payload

Field details and JSON examples are in references/alert-schemas.md (Routing labels, Notification Group, Case Settings).

  • Default: routing labels when the user wants notifications, notificationGroup with only groupByKeys when the user wants one case per group (otherwise leave it out), and no incidentsSettings. The API fills in Cases-mode defaults.
  • Routing labels go in entityLabels as routing.team, routing.service and routing.environment. The routing. prefix is required: a bare team key is an ordinary label that no router matches, and nothing reports an error. Set only the labels the user gives; one is enough.
  • Case grouping: when the alert groups by something, ask whether each group should open its own case. If yes, set "notificationGroup": {"groupByKeys": [...]} with keys taken from the alert's own group-by keys (for metric alerts, only from the PromQL by (...) clause). Otherwise leave it out: the alert then opens one combined case for all groups.
  • Never add notificationGroup.router unless the user explicitly asks for alert-based notifications, and tell them the notifications will then come from the alert rather than from its Cases.
  • Don't add notificationGroup.destinations or webhooks. They are older direct notifications sent by the alert itself. To send this alert's cases straight to a connector, use caseSettings.destinations.
  • Copying an alert: if you build the payload from cx alerts get <id> -o json, keep its routing.* labels and notificationGroup.groupByKeys but delete notificationGroup.router, notificationGroup.destinations, notificationGroup.webhooks and incidentsSettings unless the user wants them. A Logs Unique Count alert allows only one group-by key; if the source has more, ask the user which one to keep rather than picking one.
  • DataPrime (analytics) alerts notify through Cases only; the web editor offers no alert-based notifications for them.
  • Setting up the routers themselves is in cx-observability-setup.

Create Workflow

  1. Ask the user what they want to alert on (logs, metrics, traces) and, if it groups by a field, whether each group should open its own case (see Rules for the payload)
  2. Ask for priority (P1–P5)
  3. Build the JSON payload with alertDefProperties - use the API wire format (see references/alert-schemas.md for all enum values). Keep it in Cases mode: routing labels if wanted, notificationGroup with only groupByKeys if wanted, no incidentsSettings (see Notifications above)
  4. Tip: use cx alerts get <existing-id> -o json to get a working template, modify it, and pipe into create - but remove the alert-mode notification fields from the copy first (keep routing.* labels and notificationGroup.groupByKeys)
  5. Create using: echo '<json>' | cx alerts create or cx alerts create --from-file alert.json
  6. 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

Every logs-threshold rule needs an override block (the API returns 400 Required at rules.0.override without it). override.priority is that rule's priority; with one rule, use the alert's priority.

{
  "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"
          }
        },
        "override": { "priority": "ALERT_DEF_PRIORITY_P2" }
      }]
    }
  }
}

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": { "metricTimeWindowSpecificValue": "METRIC_TIME_WINDOW_VALUE_MINUTES_5" },
          "forOverPct": 100
        },
        "override": { "priority": "ALERT_DEF_PRIORITY_P1" }
      }],
      "missingValues": { "replaceWithZero": true }
    }
  }
}

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.

CommandPurpose
cx alerts suppression-rules listList all suppression rules
cx alerts suppression-rules get <id>Get a suppression rule by ID
cx alerts suppression-rules create --from-fileCreate a suppression rule
cx alerts suppression-rules update --from-fileUpdate a suppression rule
cx alerts suppression-rules delete <id>Delete a suppression rule

A rule has two IDs: unique_identifier is its stable, addressable ID (use it for get/update/delete), while id is the rule version ID that changes on every update.

Request body shape

create and update take the rule wrapped in an alertSchedulerRule object.

{
  "alertSchedulerRule": {
    "uniqueIdentifier": "<rule-id>",
    "name": "maintenance-window",
    "filter": { "whatExpression": "source logs | filter true", "alertUniqueIds": { "value": [] } },
    "schedule": {
      "scheduleOperation": "SCHEDULE_OPERATION_MUTE",
      "oneTime": { "timeframe": { "startTime": "2026-08-10T19:30:00", "endTime": "2026-08-10T20:30:00", "timezone": "UTC" } }
    }
  }
}
# List suppression rules - the ID column is the unique_identifier
cx alerts suppression-rules list -o json

# Inspect one rule
cx alerts suppression-rules get <unique-identifier> -o json

# Create from a definition file (must use the alertSchedulerRule wrapper)
cx alerts suppression-rules create --from-file suppression-rule.json

# Delete
cx alerts suppression-rules delete <unique-identifier> --yes

Key Principles

  • Always ask for priority (P1–P5) when creating alerts - never assume
  • Cases mode by default - route with routing.* labels and set case grouping with notificationGroup.groupByKeys; never set notificationGroup.router, destinations, webhooks or incidentsSettings unless the user explicitly asks for alert-based notifications
  • 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: <base>/...` line printed by any `cx alerts` command this session - never fabricate `<base>` yourself.

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, routing labels, caseSettings, alert-mode 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

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/coralogix/cx-cli/cx-alerts">View cx-alerts on skillZs</a>