-
Notifications
You must be signed in to change notification settings - Fork 538
Closed
Labels
Description
What's wrong?
When trying to access the mimir.rules.kubernetes component UI on a non-leader instance, it shows a blank empty page and a panic error is reported in the logs.
Steps to reproduce
- Configure a
mimir.rules.kubernetescomponent - Run alloy with multiple instances
- Find a non-leader instance
- Access http://localhost:12345/component/mimir.rules.kubernetes.xxxxxx
System information
No response
Software version
Grafana Alloy v1.8.2
Configuration
mimir.rules.kubernetes "giantswarm" {
address = env("RULER_API_URL")
basic_auth {
username = env("BASIC_AUTH_USERNAME")
password = env("BASIC_AUTH_PASSWORD")
}
extra_query_matchers {
matcher {
name = "cluster_id"
match_type = "="
value = "my-cluster"
}
}
mimir_namespace_prefix = "my-cluster"
tenant_id = "my-tenant"
rule_selector {
match_labels = {
"observability.giantswarm.io/tenant" = "my-tenant",
}
match_expression {
key = "application.giantswarm.io/prometheus-rule-kind"
operator = "NotIn"
values = ["loki"]
}
}
}
Logs
2025/04/25 09:58:20 http: panic serving 127.0.0.1:43504: runtime error: invalid memory address or nil pointer dereference
goroutine 10893 [running]:
net/http.(*conn).serve.func1()
/usr/local/go/src/net/http/server.go:1947 +0xbe
panic({0xa2d0b20?, 0x12eb4ed0?})
/usr/local/go/src/runtime/panic.go:792 +0x132
github.com/grafana/alloy/internal/component/mimir/rules/kubernetes.(*eventProcessor).getMimirState(0x0)
/src/alloy/internal/component/mimir/rules/kubernetes/events.go:327 +0x3f
github.com/grafana/alloy/internal/component/mimir/rules/kubernetes.(*Component).DebugInfo(0xc001b24c08)
/src/alloy/internal/component/mimir/rules/kubernetes/debug.go:26 +0x52
github.com/grafana/alloy/internal/runtime/internal/controller.(*BuiltinComponentNode).DebugInfo(0xa66e620?)
/src/alloy/internal/runtime/internal/controller/node_builtin_component.go:431 +0xab
github.com/grafana/alloy/internal/runtime.(*Runtime).getComponentDetail(0xc001b23100, {0xd0d4c90, 0xc000da0508}, 0xc0a0d6e1a0, {0x20?, 0x4a?, 0x78?, 0xf4?})
/src/alloy/internal/runtime/alloy_components.go:130 +0xb17
github.com/grafana/alloy/internal/runtime.(*Runtime).GetComponent(0xc001b23100, {{0x0, 0x0}, {0xc0e1a0d82b, 0x21}}, {0xff?, 0xff?, 0xff?, 0xff?})
/src/alloy/internal/runtime/alloy_components.go:37 +0x2d6
github.com/grafana/alloy/internal/web/api.getComponentHandlerInternal({0xd0632a0, 0xc001b23100}, {0xd02ac20, 0xc0a0d6e140}, 0xc0f47848a0?)
/src/alloy/internal/web/api/api.go:138 +0xe4
github.com/grafana/alloy/internal/web/api.(*AlloyAPI).RegisterRoutes.getComponentHandler.func5({0xd02ac20?, 0xc0a0d6e140?}, 0xc064cb9040?)
/src/alloy/internal/web/api/api.go:119 +0x34
net/http.HandlerFunc.ServeHTTP(0xd02ab30?, {0xd02ac20?, 0xc0a0d6e140?}, 0xc0d423f378?)
/usr/local/go/src/net/http/server.go:2294 +0x29
github.com/prometheus/prometheus/util/httputil.CompressionHandler.ServeHTTP({{0xcf7ac40?, 0xc000f842e8?}}, {0xd02ab30?, 0xc012915260?}, 0xc095e6c000)
/go/pkg/mod/github.com/grafana/prometheus@v1.8.2-0.20250312141819-a2b6722387bf/util/httputil/compression.go:91 +0x63
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0013a0180, {0xd02ab30, 0xc012915260}, 0xc0a1841cc0)
/go/pkg/mod/github.com/gorilla/mux@v1.8.1/mux.go:212 +0x1e2
go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux.traceware.ServeHTTP({{0xba367ff, 0x5}, {0xcfadda0, 0xc002194de0}, {0xd01c380, 0xc001423240}, {0xcf7b740, 0xc0013a0180}, 0xc1b3a20, 0x0, ...}, ...)
/go/pkg/mod/go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux@v0.45.0/mux.go:179 +0xb90
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0013a0000, {0xd0199d0, 0xc0494bc0e0}, 0xc0a1683e00)
/go/pkg/mod/github.com/gorilla/mux@v1.8.1/mux.go:212 +0x1e2
golang.org/x/net/http2/h2c.h2cHandler.ServeHTTP({{0xcf7b740?, 0xc0013a0000?}, 0xc000696540?}, {0xd0199d0, 0xc0494bc0e0}, 0xc0a1683e00)
/go/pkg/mod/golang.org/x/net@v0.37.0/http2/h2c/h2c.go:125 +0x673
net/http.serverHandler.ServeHTTP({0xc0e5fd6db0?}, {0xd0199d0?, 0xc0494bc0e0?}, 0x6?)
/usr/local/go/src/net/http/server.go:3301 +0x8e
net/http.(*conn).serve(0xc00b06a240, {0xd04c808, 0xc0013a3ec0})
/usr/local/go/src/net/http/server.go:2102 +0x625
created by net/http.(*Server).Serve in goroutine 470
/usr/local/go/src/net/http/server.go:3454 +0x485
Reactions are currently unavailable