Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 9 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: log
joaopgrassi marked this conversation as resolved.
Show resolved Hide resolved
prefix: log
joaopgrassi marked this conversation as resolved.
Show resolved Hide resolved
type: attribute_group
brief: "Describes Log attributes"
attributes:
- id: iostream
requirement_level: opt_in
brief: >
The stream associated with the log. SHOULD be one of: `stdout`, `stderr`.
ChrsMark marked this conversation as resolved.
Show resolved Hide resolved
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: log.file
joaopgrassi marked this conversation as resolved.
Show resolved Hide resolved
prefix: log.file
type: attribute_group
brief: >
A file to which log was emitted.
attributes:
- id: name
type: string
requirement_level: opt_in
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 log.file -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `log.file.name` | string | The basename of the file. | `audit.log` | Opt-In |
| `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 |
tigrannajaryan marked this conversation as resolved.
Show resolved Hide resolved
<!-- 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 log -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `log.iostream` | string | The stream associated with the log. SHOULD be one of: `stdout`, `stderr`. | `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