You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please see dotnet/runtime#622 for reference. Given that the cpu count is now reported as the number of cores on the node, not on the container, this metric is no longer accurate.
Interesting stuff- thanks for creating this issue @amrmahdi. https://github.com/dotnet/coreclr/issues/26053 seems to suggest some future workaround (i.e. Environment.ProcessorQuota) but for now, there's not a lot that can be done.
What if we detect that the process is running a container using DOTNET_RUNNING_IN_CONTAINER then read the CPU shares from /sys/fs/cgroup/cpu/cpu.shares ?
Actually that is really not needed, since container_spec_cpu_shares counter already published this metric. So I guess if using .NET Core 3.1 one can update the grafana dashboard to use container_spec_cpu_shares instead of process_cpu_count .
Please see dotnet/runtime#622 for reference. Given that the cpu count is now reported as the number of cores on the node, not on the container, this metric is no longer accurate.
prometheus-net.DotNetRuntime/src/prometheus-net.DotNetRuntime/DotNetRuntimeStatsCollector.cs
Line 137 in 4ae6922
The text was updated successfully, but these errors were encountered: