CLI (command line interface) 프로그램을 위한 시맨틱 컨벤션
Status: Development
출처: 문서
본문
이 문서는 호출자(caller)로서든 피호출자(callee)로서든 CLI 프로그램을 계측할 때 적용할 시맨틱 컨벤션을 정의해요. 이 문서는 실행을 끝내는 수명이 짧은 프로그램, 즉 데몬이나 오래 실행되는 백그라운드 작업이 아닌 프로그램을 대상으로 해요.
실행(callee) 스팬
Status:
이 스팬은 피호출자(callee) 관점에서 CLI(Command Line Interface) 프로그램 실행을 설명해요.
Span name은 {process.executable.name} 으로 설정해야 해요(SHOULD).
실행된 명령에 대한 추가 컨텍스트가 있는 계측은
다른 낮은 카디널리티(low-cardinality) 스팬 이름 형식을 사용할 수 있으며(MAY),
그 형식을 문서화해야 해요(SHOULD).
Span status는 Recording Errors 문서를 따라야 해요(SHOULD).
오류(Error)는 {process.exit.code} 속성이 0이 아닐 때로 정의돼요.
Span kind는 INTERNAL 이어야 해요(SHOULD).
속성:
| | Key | Stability | Requirement Level | Value Type | Description | Example Values
| process.executable.name | | Required | string | The name of the process executable. On Linux based systems, this SHOULD be set to the base name of the target of /proc/[pid]/exe. On Windows, this SHOULD be set to the base name of GetProcessImageFileNameW. | otelcol
| process.exit.code | | Required | int | The exit code of the process. | 127
| process.pid | | Required | int | Process identifier (PID). | 1234
| error.type | | Conditionally Required if and only if process.exit.code is not 0 | string | Describes a class of error the operation ended with. [1] | timeout; java.net.UnknownHostException; server_certificate_invalid; 500
| process.command_args | | Recommended | string[] | All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from proc/[pid]/cmdline. For libc-based executables, this would be the full argv vector passed to main. SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data. | ["cmd/otecol", "--config=config.yaml"]
| process.executable.path | | Recommended | string | The full path to the process executable. On Linux based systems, can be set to the target of proc/[pid]/exe. On Windows, can be set to the result of GetProcessImageFileNameW. | /usr/bin/cmd/otelcol
[1] error.type: The error.type SHOULD be predictable, and SHOULD have low cardinality.
When error.type is set to a type (e.g., an exception type), its
canonical class name identifying the type within the artifact SHOULD be used.
If the recorded error type is a wrapper that is not meaningful for
failure classification, instrumentation MAY use the type of the inner
error instead. For example, in Go, errors created with fmt.Errorf
using %w MAY be unwrapped when the wrapper type does not help
classify the failure.
Instrumentations SHOULD document the list of errors they report.
The cardinality of error.type within one instrumentation library SHOULD be low.
Telemetry consumers that aggregate data from multiple instrumentation libraries and applications
should be prepared for error.type to have high cardinality at query time when no
additional filters are applied.
If the operation has completed successfully, instrumentations SHOULD NOT set error.type.
If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes), it’s RECOMMENDED to:
- Use a domain-specific attribute
- Set
error.typeto capture all errors, regardless of whether they are defined within the domain-specific set or not.
error.type 는 다음과 같은 잘 알려진 값 목록을 가져요. 그중 하나가 해당된다면 해당 값을 반드시 사용해야 하고, 그렇지 않다면 사용자 정의 값을 사용해도 돼요.
|
| Value | Description | Stability
| _OTHER | A fallback error value to be used when the instrumentation doesn’t define a custom value. |
클라이언트(caller) 스팬
이 스팬은 호출자(caller) 관점에서 CLI(Command Line Interface) 프로그램 실행을 설명해요.
Span name은 {process.executable.name} 으로 설정해야 해요(SHOULD).
실행된 명령에 대한 추가 컨텍스트가 있는 계측은
다른 낮은 카디널리티 스팬 이름 형식을 사용할 수 있으며(MAY),
그 형식을 문서화해야 해요(SHOULD).
Span status는 Recording Errors 문서를 따라야 해요(SHOULD).
오류(Error)는 {process.exit.code} 속성이 0이 아닐 때로 정의돼요.
Span kind는 CLIENT 이어야 해요(SHOULD).
속성:
| | Key | Stability | Requirement Level | Value Type | Description | Example Values
| process.executable.name | | Required | string | The name of the process executable. On Linux based systems, this SHOULD be set to the base name of the target of /proc/[pid]/exe. On Windows, this SHOULD be set to the base name of GetProcessImageFileNameW. | otelcol
| process.exit.code | | Required | int | The exit code of the process. | 127
| process.pid | | Required | int | Process identifier (PID). | 1234
| error.type | | Conditionally Required if and only if process.exit.code is not 0 | string | Describes a class of error the operation ended with. [1] | timeout; java.net.UnknownHostException; server_certificate_invalid; 500
| process.command_args | | Recommended | string[] | All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from proc/[pid]/cmdline. For libc-based executables, this would be the full argv vector passed to main. SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data. | ["cmd/otecol", "--config=config.yaml"]
| process.executable.path | | Recommended | string | The full path to the process executable. On Linux based systems, can be set to the target of proc/[pid]/exe. On Windows, can be set to the result of GetProcessImageFileNameW. | /usr/bin/cmd/otelcol
[1] error.type: The error.type SHOULD be predictable, and SHOULD have low cardinality.
When error.type is set to a type (e.g., an exception type), its
canonical class name identifying the type within the artifact SHOULD be used.
If the recorded error type is a wrapper that is not meaningful for
failure classification, instrumentation MAY use the type of the inner
error instead. For example, in Go, errors created with fmt.Errorf
using %w MAY be unwrapped when the wrapper type does not help
classify the failure.
Instrumentations SHOULD document the list of errors they report.
The cardinality of error.type within one instrumentation library SHOULD be low.
Telemetry consumers that aggregate data from multiple instrumentation libraries and applications
should be prepared for error.type to have high cardinality at query time when no
additional filters are applied.
If the operation has completed successfully, instrumentations SHOULD NOT set error.type.
If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes), it’s RECOMMENDED to:
- Use a domain-specific attribute
- Set
error.typeto capture all errors, regardless of whether they are defined within the domain-specific set or not.
error.type 는 다음과 같은 잘 알려진 값 목록을 가져요. 그중 하나가 해당된다면 해당 값을 반드시 사용해야 하고, 그렇지 않다면 사용자 정의 값을 사용해도 돼요.
|
| Value | Description | Stability
| _OTHER | A fallback error value to be used when the instrumentation doesn’t define a custom value. |