# Buildkite

## About the integration

The Buildkite integration provides Sleuth with the ability to track your Buildkite builds and associate them with your corresponding Sleuth deploys. Once configured, the Sleuth Buildkite integration silently monitors your deployment activity, and ties your Buildkite builds with associated deployments you make to your integrated change sources by matching the git SHAs from your code repos. Sleuth then shows you a snapshot of your build state at the time of deploy.

## Setting up the integration

To add the Sleuth Buildkite integration:

1. Click **Integrations** in the sidebar.
2. Click the\*\* CI/CD\*\* tab, then click **add** in the Buildkite card.\
   ![](https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2Fgit-blob-ab85849333b2c57727e029ff74fd70049cba5f95%2Fbuildkite-disabled.png?alt=media)
3. Enter your Buildkite User API token if you have one.\
   ![](https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2Fgit-blob-b5a3ea03673ca90da4c951f2cdad4b29152e213d%2Fbuildkite-api-token-entry.png?alt=media)\
   If not, click on **generate** and create one:\
   ![](https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2Fgit-blob-4455ff9ea7530ff196c4c935f52e19b83b24b10e%2Fbuildkite-user-api-token-generate.png?alt=media)\
   Make sure to select the requested scopes, then copy the new token into the Sleuth dialog.
4. Press **Save**
5. On successful integration, you'll see a new connection you can remove or inspect. You'll configure the default build server later.\
   ![](https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2Fgit-blob-304c4f4be145febe7a9d11283701eabb1b01178e%2Fbuildkite-enabled.png?alt=media)

You can create multiple connections and choose which connection is relevant for each usage.

{% hint style="info" %}
[Read the Buildkite documentation](https://buildkite.com/docs/apis/managing-api-tokens) for more information on generating Personal API Tokens.
{% endhint %}

## Configuring the integration

The Sleuth Buildkite integration configuration simply consists of pointing the Buildkite integration to your projects that you want Sleuth to collect build information for.

To configure the Buildkite integration, you will need to set a default build server:

1. Click **Integrations** in the sidebar, then click the **Builds** tab.
2. Click the **Set default build server** dropdown.\
   ![](https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2Fgit-blob-304c4f4be145febe7a9d11283701eabb1b01178e%2Fbuildkite-enabled.png?alt=media)
3. Select a project to set as the default build server. You'll need to add a code deployment to the selected project if you haven't already done so.

Now that the Buildkite integration is configured, you will begin seeing information displayed in the Builds tab of a [deploy](https://help.sleuth.io/modeling-your-deployments/deploy-cards), as shown below.

![](https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2Fgit-blob-912185ace5072bb0660de32fbe04bc6e57d7c8ec%2F6924f1a%20-%20Sleuth%202021-01-31%2017-29-00.png?alt=media)

## Removing the integration

#### If you wish to disconnect the Buildkite integration for the organization:

1. Click on **Integrations** in the left sidebar, then on **Builds**.
2. In the Buildkite integration card, click **remove**.

If there are no more active connections, the Buildkite integration is disconnected and no longer available to any projects within that organization.
