prometheus-net icon indicating copy to clipboard operation
prometheus-net copied to clipboard

`system_net_nameresolution_dns_lookups_requested` Metric: Should this be a Counter and not a Gauge?

Open nscherer-chipotle opened this issue 8 months ago • 2 comments

Hello! Unless I'm misunderstanding, shouldn't the system_net_nameresolution_dns_lookups_requested metric be a counter and not a gauge? Based on documentation here: https://learn.microsoft.com/en-us/dotnet/core/diagnostics/available-counters#systemnetnameresolution-counters it doesn't sound like the value of it should ever decrease.

Thanks!

nscherer-chipotle avatar Apr 17 '25 19:04 nscherer-chipotle

Based on this comment, it's intentional.

// We do not represent any of the "counter" style .NET meter types as counters because
// they may be re-created on the .NET Meters side at any time, decrementing the value!

https://github.com/prometheus-net/prometheus-net/blob/master/Prometheus/MeterAdapter.cs#L153

henryzhao95 avatar Jun 17 '25 01:06 henryzhao95

Just saw this too: https://github.com/prometheus-net/prometheus-net/issues/462#issuecomment-1869113970

henryzhao95 avatar Jun 17 '25 01:06 henryzhao95

That makes sense, thanks! I'll close.

nscherer-chipotle avatar Jul 15 '25 14:07 nscherer-chipotle