Skip to content

Commit

Permalink
Add YAML definitions for log semantic conventions and define requirem…
Browse files Browse the repository at this point in the history
…ent levels (#133)

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
  • Loading branch information
ChrsMark and arminru authored Jun 30, 2023
1 parent 537da51 commit afc8123
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
49 changes: 49 additions & 0 deletions semantic_conventions/logs/media.yaml
Original file line number Diff line number Diff line change
@@ -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" ]
29 changes: 20 additions & 9 deletions specification/logs/semantic_conventions/media.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit afc8123

Please sign in to comment.