Skip to content

Repository files navigation

Vercel Deployment Monitor Agent

An AI-powered deployment monitoring agent that continuously watches your Vercel deployments, detects issues, and coordinates with engineers via Slack.

Features

  • 🔍 Continuous Monitoring - Polls Vercel API for deployment status changes
  • 🚨 Issue Detection - Detects build failures, runtime errors, stuck deployments
  • 💬 Slack Integration - Interactive alerts with Approve/Dismiss buttons
  • 🗄️ ChromaDB Storage - Persistent issue tracking with vector search
  • 🌐 REST API - Dashboard-ready endpoints for React integration
  • 🤖 Coding Agent Ready - Structured JSON payloads for automated fixing

Quick Start

1. Install Dependencies

cd Minute0
pip install -e .

2. Configure Environment

cp .env.example .env
# Edit .env with your tokens

Required environment variables:

  • VERCEL_TOKEN - Your Vercel API token
  • SLACK_BOT_TOKEN - Slack Bot OAuth token (xoxb-...)
  • SLACK_CHANNEL - Slack channel ID for alerts

3. Run the Agent

# Monitor only
python -m vercel_monitor

# Monitor + REST API (for dashboard)
python -m vercel_monitor --with-api

# API only (for testing)
python -m vercel_monitor --api-only

# Validate config
python -m vercel_monitor --check-config

Architecture

┌─────────────────────────────────────────────────────────┐
│                  Deployment Monitor Agent                │
├─────────────────────────────────────────────────────────┤
│                                                          │
│   ┌──────────┐    ┌──────────┐    ┌──────────────────┐  │
│   │  Vercel  │───▶│  Issue   │───▶│  ChromaDB Store  │  │
│   │  Client  │    │ Detector │    └────────┬─────────┘  │
│   └──────────┘    └──────────┘             │            │
│                                            ▼            │
│   ┌──────────┐    ┌──────────┐    ┌──────────────────┐  │
│   │   REST   │◀───│   Slack  │◀───│  Slack Notifier  │  │
│   │   API    │    │  Buttons │    └──────────────────┘  │
│   └────┬─────┘    └────┬─────┘                          │
│        │               │                                 │
└────────┼───────────────┼─────────────────────────────────┘
         │               │
         ▼               ▼
   React Dashboard   Engineer → Approve/Dismiss → Coding Agent

Slack Message Example

When an issue is detected:

🔴 Deployment Issue: my-app

🚀 PRODUCTION • Build Failure
────────────────────────────
• Project:      my-app
• Deployment:   dpl_abc123...
• Environment:  production
• Status:       open

Error Summary:
Build failed: npm ERR! ERESOLVE unable to resolve dependency tree

Suspected Root Cause:
npm dependency resolution conflict

Error Logs:
┌────────────────────────────────────
│ npm ERR! code ERESOLVE
│ npm ERR! ERESOLVE unable to resolve dependency tree
│ npm ERR! ...
└────────────────────────────────────

🔗 View Deployment
────────────────────────────
[✅ Approve Fix]  [❌ Dismiss]  [📋 View Payload]

API Endpoints

Endpoint Method Description
/api/health GET Health check
/api/issues GET List all issues
/api/issues/open GET List open issues
/api/issues/{id} GET Get issue details
/api/issues/{id}/approve POST Approve issue for coding agent
/api/issues/{id}/dismiss POST Dismiss issue
/api/issues/{id}/payload GET Get coding agent payload
/api/issues/search POST Vector search for similar issues
/api/projects/{id}/issues GET Get issues for a project

Coding Agent Payload

When an issue is approved, this JSON is available for the coding agent:

{
  "project_name": "my-app",
  "project_id": "prj_abc123",
  "deployment_id": "dpl_xyz789",
  "deployment_url": "https://my-app-xyz.vercel.app",
  "env": "production",
  "issue_type": "build_failure",
  "summary": "Build failed during npm install with dependency resolution error",
  "logs": [
    "npm ERR! code ERESOLVE",
    "npm ERR! ERESOLVE unable to resolve dependency tree"
  ],
  "suspected_root_cause": "npm dependency resolution conflict",
  "commit_sha": "abc1234",
  "commit_message": "Add new feature",
  "branch": "main"
}

Slack App Setup

  1. Create a new Slack App at https://api.slack.com/apps
  2. Add these Bot Token Scopes:
    • chat:write - Send messages
    • chat:write.public - Send to public channels
  3. Enable Interactivity and set the Request URL to:
    • https://your-server.com/api/slack/interactions
  4. Install the app to your workspace
  5. Copy the Bot User OAuth Token to SLACK_BOT_TOKEN
  6. Get your channel ID and set SLACK_CHANNEL

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Run with verbose logging
python -m vercel_monitor -v

![Images] (assets/slack_agent_message.png)

About

DevOps AI Agent / OnCall Engineer's Agent

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages