194 lines
10 KiB
Markdown
194 lines
10 KiB
Markdown
<!--- Hugo front matter used to generate the website version of this page:
|
|
linkTitle: CICD
|
|
--->
|
|
|
|
# CICD
|
|
|
|
<!-- toc -->
|
|
|
|
- [Continuous Integration and Continuous Deployment (CICD)](#continuous-integration-and-continuous-deployment-cicd)
|
|
- [CICD pipeline](#cicd-pipeline)
|
|
- [CICD pipeline run](#cicd-pipeline-run)
|
|
- [CICD worker](#cicd-worker)
|
|
- [Version Control System (VCS)](#version-control-system-vcs)
|
|
- [VCS repository](#vcs-repository)
|
|
- [VCS reference](#vcs-reference)
|
|
|
|
<!-- tocstop -->
|
|
|
|
See also:
|
|
|
|
- The [Trace semantic conventions for CICD](/docs/cicd/cicd-spans.md)
|
|
|
|
## Continuous Integration and Continuous Deployment (CICD)
|
|
|
|
### CICD pipeline
|
|
|
|
<!-- semconv entity.cicd.pipeline -->
|
|
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
|
<!-- see templates/registry/markdown/snippet.md.j2 -->
|
|
<!-- prettier-ignore-start -->
|
|
<!-- markdownlint-capture -->
|
|
<!-- markdownlint-disable -->
|
|
|
|
|
|
**Status:** 
|
|
|
|
**type:** `cicd.pipeline`
|
|
|
|
**Description:** A pipeline is a series of automated steps that helps software teams deliver code.
|
|
|
|
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
|
|---|---|---|---|---|---|
|
|
| [`cicd.pipeline.name`](/docs/registry/attributes/cicd.md) | string | The human readable name of the pipeline within a CI/CD system. | `Build and Test`; `Lint`; `Deploy Go Project`; `deploy_to_environment` | `Recommended` |  |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### CICD pipeline run
|
|
|
|
To efficiently set the following attributes for all spans of a pipeline run they should be defined as the following resource.
|
|
|
|
Since this resource is unique for each pipeline run, this means instantiating separate [TracerProviders](https://opentelemetry.io/docs/specs/otel/trace/api/#tracerprovider) for each pipeline run in order to be able to configure the resources of any spans emitted through that tracer.
|
|
|
|
Using the CICD pipeline run resource with metrics inherently causes high cardinality and may increase costs with some metric storage backends. Thus, using CICD pipeline run resource for metrics MUST be opt-in.
|
|
|
|
<!-- 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 -->
|
|
<!-- markdownlint-capture -->
|
|
<!-- markdownlint-disable -->
|
|
|
|
|
|
**Status:** 
|
|
|
|
**type:** `cicd.pipeline.run`
|
|
|
|
**Description:** A pipeline run is a singular execution of a given pipeline's tasks.
|
|
|
|
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
|
|---|---|---|---|---|---|
|
|
| [`cicd.pipeline.run.id`](/docs/registry/attributes/cicd.md) | string | The unique identifier of a pipeline run within a CI/CD system. | `120912` | `Recommended` |  |
|
|
| [`cicd.pipeline.run.url.full`](/docs/registry/attributes/cicd.md) | string | The [URL](https://wikipedia.org/wiki/URL) of the pipeline run, providing the complete address in order to locate and identify the pipeline run. | `https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763?pr=1075` | `Recommended` |  |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### CICD worker
|
|
|
|
<!-- semconv entity.cicd.worker -->
|
|
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
|
<!-- see templates/registry/markdown/snippet.md.j2 -->
|
|
<!-- prettier-ignore-start -->
|
|
<!-- markdownlint-capture -->
|
|
<!-- markdownlint-disable -->
|
|
|
|
|
|
**Status:** 
|
|
|
|
**type:** `cicd.worker`
|
|
|
|
**Description:** A CICD worker is a component of the CICD system that performs work (eg. running pipeline tasks or performing sync).
|
|
|
|
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
|
|---|---|---|---|---|---|
|
|
| [`cicd.worker.id`](/docs/registry/attributes/cicd.md) | string | The unique identifier of a worker within a CICD system. | `abc123`; `10.0.1.2`; `controller` | `Required` |  |
|
|
| [`cicd.worker.name`](/docs/registry/attributes/cicd.md) | string | The name of a worker within a CICD system. | `agent-abc`; `controller`; `Ubuntu LTS` | `Recommended` |  |
|
|
| [`cicd.worker.url.full`](/docs/registry/attributes/cicd.md) | string | The [URL](https://wikipedia.org/wiki/URL) of the worker, providing the complete address in order to locate and identify the worker. | `https://cicd.example.org/worker/abc123` | `Recommended` If available |  |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
## Version Control System (VCS)
|
|
|
|
### VCS repository
|
|
|
|
<!-- semconv entity.vcs.repo -->
|
|
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
|
<!-- see templates/registry/markdown/snippet.md.j2 -->
|
|
<!-- prettier-ignore-start -->
|
|
<!-- markdownlint-capture -->
|
|
<!-- markdownlint-disable -->
|
|
|
|
|
|
**Status:** 
|
|
|
|
**type:** `vcs.repo`
|
|
|
|
**Description:** A repository in the Version Control System.
|
|
|
|
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
|
|---|---|---|---|---|---|
|
|
| [`vcs.repository.name`](/docs/registry/attributes/vcs.md) | string | The human readable name of the repository. It SHOULD NOT include any additional identifier like Group/SubGroup in GitLab or organization in GitHub. [1] | `semantic-conventions`; `my-cool-repo` | `Recommended` |  |
|
|
| [`vcs.repository.url.full`](/docs/registry/attributes/vcs.md) | string | The [canonical URL](https://support.google.com/webmasters/answer/10347851?hl=en#:~:text=A%20canonical%20URL%20is%20the,Google%20chooses%20one%20as%20canonical.) of the repository providing the complete HTTP(S) address in order to locate and identify the repository through a browser. [2] | `https://github.com/opentelemetry/open-telemetry-collector-contrib`; `https://gitlab.com/my-org/my-project/my-projects-project/repo` | `Recommended` |  |
|
|
|
|
**[1] `vcs.repository.name`:** Due to it only being the name, it can clash with forks of the same
|
|
repository if collecting telemetry across multiple orgs or groups in
|
|
the same backends.
|
|
|
|
**[2] `vcs.repository.url.full`:** In Git Version Control Systems, the canonical URL SHOULD NOT include
|
|
the `.git` extension.
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|
|
|
|
### VCS reference
|
|
|
|
<!-- semconv entity.vcs.ref -->
|
|
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
|
|
<!-- see templates/registry/markdown/snippet.md.j2 -->
|
|
<!-- prettier-ignore-start -->
|
|
<!-- markdownlint-capture -->
|
|
<!-- markdownlint-disable -->
|
|
|
|
|
|
**Status:** 
|
|
|
|
**type:** `vcs.ref`
|
|
|
|
**Description:** A reference to a specific version in the Version Control System.
|
|
|
|
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|
|
|---|---|---|---|---|---|
|
|
| [`vcs.ref.head.name`](/docs/registry/attributes/vcs.md) | string | The name of the [reference](https://git-scm.com/docs/gitglossary#def_ref) such as **branch** or **tag** in the repository. [1] | `my-feature-branch`; `tag-1-test` | `Recommended` |  |
|
|
| [`vcs.ref.head.revision`](/docs/registry/attributes/vcs.md) | string | The revision, literally [revised version](https://www.merriam-webster.com/dictionary/revision), The revision most often refers to a commit object in Git, or a revision number in SVN. [2] | `9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc`; `main`; `123`; `HEAD` | `Recommended` |  |
|
|
| [`vcs.ref.type`](/docs/registry/attributes/vcs.md) | string | The type of the [reference](https://git-scm.com/docs/gitglossary#def_ref) in the repository. | `branch`; `tag` | `Recommended` |  |
|
|
|
|
**[1] `vcs.ref.head.name`:** `head` refers to where you are right now; the current reference at a
|
|
given time.
|
|
|
|
**[2] `vcs.ref.head.revision`:** `head` refers to where you are right now; the current reference at a
|
|
given time.The revision can be a full [hash value (see
|
|
glossary)](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf),
|
|
of the recorded change to a ref within a repository pointing to a
|
|
commit [commit](https://git-scm.com/docs/git-commit) object. It does
|
|
not necessarily have to be a hash; it can simply define a [revision
|
|
number](https://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html)
|
|
which is an integer that is monotonically increasing. In cases where
|
|
it is identical to the `ref.head.name`, it SHOULD still be included.
|
|
It is up to the implementer to decide which value to set as the
|
|
revision based on the VCS system and situational context.
|
|
|
|
---
|
|
|
|
`vcs.ref.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
|
|
|
|
| Value | Description | Stability |
|
|
|---|---|---|
|
|
| `branch` | [branch](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefbranchabranch) |  |
|
|
| `tag` | [tag](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftagatag) |  |
|
|
|
|
<!-- markdownlint-restore -->
|
|
<!-- prettier-ignore-end -->
|
|
<!-- END AUTOGENERATED TEXT -->
|
|
<!-- endsemconv -->
|