From 053abd867c7c89ec05a90365bf8c4f502b417479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Sun, 11 Oct 2026 13:26:55 +0200 Subject: [PATCH] mixin: drop "not in Go" goroutines from the Goroutines by state panel (#2676) Co-authored-by: Claude Signed-off-by: Claude --- contrib/mixin/dashboards/exporter.libsonnet | 6 ++--- dashboard/windows-exporter-dashboard.json | 26 ++------------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/contrib/mixin/dashboards/exporter.libsonnet b/contrib/mixin/dashboards/exporter.libsonnet index 7098318f..70265f99 100644 --- a/contrib/mixin/dashboards/exporter.libsonnet +++ b/contrib/mixin/dashboards/exporter.libsonnet @@ -495,7 +495,7 @@ function(on) }), b.panel.new(107, 'Goroutines by state', 'timeseries') - + b.panel.withDescription('Steady growth of goroutines points to a goroutine leak. Goroutines that stay "not in Go" sit in a system call, for example a collector waiting on WMI or PDH. The states need an exporter build with the Go scheduler metrics; the total line works with every build. Since 0.32, "not in Go" keeps growing even without a leak: a Go runtime bug (golang/go#82136) counts each WMI callback from a Windows thread once and never subtracts it. Use the total line to spot a leak instead.') + + b.panel.withDescription('Steady growth of goroutines points to a goroutine leak. The states need an exporter build with the Go scheduler metrics; the total line works with every build. The "not in Go" state is left out: since 0.32 a Go runtime bug (golang/go#82136) counts each WMI callback from a Windows thread once and never subtracts it, so it keeps growing without a leak.') + b.panel.withQueries([ b.query.new('go_sched_goroutines_running_goroutines{job=~"$job", instance="$instance"}', 'A') + b.query.withLegendFormat('running'), @@ -503,9 +503,7 @@ function(on) + b.query.withLegendFormat('runnable'), b.query.new('go_sched_goroutines_waiting_goroutines{job=~"$job", instance="$instance"}', 'C') + b.query.withLegendFormat('waiting'), - b.query.new('go_sched_goroutines_not_in_go_goroutines{job=~"$job", instance="$instance"}', 'D') - + b.query.withLegendFormat('not in Go'), - b.query.new('go_goroutines{job=~"$job", instance="$instance"}', 'E') + b.query.new('go_goroutines{job=~"$job", instance="$instance"}', 'D') + b.query.withLegendFormat('total'), ]) + b.panel.withDefaults({ diff --git a/dashboard/windows-exporter-dashboard.json b/dashboard/windows-exporter-dashboard.json index f15c5e5d..ca4f90f7 100644 --- a/dashboard/windows-exporter-dashboard.json +++ b/dashboard/windows-exporter-dashboard.json @@ -982,28 +982,6 @@ "refId": "C" } }, - { - "kind": "PanelQuery", - "spec": { - "hidden": false, - "query": { - "datasource": { - "name": "${datasource}" - }, - "group": "prometheus", - "kind": "DataQuery", - "spec": { - "editorMode": "code", - "expr": "go_sched_goroutines_not_in_go_goroutines{job=~\"$job\", instance=\"$instance\"}", - "instant": false, - "legendFormat": "not in Go", - "range": true - }, - "version": "v0" - }, - "refId": "D" - } - }, { "kind": "PanelQuery", "spec": { @@ -1023,7 +1001,7 @@ }, "version": "v0" }, - "refId": "E" + "refId": "D" } } ], @@ -1031,7 +1009,7 @@ "transformations": [] } }, - "description": "Steady growth of goroutines points to a goroutine leak. Goroutines that stay \"not in Go\" sit in a system call, for example a collector waiting on WMI or PDH. The states need an exporter build with the Go scheduler metrics; the total line works with every build. Since 0.32, \"not in Go\" keeps growing even without a leak: a Go runtime bug (golang/go#82136) counts each WMI callback from a Windows thread once and never subtracts it. Use the total line to spot a leak instead.", + "description": "Steady growth of goroutines points to a goroutine leak. The states need an exporter build with the Go scheduler metrics; the total line works with every build. The \"not in Go\" state is left out: since 0.32 a Go runtime bug (golang/go#82136) counts each WMI callback from a Windows thread once and never subtracts it, so it keeps growing without a leak.", "id": 107, "links": [], "title": "Goroutines by state",