Add YAML definitions for log semantic conventions and define requirement levels (#133)

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
This commit is contained in:
Chris Mark 2023-06-30 13:13:12 +03:00 committed by GitHub
parent 537da5112e
commit afc81230cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 9 deletions

View File

@ -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)

View File

@ -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" ]

View File

@ -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` |
<!-- semconv attributes.log.file -->
| 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 |
<!-- endsemconv -->
### 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` |
<!-- semconv attributes.log -->
| 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 |
<!-- endsemconv -->
[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/document-status.md