Anvil.Telemetry.Alerts (Anvil v0.1.1)
View SourceAlerting hooks for critical Anvil telemetry events.
Provides configurable alerting for:
- Low agreement scores (quality degradation)
- Queue backup (throughput issues)
- Export failures (operational issues)
- Assignment timeout spikes (policy issues)
Usage
Attach alerting handlers in your application supervisor:
def start(_type, _args) do
children = [
# ... other children
]
# Attach alert handlers after supervisor starts
:ok = Anvil.Telemetry.Alerts.attach_handlers()
Supervisor.start_link(children, strategy: :one_for_one)
endConfiguration
config :anvil, :alerts,
enabled: true,
low_agreement_threshold: 0.4,
queue_backup_threshold: 100,
timeout_spike_threshold: 50,
timeout_spike_window: :hour,
handlers: [
log: true,
slack: [enabled: false, webhook_url: nil],
pagerduty: [enabled: false, api_key: nil]
]