MagicTradeBot provides native support for integrating with PagerDuty — a leading incident response and digital operations platform. This integration allows real-time log forwarding, alerting, and incident management across all bot instances running under your infrastructure.
Whether you are running a single bot instance or managing hundreds of bots across multiple exchanges, trading accounts, and servers, PagerDuty enables you to centralize observability, respond instantly to failures, and ensure high availability of your trading operations.
🚀 Overview
MagicTradeBot can forward log events and alerts from each bot instance to PagerDuty in real-time. This is essential for:
- Monitoring distributed bot instances and market activity
- Triggering automated incident responses during trade failures or strategy errors
- Managing alerts across time zones, teams, and environments
Manual monitoring becomes impractical when your bots are scanning and trading across hundreds of cryptocurrency pairs. PagerDuty offers a centralized and intelligent way to control, monitor, and respond at scale.
🔧 Key Features
- 📡 Real-time event delivery to PagerDuty via webhooks or REST API
- 🚨 Configurable alert conditions for bot errors, failed trades, or system outages
- 🌍 Scalable for single-instance and multi-instance bot environments
- 🧠 Smart escalation policies and automated incident routing
- 📊 Central dashboard for tracking alert history and trade health
🛠️ Prerequisites
- A PagerDuty account with a valid API key or integration token
- An existing PagerDuty service with defined escalation policies
- MagicTradeBot configured for external webhook or API notification
⚙️ Configuration Steps
1. Create a PagerDuty Integration
In your PagerDuty dashboard, navigate to Services → Add Service and create a new service for MagicTradeBot monitoring. Choose the integration type Events API v2 or Custom Webhook.
2. Get the Integration Key
Copy the integration key (routing key) or webhook URL for use in the bot configuration.
3. Update Bot Configuration
Add the PagerDuty integration to your MagicTradeBot configuration file (e.g., config.yaml
):
incident_reporting:
pagerduty:
enabled: true
integration_key: "YOUR_PAGERDUTY_ROUTING_KEY"
service_name: "magictradebot"
severity_threshold: "error"
environment: "production"
4. Define Alert Conditions
The bot will send alerts to PagerDuty based on internal rules, such as:
- Bot failed to execute trade
- Exchange API unreachable
- High error rates or memory spikes
- Strategy misfires or invalid parameters
5. Test and Validate
Deploy the bot with test alerts enabled and verify events appear in the PagerDuty dashboard. Adjust severity or filters as needed.
🧪 Example PagerDuty Event Payload
{
"routing_key": "YOUR_PAGERDUTY_ROUTING_KEY",
"event_action": "trigger",
"payload": {
"summary": "MagicTradeBot failed to execute BTC/USDT trade",
"severity": "error",
"source": "bot-eu-1",
"component": "trade-engine",
"custom_details": {
"symbol": "BTC/USDT",
"exchange": "binance",
"reason": "Insufficient margin balance"
}
}
}
✅ Benefits of PagerDuty Integration
- 📍 Centralized alerting across all bot instances and environments
- 🚀 Faster incident response and recovery with automated escalation
- 🧩 Easy integration with teams via SMS, email, Slack, or Ops tools
- 📉 Minimized downtime and lost opportunities in volatile markets
- 📈 Complete visibility into trading health and execution reliability