Skip to content

Commit 0902d5f

Browse files
svrnmjoaopgrassijack-bergtigrannajaryan
authored
Add semantic conventions for log record ID (#3047)
Fixes #597 ## Changes - Add a section for "generic attributes" to the log semconv - Add an attribute `log_record.id` making use of ULID as discussed in #597 Some additional notes: - I kept the PR small, so I left out some other potential attributes, e.g. something for pre-existing ID (like windows event logs) or for storing the used logging/eventing system or even something like a "signature" that might be worth discussing, etc. - I followed the structure of "generic attributes" from the spans semconv - I took some of the existing wording from #597 & open-telemetry/oteps#97 (comment) to describe the field --------- Signed-off-by: svrnm <neumanns@cisco.com> Co-authored-by: Joao Grassi <joao@joaograssi.com> Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com> Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
1 parent 189cb12 commit 0902d5f

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
groups:
2+
- id: log.record
3+
prefix: log.record
4+
brief: >
5+
The attributes described in this section are rather generic. They may be used in any Log Record they apply to.
6+
attributes:
7+
- id: uid
8+
type: string
9+
requirement_level: opt_in
10+
brief: >
11+
A unique identifier for the Log Record.
12+
note: >
13+
If an id is provided, other log records with the same id will be considered duplicates and can be removed safely.
14+
This means, that two distinguishable log records MUST have different values.
15+
16+
The id MAY be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec),
17+
but other identifiers (e.g. UUID) may be used as needed.
18+
examples: ["01ARZ3NDEKTSV4RRFFQ69G5FAV"]

specification/logs/semantic_conventions/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
The following semantic conventions for logs are defined:
66

7+
* [General](general.md): General semantic attributes that may be used in describing Log Records.
78
* [Log Media](media.md): Semantic attributes that may be used in describing the source of a log.
89

910
The following semantic conventions for events are defined:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# General attributes
2+
3+
**Status**: [Experimental](../../document-status.md)
4+
5+
The attributes described in this section are rather generic.
6+
They may be used in any Log Record they apply to.
7+
8+
<!-- Re-generate TOC with `markdown-toc --no-first-h1 -i` -->
9+
10+
<!-- toc -->
11+
12+
- [General log identification attributes](#general-log-identification-attributes)
13+
14+
<!-- tocstop -->
15+
16+
## General log identification attributes
17+
18+
These attributes may be used for identifying a Log Record.
19+
20+
<!-- semconv log.record -->
21+
| Attribute | Type | Description | Examples | Requirement Level |
22+
|---|---|---|---|---|
23+
| `log.record.uid` | string | A unique identifier for the Log Record. [1] | `01ARZ3NDEKTSV4RRFFQ69G5FAV` | Opt-In |
24+
25+
**[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.
26+
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.
27+
<!-- endsemconv -->

0 commit comments

Comments
 (0)