選択したサイト () では現在 CI Visibility は利用できません。

概要

Buildkite is a continuous integration and deployment platform that allows you to run builds on your own infrastructure, providing you with full control over security and customizing your build environment while managing orchestration in the cloud.

Set up tracing on Buildkite to optimize your resource usage, reduce overhead, and improve the speed and quality of your software development lifecycle.

互換性

Pipeline Visibilityプラットフォーム定義
Partial retriesPartial pipelinesView partially retried pipeline executions.
インフラストラクチャーメトリクスの相関インフラストラクチャーメトリクスの相関Correlate jobs to infrastructure host metrics for Buildkite agents.
Manual stepsManual stepsView manually triggered pipelines.
Queue timeQueue timeView the amount of time pipeline jobs sit in the queue before processing.
Custom tags and measures at runtimeCustom tags and measures at runtimeConfigure custom tags and measures at runtime.
Custom spansCustom spansConfigure custom spans for your pipelines.

Datadog インテグレーションの構成

To set up the Datadog integration for Buildkite:

  1. Buildkite の Settings > Notification Services に移動し、add a Datadog Pipeline Visibility integration をクリックします。
  2. 以下の情報をフォームに入力してください。
    • Description: Datadog CI Visibility インテグレーションのように、将来的にインテグレーションを識別するのに役立つ説明です。
    • API key: Datadog API キーです。
    • Datadog site:
    • Pipelines: トレースするすべてのパイプラインまたはパイプラインのサブセットを選択します。
    • Branch filtering: すべてのブランチをトレースする場合は空のままにします。または、トレースしたいブランチのサブセットを選択します。
  3. Add Datadog Pipeline Visibility Notification をクリックして、インテグレーションを保存します。

カスタムタグの設定

カスタムタグは buildkite-agent meta-data set コマンドを使用して Buildkite トレースに追加することができます。 dd_tags. で始まるキーを持つメタデータタグはすべて、ジョブとパイプラインのスパンに追加されます。これらのタグを使用して、パイプラインを検索および整理するための文字列ファセットを作成することができます。

以下の YAML は、チーム名と Go バージョンのタグが設定されたシンプルなパイプラインを表しています。

steps:
  - command: buildkite-agent meta-data set "dd_tags.team" "backend"
  - command: go version | buildkite-agent meta-data set "dd_tags.go.version"
    label: Go version
  - commands: go test ./...
    label: Run tests

Datadog では、ルートスパンだけでなく、関連するジョブスパンにも以下のタグが表示されます。

  • team: backend
  • go.version: go version go1.17 darwin/amd64 (出力はランナーに依存します)

その結果、パイプラインは次のようになります。

カスタムタグによる Buildkite パイプラインのトレース

Any metadata with a key starting with dd-measures. and containing a numerical value will be set as a metric tag that can be used to create numerical measures. You can use the buildkite-agent meta-data set command to create such tags. This can be used for example to measure the binary size in a pipeline:

steps:
  - commands:
    - go build -o dst/binary .
    - ls -l dst/binary | awk '{print \$5}' | tr -d '\n' | buildkite-agent meta-data set "dd_measures.binary_size"
    label: Go build

出来上がったパイプラインは、パイプラインスパンに以下のようなタグが表示されます。

  • binary_size: 502 (出力はファイルサイズに依存します)

この例では、binary_size の値を使って、バイナリーサイズの経時変化をプロットすることができます。

Datadog でパイプラインデータを視覚化する

The CI Pipeline List and Executions pages populate with data after the pipelines finish.

The CI Pipeline List page shows data for only the default branch of each repository.

インフラストラクチャーメトリクスとジョブの相関付け

If you are using Buildkite agents, you can correlate jobs with the infrastructure that is running them. For this feature to work, install the Datadog Agent in the hosts running the Buildkite agents.

部分的およびダウンストリームパイプラインを表示する

Executions ページでは、検索バーで以下のフィルターを使用することができます。

Downstream Pipeline
可能な値: truefalse
Manually Triggered
可能な値: truefalse
Partial Pipeline
可能な値: retrypausedresumed
検索クエリに Partial Pipeline:retry を入力したパイプラインの実行画面

これらのフィルターは、ページの左側にあるファセットパネルからも適用することができます。

Partial Pipeline ファセットが展開され、値 Retry が選択されたファセットパネル、Partial Retry ファセットが展開され、値 true が選択されたファセットパネル

参考資料

PREVIEWING: evan.li/clarify-agentless