Skip to main content

AI-powered runtime incident detection and auto-remediation for Docker workloads.

Project description

OpsGuard

AI-powered Runtime Incident Detection & Intelligent Auto-Remediation for Docker Workloads

OpsGuard continuously monitors your Docker containers, detects runtime failures, investigates the root cause using AI, correlates failures with source code and Git history, generates an executable remediation plan, and allows engineers to safely approve and execute remediation actions.


Features

  • Real-time Docker container monitoring
  • Automatic runtime incident detection
  • Structured incident reports
  • Log collection and stack trace analysis
  • AI-powered root cause investigation
  • Source code context collection
  • Git commit correlation
  • Dependency analysis
  • AI-generated remediation plans
  • Human approval workflow
  • Tool-based remediation execution
  • Complete execution history
  • Safe execution through registered tools
  • Simple Python package installation

Architecture

                    Docker Events
                          │
                          ▼
                 Crash Detection Engine
                          │
                          ▼
                  Incident Generation
                          │
                          ▼
                 Context Collection Layer
          ┌──────────┬──────────┬──────────┐
          │          │          │          │
      Docker      Source      Git     Dependencies
          │          │          │          │
          └──────────┴──────────┴──────────┘
                          │
                          ▼
                 AI Root Cause Analysis
                          │
                          ▼
               AI Execution Plan Generator
                          │
                          ▼
                 Approval Required
                          │
                          ▼
                  Tool Execution Engine
                          │
                          ▼
               Incident Successfully Resolved

Installation

Requirements

  • Python 3.10+
  • Docker
  • Git
  • Ollama (for local AI)
  • Linux/macOS (Windows support coming soon)

Install

pip install opsguard

Verify installation:

opsguard --help

Quick Start

1. Navigate to your project

cd your-project

2. Initialize OpsGuard

opsguard init

This creates:

.opsguard/
└── config.json

3. Register your Docker container

opsguard register-container my-app

4. Start OpsGuard

opsguard start

OpsGuard will now continuously monitor registered containers.


Workflow

Container Crash
      │
      ▼
Collect Logs
      │
      ▼
Analyze Stack Trace
      │
      ▼
Collect Source Code
      │
      ▼
Analyze Git History
      │
      ▼
Collect Dependencies
      │
      ▼
AI Investigation
      │
      ▼
Execution Plan
      │
      ▼
Human Approval
      │
      ▼
Execute Tools
      │
      ▼
Execution Report

Example Incident Lifecycle

Runtime Failure

NameError: name 'os' is not defined

OpsGuard automatically:

  • Collects logs
  • Detects stack trace
  • Locates affected source file
  • Collects Git history
  • Finds recent commits
  • Builds investigation context
  • Sends investigation to AI

AI Investigation

{
  "root_cause": "Missing import for os module.",
  "severity": "low",
  "confidence": 92
}

Execution Plan

{
  "status": "PENDING_APPROVAL",
  "actions": [
    {
      "tool": "filesystem.replace_text",
      "arguments": {
        "filename": "database.py"
      }
    },
    {
      "tool": "docker.restart_container"
    }
  ]
}

Engineer approves

OpsGuard executes the plan

Execution report generated


Project Structure

opsguard/
│
├── cli/
│
├── server/
│   ├── ai/
│   ├── analysis/
│   ├── context/
│   ├── execution/
│   ├── observer/
│   ├── remediation/
│   ├── storage/
│   └── tools/
│
└── memory/

Supported AI Providers

Current

  • Ollama

Planned

  • OpenAI
  • Anthropic Claude
  • Google Gemini
  • Azure OpenAI
  • Local Llama.cpp

Built-in Tools

Current tools include:

Docker

  • Collect logs
  • Restart container
  • Inspect container
  • List containers

Filesystem

  • Read file
  • Replace text
  • Find file

More tools will be added in future releases.


Safety

OpsGuard never executes AI output directly.

Every action must be converted into structured tool calls.

Example:

{
    "tool": "filesystem.replace_text",
    "arguments": {}
}

instead of

rm -rf /

This design prevents arbitrary command execution.


Roadmap

v0.1

  • Docker monitoring
  • AI investigation
  • Human approval
  • Tool execution

v0.2

  • Better CLI
  • Doctor command
  • Better diagnostics

v0.3

  • Web Dashboard
  • Live incidents
  • Approval UI

v0.4

  • Kubernetes support

v0.5

  • Cloud deployments

v1.0

  • Production-ready platform

Contributing

Contributions are welcome.

  1. Fork the repository.
  2. Create a feature branch.
  3. Make your changes.
  4. Submit a Pull Request.

License

This project is licensed under the MIT License.

See the LICENSE file for details.


Author

Shivam Jangid


Disclaimer

OpsGuard is currently under active development.

While remediation actions are executed only after explicit approval, always review generated execution plans before applying them to production environments.


Star the Project

If you find OpsGuard useful, consider starring the repository to support the project and stay updated with future releases.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opsguard-0.1.0.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opsguard-0.1.0-py3-none-any.whl (58.3 kB view details)

Uploaded Python 3

File details

Details for the file opsguard-0.1.0.tar.gz.

File metadata

  • Download URL: opsguard-0.1.0.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for opsguard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 27a17cdac0da15c6abfeb73fedb59bdd236be541ca55c705ece14957b44e1045
MD5 e9284ec7ac4ef8b3f5d88ca8f09e3c72
BLAKE2b-256 fec9c854c916c24fb271b18ac041cf716a3df5d17116548dcf2a211a3b581af6

See more details on using hashes here.

File details

Details for the file opsguard-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: opsguard-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 58.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for opsguard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8f68bc303c0367632603e5ec5ca950cee9ab60309b8bb6b2f3b437e344228a2
MD5 a64b88c79b1a719a6871391f888aab5e
BLAKE2b-256 b90db36ce9e2e292b97ec09cff2b13578e8dae0f2c6a0d8c9cbf85347c8aec74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page