Skip to content

Commit

Permalink
Change event.name attribute into top-level event name field (#4320)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored Dec 6, 2024
1 parent 52e9be7 commit a265ae0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ release.
([#4310](https://github.com/open-telemetry/opentelemetry-specification/pull/4310))
- Remove the in-development isolating log record processor.
([#4301](https://github.com/open-telemetry/opentelemetry-specification/pull/4301))
- Change `event.name` attribute into top-level event name field.
([#4320](https://github.com/open-telemetry/opentelemetry-specification/pull/4320))

### Events

Expand Down
4 changes: 2 additions & 2 deletions specification/logs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ The API MUST accept the following parameters:
- [Severity Text](./data-model.md#field-severitytext) (optional)
- [Body](./data-model.md#field-body) (optional)
- [Attributes](./data-model.md#field-attributes) (optional)
- **Status**: [Development](../document-status.md) - [Event Name](./data-model.md#event-name) (optional)

#### Enabled

Expand Down Expand Up @@ -173,8 +174,7 @@ formatted as an [event](./data-model.md#events).

**Parameters:**

* The [`Name`](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/events.md)
of the Event.
* [Event Name](./data-model.md#event-name) (required)
* [Timestamp](./data-model.md#field-timestamp) (optional)
* [Observed Timestamp](./data-model.md#field-observedtimestamp) (optional). If unspecified
the implementation SHOULD set it equal to the current time.
Expand Down
14 changes: 13 additions & 1 deletion specification/logs/data-model.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Logs Data Model

**Status**: [Stable](../document-status.md)
**Status**: [Stable](../document-status.md), except where otherwise specified

<details>
<summary>Table of Contents</summary>
Expand Down Expand Up @@ -34,6 +34,7 @@
* [Field: `InstrumentationScope`](#field-instrumentationscope)
* [Field: `Attributes`](#field-attributes)
+ [Errors and Exceptions](#errors-and-exceptions)
* [Field: `EventName`](#field-eventname)
- [Example Log Records](#example-log-records)
- [Example Mappings](#example-mappings)
- [References](#references)
Expand Down Expand Up @@ -208,6 +209,7 @@ Body |The body of the log record.
Resource |Describes the source of the log.
InstrumentationScope|Describes the scope that emitted the log.
Attributes |Additional information about the event.
**Status**: [Development](../document-status.md) - EventName | Name that identifies the class / type of event.

Below is the detailed description of each field.

Expand Down Expand Up @@ -477,6 +479,16 @@ of the record.
If included, they MUST follow the OpenTelemetry
[semantic conventions for exception-related attributes](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/exceptions/exceptions-logs.md).

### Field: `EventName`

**Status**: [Development](../document-status.md)

Type: string.

Description: Name that identifies the class / type of the [Event](#events).
This name SHOULD uniquely identify the event structure (both attributes and body).
A log record with a non-empty event name is an [Event](#events).

## Example Log Records

For example log records see
Expand Down
1 change: 1 addition & 0 deletions specification/logs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ the following information added to the [LogRecord](data-model.md#log-and-event-r
* [`TraceId`](./data-model.md#field-traceid)
* [`SpanId`](./data-model.md#field-spanid)
* [`TraceFlags`](./data-model.md#field-traceflags)
* **Status**: [Development](../document-status.md) - [`EventName`](./data-model.md#event-name)

The SDK MAY provide an operation that makes a deep clone of a `ReadWriteLogRecord`.
The operation can be used by asynchronous processors (e.g. [Batching processor](#batching-processor))
Expand Down
2 changes: 1 addition & 1 deletion specification/versioning-and-stability.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Semantic Conventions defines the set of fields in the OTLP data model:
- The attribute keys provided on the LogRecord
- The attribute values provided on the LogRecord that are defined in a list
of well-known values.
- The event name (the value of the `event.name` attribute)
- The event name

Things not listed in the above are not expected to remain stable via semantic
convention and are allowed (or expected) to change. A few examples:
Expand Down

0 comments on commit a265ae0

Please sign in to comment.