CI/CD 스팬 시맨틱 컨벤션
Status: Release Candidate
출처: 문서
본문
-
CI/CD 스팬(Spans)
-
파이프라인 실행(Pipeline run)
-
파이프라인 태스크 실행(Pipeline task run)
CI/CD 스팬
이 섹션에서 설명하는 컨벤션은 CI/CD(Continuous Integration / Continuous Deployment) 시스템에 특화된 내용이에요.
해당된다면 CI/CD와 VCS 리소스 컨벤션에서 제공하는 리소스를 모두 사용해야 해요(SHOULD).
파이프라인 실행(Pipeline run)
Status:
이 스팬은 CI/CD 파이프라인 실행을 나타내요.
모든 파이프라인 실행에 대해, 파이프라인 실행의 수행에 대응하는 kind가 SERVER인 스팬을 만들어야 해요(SHOULD).
스팬 이름은 스팬 이름에 대한 전반적인 지침을 반드시 따라야 해요(MUST).
(낮은 카디널리티의) 파이프라인 이름을 사용할 수 있다면 스팬 이름은 {action} {pipeline}이어야 해요(SHOULD).
파이프라인 이름을 사용할 수 없거나 카디널리티가 높을 가능성이 있다면 스팬 이름은 {action}이어야 해요(SHOULD).
{action}은 cicd.pipeline.action.name이어야 해요(SHOULD).
{pipeline}은 cicd.pipeline.name이어야 해요(SHOULD).
스팬 kind는 SERVER여야 해요(SHOULD).
스팬 상태는 Recording Errors 문서를 따라야 해요(SHOULD).
속성(Attributes):
| | Key | Stability | Requirement Level | Value Type | Description | Example Values
| cicd.pipeline.result | | Required | string | The result of a pipeline run. | success; failure; timeout; skip
| error.type | | Conditionally Required if the pipeline result is failure or error | string | Describes a class of error the operation ended with. [1] | timeout; java.net.UnknownHostException; server_certificate_invalid; 500
| cicd.pipeline.action.name | | Opt-In | string | The kind of action a pipeline run is performing. | BUILD; RUN; SYNC
[1] error.type: error.type은 예측 가능해야 하고(SHOULD), 카디널리티가 낮아야 해요(SHOULD).
error.type을 타입(예: 예외 타입)으로 설정할 때는 해당 아티팩트 내에서 그 타입을 식별하는 표준 클래스 이름을 사용해야 해요(SHOULD).
기록된 오류 타입이 실패 분류에 유의미하지 않은 래퍼(wrapper)라면, 인스트루멘테이션은 내부 오류의 타입을 대신 사용할 수 있어요(MAY). 예를 들어 Go에서 fmt.Errorf와 %w로 만든 오류는 래퍼 타입이 실패 분류에 도움이 되지 않을 때 언랩(unwrap)할 수 있어요(MAY).
인스트루멘테이션은 보고하는 오류 목록을 문서화해야 해요(SHOULD).
하나의 인스트루멘테이션 라이브러리 내에서 error.type의 카디널리티는 낮아야 해요(SHOULD).
여러 인스트루멘테이션 라이브러리와 애플리케이션의 데이터를 집계하는 텔레메트리 소비자는 추가 필터를 적용하지 않을 때 쿼리 시점에 error.type의 카디널리티가 높아질 수 있다는 점을 대비해야 해요.
연산이 성공적으로 완료됐다면 인스트루멘테이션은 error.type을 설정하지 않아야 해요(SHOULD NOT).
특정 도메인이 자체 오류 식별자 집합(HTTP나 RPC 상태 코드 등)을 정의한다면 다음을 권장해요(RECOMMENDED):
- 도메인 특화 속성 사용
- 도메인 특화 집합에서 정의됐든 아니든 모든 오류를 포착하도록
error.type설정
cicd.pipeline.action.name에는 다음과 같은 잘 알려진 값 목록이 있어요. 그중 하나가 적용된다면 해당 값을 반드시 사용해야 하고(MUST), 그렇지 않으면 커스텀 값을 사용할 수 있어요(MAY).
| | Value | Description | Stability
| BUILD | The pipeline run is executing a build. |
| RUN | The pipeline run is executing. |
| SYNC | The pipeline run is executing a sync. |
cicd.pipeline.result에는 다음과 같은 잘 알려진 값 목록이 있어요. 그중 하나가 적용된다면 해당 값을 반드시 사용해야 하고(MUST), 그렇지 않으면 커스텀 값을 사용할 수 있어요(MAY).
| | Value | Description | Stability
| cancellation | The pipeline run was cancelled, eg. by a user manually cancelling the pipeline run. |
| error | The pipeline run failed due to an error in the CI/CD system, eg. due to the worker being killed. |
| failure | The pipeline run did not finish successfully, eg. due to a compile error or a failing test. Such failures are usually detected by non-zero exit codes of the tools executed in the pipeline run. |
| skip | The pipeline run was skipped, eg. due to a precondition not being met. |
| success | The pipeline run finished successfully. |
| timeout | A timeout caused the pipeline run to be interrupted. |
error.type에는 다음과 같은 잘 알려진 값 목록이 있어요. 그중 하나가 적용된다면 해당 값을 반드시 사용해야 하고(MUST), 그렇지 않으면 커스텀 값을 사용할 수 있어요(MAY).
| | Value | Description | Stability
| _OTHER | A fallback error value to be used when the instrumentation doesn’t define a custom value. |
파이프라인 태스크 실행(Pipeline task run)
이 스팬은 파이프라인 실행에서 태스크의 수행을 나타내요.
스팬 kind는 INTERNAL이어야 해요(SHOULD).
스팬 상태는 Recording Errors 문서를 따라야 해요(SHOULD).
속성(Attributes):
| | Key | Stability | Requirement Level | Value Type | Description | Example Values
| cicd.pipeline.task.name | | Required | string | The human readable name of a task within a pipeline. Task here most closely aligns with a computing process in a pipeline. Other terms for tasks include commands, steps, and procedures. | Run GoLang Linter; Go Build; go-test; deploy_binary
| cicd.pipeline.task.run.id | | Required | string | The unique identifier of a task run within a pipeline. [1] | 12097
| cicd.pipeline.task.run.result | | Required | string | The result of a task run. | success; failure; timeout; skip
| cicd.pipeline.task.run.url.full | | Required | string | The URL of the pipeline task run, providing the complete address in order to locate and identify the pipeline task run. | https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763/job/26920038674?pr=1075
| error.type | | Conditionally Required if the task result is failure or error | string | Describes a class of error the operation ended with. [2] | timeout; java.net.UnknownHostException; server_certificate_invalid; 500
[1] cicd.pipeline.task.run.id: 주어진 파이프라인 실행과 태스크에 대해 cicd.pipeline.task.run.id는 해당 실행 내에서 고유해야 해요(MUST). 같은 파이프라인의 다른 실행에 걸쳐 같은 태스크라면 cicd.pipeline.task.run.id가 같아도 되며(MAY), 이렇게 하면 여러 파이프라인 실행에 걸쳐 cicd.pipeline.task.run.result 값을 상호 연관시킬 수 있어요.
[2] error.type: error.type은 예측 가능해야 하고(SHOULD), 카디널리티가 낮아야 해요(SHOULD).
error.type을 타입(예: 예외 타입)으로 설정할 때는 해당 아티팩트 내에서 그 타입을 식별하는 표준 클래스 이름을 사용해야 해요(SHOULD).
기록된 오류 타입이 실패 분류에 유의미하지 않은 래퍼(wrapper)라면, 인스트루멘테이션은 내부 오류의 타입을 대신 사용할 수 있어요(MAY). 예를 들어 Go에서 fmt.Errorf와 %w로 만든 오류는 래퍼 타입이 실패 분류에 도움이 되지 않을 때 언랩(unwrap)할 수 있어요(MAY).
인스트루멘테이션은 보고하는 오류 목록을 문서화해야 해요(SHOULD).
하나의 인스트루멘테이션 라이브러리 내에서 error.type의 카디널리티는 낮아야 해요(SHOULD).
여러 인스트루멘테이션 라이브러리와 애플리케이션의 데이터를 집계하는 텔레메트리 소비자는 추가 필터를 적용하지 않을 때 쿼리 시점에 error.type의 카디널리티가 높아질 수 있다는 점을 대비해야 해요.
연산이 성공적으로 완료됐다면 인스트루멘테이션은 error.type을 설정하지 않아야 해요(SHOULD NOT).
특정 도메인이 자체 오류 식별자 집합(HTTP나 RPC 상태 코드 등)을 정의한다면 다음을 권장해요(RECOMMENDED):
- 도메인 특화 속성 사용
- 도메인 특화 집합에서 정의됐든 아니든 모든 오류를 포착하도록
error.type설정
샘플링 결정을 내리는 데 중요할 수 있는 다음 속성들은 (제공된다면) 스팬 생성 시점에 제공해야 해요(SHOULD):
cicd.pipeline.task.namecicd.pipeline.task.run.idcicd.pipeline.task.run.url.full
cicd.pipeline.task.run.result에는 다음과 같은 잘 알려진 값 목록이 있어요. 그중 하나가 적용된다면 해당 값을 반드시 사용해야 하고(MUST), 그렇지 않으면 커스텀 값을 사용할 수 있어요(MAY).
| | Value | Description | Stability
| cancellation | The task run was cancelled, eg. by a user manually cancelling the task run. |
| error | The task run failed due to an error in the CI/CD system, eg. due to the worker being killed. |
| failure | The task run did not finish successfully, eg. due to a compile error or a failing test. Such failures are usually detected by non-zero exit codes of the tools executed in the task run. |
| skip | The task run was skipped, eg. due to a precondition not being met. |
| success | The task run finished successfully. |
| timeout | A timeout caused the task run to be interrupted. |
error.type에는 다음과 같은 잘 알려진 값 목록이 있어요. 그중 하나가 적용된다면 해당 값을 반드시 사용해야 하고(MUST), 그렇지 않으면 커스텀 값을 사용할 수 있어요(MAY).
| | Value | Description | Stability
| _OTHER | A fallback error value to be used when the instrumentation doesn’t define a custom value. |