Skip to content

Commit

Permalink
Define the shape of a event by encapsulating the payload in event.data.
Browse files Browse the repository at this point in the history
  • Loading branch information
MSNev committed Nov 7, 2022
1 parent 7405243 commit ba9b2d0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ internal/tools/bin
# Node.js files for tools (e.g. markdown-toc)
node_modules/
package-lock.json

# Visual Studio
.vs/
2 changes: 1 addition & 1 deletion semantic_conventions/logs/events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ groups:
note: |
An `event.name` is supposed to be unique only in the context of an
`event.domain`, so this allows for two events in different domains to
have same `event.name`, yet be unrelated events.
have same `event.name`, yet be unrelated events.
20 changes: 20 additions & 0 deletions specification/logs/semantic_conventions/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,23 @@ by `LogRecord`s. All standalone Events have a name and a domain. The Event domai
is a namespace for event names and is used as a mechanism to avoid conflicts of
event names.

Events MAY include domain-specific information about the occurrence (`payload`)
of the `event`, when present this information MUST be included in the `event.data`
attribute the values included SHOULD conform to the domain-specific defined schema
for the identified `event`. This is the primary container for details about the
`event`.

Events MAY also include one or more additional Attributes which can be used to
provide additional context about the `event`, whether an Attribute is required
or optional SHOULD be defined by the domain-specific schema definition of the
`event`.

<!-- semconv event -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `event.name` | string | The name identifies the event. | `click`; `exception` | Required |
| `event.domain` | string | The domain identifies the context in which an event happened. An event name is unique only within a domain. [1] | `browser` | Required |
| `event.data` | [any](../data-model.md#type-any) \| [map<string, any>](../data-model.md#type-mapstring-any) | The domain-specific `payload` of the `event` which provides details about the occurrence of the named event. | `{ connectStart: 100, connectEnd: 103, domainLookupStart: 80, domainLookupEnd: 90 }` | Optional |

**[1]:** An `event.name` is supposed to be unique only in the context of an
`event.domain`, so this allows for two events in different domains to
Expand All @@ -24,4 +36,12 @@ have same `event.name`, yet be unrelated events.
| `browser` | Events from browser apps |
| `device` | Events from mobile apps |
| `k8s` | Events from Kubernetes |

`event.data` contains the domain-specific information about the occurrence of the
`event` (ie. the payload of the event). And may include details about the occurrence
or data that was change (depending on the schema of the domain-specific named event)

The specification does not place any restriction on the fields or type of the
information included in the `event.data` Attribute as it's contents SHOULD conform
to the `schema` of the domain-specific event.
<!-- endsemconv -->

0 comments on commit ba9b2d0

Please sign in to comment.