【 OB or 其他组件 】 obproxy
【 使用版本 】4.3.2.0-752024120610
【问题描述】 大量告警日志: metric num reach limit, will discard and expire metric(metric_num=5000)
【其他】
enable_extra_prometheus_metric = false
enable_prometheus = true
OceanBase: 4.2.5.3
【日志】大量刷
[2026-12-03 11:09:39.879973] WDIAG [PROXY] get_or_create_metric (ob_prometheus_processor.cpp:455) [2692592][Y0-0000FFFCD5D6BD30] [lt=0] [dc=0] metric num reach limit, will discard and expire metric(metric_num=5000)
原因是 开启 enable_prometheus=true 后 ODP 会按多维 label 生成 series 超过了monitor_item_limit的指标了告警。
先确认并调大上限(即时缓解)
SHOW PROXYCONFIG LIKE ‘%monitor_item%’;
SHOW PROXYCONFIG LIKE ‘%prometheus%’;
– 上限最大 10000,动态生效,无需重启
ALTER PROXYCONFIG SET monitor_item_limit = 10000;
– 可选:加快空闲 metric 回收(默认 30m)
ALTER PROXYCONFIG SET monitor_item_max_idle_period = ‘10m’;
看一下实际指标膨胀点
curl -s http://<obproxy_ip>:2884/metrics | wc -l
curl -s http://<obproxy_ip>:2884/metrics | awk -F’{’ ‘{print $1}’ | sort | uniq -c | sort -rn | head
参数值:
monitor_item_max_idle_period = 30m
monitor_item_limit = 5000
curl -s http://<obproxy_ip>:2884/metrics | wc -l
值:1477
curl -s http://<obproxy_ip>:2884/metrics | awk -F’{’ ‘{print $1}’ | sort | uniq -c | sort -rn | head
959 odp_sql_cost_total
329 odp_sql_requst_total
78 odp_transaction_total
55 odp_current_session
17 odp_new_client_connections
3 exposer_request_latencies
2 odp_memoy
调大就好了 看着查询的信息复合预期 确实超了
蹲一个
如果再发无效回复 给你禁言