Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add event.summary as a recommendation for events #1074

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .chloggen/event-message.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: events

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add a human-readable description as an attribute representing the event

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [ 1076 ]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
Events are identified by an `event.name` and a set of attributes and fields in the body that carry specific
meaning. However, since these events will be combined with other logs, `event.description` allows a

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be event.summary

centralized logging system to display a human-readable representation of the event.
10 changes: 7 additions & 3 deletions docs/attributes-registry/event.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@

Attributes for Events represented using Log Records.

| Attribute | Type | Description | Examples | Stability |
| ------------ | ------ | ----------------------------------------- | --------------------------------------------- | ---------------------------------------------------------------- |
| `event.name` | string | Identifies the class / type of event. [1] | `browser.mouse.click`; `device.app.lifecycle` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| Attribute | Type | Description | Examples | Stability |
| --------------- | ------ | ------------------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `event.name` | string | Identifies the class / type of event. [1] | `browser.mouse.click`; `device.app.lifecycle` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `event.summary` | string | Human-readable summary representing an event. [2] | `User clicked element with id 42`; `Device app lifecycle changed to PAUSED` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** 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.

**[2]:** Events are identified by an `event.name` and a set of attributes and fields in the body that carry specific meaning. However, since these events will be combined with other logs, `event.summary` allows a centralized logging system to display a human-readable representation of the event.
When summaries are generated, they are not expected to include every attribute and field that is part of the event but could contain those that are meaningful for a human operator when visually navigating a centralized log system. Instrumentation libraries that produce events defined within the standard OpenTelemetry are not expected to add an `event.summary` attribute, as these are well-known events.
6 changes: 6 additions & 0 deletions docs/general/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ structure and semantics will also be defined.
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`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) |
| [`event.summary`](/docs/attributes-registry/event.md) | string | Human-readable summary representing an event. [2] | `User clicked element with id 42`; `Device app lifecycle changed to PAUSED` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** 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.

**[2]:** Events are identified by an `event.name` and a set of attributes and fields in the body that carry specific meaning. However, since these events will be combined with other logs, `event.summary` allows a centralized logging system to display a human-readable representation of the event.
When summaries are generated, they are not expected to include every attribute and field that is part of the event but could contain those that are meaningful for a human operator when visually navigating a centralized log system. Instrumentation libraries that produce events defined within the standard OpenTelemetry are not expected to add an `event.summary` attribute, as these are well-known events.




Expand All @@ -69,6 +73,8 @@ structure and semantics will also be defined.
and the semantic conventions will define the expected structure of the _payload_
(data) for the event.
* The _payload_ (data) SHOULD be used to represent the structure of the event.
* The event MAY have an `event.summary` attribute that is a human-readable
representation of the event.

Recommendations for defining events:

Expand Down
2 changes: 2 additions & 0 deletions model/logs/events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ groups:
attributes:
- ref: event.name
requirement_level: required
- ref: event.summary
requirement_level: recommended
15 changes: 15 additions & 0 deletions model/registry/event.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,18 @@ groups:
separation of semantics for events in separate domains like browser, mobile, and
kubernetes.
examples: ['browser.mouse.click', 'device.app.lifecycle']
- id: summary
type: string
stability: experimental
brief: >
Human-readable summary representing an event.
note: >
Events are identified by an `event.name` and a set of attributes and fields in the body that carry specific
meaning. However, since these events will be combined with other logs, `event.summary` allows a
centralized logging system to display a human-readable representation of the event.

Comment on lines +25 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph does not seem to provide new information - it's already captured in the event name, the markdown, and the brief. Could it be removed?

Suggested change
Events are identified by an `event.name` and a set of attributes and fields in the body that carry specific
meaning. However, since these events will be combined with other logs, `event.summary` allows a
centralized logging system to display a human-readable representation of the event.

When summaries are generated, they are not expected to include every attribute and field that is part of the
event but could contain those that are meaningful for a human operator when visually navigating a centralized
log system. Instrumentation libraries that produce events defined within the standard OpenTelemetry are not
expected to add an `event.summary` attribute, as these are well-known events.
Comment on lines +29 to +32
Copy link
Contributor

@lmolkova lmolkova Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make it normative? E.g.

Suggested change
When summaries are generated, they are not expected to include every attribute and field that is part of the
event but could contain those that are meaningful for a human operator when visually navigating a centralized
log system. Instrumentation libraries that produce events defined within the standard OpenTelemetry are not
expected to add an `event.summary` attribute, as these are well-known events.
It's NOT RECOMMENDED to record full string representation of the event on the `event.summary` attribute. The summary SHOULD be concise and human-readable as it's expected to be used by a human operator when visually navigating a centralized log system.

I removed

Instrumentation libraries that produce events defined within the standard
OpenTelemetry are not expected to add an event.summary attribute, as these are well-known events.

I'm not sure how it could work - if we have 100+ events defined, no backend would be able to special-case each event and define human-readable representation of it. I.e. I don't understand why we would NOT allow to define a summary for at least some standards events.

examples: ['User clicked element with id 42', 'Device app lifecycle changed to PAUSED']
Loading