What are Channels?
Channels are webhook configurations that:- Receive alert notifications via HTTP POST
- Support custom headers for authentication
- Integrate with services like Slack, PagerDuty, Discord, and custom webhooks
- Retry failed deliveries with exponential backoff
- Are referenced by name in alert configurations
ChannelConfig Interface
Channels are defined inpongo/channels.ts:
Channel type. Currently only
"webhook" is supported.Webhook endpoint URL that will receive POST requests with alert payloads.
Optional HTTP headers to include in webhook requests. Useful for authentication tokens or API keys.
Configuration
Define all channels in a single file:pongo/channels.ts
channels() helper function for full type inference and validation.
Channel names (object keys) must match the values referenced in alert
channels arrays.Webhook Payload
When alerts fire or resolve, Pongo sends a POST request with this payload:Payload Fields
Either
"alert.fired" when the alert starts firing, or "alert.resolved" when it clears.Alert metadata including ID, name, associated monitor, and severity level.
ISO 8601 timestamp when the webhook was sent.
Current state snapshot including consecutive failure/success counts and last known values.
Details of the check that triggered the alert, including status, response time, and any error messages.
Optional region identifier if running multi-region monitoring.
List of regions where the alert is currently firing (multi-region deployments).
List of regions where the check is passing (multi-region deployments).
Webhook Delivery
Pongo ensures reliable webhook delivery:- Immediate delivery: Webhooks are sent as soon as alerts fire or resolve
- Retry logic: Failed requests retry with exponential backoff
- Timeout: Requests timeout after 30 seconds
- Concurrent delivery: Multiple channels receive webhooks in parallel
Integration Examples
Slack
Create a Slack Incoming Webhook:PagerDuty
Use the PagerDuty Events API v2:You may need to transform Pongo’s payload format to match PagerDuty’s expected schema. Consider using a proxy service or serverless function for transformation.
Discord
Create a Discord webhook:Custom Webhook
Send to any HTTP endpoint:Microsoft Teams
Create an Incoming Webhook connector:Email via Webhook Service
Use a service like Zapier or Make to convert webhooks to emails:Using Channels in Alerts
Reference channel names in your monitor alert configurations:Environment Variables
Store sensitive webhook URLs and tokens in environment variables:.env
Never commit secrets to version control. Use
.env files locally and environment variable configuration in production.Testing Channels
Test webhook delivery by:- Temporarily lowering alert thresholds (e.g.,
consecutiveFailures: 1) - Creating a test monitor that intentionally fails
- Checking your channel destination for the webhook
- Verifying the payload format and content
Testing with webhook.site
Use webhook.site to inspect webhook payloads:Best Practices
Use environment variables for secrets
Use environment variables for secrets
Always store webhook URLs and API keys in environment variables, never hardcode them in source files.
Route by severity
Route by severity
Create different channels for different severity levels. Send critical alerts to PagerDuty, warnings to Slack.
Test webhook endpoints
Test webhook endpoints
Verify your webhooks work before deploying to production. Use test monitors or webhook.site for validation.
Handle webhook transformation
Handle webhook transformation
If your destination service expects a specific payload format, use a proxy service or serverless function to transform Pongo’s payload.
Monitor webhook failures
Monitor webhook failures
Check Pongo logs for webhook delivery failures. Failed webhooks indicate configuration issues or service outages.
Retry Behavior
Failed webhook deliveries are automatically retried:- Max retries: Configurable via
SCHEDULER_MAX_RETRIES(default: 3) - Retry delay: Exponential backoff starting at
SCHEDULER_RETRY_DELAY_MS(default: 5000ms) - Timeout: 30 seconds per request
Next Steps
Alerts
Configure alerts that use channels
Monitors
Create monitors with alert rules