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

Offen
#2,749 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
prometheus, rust

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Rust
Sterne
2
Forks
0
Ø Merge
9 Std. 48 Min.
Gemergte PRs (30 T.)
151

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus registrystack/registry-stack

Alle Issues in registrystack/registry-stack

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.