Integrations2 min read
GitLab CI/CD Integration Guide
Ingest GitLab pipeline failures and auto-resolve on branch success in OpsKnight.
OpsKnight natively integrates with GitLab.com and self-hosted GitLab CE/EE via Webhooks.
🎯 Key Capabilities
- Pipeline Failure Alerting: Triggers
HIGHorCRITICALincidents when CI/CD pipelines fail on monitored branches (e.g.main,production,release/*). - Automatic Recovery: When a subsequent pipeline run succeeds on the same branch, the active incident is automatically resolved.
- Merge Request Context: Preserves commit author, commit message, commit SHA link, and merge request URLs in custom incident details.
- Secret Token Security: Authenticates incoming payloads using the
x-gitlab-tokensecret header.
🚀 Setup Instructions
1. In OpsKnight
- Go to Services $\to$ select target service $\to$ Integrations tab.
- Click Add Integration $\to$ choose GitLab.
- Copy the Webhook URL and Integration Key / Secret Token.
https://your-opsknight.com/api/integrations/gitlab?integrationId=YOUR_INTEGRATION_ID&integrationKey=YOUR_INTEGRATION_KEY
2. In GitLab
- Open your GitLab Project $\to$ Settings $\to$ Webhooks.
- Click Add new webhook.
- URL: Paste your OpsKnight Webhook URL.
- Secret token: Paste your OpsKnight Integration Key or configured
signatureSecret. - Trigger Events:
- Check ☑️ Pipeline events
- Optionally check ☑️ Job events
- SSL verification: Keep ☑️ Enable SSL verification checked.
- Click Add webhook.
🔍 Payload Processing & Deduplication
- Deduplication Key: Generated per project and branch/ref (e.g.
gitlab-myorg-myrepo-main). This guarantees that multiple pipeline retries on the same branch resolve the existing incident instead of creating noisy duplicate alerts. - Status Lifecycle:
failed$\to$ Triggers incidentsuccess$\to$ Auto-resolves active incidentcanceled/running/pending$\to$ Acknowledges / updates timeline
Last updated for v1.3
Edit this page on GitHub