[chore] move log to registry (#908)

Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com>
This commit is contained in:
Alexandra Konrad 2024-04-22 13:40:25 +02:00 committed by GitHub
parent c8a1337e7a
commit 7f6876de7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 143 additions and 62 deletions

View File

@ -48,6 +48,7 @@ body:
- area:http - area:http
- area:ios - area:ios
- area:k8s - area:k8s
- area:log
- area:messaging - area:messaging
- area:network - area:network
- area:oci - area:oci

View File

@ -41,6 +41,7 @@ body:
- area:http - area:http
- area:ios - area:ios
- area:k8s - area:k8s
- area:log
- area:messaging - area:messaging
- area:network - area:network
- area:oci - area:oci

View File

@ -50,6 +50,7 @@ body:
- area:http - area:http
- area:ios - area:ios
- area:k8s - area:k8s
- area:log
- area:messaging - area:messaging
- area:network - area:network
- area:oci - area:oci

View File

@ -55,6 +55,7 @@ Currently, the following namespaces exist:
* [HTTP](http.md) * [HTTP](http.md)
* [iOS](ios.md) * [iOS](ios.md)
* [K8s](k8s.md) * [K8s](k8s.md)
* [Log](log.md)
* [Network](network.md) * [Network](network.md)
* [OCI](oci.md) * [OCI](oci.md)
* [OpenTelemetry](otel.md) * [OpenTelemetry](otel.md)

View File

@ -0,0 +1,52 @@
<!--- 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)
<!-- 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` | string | The basename of the file. | `audit.log` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `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` | string | The full path to the file. | `/var/log/mysql/audit.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 -->

View File

@ -38,7 +38,7 @@ These attributes may be used for identifying a Log Record.
<!-- semconv log.record --> <!-- semconv log.record -->
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | | 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. **[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. 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.
@ -59,22 +59,22 @@ As such, these should be recorded as Log Record attributes when applicable. They
<!-- semconv attributes.log.file --> <!-- semconv attributes.log.file -->
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | | 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`](../attributes-registry/log.md) | 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.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` | 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`](../attributes-registry/log.md) | 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) | | [`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 --> <!-- endsemconv -->
### I/O Stream ### I/O Stream
**Description:** The I/O stream to which the log was emitted. **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 | | 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 | | Value | Description | Stability |
|---|---|---| |---|---|---|

View File

@ -1,20 +1,8 @@
groups: groups:
- id: log.record - id: log.record
prefix: log.record
type: attribute_group type: attribute_group
brief: > brief: >
The attributes described in this section are rather generic. They may be used in any Log Record they apply to. The attributes described in this section are rather generic. They may be used in any Log Record they apply to.
attributes: attributes:
- id: uid - ref: log.record.uid
type: string
stability: experimental
requirement_level: opt_in 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"]

View File

@ -1,56 +1,21 @@
groups: groups:
- id: attributes.log - id: attributes.log
prefix: log
type: attribute_group type: attribute_group
brief: "Describes Log attributes" brief: "Describes Log attributes"
attributes: attributes:
- id: iostream - ref: log.iostream
requirement_level: opt_in 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 - id: attributes.log.file
prefix: log.file
type: attribute_group type: attribute_group
brief: > brief: >
A file to which log was emitted. A file to which log was emitted.
attributes: attributes:
- id: name - ref: log.file.name
type: string
stability: experimental
requirement_level: recommended requirement_level: recommended
brief: > - ref: log.file.path
The basename of the file.
examples: ["audit.log"]
- id: path
type: string
stability: experimental
requirement_level: opt_in requirement_level: opt_in
brief: > - ref: log.file.name_resolved
The full path to the file.
examples: [ "/var/log/mysql/audit.log" ]
- id: name_resolved
type: string
stability: experimental
requirement_level: opt_in requirement_level: opt_in
brief: > - ref: log.file.path_resolved
The basename of the file, with symlinks resolved.
examples: [ "uuid.log" ]
- id: path_resolved
type: string
stability: experimental
requirement_level: opt_in requirement_level: opt_in
brief: >
The full path to the file, with symlinks resolved.
examples: [ "/var/lib/docker/uuid.log" ]

72
model/registry/log.yaml Normal file
View File

@ -0,0 +1,72 @@
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?
type: attribute_group
prefix: log.file
brief: >
Attributes for a file to which log was emitted.
attributes:
- id: name
type: string
stability: experimental
brief: >
The basename of the file.
examples: [ "audit.log" ]
- id: path
type: string
stability: experimental
brief: >
The full path to the file.
examples: [ "/var/log/mysql/audit.log" ]
- 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"]