mixin: drop "not in Go" goroutines from the Goroutines by state panel (#2676)

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
Jan-Otto Kröpke
2026-10-11 13:26:55 +02:00
committed by GitHub
co-authored by Claude
parent c5b88ef2d2
commit 053abd867c
2 changed files with 4 additions and 28 deletions
+2 -4
View File
@@ -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({
+2 -24
View File
@@ -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",