- Github repository: https://github.com/vahidtwo/skylog-sdk/
- Documentation https://vahidtwo.github.io/skylog-sdk/
- PIPY Package https://pypi.org/project/skylog-sdk/
Skylog is a robust service designed for seamless integration with various platforms like Sentry, Telegram, and more, enabling the efficient transmission of logs and rapid identification of issues.
This Python SDK facilitates easy interaction with Skylog services, allowing users to:
- fire alert
- stop alert
- notify
install from gitlab
pip install skylog-sdk
-
Environment Variables: Configure the following variables in your project environment:
DEFAULT_SKY_LOG_ALERTING_TELEGRAM_ALERT_NAME
: Default alert name for TelegramDEFAULT_SKY_LOG_ALERTING_PHONE_CALL_ALERT_NAME
: Default alert name for phone callsDEFAULT_SKY_LOG_ALERTING_SMS_ALERT_NAME
: Default alert name for SMSSKY_LOG_ALERTING_BASE_URL
: Base URL for Skylog API callsSKY_LOG_ALERTING_TOKEN
: Your Skylog authentication token
-
Proxy Configuration: If using a proxy, include the following additional variables:
PROXY_USERNAME
PROXY_PASSWORD
PROXY_IP
PROXY_PORT
from skylog import AlertingSkyLogClient, AlertingProvider
# Initialize the Skylog client with the desired provider (e.g., Telegram)
client = AlertingSkyLogClient(provider=AlertingProvider.telegram)
# Example Operations:
client.fire_alert(description='Issue detected', instance_name='unique_key', provider=AlertingProvider.sms)
client.stop_alert(description='Issue resolved', instance_name='unique_key', provider=AlertingProvider.sms)
client.notify(description='Alert notification', instance_name='unique_key', provider=AlertingProvider.telegram)
- Alertname: Represents the provider or service. It identifies where Skylog sends alerts.
- Instance: A unique identifier within a group alert, specifying a particular part of a universal alert.
- Firing an Alert: Triggering an alert, resulting in immediate notifications sent to relevant endpoints.
- Stopping an Alert: Removing a fired alert, resolving it and stopping further notifications.
- Notifying an Alert: Sending messages to endpoints without adding records to the triggered list.