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

Ouverte
#2,749 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
45/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
prometheus, rust

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Rust
Étoiles
2
Forks
0
Merge moyen
9 h 48 min
PR mergées (30 j)
151

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de registrystack/registry-stack

Toutes les issues de registrystack/registry-stack

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.