Opsgenie Integration
Assert creates an Opsgenie alert when a monitor fails, and your Opsgenie escalation policy decides who it wakes.
The alert carries the assertion that failed, the expected value, the value your API returned, the regions that agreed, and the time. A failure re-runs across regions before the alert is created. Assert creates one alert per incident and closes it when the assertion passes again.
Routing is per monitor, so the payments team and the platform team can own different checks. Opsgenie is on every paid plan.
Setup Guide
Step 1: Create Integration in Opsgenie
- Log in to Opsgenie
- Go to Settings → Integration list
- Click Add integration
- Search for "API" and select the API integration
- Copy the API Key
Step 2: Add Opsgenie in Assert
- Go to Alerts → Channels in your Assert dashboard
- Click Add Channel → Opsgenie
- Paste your API key
- (Optional) Select the team to route alerts to
- Click Save
Step 3: Test the Integration
Click Send Test. Assert creates a test alert in Opsgenie. Close the test alert once you see it.
Step 4: Assign to Monitors
Open each monitor. Add the Opsgenie channel under Alert Channels.
How It Works
Alert Creation
When a monitor fails, Assert creates an Opsgenie alert:
{
"message": "Monitor Failed: Production API",
"alias": "ApiAssert-mon_abc123",
"description": "API health check failed",
"priority": "P1",
"source": "Assert",
"tags": ["api", "production", "ApiAssert"],
"details": {
"Monitor": "Production API",
"URL": "https://api.example.com/health",
"Status Code": "500",
"Response Time": "2,340ms",
"Region": "US East",
"Failure": "$.status expected 'success', got 'error'"
}
}
Auto-Close
Assert closes the alert with the same alias when the assertion passes again.
Configuration Options
| Option | Description |
|---|---|
| API Key | Your Opsgenie API integration key |
| Team | Default team to route alerts to |
| Priority | Default priority (P1-P5) |
| Auto-close | Automatically close alerts on recovery |
Priority Mapping
Set the priority by monitor type:
| Monitor Type | Opsgenie Priority |
|---|---|
| Production APIs | P1 (Critical) |
| Core services | P2 (High) |
| Supporting services | P3 (Moderate) |
| Staging/Dev | P4 (Low) |
Best Practices
Route to Teams
Create Opsgenie teams for different services:
- Platform Team for core API monitors
- Payments Team for payment processing monitors
- Integrations Team for third-party API monitors
Configure Escalations
Set up escalation policies in Opsgenie:
- Immediate: on-call engineer
- After 5 min: notify the team channel
- After 15 min: escalate to the team lead
- After 30 min: escalate to the manager
Use Alert Actions
Opsgenie alert actions worth wiring up:
- Acknowledge to claim the alert
- Add Note to record what you found
- Run Playbook to execute runbook steps
- Create Jira to track the incident
Set Up Schedules
Create on-call schedules in Opsgenie:
Weekly Rotation:
├── Mon-Wed: Alice
├── Wed-Fri: Bob
└── Fri-Mon: Charlie
Troubleshooting
Alerts not creating?
- Check the API key
- Check that the integration is enabled in Opsgenie
- Check that your Opsgenie plan includes API integrations
Alerts not routing to team?
- Check that the team name matches exactly
- Check the team routing rules in Opsgenie
- Check that the integration can create alerts for the team
Alerts not auto-closing?
- Check that "Auto-close" is enabled in Assert
- Check that the alias is set correctly
- Check that the integration can close alerts
Too many alerts?
- Turn on alert deduplication in Opsgenie
- Use the Assert alert cooldown
- Increase the monitor check interval
Advanced: Alert Policies
Opsgenie alert policies rewrite alerts as they arrive:
- Go to Settings → Alert policies
- Create a policy that matches the source "Assert"
- Set the modifications you want (priority, team, tags)
Example policy:
IF source = "Assert"
AND message contains "staging"
THEN set priority to P4
AND add tag "non-critical"
Integration with Atlassian Suite
Opsgenie connects to the rest of Atlassian:
- Jira to create tickets from alerts
- Statuspage to update status when alerts trigger
- Confluence to link runbooks
Next Steps
- Set up Slack for team visibility
- Configure PagerDuty as backup
- Learn about alerting