- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
Use the custom tags and measures commands to add user-defined text and numerical tags to your pipeline traces in CI Pipeline Visibility. You can use the datadog-ci
NPM package to add custom tags to a pipeline trace or a job span, in addition to adding measures to a pipeline trace or a job span. From these custom tags and measures, you can create facets (string value tags) or measures (numerical value tags).
You can use facets and measures to filter, create visualizations, or create monitors for your pipelines in the CI Visibility Explorer.
Custom tags and measures work with the following CI providers:
Install the datadog-ci
(>=v1.15.0) CLI globally using npm
:
npm install -g @datadog/datadog-ci
Alternatively, you can try and use the beta standalone binary if you don’t want to use npm
.
To install the standalone binary on Linux, run:
curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-x64" --output "/usr/local/bin/datadog-ci" && chmod +x /usr/local/bin/datadog-ci
To install the standalone binary on MacOS, run:
curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_darwin-x64" --output "/usr/local/bin/datadog-ci" && chmod +x /usr/local/bin/datadog-ci
To install the standalone binary on Windows, run:
Invoke-WebRequest -Uri "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_win-x64.exe" -OutFile "datadog-ci.exe"
Tags can be added to the pipeline span or to the job span.
To do this, run the tag
command:
DATADOG_SITE= datadog-ci tag [--level <pipeline|job>] [--tags <tag1>] [--tags <tag2>] ...
You must specify a valid Datadog API key using the environment variable DATADOG_API_KEY
and the Datadog site using the environment variable DATADOG_SITE
.
The following example adds team
and service
tags to the pipeline span.
DATADOG_SITE= datadog-ci tag --level pipeline --tags team:backend --tags service:processor
The following example adds the tag go.version
to the span for the current job:
DATADOG_SITE= datadog-ci tag --level job --tags "go.version:`go version`"
To create a facet from a tag, click the gear icon next to a tag name on the Pipeline Executions page, and click Create Facet.
To add numerical tags to the pipeline span or the job span, run the measure
command:
DATADOG_SITE= datadog-ci measure [--level <pipeline|job>] [--measures <measure1>] [--measures <measure2>]...
You must specify a valid Datadog API key using the environment variable DATADOG_API_KEY
and the Datadog site using the environment variable DATADOG_SITE
.
The following example adds error_rate
and size
measures to the pipeline span:
DATADOG_SITE= datadog-ci measure --level pipeline --measures "error_rate:0.56" --measures "size:2327"
The following example adds a measure binary.size
to the span for the currently running job:
DATADOG_SITE= datadog-ci measure --level job --measures "binary.size:`ls -l dst/binary | awk '{print \$5}' | tr -d '\n'`"
To create a measure, click the gear icon next to a measures name on the Pipeline Executions page and click Create Measure.
To add tags and measures to GitHub jobs, datadog-ci CLI
version 2.29.0
or higher is required.
If the job name does not match the entry defined in the workflow configuration file (the GitHub job ID),
the DD_GITHUB_JOB_NAME
environment variable needs to be exposed, pointing to the job name. For example:
If the job name is changed using the name property:
jobs:
build:
name: My build job name
env:
DD_GITHUB_JOB_NAME: My build job name
steps:
- run: datadog-ci tag ...
If the matrix strategy is used, several job names are generated by GitHub by adding the matrix values at the end of the job name, within parenthesis. The DD_GITHUB_JOB_NAME
environment variable should then be conditional on the matrix values:
jobs:
build:
strategy:
matrix:
version: [1, 2]
os: [linux, macos]
env:
DD_GITHUB_JOB_NAME: build (${{ matrix.version }}, ${{ matrix.os }})
steps:
- run: datadog-ci tag ...