This repository was archived by the owner on Nov 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 162
Event basics #265
Merged
Merged
Event basics #265
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
f4a9f43
Event basics
trask 5c2ab4b
feedback
trask e9fce22
feedback
trask dbe75df
future possibilities - ergonomics
trask cbcce62
traditional logs -> generic logs
trask 2b2b9d8
feedback
trask cf91d7d
fix
trask e600aef
feedback
trask 02a695d
feedback
trask bfc4d5a
editorial
trask a36584e
feedback
trask e203bc8
remove empty sections
trask d30f276
Add more detail
trask bba526e
event api -> log api
trask 99c4a25
remove the word replacement
trask 38f1598
emitting
trask 7f8a03e
change generic to other
trask fb40c48
change generic to other
trask 187697a
move future possibilities to open questions
trask fc0381e
Add a short section titled 'alternatives'
trask 6956f82
document another open question
trask d3a2af5
add another open question
trask 3c34c00
add another open question
trask f418c4d
Log API -> Logs API
trask 9dc13e1
Refine one of the open questions
trask 3c8c0ab
mention bundle size in open questions
trask e466003
should -> SHOULD
trask File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # Event Basics | ||
|
|
||
| ## Motivation | ||
|
|
||
| The introduction of Events has been contentious, so we want to document and agree on a few basics. | ||
|
|
||
| ### What are OpenTelemetry Events? | ||
|
|
||
| OpenTelemetry Events are a type of OpenTelemetry Log that requires an event name and follows a specific structure implied by that event name. | ||
|
|
||
| They are a core concept in OpenTelemetry Semantic Conventions. | ||
|
|
||
| ### OTLP | ||
|
|
||
| Since OpenTelemetry Events are a type of OpenTelemetry Log, they share the same OTLP log data structure and pipeline. | ||
|
|
||
| ### API | ||
|
|
||
| OpenTelemetry SHOULD provide a (user-facing) Logs API that includes the capability to emit OpenTelemetry Events. | ||
|
|
||
| ### Interoperability with other logging libraries | ||
|
|
||
| OpenTelemetry SHOULD provide a way to send OpenTelemetry Logs from the OpenTelemetry Logs API to other logging libraries (e.g., Log4j). | ||
| This allows users to integrate OpenTelemetry Logs into an existing (non-OpenTelemetry) log stream. | ||
|
|
||
| OpenTelemetry SHOULD provide a way to bypass the OpenTelemetry Logs API entirely and emit OpenTelemetry Logs (including Events) | ||
| directly via existing language-specific logging libraries, if that library has the capability to do so. | ||
|
|
||
| OpenTelemetry will recommend that | ||
| [instrumentation libraries](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/glossary.md#instrumentation-library) | ||
| use the OpenTelemetry Logs API to emit OpenTelemetry Events rather than using other logging libraries to emit OpenTelemetry Events. This recommendation aims to provide users with a simple and consistent | ||
| onboarding experience that avoids mixing approaches. | ||
|
|
||
| OpenTelemetry will also recommend that application developers use the OpenTelemetry Logs API to emit OpenTelemetry Events instead of using another | ||
| logging library, as this helps prevent accidentally emitting logs that lack an event name or are unstructured. | ||
|
|
||
| Recommending the OpenTelemetry Logs API for emitting OpenTelemetry Events, rather than using other logging libraries, contributes to a clearer overall | ||
| OpenTelemetry API story. This ensures a unified approach with first-class user-facing APIs for traces, metrics, and events, | ||
| all suitable for direct use in native instrumentation. | ||
|
|
||
| ### Relationship to Span Events | ||
|
|
||
| Events are intended to replace Span Events in the long term. | ||
| Span Events will be deprecated to signal that users should prefer Events. | ||
|
trask marked this conversation as resolved.
|
||
|
|
||
| Interoperability between Events and Span Events will be defined in the short term. | ||
|
|
||
| ### SDK | ||
|
|
||
| This refers to the existing OpenTelemetry Logs SDK. | ||
|
|
||
| ## Alternatives | ||
|
|
||
| Many alternatives were considered over the past 2+ years. | ||
|
|
||
| These alternatives primarily boil down to differences in naming (e.g. whether to even use the word Event) | ||
| and organization (e.g. whether Event API should be something separate from Logs API). | ||
|
|
||
| The state of this OTEP represents the option that we think will be the least confusing to the most number of users across the wide range of different language ecosystems that are supported. | ||
|
trask marked this conversation as resolved.
|
||
|
|
||
| ## Open questions | ||
|
|
||
| * How to support routing logs from the Logs API to a language-specific logging library | ||
| while simultaneously routing logs from the language-specific logging library to an OpenTelemetry Logging Exporter? | ||
| * How do log bodies interoperate with other logging libraries? | ||
| OpenTelemetry Logs have two places to put structure (attributes and body), while often logging libraries only have one layer of structure, | ||
| which makes it non-obvious how to do a two-way mapping between them in this case. | ||
| * How do event bodies interoperate with Span Events? | ||
| * Should the Logs API have an `Enabled` function based on severity level and event name? | ||
| * What kind of capabilities should the OpenTelemetry Logs API have now that it is user-facing? | ||
| (Keeping in mind the bundle size constraints of browsers and possibly other client environments.) | ||
| * What kind of ergonomic improvements make sense now that the OpenTelemetry Logs API is user-facing? | ||
| (Keeping in mind the bundle size constraints of browsers and possibly other client environments.) | ||
| * How do OpenTelemetry Events relate to raw metric events? | ||
| (e.g. [opentelemetry-specification/617](https://github.com/open-telemetry/opentelemetry-specification/issues/617)). | ||
| * How do OpenTelemetry Events relate to raw span events? | ||
| (e.g. a [streaming SDK](https://github.com/search?q=repo%3Aopen-telemetry%2Fopentelemetry-specification+%22streaming+sdk%22&type=issues)). | ||
| * Should event name be captured as an attribute or as a top-level field? | ||
| * How will Event / Span Event interoperability work in the presence of sampling (e.g. since Span Events are sampled along with Spans)? | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.