Overview
Integrate Datadog with your GitLab projects to streamline troubleshooting of code issues and get suggested changes on your source code.
Get context-relevant code snippets while investigating issues in Error Tracking, Continuous Profiler, Code Security, and many more areas within Datadog.
Protect your production code base with merge request comments from Code Security, Test Optimization, and CI Visibility that provide automated code reviews and suggested changes.
GitLab instances
Using the GitLab Source Code integration, connect your GitLab.com or GitLab Self-Managed instance to Datadog to enable source code functionality and monitor your GitLab environment. Manage your GitLab instances through the Configuration tab to get started.

Source code functionality
When installed with the correct scopes, this integration powers source code integration features across Datadog to help you troubleshoot and take action on your code:
- See code snippets in your stack traces to identify where code problems originate. This can speed up investigations in Error Tracking, Continuous Profiler, Dynamic Instrumentation, and Live Debugger.
- Streamline code reviews with automated feedback and suggested changes from CI Visibility, Code Security, and Test Optimization, posted directly on merge requests.
- Access multiple service definitions in GitLab from the Software Catalog.
Repository events
This integration also captures GitLab repository events, which allows you to:
- Track new features from code changes.
- Identify when new code changes lead to system alerts or build failures.
- Discuss code changes with your team.
- Declare an incident or export an event to an ongoing incident.
Setup
Some features require additional setup beyond installing the GitLab Source Code integration. Installing the integration to connect your GitLab groups and projects to Datadog only grants the scopes and roles that features require as prerequisites. It doesn’t enable any billable functionality by default, and you won’t incur additional charges unless you explicitly configure a paid feature.
- In the GitLab Source Code integration tile, navigate to the Configuration tab.
- Click Connect GitLab Instance.
- Under Confirm Prerequisites, select GitLab.com or Self-Managed:
- GitLab.com: Select Connect your GitLab account and authorize Datadog to access your GitLab account.
- Self-Managed: Enter your GitLab Host Name, and click Verify Ingress to confirm that Datadog servers can connect to your GitLab instance. For server IPs, see the Webhooks section of IP Ranges.
- Under Perform Actions in GitLab, click Datadog Integration to open integration settings in GitLab.
- In GitLab, enter all relevant information to connect to Datadog. This integration ingests GitLab webhooks into Datadog. Optionally, you can also enable CI Visibility here.
- Click Save changes, then Return to Datadog.
- (Optional) In Datadog, click Token Settings to return to GitLab. Clear the Service account token expiration setting to allow long-lived tokens, which you’ll need in the next step. Click Return to Datadog.
- In Datadog, under Create Service Account, click Service Accounts to go to the service account settings in GitLab. Create a service account with the scopes listed in Datadog. Copy the Secret Access Token and paste it into Datadog to register the account.
- (Self-Managed only) Create an OAuth application on your GitLab instance:
- Under Create OAuth App, click Applications to open GitLab’s Application settings.
- Create an application with the scopes listed in Datadog, then copy and paste the Name, ID, and Secret into Datadog.
- Select Connect your GitLab account and authorize Datadog to access your GitLab account.
- Select GitLab Groups and/or GitLab Projects to add the service account to at least one group or project. Make sure the service account has the Reporter role.
- Click Return to Datadog, then Finish.
After setup, you’re returned to your original location in Datadog. To enable inline code snippets in APM, set up Source Code Integration.
Data Collected
Metrics
GitLab Source Code does not include any metrics.
Events
GitLab Source Code does not include any events.
Troubleshooting
Need help? Contact Datadog support.