For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/integrations/bitbucket-source-code.md. A documentation index is available at /llms.txt.

Bitbucket Cloud Source Code

Integration version1.0.0
This product is not supported for your selected Datadog site. ().
This integration is in Preview. Use this form to request access.

Overview

Integrate Datadog with your Bitbucket repositories 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 pull request comments from Code Security, Test Optimization, and CI Visibility that provide automated code reviews and suggested changes.

Bitbucket Cloud workspaces

Using the Bitbucket Cloud Source Code integration, connect your Bitbucket Cloud workspaces to Datadog to enable source code functionality. Manage your connected workspaces through the Configuration tab to get started.

Configuration tab of Bitbucket Cloud Source Code integration

Source code functionality

When installed with the correct permissions, 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 Code Security and Test Optimization, posted directly on pull requests.

Bitbucket pipelines

For more in-depth monitoring of your Bitbucket pipelines, check out CI Pipeline Visibility. CI Pipeline Visibility provides granular insights into your user workflow, lets you access detailed Git metadata, and tracks pipeline performance over time.

Setup

Some features require additional setup beyond installing the Bitbucket Cloud Source Code integration. Installing the integration connects your Bitbucket repositories to Datadog and grants only the permissions and access required as prerequisites for supported features. It doesn't enable any billable functionality by default, and you only incur additional charges if you explicitly configure a paid feature.
  1. In the Bitbucket Cloud Source Code integration tile, navigate to the Configuration tab.
  2. Click Connect Bitbucket Account.
  3. In the Connect Bitbucket Cloud Workspace dialog, confirm the prerequisites, then click Connect your Bitbucket Cloud account.
  4. In Bitbucket, click Grant access to authorize Datadog.
  5. Back in Datadog, select your Bitbucket Cloud workspace and click Connect.
  6. In the Create Workspace-level Access Token step, click Access Tokens to open Bitbucket again and create a token. A workspace-level access token lets Datadog perform actions in your workspace automatically, such as posting pull request comments.
  7. In Bitbucket, create an access token with a descriptive name, for example datadog-source-code-token.
  8. (Recommended) Set the expiration to No expiry.
  9. Select the following scopes:
    • Account: Read
    • Projects: Read
    • Repositories: Read, Write
    • Pull requests: Read, Write
    • Webhooks: Read and write
  10. Click Create, then copy the generated token.
  11. Back in Datadog, paste the token into the Secret Access Token field.
  12. Select Never expires or enter your token’s expiration date by selecting Expires on, then click Connect.

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

Bitbucket Cloud Source Code does not include any metrics.

Events

Bitbucket Cloud Source Code does not include any events.

Troubleshooting

Need help? Contact Datadog support.