---
title: Bitbucket Cloud Source Code
description: >-
  Bitbucket is a web-based hosting service for software development projects
  that use the Git revision control system.
breadcrumbs: Docs > Integrations > Bitbucket Cloud Source Code
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Bitbucket Cloud Source Code
Integration version1.0.0
{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

{% alert level="info" %}
This integration is in Preview. Use [this form](https://forms.gle/Jis7h1ELT88SYcet7) to request access.
{% /alert %}

## Overview{% #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{% #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](https://app.datadoghq.com/integrations/bitbucket-source-code/configuration) to get started.



### Source code functionality{% #source-code-functionality %}

When installed with the correct permissions, this integration powers [source code integration](https://docs.datadoghq.com/integrations/guide/source-code-integration.md) 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](https://docs.datadoghq.com/security/code_security/dev_tool_int/github_pull_requests.md) and [Test Optimization](https://docs.datadoghq.com/continuous_integration/guides/pull_request_comments.md), posted directly on pull requests.

### Bitbucket pipelines{% #bitbucket-pipelines %}

For more in-depth monitoring of your Bitbucket pipelines, check out [CI Pipeline Visibility](https://app.datadoghq.com/ci/getting-started). CI Pipeline Visibility provides granular insights into your user workflow, lets you access detailed Git metadata, and tracks pipeline performance over time.

## Setup{% #setup %}

{% alert level="info" %}
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.
{% /alert %}

1. In the [Bitbucket Cloud Source Code integration tile](https://app.datadoghq.com/integrations/bitbucket-source-code/), navigate to the **Configuration** tab.
1. Click **Connect Bitbucket Account**.
1. In the **Connect Bitbucket Cloud Workspace** dialog, confirm the prerequisites, then click **Connect your Bitbucket Cloud account**.
1. In Bitbucket, click **Grant access** to authorize Datadog.
1. Back in Datadog, select your Bitbucket Cloud workspace and click **Connect**.
1. 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.
1. In Bitbucket, create an access token with a descriptive name, for example `datadog-source-code-token`.
1. (Recommended) Set the expiration to **No expiry**.
1. Select the following scopes:
   - **Account**: **Read**
   - **Projects**: **Read**
   - **Repositories**: **Read**, **Write**
   - **Pull requests**: **Read**, **Write**
   - **Webhooks**: **Read and write**
1. Click **Create**, then copy the generated token.
1. Back in Datadog, paste the token into the **Secret Access Token** field.
1. 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](https://docs.datadoghq.com/integrations/guide/source-code-integration.md).

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

Bitbucket Cloud Source Code does not include any metrics.

### Events{% #events %}

Bitbucket Cloud Source Code does not include any events.

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
