Registry Scheduling: startup logging goes to stdout, colliding with a stdout audit destination
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- backend, observability
Direzione di ricerca
Inizia da crates/registry-scheduling/src/main.rs:7 e confronta la sua configurazione di tracing con quella di crates/registry-relay-v2/src/main.rs:31-41. Configura audit.destination: stdout, avvia Scheduling e verifica che stdout contenga solo righe JSON di audit valide mentre l'output di tracing è su stderr. Il lavoro è completato quando i due flussi di output non si intrecciano più.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What (Registry Scheduling)
crates/registry-scheduling/src/main.rs:7 calls tracing_subscriber::fmt::init() unconditionally, as the first statement, with no .with_writer(...) override, so tracing logs go to stdout using the default plain-text formatter. Separately, AuditDestinationKind::Stdout (crates/registry-platform-audit/src/writer.rs:216-222) is a supported destination, and Scheduling's AuditConfig.destination (crates/registry-scheduling/src/config.rs:283-299, documented in products/scheduling/RUNTIME-CONFIG.md:84-92) allows audit.destination: stdout. Nothing checks or warns about this combination: RuntimeConfig::validate only validates the destination's own shape, and runtime.rs::open_audit just opens whichever destination is configured. When an operator selects a stdout audit destination, tracing's plain-text log lines and the audit writer's JSON Lines entries interleave on the same stream.
main.rs itself is unchanged by #1560 (its stdout logging predates this PR), but Scheduling's config previously required a mandatory file path for audit (path: PathBuf, no stdout option existed); #1560 added the destination enum with a stdout variant. So the collision this creates is newly reachable through this PR even though the logging call itself is old.
For comparison: crates/registry-relay-v2/src/main.rs:31-41 already sends its tracing output to stderr (.with_writer(std::io::stderr)) in install_operational_logging. crates/registry-evidence/src/main.rs:667-676 has the identical gap as Scheduling (also logs to stdout with no writer override), so this is not scheduling-specific, though this ticket is scoped to Scheduling since that is the assigned claim.
Found while reviewing #1560.
Why it matters
A stdout audit destination is meant to produce a clean JSON Lines stream for a downstream collector. Plain-text tracing lines mixed into that stream will not parse as audit entries; a lenient consumer might silently drop them (masking real log output) and a strict one might choke on the whole stream. Scheduling's formatter is plain-text rather than JSON, so the more likely failure is a JSON Lines consumer failing on non-JSON lines rather than a spurious line being misparsed as an audit record.
Suggested fix
Send tracing output to stderr unconditionally in main.rs, matching the pattern Relay already uses, regardless of which audit destination is configured. This avoids needing tracing initialization to depend on config having been parsed first.
How to test
Configure audit.destination: stdout, start the service, and assert stdout contains only well-formed audit JSON Lines while tracing output appears on stderr.
- Lingua principale
- Rust
- Stelle
- 2
- Fork
- 0
- Merge medio
- 5h 13m
- PR unite (30g)
- 176
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di registrystack/registry-stack
-
docs(breg): configure/breg.mdx lists stages for a request_lifecycle when, which bregctl refusesApertaagent-ready area:breg area:docs criticality:p3 documentation triage:needs-implementation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
registrystack/registry-stack#1574 ·
I maintainer di solito rispondono entro 1 giorno
-
area:docs area:release criticality:p2 documentation triage:needs-implementation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
registrystack/registry-stack#1474 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-ready area:evidence bug criticality:p3 triage:needs-implementation
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
registrystack/registry-stack#1449 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-ready area:breg bug criticality:p3 triage:needs-implementation
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
registrystack/registry-stack#1405 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-ready bug criticality:p2 github_actions triage:needs-implementation
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
registrystack/registry-stack#1393 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di registrystack/registry-stack
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
bytecodealliance/wasmtime#14433 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno