- Integrated all production features into main application flow - Added metrics, tracing, caching, and health checks to API server - Enhanced trade execution with circuit breakers and retry policies - Integrated database persistence for trades and metrics - Added structured logging and observability - Enhanced middleware with missing validators and rate limiters - Added comprehensive error handling and resilience patterns
90 lines
2.3 KiB
YAML
90 lines
2.3 KiB
YAML
# Alertmanager Configuration
|
|
# Routes alerts to appropriate channels
|
|
|
|
global:
|
|
resolve_timeout: 5m
|
|
# Telegram configuration (if using Telegram for alerts)
|
|
# telegram_api_url: 'https://api.telegram.org'
|
|
# telegram_bot_token: 'YOUR_BOT_TOKEN'
|
|
|
|
# Route tree
|
|
route:
|
|
receiver: 'default'
|
|
group_by: ['alertname', 'severity']
|
|
group_wait: 10s
|
|
group_interval: 10s
|
|
repeat_interval: 12h
|
|
routes:
|
|
# Critical alerts go to on-call
|
|
- match:
|
|
severity: critical
|
|
receiver: 'oncall'
|
|
continue: true
|
|
|
|
# Warning alerts go to team channel
|
|
- match:
|
|
severity: warning
|
|
receiver: 'team'
|
|
continue: true
|
|
|
|
# Info alerts go to general channel
|
|
- match:
|
|
severity: info
|
|
receiver: 'general'
|
|
|
|
# Inhibition rules (suppress less important alerts when critical ones fire)
|
|
inhibit_rules:
|
|
- source_match:
|
|
severity: 'critical'
|
|
target_match:
|
|
severity: 'warning'
|
|
equal: ['alertname', 'instance']
|
|
|
|
# Receivers
|
|
receivers:
|
|
# Default receiver (fallback)
|
|
- name: 'default'
|
|
webhook_configs:
|
|
- url: 'http://localhost:9094/webhook'
|
|
send_resolved: true
|
|
|
|
# On-call receiver (critical alerts)
|
|
- name: 'oncall'
|
|
webhook_configs:
|
|
# PagerDuty integration
|
|
- url: 'https://events.pagerduty.com/v2/enqueue'
|
|
send_resolved: true
|
|
http_config:
|
|
bearer_token: 'YOUR_PAGERDUTY_KEY'
|
|
|
|
# Email notifications
|
|
email_configs:
|
|
- to: 'oncall@immortal-bot.com'
|
|
from: 'alerts@immortal-bot.com'
|
|
smarthost: 'smtp.gmail.com:587'
|
|
auth_username: 'alerts@immortal-bot.com'
|
|
auth_password: 'YOUR_SMTP_PASSWORD'
|
|
send_resolved: true
|
|
|
|
# Team receiver (warning alerts)
|
|
- name: 'team'
|
|
webhook_configs:
|
|
# Slack integration
|
|
- url: 'https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK'
|
|
send_resolved: true
|
|
title: '{{ .GroupLabels.alertname }}'
|
|
text: '{{ range .Alerts }}{{ .Annotations.description }}{{ end }}'
|
|
|
|
# Telegram integration
|
|
# telegram_configs:
|
|
# - bot_token: 'YOUR_BOT_TOKEN'
|
|
# chat_id: -1001234567890
|
|
# send_resolved: true
|
|
|
|
# General receiver (info alerts)
|
|
- name: 'general'
|
|
webhook_configs:
|
|
- url: 'http://localhost:9094/webhook'
|
|
send_resolved: true
|
|
|