-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[blog] Deprecating Span Events API #9342
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
Merged
tiffany76
merged 74 commits into
open-telemetry:main
from
pellared:deprecate-span-events
Mar 17, 2026
Merged
Changes from all commits
Commits
Show all changes
74 commits
Select commit
Hold shift + click to select a range
dbac8bc
[blog] Deprecating Span Events
pellared e3d94a0
Results from /fix directive
otelbot[bot] 8983687
Results from /fix directive
otelbot[bot] d409cfa
update references to OTEP 4430
pellared 72dca1c
Results from /fix directive
otelbot[bot] 6a77efb
fix authors
pellared dffb6d4
refactor: update section headings and reorganize content for clarity …
pellared b7c521f
refactor collector changes
pellared 569e364
docs: add mention of changes in the Collector for deprecating span ev…
pellared 7851f95
fix: add space in reference to OTEP 4430 for clarity
pellared 69120cc
simplify
pellared f9a3109
Results from /fix directive
otelbot[bot] c49a127
Merge branch 'main' into deprecate-span-events
pellared 85f694a
remove unnecessary word
pellared 3e6c467
Results from /fix directive
otelbot[bot] d849652
Update content/en/blog/2026/deprecating-span-events.md
pellared 27cd110
Merge branch 'main' into deprecate-span-events
pellared cfd75bb
mention trace_based confiuration
pellared 188908f
emit log-based events instead of span events
pellared a844815
update author details and improve clarity in deprecating span events …
pellared d31431c
improve clarity and consistency in deprecating span events blog post
pellared bf8d659
refine language for clarity in deprecating span events blog post
pellared 3b4e80e
clarify deprecation of span events, emphasizing shift to Logs API for…
pellared e82de69
Merge branch 'main' into deprecate-span-events
pellared e4ffa4f
Results from /fix directive
otelbot[bot] cc71263
Results from /fix directive
otelbot[bot] 2806da2
Merge branch 'main' into deprecate-span-events
pellared 2b5d106
Results from /fix directive
otelbot[bot] 2d639fb
Add TL;DR section to deprecating span events blog post
pellared ce4159b
Add note on stabilizing recording errors semantic conventions
pellared e4398cd
Results from /fix directive
otelbot[bot] 3499d82
Merge branch 'main' into deprecate-span-events
pellared 68ade46
Apply suggestions from code review
pellared 6c4d4bd
Update content/en/blog/2026/deprecating-span-events.md
pellared 76c2cd1
Update content/en/blog/2026/deprecating-span-events.md
pellared 8ff1ec7
Results from /fix directive
otelbot[bot] 426d61f
Remove references to the Collector in deprecation plan for Span Events
pellared 2a5ee8a
Remove guidance on using span events for additional details
pellared e1da3e5
apply suggestion in preface
pellared 4b95942
Enhance explanation of OTLP support
pellared 506128f
Remove unnecessary note about span events in TL;DR section
pellared 2ca4828
Clarify "Trace-centric views can still show events on spans"
pellared 0637cd2
Add spec links
pellared ba862e9
Results from /fix directive
otelbot[bot] 17bf48d
Improve TL;DR; and preface
pellared bd8fd99
simplify the blog post
pellared 4d8e283
Merge branch 'deprecate-span-events' of github.com:pellared/opentelem…
pellared e1b8fb1
Refine "What should you do?"
pellared 89dbf75
Results from /fix directive
otelbot[bot] f8f0b60
Results from /fix directive
otelbot[bot] 944475c
Update deprecating-span-events.md
pellared c560a79
Results from /fix directive
otelbot[bot] 183b36e
Apply suggestions from code review
pellared 286804c
Remove blank line
pellared 9ce3469
Results from /fix directive
otelbot[bot] 763ec80
Merge branch 'main' into deprecate-span-events
pellared 3cc339e
refine What should you do? and Feedback
pellared 1f9ca1b
fix typo
pellared d3ee7e5
Results from /fix directive
otelbot[bot] 7ddef62
Update deprecating-span-events.md
pellared a1d7c80
Merge branch 'main' into deprecate-span-events
pellared 2a19018
grammar fixes
pellared 1ac7746
Merge branch 'main' into deprecate-span-events
pellared 07a226c
Results from /fix directive
otelbot[bot] 05bf8c4
Apply suggestions from code review
pellared ee50538
Merge branch 'main' into deprecate-span-events
pellared c7f687b
Results from /fix directive
otelbot[bot] f8af5f4
link for OTEL_SEMCONV_EXCEPTION_SIGNAL_OPT_IN
pellared 39a4782
Apply suggestions from code review
pellared 82c534c
Refine "Application developers" section
pellared a908dea
without breaking -> providing transition
pellared 1c73fd6
Merge branch 'main' into deprecate-span-events
pellared a1bae55
Results from /fix directive
otelbot[bot] 9779c4b
Merge branch 'main' into deprecate-span-events
pellared 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
Some comments aren't visible on the classic Files Changed page.
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,188 @@ | ||
| --- | ||
| title: Deprecating Span Events API | ||
| linkTitle: Deprecating Span Events API | ||
| date: 2026-03-17 | ||
| author: >- | ||
| [Liudmila Molkova](https://github.com/lmolkova) (Grafana Labs), [Robert | ||
| Pająk](https://github.com/pellared) (Splunk), [Trask | ||
| Stalnaker](https://github.com/trask) (Microsoft) | ||
| sig: Specification, Logs | ||
| cSpell:ignore: Liudmila Molkova Pająk | ||
| --- | ||
|
|
||
| OpenTelemetry is deprecating the Span Event API. This post explains why we’re | ||
| making this change, what it means at a high level, and how you can prepare. In | ||
| short: | ||
|
|
||
| - We want to remove confusion and duplication caused by having two overlapping | ||
| ways to emit events: span events and log-based events. | ||
| - New code should write events as logs that are correlated with the current | ||
| span. | ||
| - The older "span events" style will be phased out over time, but existing data | ||
| and views that show events on spans will keep working. | ||
|
|
||
| ## Why deprecate the Span Event API? | ||
|
|
||
| Today, OpenTelemetry offers two main ways to emit events that are correlated | ||
| with traces: | ||
|
|
||
| - Span events, created via the | ||
| [Tracing API](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.40.0/specification/trace/api.md) | ||
| using methods `Span.AddEvent` or `Span.RecordException`. | ||
| - Log-based events, emitted via the | ||
| [Logs API](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.40.0/specification/logs/api.md) | ||
| (either directly or through logging libraries bridged into OpenTelemetry) and | ||
| associated with the active context. | ||
|
|
||
| Having two competing APIs for the same concept has several drawbacks: | ||
|
|
||
| - **Split guidance for instrumentation authors.** Library and framework authors | ||
| must choose between two ways of emitting very similar data. Different choices | ||
| lead to inconsistent user experiences across the ecosystem. | ||
| - **Duplicate concepts for users.** Operators must understand both span events | ||
| and log events, how they are exported, and how their backends treat them. | ||
| - **Slower evolution.** Improvements to the event model (for example, around | ||
| schemas, attributes, and backward-compatibility) must be specified and | ||
| implemented in two places. | ||
|
|
||
| The OpenTelemetry community has been converging on a simpler mental model: | ||
| **events are logs with names** emitted via the Logs API, correlated with traces | ||
| and metrics through context, rather than as a special case on spans. This change | ||
| is significant because it unifies how OpenTelemetry represents events. | ||
|
|
||
| At the same time, we recognize that span events are widely used today. Many | ||
| backends present span events in dedicated trace views, and some users depend on | ||
| events being sent in the same OTLP export payload as their parent span. | ||
|
|
||
| The plan in [OTEP 4430: Span Event API deprecation plan][OTEP] aims to balance | ||
| these goals: | ||
|
|
||
| - Provide **clear, consistent guidance** that new events should go through the | ||
| Logs API. | ||
| - **Preserve existing workflows** that depend on span events in traces, via a | ||
| compatibility layer. | ||
|
|
||
| In short, we are deprecating the **API** for recording span events, not the | ||
| ability to see events attached to spans. | ||
|
|
||
| ## What is changing? | ||
|
|
||
| The deprecation focuses on **how new events are recorded**: | ||
|
|
||
| - OTLP support for log-based events is already stable, and the Logs API can | ||
| capture everything span events historically carried, with richer metadata and | ||
| more flexible export and filtering. | ||
| - The tracing specification will deprecate APIs such as `Span.AddEvent` and | ||
| `Span.RecordException` in favor of emitting log-based events. | ||
| - Language APIs and SDKs will make log-based events first-class, and provide | ||
| compatibility options that can still surface those events as span events where | ||
| needed. | ||
| - Instrumentations and semantic conventions will gradually move from span events | ||
| to log-based events in their next major versions, while keeping existing | ||
| behavior stable until then. | ||
|
|
||
| ## What stays the same? | ||
|
pellared marked this conversation as resolved.
|
||
|
|
||
| Even though the Span Event API is being deprecated, several important aspects of | ||
| user experience are intentionally preserved: | ||
|
|
||
| - **Correlation across signals continues to work the same way.** Log-based | ||
| events still participate in OpenTelemetry context. | ||
| - **Existing data remains valid.** Data that already uses span events remains | ||
| part of the supported OTLP trace model. | ||
|
|
||
| Deprecation is about providing a single recommended way to emit events in new | ||
| code, not about removing visibility into events on spans. | ||
|
|
||
| ## What should you do? | ||
|
pellared marked this conversation as resolved.
|
||
|
|
||
| First and foremost, we want this transition to be safe, gradual, and compatible | ||
| with the workflows you rely on today. | ||
|
|
||
| Depending on your role, here is how the upcoming changes can affect you and what | ||
| you can do. | ||
|
|
||
| ### Operators | ||
|
|
||
| If you mainly consume traces, logs, and metrics in dashboards and analysis | ||
| tools: | ||
|
|
||
| - You should not need to change your applications or dashboards immediately. | ||
| - When you upgrade, your instrumentations may emit exceptions and other events | ||
| as log-based events rather than span events. Verify that events still appear | ||
| in the views you rely on (for example, span timelines and event views). | ||
|
|
||
| ### Application developers | ||
|
|
||
| If you maintain an application that you instrument: | ||
|
|
||
| - You should not need to change code immediately. | ||
| - Watch for new versions of your instrumentation libraries as they may start | ||
| emitting log-based events. However, they may still have an option to keep | ||
| using span events. | ||
| - The SDK will offer you a way transform log-based events back onto span events. | ||
|
|
||
| If you maintain your own custom instrumentation: | ||
|
|
||
| - Prefer the Logs API for new events and exceptions. | ||
| - Avoid adding new dependencies on span event methods, especially where they are | ||
| already marked as deprecated. | ||
|
|
||
| ### Observability vendors | ||
|
|
||
| If you build observability backends or services: | ||
|
|
||
| - Support ingestion of log-based events. | ||
| - Ensure that log-based events can still be surfaced in existing span-oriented | ||
| views where users expect them. | ||
|
|
||
| ### Instrumentation authors | ||
|
|
||
| If you author OpenTelemetry instrumentations: | ||
|
|
||
| - Keep existing stable major versions behaviorally compatible for now. | ||
| - Consider adding an opt-in mechanism in current major versions (like | ||
| [`OTEL_SEMCONV_EXCEPTION_SIGNAL_OPT_IN`](/docs/specs/semconv/exceptions)) to | ||
| emit log-based events alongside existing span events. | ||
| - For the next major versions, plan to migrate events and exceptions to the Logs | ||
| API following updated semantic conventions, rather than adding new span | ||
| events. | ||
|
|
||
| ### Semantic convention authors | ||
|
|
||
| If you define or maintain OpenTelemetry semantic conventions: | ||
|
|
||
| - Document events as log-based events, specifying attributes and event names for | ||
| log records instead of span events. | ||
| - When evolving existing conventions that currently rely on span events, provide | ||
| clear guidance on their log-based equivalents. | ||
|
|
||
| ### OpenTelemetry maintainers | ||
|
|
||
| If you maintain OpenTelemetry language APIs and SDKs: | ||
|
|
||
| - Expose and stabilize the Logs API so that end users can easily emit log-based | ||
| events. | ||
| - Prepare for the deprecation of span event methods such as `Span.AddEvent` and | ||
| `Span.RecordException` in favor of log-based events, while maintaining | ||
| compatibility where needed. | ||
| - Provide helpers or configuration that can transform log-based events back onto | ||
| span events for users and backends that still depend on that representation. | ||
|
|
||
| ## Closing | ||
|
|
||
| Please share your requirements and concerns in | ||
| [community#3312](https://github.com/open-telemetry/community/issues/3312). We | ||
| are especially interested in which compatibility aspects matter most to you, for | ||
| example, whether you rely on seeing events directly on spans in trace views, on | ||
| having events included in the same OTLP export payload as their parent spans, or | ||
| on other behaviors your current tooling depends on. | ||
|
|
||
| Deprecation here does **not** mean removing span events. It is about shifting | ||
| the recommended way to emit new events toward the Logs API. | ||
|
|
||
| Our goal is to make events in OpenTelemetry **simpler, more consistent, and more | ||
| powerful**, while providing a graceful transition to the new recommendations. | ||
|
|
||
| [OTEP]: | ||
| https://github.com/open-telemetry/opentelemetry-specification/blob/fd43145dde7e5192ebc59a20992d98a3e6af5553/oteps/4430-span-event-api-deprecation-plan.md | ||
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
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.