Skip to main content

Make all code self-healing with automatic debug state capture and LLM analysis

Project description

SelfHeal - Make all code self-healing

SelfHeal helps your code achieve self healing, by automatically captures debug states when exceptions occur, sends Slack alerts, and provide LLM analysis of how to fix the root cause. See examples for detailed usage scenarios.

Features

  • 🔍 Debug State Capture: Stack traces, variables, class state, source code
  • 📊 Web Viewer: Browse and analyze debug states
  • 🤖 AI Analysis: GPT-4 powered root cause analysis and fix suggestions

Quick Start

  1. Install
pip install -r requirements.txt
  1. Configure
export SLACK_BOT_TOKEN="xoxb-your-token"  # Optional
  1. Use
from selfheal import FunctionDebugger

debugger = FunctionDebugger(
    dump_dir="/path/to/debug/states",
    slack_token=os.environ.get("SLACK_BOT_TOKEN")
)

# Decorate functions
@debugger.debug_enabled()
def my_function():
    pass

# Or entire classes
@debugger.debug_class()
class MyClass:
    pass
  1. View Debug States
streamlit run selfheal/debug_viewer.py

Access at http://openexcept.com

How It Works

When an exception occurs:

  1. Debug state is captured and saved
  2. Slack alert is sent with viewer link in the format of http://openexcept.com?debug_path=/path/to/state.json

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

selfheal-0.1.0.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

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

selfheal-0.1.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: selfheal-0.1.0.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for selfheal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 030b3b4f5c1492fa749bdc852e4663708dcccd002d302ce5c2399a1c008b4caf
MD5 8855de8396965f6cedffd8855046e4a3
BLAKE2b-256 4638faa4f74aab800a01db4c4d991154654aaf3c2b399857125758c9b11ebe46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: selfheal-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for selfheal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6609c9efa74d97f31e952e66b697b8760b5af78eb942bc04bf1305bdd46160e
MD5 c34d80df43b5b2833114a07b4c7f0b3f
BLAKE2b-256 854fe65a746407eb85f037f57e492320a4e1f3d96bc114badd5e8791a30e4208

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