Skip to content

Commit a596f19

Browse files
author
Liudmila Molkova
authored
Deprecate event.name attribute in favor of EventName on the log record (#1646)
1 parent 01be4a4 commit a596f19

File tree

11 files changed

+31
-62
lines changed

11 files changed

+31
-62
lines changed

.chloggen/1646.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
change_type: breaking
2+
component: event
3+
note: Deprecate `event.name` attribute in favor of the top level event name property on the log record
4+
issues: [1646]

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ body:
4242
- area:dns
4343
- area:dotnet
4444
- area:error
45-
- area:event
4645
- area:exception
4746
- area:faas
4847
- area:feature-flag

.github/ISSUE_TEMPLATE/change_proposal.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ body:
3434
- area:dns
3535
- area:dotnet
3636
- area:error
37-
- area:event
3837
- area:exception
3938
- area:faas
4039
- area:feature-flag

.github/ISSUE_TEMPLATE/new-conventions.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ body:
4343
- area:dns
4444
- area:dotnet
4545
- area:error
46-
- area:event
4746
- area:exception
4847
- area:faas
4948
- area:feature-flag

docs/attributes-registry/event.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@ Attributes for Events represented using Log Records.
1212

1313
| Attribute | Type | Description | Examples | Stability |
1414
|---|---|---|---|---|
15-
| <a id="event-name" href="#event-name">`event.name`</a> | string | Identifies the class / type of event. [1] | `browser.mouse.click`; `device.app.lifecycle` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
16-
17-
**[1] `event.name`:** Event names are subject to the same rules as [attribute names](/docs/general/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes.
15+
| <a id="event-name" href="#event-name">`event.name`</a> | string | Identifies the class / type of event. | `browser.mouse.click`; `device.app.lifecycle` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Replaced by EventName top-level field on the LogRecord |

docs/gen-ai/gen-ai-events.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ linkTitle: Generative AI events
2323

2424
<!-- tocstop -->
2525

26-
GenAI instrumentations MAY capture user inputs sent to the model and responses received from it as [events](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.39.0/specification/logs/event-api.md).
26+
GenAI instrumentations MAY capture user inputs sent to the model and responses received from it as [events](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.40.0/specification/logs/api.md#emit-an-event).
2727

28+
<<<<<<< HEAD
2829
> [!NOTE]
2930
> Event API is experimental and not yet available in some languages. Check [spec-compliance matrix](https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md#events) to see the implementation status in corresponding language.
31+
=======
32+
> Note:
33+
> Event API is experimental and not yet available in some languages. Check [spec-compliance matrix](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.40.0/spec-compliance-matrix.md#logs) to see the implementation status in corresponding language.
34+
>>>>>>> 75746bc9 (reword)
3035
3136
Instrumentations MAY capture inputs and outputs if and only if application has enabled the collection of this data.
3237
This is for three primary reasons:

docs/general/events.md

Lines changed: 15 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ aliases: [events-general]
55

66
# Semantic Conventions for Events
77

8-
**Status**: [Experimental][DocumentStatus]
8+
**Status**: [Development][DocumentStatus]
99

1010
This document describes the characteristics of standalone Events that are represented
1111
in the data model by `LogRecord`s.
@@ -15,11 +15,7 @@ Semantically, an Event is a named occurrence at an instant in time. It signals t
1515
Examples of Events might include things like uncaught exceptions, button clicks, user logout,
1616
network connection severed, etc.
1717

18-
In OpenTelemetry, Events are implemented as a specific type of `LogRecord` that conforms to
19-
the conventions included here, and Events
20-
[have their own API](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/event-api.md).
21-
The API abstracts away knowledge of `LogRecord` so that users only deal with Event
22-
semantics.
18+
In OpenTelemetry, Events are implemented as a specific type of [`LogRecord`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.39.0/specification/logs/api.md) that conforms to the conventions included here.
2319

2420
In addition to a required name, an Event may contain a _payload_ (body) of any type permitted
2521
by the [LogRecord body](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-body).
@@ -32,30 +28,11 @@ field semantics, and stability and requirement levels. Other events may be user-
3228
bespoke user semantics. When an Event name exists in the semantic conventions, its _payload_
3329
structure and semantics will also be defined.
3430

35-
## Event definition
31+
## General event semantics
3632

37-
<!-- semconv event -->
38-
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
39-
<!-- see templates/registry/markdown/snippet.md.j2 -->
40-
<!-- prettier-ignore-start -->
41-
<!-- markdownlint-capture -->
42-
<!-- markdownlint-disable -->
43-
44-
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
45-
|---|---|---|---|---|---|
46-
| [`event.name`](/docs/attributes-registry/event.md) | string | Identifies the class / type of event. [1] | `browser.mouse.click`; `device.app.lifecycle` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
47-
48-
**[1] `event.name`:** Event names are subject to the same rules as [attribute names](/docs/general/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes.
49-
50-
<!-- markdownlint-restore -->
51-
<!-- prettier-ignore-end -->
52-
<!-- END AUTOGENERATED TEXT -->
53-
<!-- endsemconv -->
54-
55-
### General event semantics
56-
57-
* An event MUST have an `event.name` attribute that uniquely identifies the event.
58-
* It MAY have [standard](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.39.0/specification/common#attribute)
33+
* An event MUST have an [Event name property](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.40.0/specification/logs/data-model.md#field-eventname)
34+
that uniquely identifies the event. Event names are subject to the same rules as [attribute names](/docs/general/attribute-naming.md).
35+
* Event MAY have [standard](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.39.0/specification/common#attribute)
5936
attributes that provide additional context about the event.
6037
* It MAY contain a _payload_ (body) that describes the specific details of the
6138
named event.
@@ -73,29 +50,30 @@ Recommendations for defining events:
7350
collection of [standard](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.39.0/specification/common#attribute)
7451
attributes.
7552
* Events SHOULD be generated / produced / recorded using the
76-
[Event API](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/event-api.md)
53+
[Emit Event API](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.40.0/specification/logs/api.md#emit-an-event)
7754
to ensure that the event is created using the configured SDK instance.
78-
* The Event API is not yet available in all OpenTelemetry SDKs.
79-
* TODO: Add deep link to the [compliance matrix of the Event API](https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md)
80-
when it exists.
81-
* It's NOT RECOMMENDED to prefix the _payload_ (body) _fields_ with the `event.name` to
55+
* The Emit Event API is not yet available in all OpenTelemetry SDKs. Check [spec-compliance matrix](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.40.0/spec-compliance-matrix.md#logs) to see the implementation status in corresponding language.
56+
* It's NOT RECOMMENDED to prefix the _payload_ (body) _fields_ with the `EventName` to
8257
avoid redundancy and to keep the event definition clean.
8358
* The events SHOULD document their semantic conventions including event name,
8459
attributes, and the payload.
8560

8661
Recommendations on using attributes vs. body fields:
8762

88-
* If the field should be comparable across every type of record, it should be an attribute.
63+
* If the field should be comparable across events with different `EventName` (or between an event and other telemetry items),
64+
it should be an attribute.
8965
* If the field is specific to the event itself, then it should be a body field.
90-
* Unless the same `event.name` exists on two events, anything in two event bodies is not comparable to each other.
66+
* Body fields that belong to events with different event names are not comparable.
67+
For example, body field `id` on event `my_company.order_submitted` is semantically different from
68+
field `id` on an event with name `session.start`.
9169

9270
### Event payload (body)
9371

9472
* Common attribute naming conventions and [registry](../attributes-registry/README.md)
9573
requirements don't apply to event payload fields.
9674
* The definition for OpenTelemetry defined events supports describing
9775
individual _fields_ (Body Fields)
98-
* The _fields_ are unique to the named event (`event.name`) and different events
76+
* The _fields_ are unique to the named event ([EventName](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.40.0/specification/logs/data-model.md#field-eventname)) and different events
9977
may use the same _field_ name to represent different data, due to the unique
10078
nature of the event.
10179

docs/general/session.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ backends can link the two sessions (see [Session Start Event](#session-start-eve
4040

4141
![Experimental](https://img.shields.io/badge/-experimental-blue)
4242

43-
`event.name` MUST be`session.start`
43+
[EventName](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.40.0/specification/logs/data-model.md#field-eventname) MUST be`session.start`
4444

4545
For instrumentation that tracks user behavior during user sessions, a `session.start` event MUST be emitted
4646
every time a session is created. When a new session is created as a continuation of a prior session,
@@ -61,7 +61,7 @@ that the previous session has ended. If the session ID in `session.previous_id`
6161

6262
![Experimental](https://img.shields.io/badge/-experimental-blue)
6363

64-
`event.name` MUST be `session.end`
64+
[EventName](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.40.0/specification/logs/data-model.md#field-eventname) MUST be `session.end`
6565

6666
For instrumentation that tracks user behavior during user sessions, a `session.end` event SHOULD be emitted
6767
every time a session ends. When a session ends and continues as a new session, this event SHOULD be

docs/mobile/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
This document defines semantic conventions for instrumentations that emit
66
events on mobile platforms. All mobile events MUST use a namespace of
7-
`device` in the `event.name` property.
7+
`device` in the EventName LogRecord property.
88

99
<!-- toc -->
1010

model/event/common.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)