Skip to content

Commit dd6272f

Browse files
authored
Move event.domain from InstrumentationScope to LogRecord (open-telemetry#2940)
Resolves open-telemetry#2939.
1 parent 2cf57d2 commit dd6272f

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ release.
1515

1616
### Logs
1717

18+
- Move `event.domain` from InstrumentationScope attributes to LogRecord
19+
attributes.
20+
([#2940](https://github.com/open-telemetry/opentelemetry-specification/pull/2940))
21+
1822
### Resource
1923

2024
### Semantic Conventions

specification/logs/api.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ the scope has a version (e.g. a library version). Example value: 1.0.0.
9292
- `schema_url` (optional): Specifies the Schema URL that should be recorded in
9393
the emitted telemetry.
9494
- `event_domain` (optional): Specifies the domain for the Events emitted, which
95-
should be added as `event.domain` attribute of the instrumentation scope.
95+
MUST be added as an attribute with the key `event.domain`
96+
to [emitted Events](#emit-event).
9697
- `include_trace_context` (optional): Specifies whether the Trace Context should
9798
automatically be passed on to the Events and Logs emitted by the Logger. This
9899
SHOULD be true by default.
@@ -153,7 +154,8 @@ This function MAY be named `logEvent`.
153154
* `logRecord` - the [LogRecord](#logrecord) representing the Event.
154155

155156
Events require the `event.domain` attribute. The API MUST not allow creating an
156-
Event if the Logger instance doesn't have `event.domain` scope attribute.
157+
Event if `event_domain` was not specified when
158+
the [Logger was obtained](#get-a-logger).
157159

158160
#### Emit LogRecord
159161

specification/logs/semantic_conventions/events.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44

55
This document describes the attributes of standalone Events that are represented
66
in the data model by `LogRecord`s. Events are recorded as LogRecords that are shaped
7-
in a special way:
8-
9-
- They have a LogRecord attribute `event.name` (and possibly other LogRecord attributes).
10-
- They have an InstrumentationScope with a non-empty `Name` and with an
11-
InstrumentationScope attribute `event.domain` (and possibly other InstrumentationScope attributes).
7+
in a special way: Event LogRecords have the attributes `event.domain`
8+
and `event.name` (and possibly other LogRecord attributes).
129

1310
The `event.domain` attribute is used to logically separate events from different
1411
systems. For example, to record Events from browser apps, mobile apps and

0 commit comments

Comments
 (0)