DiagnosticSourcery 101
summary
DiagnosticSource is a built-in .NET mechanism that emits structured events and activities (with automatic timing, parent IDs and baggage for distributed tracing) and is already used by ASP.NET Core, EF Core and HttpClient. Example: adding diagnostics found a loop issuing ~20,000 upstream calls that cost ~1 minute; a demo service emits original image size 563K → 32K and activity durations to InfluxDB (via a custom, allocation-free client using array pooling and System.Threading.Channels) and visualises them in Grafana/Chronograf. Subscription toggles enablement so there’s no overhead unless someone listens.
AI-written summary · about
chapters (12)
- 0:00DiagnosticsSourcery intro
- 1:11Diagnostics and metrics matter
- 4:45Metrics vs logs explained
- 6:55What to measure in apps
- 12:02Measuring with DiagnosticSource
- 21:12Live code demo
- 30:02DiagnosticSource in .NET Core
- 33:58Distributed tracing challenges
- 42:15Activities and HTTP correlation
- 53:58Syntactic sugar for events
- 57:34Writing metrics to InfluxDB
- 1:01:16Summary and call to action
related talks
55mPower your .NET application with the new generation of diagnostics
01h 09mSherlock Homepage - A detective story about running large web services
01h 01mLogging, tracing and metrics: instrumentation in .NET and Azure
52mApplication Insights: The Tool You Never Knew You Needed
59mOpenTelemetry will save your day and night
55mPreemptive monitoring applications in production
01h 04mAdvanced .NET debugging techniques from real world investigations
12mUnlocking the Secrets of Client Data
