From 9e2c8c8ae518a9a6339a122fc64c5436d03b66f4 Mon Sep 17 00:00:00 2001 From: jack-berg <34418638+jack-berg@users.noreply.github.com> Date: Mon, 14 Nov 2022 09:34:49 -0600 Subject: [PATCH] Move event.domain from InstrumentationScope to LogRecord (#2940) Resolves #2939. --- CHANGELOG.md | 4 ++++ specification/logs/api.md | 6 ++++-- specification/logs/semantic_conventions/events.md | 7 ++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ae1720630c..9c9077e2dc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ release. ### Logs +- Move `event.domain` from InstrumentationScope attributes to LogRecord + attributes. + ([#2940](https://github.com/open-telemetry/opentelemetry-specification/pull/2940)) + ### Resource ### Semantic Conventions diff --git a/specification/logs/api.md b/specification/logs/api.md index 9367067b219..55fc6190c66 100644 --- a/specification/logs/api.md +++ b/specification/logs/api.md @@ -92,7 +92,8 @@ the scope has a version (e.g. a library version). Example value: 1.0.0. - `schema_url` (optional): Specifies the Schema URL that should be recorded in the emitted telemetry. - `event_domain` (optional): Specifies the domain for the Events emitted, which -should be added as `event.domain` attribute of the instrumentation scope. + MUST be added as an attribute with the key `event.domain` + to [emitted Events](#emit-event). - `include_trace_context` (optional): Specifies whether the Trace Context should automatically be passed on to the Events and Logs emitted by the Logger. This SHOULD be true by default. @@ -153,7 +154,8 @@ This function MAY be named `logEvent`. * `logRecord` - the [LogRecord](#logrecord) representing the Event. Events require the `event.domain` attribute. The API MUST not allow creating an -Event if the Logger instance doesn't have `event.domain` scope attribute. +Event if `event_domain` was not specified when +the [Logger was obtained](#get-a-logger). #### Emit LogRecord diff --git a/specification/logs/semantic_conventions/events.md b/specification/logs/semantic_conventions/events.md index ee61cf49f01..149903e3848 100644 --- a/specification/logs/semantic_conventions/events.md +++ b/specification/logs/semantic_conventions/events.md @@ -4,11 +4,8 @@ This document describes the attributes of standalone Events that are represented in the data model by `LogRecord`s. Events are recorded as LogRecords that are shaped -in a special way: - -- They have a LogRecord attribute `event.name` (and possibly other LogRecord attributes). -- They have an InstrumentationScope with a non-empty `Name` and with an - InstrumentationScope attribute `event.domain` (and possibly other InstrumentationScope attributes). +in a special way: Event LogRecords have the attributes `event.domain` +and `event.name` (and possibly other LogRecord attributes). The `event.domain` attribute is used to logically separate events from different systems. For example, to record Events from browser apps, mobile apps and