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

[chore] move log to registry #908

Merged
merged 8 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
22 changes: 22 additions & 0 deletions .chloggen/log.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: log

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Rename `log.file.name` to `file.name` and `log.file.path` to `file.path`. Deprecate old names.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [908]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ body:
- area:http
- area:ios
- area:k8s
- area:log
- area:messaging
- area:network
- area:oci
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/change_proposal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ body:
- area:http
- area:ios
- area:k8s
- area:log
- area:messaging
- area:network
- area:oci
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/new-conventions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ body:
- area:http
- area:ios
- area:k8s
- area:log
- area:messaging
- area:network
- area:oci
Expand Down
1 change: 1 addition & 0 deletions docs/attributes-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Currently, the following namespaces exist:
* [HTTP](http.md)
* [iOS](ios.md)
* [K8s](k8s.md)
* [Log](log.md)
* [Network](network.md)
* [OCI](oci.md)
* [OpenTelemetry](otel.md)
Expand Down
60 changes: 60 additions & 0 deletions docs/attributes-registry/log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!--- Hugo front matter used to generate the website version of this page:
--->

# Log

<!-- toc -->

- [Log Attributes](#log-attributes)
- [Generic log attributes](#generic-log-attributes)
- [File log attributes](#file-log-attributes)
- [Record log attributes](#record-log-attributes)
- [Deprecated log attributes](#deprecated-log-attributes)

<!-- tocstop -->

## Log Attributes

### Generic log attributes

<!-- semconv registry.log(omit_requirement_level) -->
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| `log.iostream` | string | The stream associated with the log. See below for a list of well-known values. | `stdout` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`log.iostream` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
|---|---|---|
| `stdout` | Logs from stdout stream | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `stderr` | Events from stderr stream | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
<!-- endsemconv -->

### File log attributes

<!-- semconv registry.log.file(omit_requirement_level) -->
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| `log.file.name_resolved` | string | The basename of the file, with symlinks resolved. | `uuid.log` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `log.file.path_resolved` | string | The full path to the file, with symlinks resolved. | `/var/lib/docker/uuid.log` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
<!-- endsemconv -->

### Record log attributes

<!-- semconv registry.log.record(omit_requirement_level) -->
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| `log.record.uid` | string | A unique identifier for the Log Record. [1] | `01ARZ3NDEKTSV4RRFFQ69G5FAV` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values.
The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed.
<!-- endsemconv -->

### Deprecated log attributes

<!-- semconv registry.log.file.deprecated(omit_requirement_level) -->
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| `log.file.name` | string | Deprecated, use `file.name` instead. | `audit.log` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `file.name`. |
| `log.file.path` | string | Deprecated, use `file.path` instead. | `/var/log/mysql/audit.log` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by `file.path`. |
<!-- endsemconv -->
16 changes: 8 additions & 8 deletions docs/general/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ These attributes may be used for identifying a Log Record.
<!-- semconv log.record -->
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| `log.record.uid` | string | A unique identifier for the Log Record. [1] | `01ARZ3NDEKTSV4RRFFQ69G5FAV` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`log.record.uid`](../attributes-registry/log.md) | string | A unique identifier for the Log Record. [1] | `01ARZ3NDEKTSV4RRFFQ69G5FAV` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records MUST have different values.
The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed.
Expand All @@ -59,22 +59,22 @@ As such, these should be recorded as Log Record attributes when applicable. They
<!-- semconv attributes.log.file -->
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| `log.file.name` | string | The basename of the file. | `audit.log` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `log.file.name_resolved` | string | The basename of the file, with symlinks resolved. | `uuid.log` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `log.file.path` | string | The full path to the file. | `/var/log/mysql/audit.log` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `log.file.path_resolved` | string | The full path to the file, with symlinks resolved. | `/var/lib/docker/uuid.log` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`file.name`](../attributes-registry/file.md) | string | Name of the file including the extension, without the directory. | `example.png` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`file.path`](../attributes-registry/file.md) | string | Full path to the file, including the file name. It should include the drive letter, when appropriate. | `/home/alice/example.png`; `C:\Program Files\MyApp\myapp.exe` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`log.file.name_resolved`](../attributes-registry/log.md) | string | The basename of the file, with symlinks resolved. | `uuid.log` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`log.file.path_resolved`](../attributes-registry/log.md) | string | The full path to the file, with symlinks resolved. | `/var/lib/docker/uuid.log` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
<!-- endsemconv -->

### I/O Stream

**Description:** The I/O stream to which the log was emitted.

<!-- semconv attributes.log -->
<!-- semconv attributes.log(full) -->
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| `log.iostream` | string | The stream associated with the log. See below for a list of well-known values. | `stdout` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`log.iostream`](../attributes-registry/log.md) | string | The stream associated with the log. See below for a list of well-known values. | `stdout` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`log.iostream` MUST be one of the following:
`log.iostream` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
|---|---|---|
Expand Down
14 changes: 1 addition & 13 deletions model/logs/general.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
groups:
- id: log.record
prefix: log.record
type: attribute_group
brief: >
The attributes described in this section are rather generic. They may be used in any Log Record they apply to.
attributes:
- id: uid
type: string
stability: experimental
- ref: log.record.uid
requirement_level: opt_in
brief: >
A unique identifier for the Log Record.
note: >
If an id is provided, other log records with the same id will be considered duplicates and can be removed safely.
This means, that two distinguishable log records MUST have different values.

The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec),
but other identifiers (e.g. UUID) may be used as needed.
examples: ["01ARZ3NDEKTSV4RRFFQ69G5FAV"]
47 changes: 6 additions & 41 deletions model/logs/media.yaml
Original file line number Diff line number Diff line change
@@ -1,56 +1,21 @@
groups:
- id: attributes.log
prefix: log
type: attribute_group
brief: "Describes Log attributes"
attributes:
- id: iostream
- ref: log.iostream
requirement_level: opt_in
stability: experimental
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'
stability: experimental
- id: stderr
value: 'stderr'
brief: 'Events from stderr stream'
stability: experimental

- id: attributes.log.file
prefix: log.file
type: attribute_group
brief: >
A file to which log was emitted.
attributes:
- id: name
type: string
stability: experimental
- ref: file.name
requirement_level: recommended
brief: >
The basename of the file.
examples: ["audit.log"]
- id: path
type: string
stability: experimental
- ref: file.path
requirement_level: opt_in
brief: >
The full path to the file.
examples: [ "/var/log/mysql/audit.log" ]
- id: name_resolved
type: string
stability: experimental
- ref: log.file.name_resolved
requirement_level: opt_in
brief: >
The basename of the file, with symlinks resolved.
examples: [ "uuid.log" ]
- id: path_resolved
type: string
stability: experimental
- ref: log.file.path_resolved
requirement_level: opt_in
brief: >
The full path to the file, with symlinks resolved.
examples: [ "/var/lib/docker/uuid.log" ]
18 changes: 18 additions & 0 deletions model/registry/deprecated/log.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
groups:
- id: registry.log.file.deprecated
prefix: log.file
type: attribute_group
brief: 'Deprecated log attributes.'
attributes:
- id: name
type: string
examples: ["audit.log"]
stability: experimental
brief: "Deprecated, use `file.name` instead."
deprecated: "Replaced by `file.name`."
- id: path
type: string
examples: [ "/var/log/mysql/audit.log"]
stability: experimental
brief: "Deprecated, use `file.path` instead."
deprecated: "Replaced by `file.path`."
60 changes: 60 additions & 0 deletions model/registry/log.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
groups:
- id: registry.log
type: attribute_group
prefix: log
brief: >
This document defines log attributes
attributes:
- id: iostream
stability: experimental
brief: >
The stream associated with the log. See below for a list of well-known values.
type:
allow_custom_values: true
members:
- id: stdout
value: 'stdout'
brief: 'Logs from stdout stream'
stability: experimental
- id: stderr
value: 'stderr'
brief: 'Events from stderr stream'
stability: experimental

- id: registry.log.file # TODO: should we move it to the file model?
ChrsMark marked this conversation as resolved.
Show resolved Hide resolved
type: attribute_group
prefix: log.file
brief: >
Attributes for a file to which log was emitted.
attributes:
- id: name_resolved
type: string
stability: experimental
brief: >
The basename of the file, with symlinks resolved.
examples: [ "uuid.log" ]
- id: path_resolved
type: string
stability: experimental
brief: >
The full path to the file, with symlinks resolved.
examples: [ "/var/lib/docker/uuid.log" ]

- id: registry.log.record
type: attribute_group
prefix: log.record
brief: >
This document defines the generic attributes that may be used in any Log Record.
attributes:
- id: uid
type: string
stability: experimental
brief: >
A unique identifier for the Log Record.
note: >
If an id is provided, other log records with the same id will be considered duplicates and can be removed safely.
This means, that two distinguishable log records MUST have different values.

The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec),
but other identifiers (e.g. UUID) may be used as needed.
examples: ["01ARZ3NDEKTSV4RRFFQ69G5FAV"]
7 changes: 7 additions & 0 deletions schema-next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ file_format: 1.1.0
schema_url: https://opentelemetry.io/schemas/next
versions:
next:
logs:
changes:
# https://github.com/open-telemetry/semantic-conventions/pull/908
- rename_attributes:
attribute_map:
log.file.name: file.name
ChrsMark marked this conversation as resolved.
Show resolved Hide resolved
log.file.path: file.path

1.25.0:
spans:
Expand Down
Loading