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

Merging events domain and name #473

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ release.
([#449](https://github.com/open-telemetry/semantic-conventions/pull/449))
- Change `user_agent.original` from recommended to opt-in on HTTP client spans.
([#468](https://github.com/open-telemetry/semantic-conventions/pull/468))
- BREAKING: Remove `event.domain` from log event attributes.
([#473](https://github.com/open-telemetry/semantic-conventions/pull/473))
- BREAKING: Change `event.name` definition to include `namespace`.
([#473](https://github.com/open-telemetry/semantic-conventions/pull/473))

### Features

Expand Down
25 changes: 14 additions & 11 deletions docs/general/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ The following semantic conventions for events are defined:
## General event attributes

Events are recorded as LogRecords that are shaped
in a special way: Event LogRecords have the attributes `event.domain`
and `event.name` (and possibly other LogRecord attributes).
in a special way: Event LogRecords have the attribute
`event.name` consisting of a dot-separated `namespace` and `name` that
uniquely identifies the event (and possibly other LogRecord attributes).
patrickhousley marked this conversation as resolved.
Show resolved Hide resolved

The `event.domain` attribute is used to logically separate events from different
The `namespace` portion is used to logically separate events from different
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
systems. For example, to record Events from browser apps, mobile apps and
Kubernetes, we could use `browser`, `device` and `k8s` as the domain for their
Kubernetes, we could use `browser`, `device` and `k8s` as the `namespace` for their
Events. This provides a clean separation of semantics for events in each of the
domains.

Within a particular domain, the `event.name` attribute identifies the event.
Events with same domain and name are structurally similar to one another. For
example, some domains could have well-defined schema for their events based on
Within a particular `namespace`, the `name` portion identifies the event.
Events with same `namespace` and `name` are structurally similar to one another. For
example, some namespaces could have well-defined schema for their events based on
event names.
patrickhousley marked this conversation as resolved.
Show resolved Hide resolved

When recording events from an existing system as OpenTelemetry Events, it is
Expand All @@ -43,18 +44,20 @@ that identify the class of Events but not the instance of the Event.
<!-- semconv event -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `event.domain` | string | The domain identifies the business context for the events. [1] | `browser` | Required |
| `event.name` | string | The name identifies the event. | `click`; `exception` | Required |
| `event.name` | string | Consisting of a `namespace` and `name`; uniquely identifies the event. | `browser.mouse.click`; `browser.exception` | Required |

**[1]:** Events across different domains may have same `event.name`, yet be unrelated events.
**[1]:** Events across different namespaces may have same name, yet be unrelated events.
patrickhousley marked this conversation as resolved.
Show resolved Hide resolved

`event.domain` has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used.
The `namespace` portion of the name has the following list of well-known values. If one of them applies, then the respective value MUST be used, otherwise a custom value MAY be used.

| Value | Description |
|---|---|
| `browser` | Events from browser apps |
| `device` | Events from mobile apps |
| `k8s` | Events from Kubernetes |
patrickhousley marked this conversation as resolved.
Show resolved Hide resolved

The `namespace` and `name` portions of `event.name` MUST be separated by a period (`.`). Periods MUST NOT be used in the `name` portion of the `event.name`
value. Instead, for multi-word `name` portions, each word SHOULD be separated by underscores (i.e. use snake_case). See [Attribute Naming](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/common/attribute-naming.md) for details on namespaces and names.
<!-- endsemconv -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
25 changes: 4 additions & 21 deletions model/logs/events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,7 @@ groups:
type: string
requirement_level: required
brief: >
The name identifies the event.
examples: ['click', 'exception']
- id: domain
brief: >
The domain identifies the business context for the events.
type:
allow_custom_values: true
members:
- id: browser
value: 'browser'
brief: 'Events from browser apps'
- id: device
value: 'device'
brief: 'Events from mobile apps'
- id: k8s
value: 'k8s'
brief: 'Events from Kubernetes'
requirement_level: required
note: >
Events across different domains may have same `event.name`, yet be
unrelated events.
The name identifies the event and includes a prefixed namespace. The namespace
and name are separated by a period. Events across different namespaces may have
the same name, yet be unrelated events.
examples: ['browser.pointer.click', 'device.exception']
AlexanderWert marked this conversation as resolved.
Show resolved Hide resolved