Metrics follow-ups from the operator-signals review: BReg scrape lock, offline check depth

未关闭
#2,749 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
prometheus, rust

调研方向

Start in crates/registry-breg/src/metrics.rs at with_scrape_deadline and trace where the queue_sample lock is taken relative to the ScrapeDeadline, then look at the Adapter job host's sample cache as the reference for sharing one in-flight sample between concurrent scrapes. For part 2, find the offline configuration check in the Evidence and Adapter crates and compare how they decode metricsListener.networkExposure against a product that substitutes the stand-in (BReg or Casework). Done means two concurrent scrapes stay within scrape_timeout on a slow database, and Evidence/Adapter keep checking the rest of the file past an ${ENV} value.

由索引模型根据 Issue 内容生成。

描述

area:breg area:evidence area:platform bug

Two follow-ups from the review of #2745 (operator signals). Neither blocks it.

1. BReg: a second concurrent scrape can exceed the scrape timeout when the database is slow

crates/registry-breg/src/metrics.rs, with_scrape_deadline, holds the queue_sample lock for the whole sample. It starts the 5 second ScrapeDeadline only once the lock is held, by design: lock contention never counts as a failed read.

With two Prometheus servers scraping the same BReg (a common high-availability pair) and a degraded database whose reads run to the deadline, the second scrape waits about 5 seconds for the lock and then uses its own 5 seconds. With rendering on top, it passes the 10 second scrape_timeout the stuck-work page suggests. Prometheus then records up == 0 for that target exactly when the queue gauges matter most. With a healthy database, sampling takes milliseconds and nothing happens.

Possible fixes: let concurrent scrapes share one in-flight sample (the Adapter job host's sample cache does this), or start the deadline before taking the lock and accept that contention can cut a sample short.

2. Evidence and Adapter offline checks stop when metricsListener.networkExposure is an ${ENV} expression

Products that check configuration offline differ in how far they go when networkExposure is written as an environment expression:

  • BReg, Casework, Scheduling, Messaging, Documents, Coordinator, Render, OID4VCI and OID4VP substitute a stand-in and keep checking the rest of the file.
  • Evidence and Adapter cannot decode the value. They warn that it was not checked and stop checking the remainder of the file, so other configuration mistakes go unreported until start-up.

Nothing is refused that another product accepts. The gap is check depth. Giving Evidence and Adapter the same stand-in would align them with the other products.

主要语言
Rust
星标
2
派生
0
平均合并
9 小时 48 分钟
30 天内合并 PR
151

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

registrystack/registry-stack 的其他 Issue

查看 registrystack/registry-stack 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。