What would you like to be added: Three new Prometheus gauges for kmesh-owned eBPF maps:
kmesh_map_max_entries{node_name, map_name, map_type} - map capacity
kmesh_map_memlock_bytes{node_name, map_name, map_type} - kernel locked memory
kmesh_map_entry_utilization_ratio{node_name, map_name, map_type} - entry_count / max_entries
Changes required:
- Extend
MapInfo in pkg/controller/telemetry/map_metric.go to capture MaxEntries, Type, and Memlock
- Add
map_type to kmeshMapLabels in pkg/controller/telemetry/utils.go
- Register the three new gauges and expose them on
/status/metric
- Update Grafana dashboards in
samples/addons/ with panels for capacity, utilization, and memlock
- Add unit tests in
map_metric_test.go covering new label dimensions, utilization ratio computation, and missing memlock edge case
Why is this needed: Currently updatePrometheusMetric only collects mapName and entryCount.
Neither MaxEntries (capacity) nor Memlock (locked kernel memory) is exported,
leaving operators with no map headroom or memory visibility.
This makes scale diagnosis difficult as raised in #945, operators cannot
tell whether a map is approaching its capacity limit or how much kernel memory
it is consuming under load. The performance monitoring proposal
(docs/proposal/performance_monitoring.md) explicitly lists these data points
but they were never implemented.
What would you like to be added: Three new Prometheus gauges for kmesh-owned eBPF maps:
kmesh_map_max_entries{node_name, map_name, map_type}- map capacitykmesh_map_memlock_bytes{node_name, map_name, map_type}- kernel locked memorykmesh_map_entry_utilization_ratio{node_name, map_name, map_type}- entry_count / max_entriesChanges required:
MapInfoinpkg/controller/telemetry/map_metric.goto captureMaxEntries,Type, andMemlockmap_typetokmeshMapLabelsinpkg/controller/telemetry/utils.go/status/metricsamples/addons/with panels for capacity, utilization, and memlockmap_metric_test.gocovering new label dimensions, utilization ratio computation, and missing memlock edge caseWhy is this needed: Currently
updatePrometheusMetriconly collectsmapNameandentryCount.Neither
MaxEntries(capacity) norMemlock(locked kernel memory) is exported,leaving operators with no map headroom or memory visibility.
This makes scale diagnosis difficult as raised in #945, operators cannot
tell whether a map is approaching its capacity limit or how much kernel memory
it is consuming under load. The performance monitoring proposal
(
docs/proposal/performance_monitoring.md) explicitly lists these data pointsbut they were never implemented.