[Diagnostics] Add EventPipe Buffer Mode and EventFilter#54631
Draft
mdh1418 wants to merge 3 commits into
Draft
Conversation
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>
Contributor
There was a problem hiding this comment.
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
EventPipeBufferingModeandEventPipeProviderEventFilterin theMicrosoft.Diagnostics.NETCore.ClientAPI reference. - Add/describe
--buffering-mode <Drop|Block>fordotnet-trace collectanddotnet-gcdump collect/report, and documentDOTNET_EventPipeBufferingMode. - Add
ai-usage: ai-assistedfrontmatter and refreshms.datein 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. |
| @@ -374,6 +387,13 @@ public class EventPipeProvider | |||
| long keywords = 0, | |||
| IDictionary<string, string> arguments = null) | |||
| EventLevel eventLevel, | ||
| long keywords, | ||
| IDictionary<string, string> arguments, | ||
| EventPipeProviderEventFilter eventFilter) |
| @@ -402,9 +424,16 @@ public EventPipeProvider( | |||
| EventLevel eventLevel, | |||
| long keywords = 0, | |||
| IDictionary<string, string> arguments = null) | |||
| EventLevel eventLevel, | ||
| long keywords, | ||
| IDictionary<string, string> arguments, | ||
| EventPipeProviderEventFilter eventFilter) |
| - Collecting general statistics about the counts of objects on the heap. | ||
|
|
||
| > [!NOTE] | ||
| > `dotnet-gcdump collect` and `report` default to non-lossy (`Block`) buffering, which produces complete dumps on large heaps. `Block` requires a .NET 11+ target runtime; on older runtimes the tool automatically falls back to the lossy buffer. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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