Alerting

Set up proactive alerts for business and technical metrics.

Overview

Alerting notifies you when metrics exceed thresholds—before issues impact customers. Configure alerts for error rates, revenue drops, slow responses, and any metric Hyperfold tracks.

Creating Alerts

# Create an alert
$ hyperfold alerts create \
  --name="High Error Rate" \
  --condition="error_rate > 5%" \
  --window="5m" \
  --channels="slack:#alerts,email:ops@company.com"
Alert created:
  ID:              alert_err_001
  Name:            High Error Rate
  Condition:       error_rate > 5% over 5 minutes
  Channels:        Slack (#alerts), Email (ops@company.com)
  Status:          active
# Create revenue drop alert
$ hyperfold alerts create \
  --name="Revenue Drop" \
  --condition="revenue.hourly < revenue.hourly.avg_7d * 0.7" \
  --window="1h" \
  --severity=critical \
  --channels="pagerduty,slack:#critical"
# Create conversion rate alert
$ hyperfold alerts create \
  --name="Low Conversion" \
  --condition="conversion_rate < 0.20" \
  --window="1h" \
  --cooldown="30m" \
  --channels="slack:#sales"

Alert Options

OptionDescription
--conditionMetric condition to evaluate
--windowTime window for evaluation
--severityinfo, warning, critical
--cooldownMinimum time between alerts
--channelsWhere to send notifications

Alert Conditions

# Available alert conditions
METRICS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PERFORMANCE
  error_rate              Error percentage (0-100)
  response_time_p50       Median response time (ms)
  response_time_p95       95th percentile response time
  response_time_p99       99th percentile response time
  throughput              Requests per second
BUSINESS
  revenue.hourly          Revenue in last hour
  revenue.daily           Revenue today
  conversion_rate         Sessions conversions (0-1)
  avg_order_value         Average order value
  discount_rate           Average discount given
AGENTS
  agent.sessions          Active sessions
  agent.errors            Error count
  agent.latency           Processing latency
  agent.llm_tokens        Token usage
INVENTORY
  inventory.low_stock     Products below threshold
  inventory.out_of_stock  Products with zero inventory
INTEGRATIONS
  integration.sync_errors Sync failure count
  integration.latency     API response time
# Condition operators: > < >= <= == !=
# Aggregation functions: avg() sum() min() max() count() rate()
# Examples
$ hyperfold alerts create \
  --name="Slow Response" \
  --condition="response_time_p95 > 500"
$ hyperfold alerts create \
  --name="Token Spike" \
  --condition="rate(agent.llm_tokens) > 1000"
$ hyperfold alerts create \
  --name="Daily Revenue Target" \
  --condition="revenue.daily < 10000" \
  --schedule="0 18 * * *"

Notification Channels

# Configure notification channels
$ hyperfold alerts channels list
NOTIFICATION CHANNELS
CHANNEL         TYPE        STATUS     CONFIGURED
slack           chat        active     #alerts, #critical
email           email       active     ops@company.com
pagerduty       oncall      active     service_id_xxx
webhook         http        active     https://hooks.example.com/alert
# Add Slack channel
$ hyperfold alerts channels add slack \
  --webhook-url="https://hooks.slack.com/services/xxx" \
  --default-channel="#alerts"
# Add PagerDuty
$ hyperfold alerts channels add pagerduty \
  --integration-key="xxx" \
  --service-id="P123ABC"
# Add custom webhook
$ hyperfold alerts channels add webhook \
  --name="custom-alerts" \
  --url="https://hooks.example.com/hyperfold" \
  --headers='{"Authorization": "Bearer xxx"}'
# Webhook payload format
{
  "alert_id": "alert_err_001",
  "alert_name": "High Error Rate",
  "status": "firing",
  "severity": "warning",
  "condition": "error_rate > 5%",
  "current_value": 7.2,
  "threshold": 5,
  "window": "5m",
  "fired_at": "2025-01-20T10:15:00Z",
  "message": "Error rate is 7.2%, exceeding threshold of 5%",
  "dashboard_url": "https://console.hyperfold.io/alerts/alert_err_001"
}

Channel Types

ChannelBest For
SlackTeam visibility, non-urgent alerts
EmailAsync notification, audit trail
PagerDutyCritical alerts, on-call escalation
WebhookCustom integrations, automation

Management

# List all alerts
$ hyperfold alerts list
# View alert details
$ hyperfold alerts show "High Error Rate"
# Acknowledge an alert
$ hyperfold alerts ack "Low Conversion" \
  --message="Investigating - appears related to checkout bug"
# Silence an alert temporarily
$ hyperfold alerts silence "High Error Rate" \
  --duration="2h" \
  --reason="Scheduled maintenance"
# Delete an alert
$ hyperfold alerts delete "Old Alert" --confirm