> Source: https://www.ymotongpoo.com/works/otel-specs-ja/semconv/resource/cicd/


# CI/CD

参考:

- [CI/CDのトレースセマンティック規約](/works/otel-specs-ja/semconv/cicd/cicd-spans/)

## 継続的インテグレーションと継続的デリバリー（CI/CD）

### CI/CDパイプライン

<!-- semconv entity.cicd.pipeline -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid)

**type:** `cicd.pipeline`

**Description:** パイプラインは、ソフトウェアチームがコードを届けるのを助ける、一連の自動化されたステップです。

**Attributes:**

| Role | Key | Stability | [Requirement Level](/works/otel-specs-ja/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- | --- |
| Identity | [`cicd.pipeline.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cicd/) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Required` | string | CI/CDシステム内における、人間が読めるパイプラインの名前。 | `Build and Test`; `Lint`; `Deploy Go Project`; `deploy_to_environment` |
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### CI/CDパイプライン実行

あるパイプライン実行のすべてのスパンに対して次の属性を効率的に設定するには、これらを次のようなリソースとして定義すべきです。

このリソースはパイプライン実行ごとに一意であるため、そのTracerを通じて発行されるあらゆるスパンのリソースを設定できるように、パイプライン実行ごとに個別の[TracerProvider](/works/otel-specs-ja/spec/trace/api/#tracerprovider)をインスタンス化することになります。

CI/CDパイプライン実行リソースをメトリクスで使用すると、本質的に高カーディナリティになり、一部のメトリクスストレージバックエンドではコストが増加する可能性があります。そのため、メトリクスに対してCI/CDパイプライン実行リソースを使用することはオプトインでなければなりません（MUST）。

<!-- semconv entity.cicd.pipeline.run -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid)

**type:** `cicd.pipeline.run`

**Description:** パイプライン実行は、あるパイプラインのタスクの単一の実行です。

**Attributes:**

| Role | Key | Stability | [Requirement Level](/works/otel-specs-ja/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- | --- |
| Identity | [`cicd.pipeline.run.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cicd/) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Required` | string | CI/CDシステム内における、パイプライン実行の一意な識別子。 | `120912` |
| Description | [`cicd.pipeline.run.url.full`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cicd/) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Recommended` | string | パイプライン実行を特定・識別するための完全なアドレスを提供する、パイプライン実行の[URL](https://wikipedia.org/wiki/URL)。 | `https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763?pr=1075` |
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### CI/CDワーカー

<!-- semconv entity.cicd.worker -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid)

**type:** `cicd.worker`

**Description:** CI/CDワーカーは、作業を実行する（パイプラインのタスクを実行する、同期を行うなど）CI/CDシステムのコンポーネントです。
1回のパイプライン実行は、複数のワーカーに分散されることがあります。あるワーカーに関連付けられたOpenTelemetryシグナルは、対応する作業を実行したそのワーカーに関連付けられるべきです。
例えば、あるパイプライン実行が複数のワーカーを含む場合、そのタスク実行のスパンは、各タスク実行を処理したワーカーに対応する異なる`cicd.worker`リソースを参照する場合があります。パイプライン実行の親スパンは、代わりにCI/CDコントローラーを`cicd.worker`リソースとして参照する場合があります。

**Attributes:**

| Role | Key | Stability | [Requirement Level](/works/otel-specs-ja/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- | --- |
| Identity | [`cicd.worker.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cicd/) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Required` | string | CI/CDシステム内における、ワーカーの一意な識別子。 | `abc123`; `10.0.1.2`; `controller` |
| Description | [`cicd.worker.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cicd/) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Recommended` | string | CI/CDシステム内における、ワーカーの名前。 | `agent-abc`; `controller`; `Ubuntu LTS` |
| Description | [`cicd.worker.url.full`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cicd/) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Recommended` If available | string | ワーカーを特定・識別するための完全なアドレスを提供する、ワーカーの[URL](https://wikipedia.org/wiki/URL)。 | `https://cicd.example.org/worker/abc123` |
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## バージョン管理システム（VCS）

### VCSリポジトリ

<!-- semconv entity.vcs.repository -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid)

**type:** `vcs.repository`

**Description:** バージョン管理システム内のリポジトリ。

**Attributes:**

| Role | Key | Stability | [Requirement Level](/works/otel-specs-ja/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- | --- |
| Identity | [`vcs.repository.url.full`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Required` | string | ブラウザーを通じてそのリポジトリを特定・識別するための完全なHTTP(S)アドレスを提供する、リポジトリの[正規URL](https://support.google.com/webmasters/answer/10347851)。[1] | `https://github.com/opentelemetry/open-telemetry-collector-contrib`; `https://gitlab.com/my-org/my-project/my-projects-project/repo` |
| Description | [`vcs.repository.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Recommended` | string | 人間が読めるリポジトリの名前。GitLabのGroup/SubGroupやGitHubのorganizationのような追加の識別子は含めるべきではありません（SHOULD NOT）。[2] | `semantic-conventions`; `my-cool-repo` |

**[1] `vcs.repository.url.full`:** GitのVersion Control Systemでは、正規URLには`.git`拡張子を含めるべきではありません（SHOULD NOT）。

**[2] `vcs.repository.name`:** 名前のみであるため、複数のorganizationやgroupをまたいでテレメトリーを収集する場合、同じリポジトリのフォークと衝突する可能性があります。
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### VCS参照

<!-- semconv entity.vcs.ref -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

**type:** `vcs.ref`

**Description:** バージョン管理システム内の、特定のバージョンへの参照。

**Attributes:**

| Role | Key | Stability | [Requirement Level](/works/otel-specs-ja/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- | --- |
| Identity | [`vcs.ref.head.revision`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Required` | string | リビジョン。文字通り[改訂されたバージョン](https://www.merriam-webster.com/dictionary/revision)を指します。リビジョンは、多くの場合Gitのコミットオブジェクト、またはSVNのリビジョン番号を指します。[1] | `9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc`; `main`; `123`; `HEAD` |
| Description | [`vcs.ref.head.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Recommended` | string | リポジトリ内の**ブランチ**や**タグ**などの[参照](https://git-scm.com/docs/gitglossary#def_ref)の名前。[2] | `my-feature-branch`; `tag-1-test` |
| Description | [`vcs.ref.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) | `Recommended` | string | リポジトリ内の[参照](https://git-scm.com/docs/gitglossary#def_ref)の種別。 | `branch`; `tag` |

**[1] `vcs.ref.head.revision`:** `head`は、今まさにいる場所、つまりある時点における現在の参照を指します。リビジョンは、リポジトリ内の参照に対する記録された変更の完全な[ハッシュ値（用語集参照）](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf)であり、[コミット](https://git-scm.com/docs/git-commit)オブジェクトを指します。必ずしもハッシュである必要はなく、単に単調増加する整数である[リビジョン番号](https://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html)を定義するだけでもかまいません。`ref.head.name`と同一の場合でも、含めるべきです（SHOULD）。VCSシステムと状況に応じたコンテキストに基づいて、リビジョンとしてどの値を設定するかは実装者に委ねられます。

**[2] `vcs.ref.head.name`:** `head`は、今まさにいる場所、つまりある時点における現在の参照を指します。

---

`vcs.ref.type`には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `branch` | [ブランチ](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
| `tag` | [タグ](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag) | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

