Skip to content

Conversation

@stakx
Copy link
Member

@stakx stakx commented Dec 29, 2025

System.Diagnostics.Tracing.EventSource used to be tightly bound to Event Tracing for Windows (ETW), but has since been turned into a cross-platform feature baked into the Framework Class Library (since .NET 5, anyway). CLI tools such as dotnet counters and dotnet trace have been made available to monitor and collect events and metrics emitted from EventSources.

What this PR does is to add an EventSource (named "Castle.DynamicProxy") to the library that allows cross-platform and dependency-free insights into DynamicProxy operations.

Currently, this is unfinished work. There are no tests yet, and more event types may be added.

I'm also using this to explore (in the context of #408) whether EventSource could possibly replace DynamicProxy's use of Castle ILoggers. While EventSource and its surrounding tools seem more concerned with performance analysis than with conventional logging, this may still be a good match. After all, DynamicProxy is already logging mostly about things that have performance implications.

These can be collected or monitored e.g. with the `dotnet-counters` CLI
tool (specify `--counters Castle.DynamicProxy`), see:

https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-counters
These can be collected e.g. using the `dotnet-trace` CLI tool (specify
`--providers Castle.DynamicProxy`); the resulting `.nettrace` files can
then be opened for analysis in e.g. Visual Studio or Perfview. See:

https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace
@stakx stakx self-assigned this Dec 29, 2025
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.

1 participant