Skip to content

[Diagnostics] Add EventPipe Buffer Mode and EventFilter#54631

Draft
mdh1418 wants to merge 5 commits into
dotnet:mainfrom
mdh1418:eventpipe-non-lossy-buffering-docs
Draft

[Diagnostics] Add EventPipe Buffer Mode and EventFilter#54631
mdh1418 wants to merge 5 commits into
dotnet:mainfrom
mdh1418:eventpipe-non-lossy-buffering-docs

Conversation

@mdh1418

@mdh1418 mdh1418 commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

In .NET 10, EventFilter was added for EventPipe sessions to filter which eventIDs to disable or enable.
In .NET 11, EventPipe introduces a new buffering mode for loss-less event collection, as opposed to the typical lossy mode which drops events when buffers are full.


Internal previews

📄 File 🔗 Preview link
docs/core/diagnostics/dotnet-gcdump.md Heap analysis tool (dotnet-gcdump)
docs/core/diagnostics/dotnet-trace.md dotnet-trace performance analysis utility
docs/core/diagnostics/eventpipe.md EventPipe Overview
docs/core/diagnostics/microsoft-diagnostics-netcore-client.md Microsoft.Diagnostics.NETCore.Client API

mdh1418 and others added 3 commits July 2, 2026 19:42
Add Microsoft.Diagnostics.NETCore.Client reference for EventPipeBufferingMode, EventPipeProviderEventFilter, the new EventPipeSessionConfiguration and EventPipeProvider overloads and properties, and the UnknownCommandException and InvalidCommandArgumentException types.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dotnet-gcdump collect/report default to non-lossy (Block) with automatic fallback on older runtimes; dotnet-trace collect adds an opt-in --buffering-mode (default Drop). Block requires a .NET 11+ target runtime.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add DOTNET_EventPipeBufferingMode and DOTNET_EventPipeOutputStreaming to the EventPipe environment-variable reference, and note the non-lossy opt-in on the circular-buffer guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request updates the diagnostics documentation to cover new EventPipe capabilities: per-provider Event ID filtering (EventFilter) and a new buffering mode that enables non-lossy collection by blocking event producers when buffers fill.

Changes:

  • Document EventPipeBufferingMode and EventPipeProviderEventFilter in the Microsoft.Diagnostics.NETCore.Client API reference.
  • Add/describe --buffering-mode <Drop|Block> for dotnet-trace collect and dotnet-gcdump collect/report, and document DOTNET_EventPipeBufferingMode.
  • Add ai-usage: ai-assisted frontmatter and refresh ms.date in the edited articles.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
docs/core/diagnostics/microsoft-diagnostics-netcore-client.md Adds API surface documentation for buffering mode and provider event filtering, plus an exception note for older runtimes.
docs/core/diagnostics/eventpipe.md Documents the new DOTNET_EventPipeBufferingMode environment variable and explains the non-lossy buffering tradeoff.
docs/core/diagnostics/dotnet-trace.md Adds --buffering-mode option documentation for trace collection.
docs/core/diagnostics/dotnet-gcdump.md Adds --buffering-mode option documentation and clarifies non-lossy defaults/fallback behavior.

Comment thread docs/core/diagnostics/microsoft-diagnostics-netcore-client.md
Comment thread docs/core/diagnostics/microsoft-diagnostics-netcore-client.md
Comment thread docs/core/diagnostics/microsoft-diagnostics-netcore-client.md
Comment thread docs/core/diagnostics/microsoft-diagnostics-netcore-client.md
Comment thread docs/core/diagnostics/dotnet-gcdump.md Outdated
mdh1418 and others added 2 commits July 9, 2026 15:34
Remove the --buffering-mode option from dotnet-gcdump (it now always collects non-lossy and falls back to lossy on pre-.NET 11 targets). Replace the dropped UnknownCommandException and InvalidCommandArgumentException with the new BadEncodingException and fix the UnsupportedCommandException base type. Clarify that non-lossy buffering is bounded by buffer capacity and can still drop events under host memory exhaustion or during shutdown, and correct the DOTNET_EventPipeBufferingMode invalid-value and streaming-session behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants