Skip to content

Additional diagnostics for .NET 6 #56072

@davidfowl

Description

@davidfowl

The goal is to help customers better understand how their applications are running by adding events and counters that can give more insights and will help them debug potential performance issues. It'll also help us debug customer applications and write tools that would be able to glean insights from traces.

Runtime

  • What is the thread pool configuration? Many of our customers set a high number of minimum thread pool threads to “fix” starvation. Knowing what this is relative to machine setting (working set and core count) would be useful. (tracked in Capture the thread pool min/max threads config in an event #57247)
  • What app context switches are used, and what are they set to? This will tell customers what quirks are enabled (binary formatter etc.) This can be a huge aid when debugging applications. (tracked in [Feature Request]: Diagnostics for App Context switches #56142)
  • What are the GC settings? Today it's sometimes difficult to tell how the GC was configured without a dump. The goal is to have an event that emits the current GC settings so customers can see what was applied. (part of PR instrumentation changes #55888)
  • What was the value of Environment.ProcessorCount should be emitted in an event. I'm not sure which event is most appropriate for this (if we have an existing one) but we need a way to get the runtime settings. (tracked in [Feature Request]: Diagnostics for processor count #56143)

Networking

  • How much time is spent in DNS resolution? This is a blocking operation, and we added a mitigation for this in .NET 6. We would like customers to be able to determine the time spent here using something high level like a counter or an event (Do we already have an event for this?)
    • dns-lookups-duration counter + we have the events
  • How many unique DNS addresses are resolved in an application’s lifetime? In .NET 6 we added some special logic to queue DNS requests to a single host name (to avoid thread pool starvation). We assume there is a handful of these in the process. Can we add a counters so customers can get a sense of what total and unique DNS resolutions look like in their applications? (tracked in Add Dns event counters #48885)

Threading

  • How many timers are one-shot, vs periodic? The Timer implementation optimizes for timers firing rarely, customers can figure out how their timer queue is behaving. Today we only collect the number of timers, but not the types of timers.
  • We added a thread pool starvation mitigation feature in .NET 6 and have added events that kick in when this mechanism is being used. We should make sure we have the appropriate events here so that customers can observe how this is behaving in their systems.

ArrayPool

  • How many arrays are discarded when returning to the pool? This is a measure of pooling efficiency that we’d like to help customers understand better. We have an event but we need to make sure it's efficient enough to turn on in a production environment.

Dependency Injection

  • We would like to help customers better understand some statistics about registered services:
  • How many singleton services?
  • How many scoped services?
  • How many transient services?
  • How many container instances are in the processes?
  • (tracked in Additional Diagnostics in Dependency Injection #56313)

similar issue in aspnetcore repo: dotnet/aspnetcore#34578

cc @danmoseley @jeffschwMSFT @jkotas @geoffkizer @stephentoub @eerhardt @kouvel @mangod9 @Maoni0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions