Slack Crash Alerter Client using Incoming Webhooks
Project description
Slack Alerter
Slack Slack Alerts, Automated Crash Alerts for your projects
A Python package for sending alerts to Slack channels using webhooks. This package allows you to easily notify users about important events or errors in your application, improving monitoring and response times.
Features
- Customizable Alerts: Send alerts with specific headers and messages.
- Automatic Exception Handling: Automatically log and notify about unhandled exceptions and threading issues.
- Retry Mechanism: Configurable retries for sending alerts, ensuring reliable notifications.
Installation
You can install the package via pip:
pip install slack-alerter
Usage
Basic Example
Here’s a quick example of how to use the slack_alerter package:
from slack_alerter import Alerts
import sys
import threading
# Initialize the Alerts class
al = Alerts(
module_name="alerter_test",
slack_alerts_webhook='https://hooks.slack.com/services/your/webhook/url'
)
# Send a test alert
al.alert("Custom Header", "This is a custom alert message.")
# Set up alerts for uncaught exception handling
sys.excepthook = al.handle_uncaught_exception
threading.excepthook = al.handle_uncaught_thread_exception
#Set up alerts for handled exceptions
try:
res = 1/0
except Exception as e:
al.send_exception_alert(e)
#Perform other functions
Configuration
The following configuration parameters are required for initializing the Alerts class:
slack_alerts_webhook: Your Slack webhook URL (mandatory).module_name: The name of your module (mandatory).
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Hritik Karwasra - https://github.com/hritikkarwasra
Acknowledgments
Thanks to the Slack API for providing the webhook functionality that makes this package possible.
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 slack_alerter-0.1.4.tar.gz.
File metadata
- Download URL: slack_alerter-0.1.4.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2d1e07782989834fde205bb741d08ff417dd50db48f85943f85937884a672d7
|
|
| MD5 |
ad87fd93eabc58acdea351ebb78d3cd5
|
|
| BLAKE2b-256 |
56a2384b3f71b815334e928db80be95cfd3cb13b794f69fdd30a138c14a90233
|
File details
Details for the file slack_alerter-0.1.4-py3-none-any.whl.
File metadata
- Download URL: slack_alerter-0.1.4-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa0399eb05fda5fd8954869eb6a6ecf43bca7f5957980e993d7bbf3e00e309e7
|
|
| MD5 |
63e1249320c2f0d37d95a4124f783499
|
|
| BLAKE2b-256 |
f73a3e24e0c528f069d070dd86dbd5fa0db8504e9ee87becd30fea9d94b4e8c0
|