Automatic exception grouping using AI
Project description
OpenExcept
OpenExcept is an intelligent exception grouping library that uses machine learning to automatically categorize and group similar exceptions without manual rules.
Features
- 🤖 Automatic exception grouping using ML - no manual rules needed
- 🎯 Groups similar exceptions together based on semantic meaning
- 🔌 Easy integration with existing logging systems
- 🚀 Simple API for getting started quickly
- 🐳 Docker support for easy deployment
Installation
pip install openexcept
Quick Start
Docker Setup
To use OpenExcept with Docker:
-
Clone the repository:
git clone https://github.com/OpenExcept/openexcept.git cd openexcept -
Build and start the Docker containers:
docker-compose up -dThis will start two containers:
- OpenExcept API server on port 8000
- Qdrant vector database on port 6333
-
Install local dependencies
pip install -e .
- You can now use the OpenExcept API at
http://localhost:8000You can now use it with an example aspython 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openexcept-0.1.0.tar.gz.
File metadata
- Download URL: openexcept-0.1.0.tar.gz
- Upload date:
- Size: 32.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb379b8280361f08f8fc186bc437b1a1d6cb0acf8f540a932ec17b5e314a43c5
|
|
| MD5 |
80d47e8f2d116be7dfb20366d6f9adc0
|
|
| BLAKE2b-256 |
18017e3fb4f7711fb602bfd98c34e3302aa06c7accd5ab789b3de911a5b55df7
|
File details
Details for the file openexcept-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openexcept-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db59786fb8b98b46d382e9baef5d7556617d0f6fd814285ae6e62e1042086079
|
|
| MD5 |
3adddd218b7ad59a4f0cc38483d0b63f
|
|
| BLAKE2b-256 |
055267511dad0ee998af08fa557e327424c6a0409d5ef7aa2777a3252af0f785
|