Skip to content
View OpenExcept's full-sized avatar
๐ŸŽฏ
Building
๐ŸŽฏ
Building
  • 16:32 (UTC -08:00)

Block or report OpenExcept

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this userโ€™s behavior. Learn more about reporting abuse.

Report abuse
OpenExcept/README.md

OpenExcept

OpenExcept is an AI based exception grouping engine.

Your application is throwing tons of exceptions, each exception trace is slightly different and many of them do not have pre-defined exception classes. How do you know which exceptions are most common? How do you know there are suddenly increases of certain exception types?

OpenExcept intelligently group exceptions based on their semantic meaning, making it easier to identify patterns and address issues more efficiently.

Features

  • ๐Ÿค– Automatic Exception Grouping: Uses AI to group exceptions without manual intervention. Once they are grouped, you can do analysis much more easily!
  • ๐Ÿ”Œ Easy Integration: Seamlessly fits into your existing logging systems.
  • ๐Ÿš€ Simple API: Get started quickly with a straightforward and intuitive API.
  • ๐Ÿณ Docker Support: Easily deployable with Docker for hassle-free setup.

Installation

pip install openexcept

Quick Start

Docker Setup

To use OpenExcept with Docker:

  1. Clone the repository:

    git clone https://github.com/OpenExcept/openexcept.git
    cd openexcept
    
  2. Build and start the Docker containers:

    docker-compose up -d
    

    This will start two containers:

    • OpenExcept API server on port 8000
    • Qdrant vector database on port 6333
  3. Install local dependencies

pip install -e .
  1. You can now use the OpenExcept API at http://localhost:8000 You can now use it with an example as python examples/basic_usage.py

Basic Usage

from openexcept import OpenExcept

grouper = OpenExcept()

exceptions = [
    "Connection refused to database xyz123",
    "Connection refused to database abc987",
    "Divide by zero error in calculate_average()",
    "Index out of range in process_list()",
    "Connection timeout to service endpoint",
]

for exception in exceptions:
    group_id = grouper.group_exception(exception)

# When we get the top 1 exception group, it should return the group
# that contains "Connection refused to database xyz123" since it occurs the most
top_exception_groups = grouper.get_top_exception_groups(1)

Integrating with Existing Logger

You can easily integrate OpenExcept with your existing logging setup using the provided OpenExceptHandler:

import logging
from openexcept.handlers import OpenExceptHandler

# Set up logging
logger = logging.getLogger(__name__)
logger.addHandler(OpenExceptHandler())

# Now, when you log an error, it will be automatically grouped
try:
    1 / 0
except ZeroDivisionError as e:
    logger.error("An error occurred", exc_info=True)

This will automatically group exceptions and add the group ID to the log message.

For more detailed examples, check the examples/logger_integration.py in the project repository.

Documentation

For more detailed information, check out our API Documentation.

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

License

This project is licensed under the AGPLv3 License - see the LICENSE file for details.

Pinned Loading

  1. OpenExcept OpenExcept Public

    The first AI based exception grouping engine.

    Python 9

  2. SelfHeal SelfHeal Public

    Make all code self healing

    Python 20