diff --git a/CHANGELOG.md b/CHANGELOG.md index bce0088735..9c9576b4f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,6 +105,8 @@ Note: This is the first release of Semantic Conventions separate from the Specif ([#39](https://github.com/open-telemetry/semantic-conventions/pull/39)) - Add Elasticsearch client semantic conventions. ([#23](https://github.com/open-telemetry/semantic-conventions/pull/23)) +- Add YAML definitions for log semantic conventions and define requirement levels + ([#133](https://github.com/open-telemetry/semantic-conventions/pull/133)) ## v1.20.0 (2023-04-07) diff --git a/semantic_conventions/logs/media.yaml b/semantic_conventions/logs/media.yaml new file mode 100644 index 0000000000..b8d1c29975 --- /dev/null +++ b/semantic_conventions/logs/media.yaml @@ -0,0 +1,49 @@ +groups: + - id: attributes.log + prefix: log + type: attribute_group + brief: "Describes Log attributes" + attributes: + - id: iostream + requirement_level: opt_in + brief: > + The stream associated with the log. See below for a list of well-known values. + type: + allow_custom_values: false + members: + - id: stdout + value: 'stdout' + brief: 'Logs from stdout stream' + - id: stderr + value: 'stderr' + brief: 'Events from stderr stream' + - id: attributes.log.file + prefix: log.file + type: attribute_group + brief: > + A file to which log was emitted. + attributes: + - id: name + type: string + requirement_level: recommended + brief: > + The basename of the file. + examples: ["audit.log"] + - id: path + type: string + requirement_level: opt_in + brief: > + The full path to the file. + examples: [ "/var/log/mysql/audit.log" ] + - id: name_resolved + type: string + requirement_level: opt_in + brief: > + The basename of the file, with symlinks resolved. + examples: [ "uuid.log" ] + - id: path_resolved + type: string + requirement_level: opt_in + brief: > + The full path to the file, with symlinks resolved. + examples: [ "/var/lib/docker/uuid.log" ] diff --git a/specification/logs/semantic_conventions/media.md b/specification/logs/semantic_conventions/media.md index ed58410897..f17f83ba05 100644 --- a/specification/logs/semantic_conventions/media.md +++ b/specification/logs/semantic_conventions/media.md @@ -29,19 +29,30 @@ As such, these should be recorded as Log Record attributes when applicable. They **Description:** A file to which log was emitted. -| Name | Notes and examples | -| ------------------------------- | ---------------------------------------------------------------------------------------- | -| `log.file.name` | The basename of the file. Example: `audit.log` | -| `log.file.path` | The full path to the file. Example: `/var/log/mysql/audit.log` | -| `log.file.name_resolved` | The basename of the file, with symlinks resolved. Example: `uuid.log` | -| `log.file.path_resolved` | The full path to the file, with symlinks resolved. Example: `/var/lib/docker/uuid.log` | + +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `log.file.name` | string | The basename of the file. | `audit.log` | Recommended | +| `log.file.path` | string | The full path to the file. | `/var/log/mysql/audit.log` | Opt-In | +| `log.file.name_resolved` | string | The basename of the file, with symlinks resolved. | `uuid.log` | Opt-In | +| `log.file.path_resolved` | string | The full path to the file, with symlinks resolved. | `/var/lib/docker/uuid.log` | Opt-In | + ### I/O Stream **Description:** The I/O stream to which the log was emitted. -| Name | Notes and examples | -| ------------------------------- | ---------------------------------------------------------------------------------------- | -| `log.iostream` | The stream associated with the log. SHOULD be one of: `stdout`, `stderr` | + +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `log.iostream` | string | The stream associated with the log. See below for a list of well-known values. | `stdout` | Opt-In | + +`log.iostream` MUST be one of the following: + +| Value | Description | +|---|---| +| `stdout` | Logs from stdout stream | +| `stderr` | Events from stderr stream | + [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/document-status.md