DevOps Monitoring

Lesson 2 of 5

Connecting Infrastructure

Estimated time: 7 minutes

Connecting Infrastructure

Time to wire up your monitoring stack, cloud providers, and deployment tools to OpenClaw. Once connected, alerts and events flow into your chat automatically.

Prerequisites

    Connect your monitoring platform

    Grafana sends alerts via webhooks. Point them at OpenClaw:

    openclaw connect add \
      --name "Grafana" \
      --type webhook \
      --secret "YOUR_WEBHOOK_SECRET" \
      --format grafana
    

    This gives you a webhook URL. In Grafana:

    1. Go to Alerting → Contact points → Add contact point
    2. Choose Webhook as the type
    3. Paste the OpenClaw webhook URL
    4. Set the HTTP method to POST
    5. Test the contact point
    Copy webhook URL
    openclaw connect show Grafana --url

    Verify the connection:

    Test connection
    openclaw connect test Grafana

    Connect your cloud infrastructure

    For remediation actions (scaling, restarting, rolling back), OpenClaw needs access to your infrastructure:

    openclaw connect add \
      --name "AWS Production" \
      --type aws \
      --region "us-east-1" \
      --access-key "YOUR_AWS_ACCESS_KEY" \
      --secret-key "YOUR_AWS_SECRET_KEY" \
      --capabilities "ec2,ecs,rds,lambda,autoscaling"
    

    Connect deployment tools

    Link your CI/CD pipeline so OpenClaw knows when deployments happen:

    openclaw connect add \
      --name "GitHub" \
      --type github \
      --token "YOUR_GITHUB_PAT" \
      --repos "your-org/your-app" \
      --events "deployment,workflow_run"
    

    Set up the monitoring agent

    Create the base agent that receives and routes alerts:

    openclaw agent add \
      --name "DevOps Monitor" \
      --source "Grafana,AWS Production,GitHub" \
      --message "You are a DevOps monitoring assistant. When you receive an alert or event:
    
    1. Identify the severity: 🔴 Critical, 🟡 Warning, 🟢 Info
    2. Summarize what happened in plain English
    3. Add relevant context (recent deployments, related metrics)
    4. For warnings and criticals, suggest immediate next steps
    
    Keep messages concise. Engineers are reading this at 3 AM.
    Don't use jargon the alert already contains — add *new* context." \
      --announce \
      --channel slack \
      --to "#ops-alerts"
    

    Test it with a simulated alert:

    openclaw connect simulate Grafana \
      --alert "CPU usage above 90%" \
      --metric "cpu_usage_percent" \
      --value 94 \
      --host "web-prod-01"
    

    You should see a formatted alert in your chat channel.

    What's Connected Now

      Monitoring                Cloud                  CI/CD
      ┌──────────┐           ┌──────────┐          ┌──────────┐
      │ Grafana  │           │ AWS/GCP  │          │ GitHub   │
      │ Datadog  │───────┐   │ or SSH   │──────┐   │ Vercel   │──┐
      │ CW/UR    │       │   └──────────┘      │   │ Docker   │  │
      └──────────┘       │                     │   └──────────┘  │
                         ▼                     ▼                 ▼
                      ┌──────────────────────────────────────────┐
                      │           OpenClaw Gateway               │
                      │    DevOps Monitor Agent                  │
                      └──────────────────────────────────────────┘
                                       │
                                       ▼
                              #ops-alerts channel
    

    Raw alerts are now flowing to chat. The next lesson makes them smart — enriched with AI analysis, correlated with deployments, and filtered to reduce noise.

    Knowledge Check

    Why does OpenClaw need access to your deployment tools (GitHub/Vercel), not just monitoring?