-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
If a tree falls in a forest and nobody is listening, does it make a sound?
If you need to upfront register your ears to listen to the sound of Tree.Falling then that question becomes more complicated.
dotnet-counters has a List
mode which appears to be a static list, a la help. This is better than nothing, but it doesn't help much as I don't think it has been updated since 3.1. For example, we added a bunch of counters for networking, that I don't believe are listed.
There should be a mode of dotnet-counters that will adapt itself and listen to any counters that are registered as the application is run. For example, something like:
dotnet-counters monitor -process-id 12345 -all-counters
Is this the most performance efficient way of running the application - no - but it'll make it much easier for developers/SRE to see what counters are available, and for when they are writing their own counters to be able to diagnose if they have made typos etc.
Activity
ghost commentedon Dec 8, 2022
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
MihaZupan commentedon Dec 8, 2022
The list of networking counters is kept up to date: https://github.com/dotnet/diagnostics/blob/433fd6a073fe29895c01ed1a70d5cba568a0e070/src/Tools/dotnet-counters/KnownData.cs#L91-L161
(that said if the tool could do it automagically I wouldn't complain 🙂)
pinkfloydx33 commentedon Dec 8, 2022
It says the maxVersion/runtimeVersion is 6.0 and only includes 7.0 as a supported version in a handful of places. Perhaps that's why?
samsp-msft commentedon Dec 9, 2022
The latest version of dotnet-counters seems to be 6.0.351802, which could well be before @MihaZupan's changes were included.
However that still doesn't solve the problem that counters can be added by any code including the app and 3rd party libraries, and so having it be able to enumerate all the counters actually be used would be very useful.
samsp-msft commentedon Jan 31, 2023
I ended up creating a utility to enumerate the counters and events exposed in a process
https://gist.github.com/samsp-msft/cb4ba1e5bb4de0c6bb3aae5ecbeac162
To use:
7 remaining items