Webhook Integration Examples
Examples for integrating Lightning Logs with webhooks and alerting systems.
Creating Alert Rules with Webhooks
const rule = await client.alerts.createRule({
name: 'High Error Rate',
query_dsl: "level = 'error'",
threshold: 100,
comparison: 'gt',
window_minutes: 5,
cooldown_minutes: 15,
enabled: true,
notification_destinations: ['webhook'],
notification_config: {
webhook_url: 'https://your-app.com/webhooks/alerts'
}
})