DEBUG.WIKI
ZgoCloud:多地区部署,按需选节点;日本、美国、香港、德国
V.PS:让项目靠近用户,亚太、欧洲、北美 KVM VPS
晚安云;香港 CN2 ¥15/月

解决 Prometheus 报错 resend queue overflow 丢弃采样点

分析 Prometheus 远程存储链路重试堆积报 resend queue overflow 根因,详解容量参数、并发分片与网络瓶颈排查方案。

问题现象

Prometheus 远程推流日志持续输出警告,指标丢弃计数器递增:

ts=2026-11-15T14:45:00.123Z caller=dedup.go:180 component=remote level=warn remote_name=vm msg="Dropped samples, resend queue is full" dropped=16384

触发根因

  1. 远端时序库响应延迟升高导致重发队列被打满。

诊断排查步骤

  1. 检查远程端点 HTTP 延迟指标:
curl -s http://127.0.0.1:9090/metrics | grep "prometheus_remote_storage_sent_batch_duration_seconds"

解决步骤与操作命令

步骤一:调大重发队列容量(capacity)与最大并发分片(max_shards)

remote_write:
  - url: "http://vm:8428/api/v1/write"
    queue_config:
      capacity: 100000
      max_shards: 150
      min_shards: 20
      max_samples_per_send: 4000

步骤二:热重载配置

curl -X POST http://127.0.0.1:9090/-/reload

验证方法

再次监控 prometheus_remote_storage_dropped_samples_total: 增量归零,监控数据稳定连续推送。