Thanks to visit codestin.com
Credit goes to support.pagerduty.com

GitLab Changes Integration Guide | PagerDuty

GitLab + PagerDuty Benefits

  • Send merge request events from GitLab to PagerDuty services to provide context for anyone using PagerDuty.
  • Responders may review change events within the Recent Activity timeline of a PagerDuty service during incident triage or hypercare. They can also see recent changes on the incidents of the service and review all changes in a comprehensive list of recent changes across all services.

Requirements

📘

Availability

This integration is available with the PagerDuty AIOps add-on. If you would like to sign up for a trial of PagerDuty AIOps features, read PagerDuty AIOps Trials.

Your service configuration must have AIOps enabled to view change events. AIOps Service Configuration is in Limited General Availability. Refer to Configurable Service Settings for more information and enablement steps.

In PagerDuty: This integration requires a Manager base role or higher to configure.

In GitLab: This integration requires a Maintainer, Admin, or Owner role to configure.

How It Works

  • When a merge_request event occurs within a GitLab repository, a webhook is sent to the endpoint of the integrated PagerDuty service.
  • These events are viewable as change events in the Recent Activity timeline of the service, on incidents associated with that service, and in a global list of all changes. They do not generate alerts, incidents, or notifications.
📘

Change Events

For more information about how PagerDuty surfaces change events on services, incidents, and in the Service Directory, see change events.

Integration Walkthrough

In PagerDuty

👍

Tip

Mapping your GitLab events to the PagerDuty service that represents what you are changing allows responders to quickly identify recent changes on their service when they receive a notification for an incident.

  1. In your PagerDuty account, navigate to Services Service Directory and click the name of your preferred service.
  2. Select the Integrations tab and click Add an integration.
  3. Search for and select GitLab and click Add.
Select GitLab

Select GitLab

  1. In the list of integrations, click to the right of the GitLab integration.
Integration details

Integration details

  1. In the Integration URL section, click to copy the integration URL to your clipboard. It is in the following format: https://events.pagerduty.com/integration/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/change/enqueue. Save this URL in a safe place for use in the following section.

Branch Tracking

By default, the integration tracks changes on your main/master branch. If you would like to change which branch is tracked, or track multiple branches, you can do this in the PagerDuty web app. If you do not wish to change which branch is tracked, skip ahead to the following section In GitLab.

  1. In your PagerDuty account, navigate to Services Service Directory and click the name of the service with your GitLab integration.
  2. Select the Integrations tab and click to the right of the GitLab integration.
Integration settings

Integration settings

  1. On the right-hand side, click Edit Integration.
  2. In the branch field, enter the name of the branch you would like to track. Note: If you would like to track multiple branches, add a space between the name of each branch, for example: feature-branch-1 feature-branch-2 feature-branch-3.
  3. Click Save changes.

In GitLab

  1. In your GitLab account, navigate to the project where you would like to track changes. In the left-side menu, select Settings Webhooks.
  2. Paste the integration URL you generated in PagerDuty (in the previous section) into the URL field.
  3. Under the Trigger header, deselect Push events and select Merge request events.
  4. Click Add webhook.

Using the Integration

After you have added a webhook to your GitLab project, you can test the integration by creating a merge request in the project. In the PagerDuty web app, navigate to the integrated service, click its title, and you see an entry in the Recent Changes section:

A screenshot of the PagerDuty UI detailing an example change event

Example change event

FAQ

Is it possible to modify change events using Event Orchestration?

Not at this time, but we are interested to learn about what you would like to accomplish. Contact our Support team with your use case and feedback.

Is it possible to send change events from multiple GitLab branches?

Yes, you can add any number of integrations to a single service, including multiple GitLab integrations. See the section Branch Tracking for information about customizing which branch an integration is associated with.

Are change events viewable in Slack or the mobile app?

Not at this time, but we would like to hear your feedback. Contact our Support team with your feedback.



Learn more