kmesh-net / kmesh

High Performance ServiceMesh Data Plane Based on Programmable Kernel
https://kmesh.net
Apache License 2.0
459 stars 69 forks source link

panic when specify --profiling=true #1036

Open hzxuzhonghu opened 1 day ago

hzxuzhonghu commented 1 day ago

What happened:

time="2024-11-12T08:59:32Z" level=info msg="start watching file /var/run/secrets/kubernetes.io/serviceaccount/token" subsys="cni installer"
panic: inconsistent label cardinality: expected 1 label values but got 2 in prometheus.Labels{"map_name":"-", "node_name":"kmesh-testing-worker"}

goroutine 69 [running]:
github.com/prometheus/client_golang/prometheus.(*GaugeVec).With(...)
    github.com/prometheus/client_golang@v1.20.5/prometheus/gauge.go:250
kmesh.net/kmesh/pkg/controller/telemetry.(*MapMetricController).updatePrometheusMetric(0x37e11d600?)
    kmesh.net/kmesh/pkg/controller/telemetry/map_metric.go:114 +0x22d
kmesh.net/kmesh/pkg/controller/telemetry.(*MapMetricController).Run.func1()
    kmesh.net/kmesh/pkg/controller/telemetry/map_metric.go:62 +0x45
created by kmesh.net/kmesh/pkg/controller/telemetry.(*MapMetricController).Run in goroutine 15
    kmesh.net/kmesh/pkg/controller/telemetry/map_metric.go:55 +0x91
time="2024-11-12T08:59:48Z" level=info msg="start remove CNI config" subsys="cni installer"

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

hzxuzhonghu commented 1 day ago

cc @skwwwwww

hzxuzhonghu commented 1 day ago

@zirain Do you know if there is a way that allow set arbitrary label