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.
- ๐ค 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.
pip install openexcept
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 -d
This 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:8000
You can now use it with an example aspython examples/basic_usage.py
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)
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.
For more detailed information, check out our API Documentation.
We welcome contributions! Please see our Contributing Guide for more details.
This project is licensed under the AGPLv3 License - see the LICENSE file for details.