Opsgenie Integration
Connect APIAssert to Atlassian Opsgenie for intelligent alert routing. When monitors fail, alerts are created and routed to the right team through your Opsgenie escalation policies.
Why Opsgenie?
- On-call scheduling — alerts go to whoever is on-call
- Team-based routing — route to specific teams by monitor
- Escalation policies — automatic escalation if not acknowledged
- Atlassian integration — works with Jira, Confluence, Statuspage
What You'll Get
- Automatic alert creation when monitors fail
- Auto-close when monitors recover
- Rich context — monitor details, response data, failure reasons
- Alert deduplication — prevent alert storms
Setup Guide
Step 1: Create Integration in Opsgenie
- Log in to Opsgenie
- Go to Settings → Integration list
- Click Add integration → Search for "API"
- Select API integration
- Copy the API Key
Step 2: Add Opsgenie in APIAssert
- Go to Alerts → Channels in your APIAssert dashboard
- Click Add Channel → Opsgenie
- Paste your API key
- (Optional) Select a team to route alerts to
- Click Save
Step 3: Test the Integration
Click Send Test to create a test alert in Opsgenie. Close it after confirming it appeared.
Step 4: Assign to Monitors
Edit your monitors and add the Opsgenie channel under Alert Channels.
How It Works
Alert Creation
When a monitor fails, APIAssert creates an Opsgenie alert:
{
"message": "Monitor Failed: Production API",
"alias": "pingpost-mon_abc123",
"description": "API health check failed",
"priority": "P1",
"source": "APIAssert",
"tags": ["api", "production", "pingpost"],
"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
When the monitor recovers, APIAssert closes the alert using the alias for matching.
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
Configure priority based on 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 — Core API monitors
- Payments Team — Payment processing monitors
- Integrations Team — Third-party API monitors
Configure Escalations
Set up escalation policies in Opsgenie:
- Immediate: On-call engineer
- After 5 min: Notify team channel
- After 15 min: Escalate to team lead
- After 30 min: Escalate to manager
Use Alert Actions
Configure Opsgenie alert actions:
- Acknowledge — I'm looking at it
- Add Note — Document findings
- Run Playbook — Execute runbook steps
- Create Jira — Track as 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?
- Verify the API key is correct
- Check that the integration is enabled in Opsgenie
- Ensure your Opsgenie subscription supports API integrations
Alerts not routing to team?
- Verify the team name matches exactly
- Check team routing rules in Opsgenie
- Ensure the integration has permission to create alerts for the team
Alerts not auto-closing?
- Verify "Auto-close" is enabled in APIAssert
- Check that the alias is being set correctly
- Ensure the integration has permission to close alerts
Too many alerts?
- Enable alert deduplication in Opsgenie
- Use APIAssert's alert cooldown feature
- Adjust monitor check intervals
Advanced: Alert Policies
Create Opsgenie alert policies to modify incoming alerts:
- Go to Settings → Alert policies
- Create policy matching source "APIAssert"
- Configure modifications (priority, team, tags)
Example policy:
IF source = "APIAssert"
AND message contains "staging"
THEN set priority to P4
AND add tag "non-critical"
Integration with Atlassian Suite
Opsgenie integrates seamlessly with other Atlassian products:
- Jira — Create tickets from alerts
- Statuspage — Update status when alerts trigger
- Confluence — Link to runbooks
Next Steps
- Set up Slack for team visibility
- Configure PagerDuty as backup
- Learn about alerting