Skip to main content
OpenSRE queries OpsGenie to retrieve active alerts and their details — correlating on-call incidents with infrastructure events and investigation findings.

Prerequisites

  • OpsGenie account (Atlassian or standalone)
  • API key with read access

Setup

Option 1: Interactive CLI

opensre integrations setup
Select OpsGenie when prompted and provide your API key.

Option 2: Environment variables

Add to your .env:
OPSGENIE_API_KEY=your-api-key
OPSGENIE_REGION=us   # or "eu" for EU accounts
VariableDefaultDescription
OPSGENIE_API_KEYRequired. OpsGenie API key
OPSGENIE_REGIONusRegion: us or eu

Option 3: Persistent store

{
  "version": 1,
  "integrations": [
    {
      "id": "opsgenie-prod",
      "service": "opsgenie",
      "status": "active",
      "credentials": {
        "api_key": "your-api-key",
        "region": "us"
      }
    }
  ]
}

Creating an API key

  1. In OpsGenie, go to SettingsAPI key management
  2. Click Add new API key
  3. Name it opensre and enable Read access
  4. Copy the key
EU accounts use a different endpoint. Set OPSGENIE_REGION=eu if your OpsGenie URL is app.eu.opsgenie.com.

Verify

opensre integrations verify --service opsgenie
Expected output:
Service: opsgenie
Status: passed
Detail: Connected to OpsGenie (US region); API key accepted

Troubleshooting

SymptomFix
401 UnauthorizedCheck the API key — ensure it has Read access
404 Not FoundTry setting OPSGENIE_REGION=eu if you’re on the EU instance
Rate limitedOpsGenie enforces per-minute rate limits; reduce query frequency

Security best practices

  • Use a read-only API key — OpsGenie supports granular permission scopes.
  • Store the API key in .env, not in source code.