Preserve tracing spans across spawns, instrument components, record missing metrics

Abierto
#631 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
rust

Línea de trabajo

Comienza con crates/core/src/scheduler.rs, wire.rs, los bucles de actores y layers/metrics.rs para mapear el comportamiento de spawn y span; después inspecciona crates/p2p/src/metrics.rs, crates/app/node/behaviour.rs y las comprobaciones de salud de la app. Se considera terminado cuando los spawns de producción preservan el contexto, las familias de métricas indicadas están conectadas o se han eliminado explícitamente, y las pruebas de resolución de topics cubren los fallbacks mencionados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement rust

Summary

Spans. The workspace has 60 production tokio::spawn/spawn_blocking sites and exactly 2 .instrument(...) calls (zero Span::current()/in_current_span). Every uninstrumented spawn drops the span context — which is also the mechanism behind #588's topic="" problem, since log-topic labels are span fields: spans and topics are the same fix. #[tracing::instrument] appears 33 times, 22 of them in one file (validatorapi/component.rs); scheduler, fetcher, bcast, tracker, dutydb, parsigdb, aggsigdb, consensus/qbft, dkg, parsigex, and priority have none. Highest-value uninstrumented spawns: the scheduler's per-slot detached duty callbacks (scheduler.rs#L173-L184), the actor loops (tracker, aggsigdb, prioritiser), and the duty-workflow wiring in wire.rs.

Defined-but-never-recorded metrics (grep-verified, zero recording sites):

  • app_eth2_using_fallback — missing entirely, yet the health check that queries it already exists and can never fire. Lands with the eth2api multi-client(#611).
  • p2p_peer_network_{sent,receive}_bytes_total — the BandwidthFactory mechanism exists but only the relay server wires it; Node::new (client path) has no bandwidth parameter (behaviour.rs#L98).
  • p2p_peer_streams, p2p_relay_connections — declared in p2p/src/metrics.rs, recorded nowhere (Charon populates both in p2p.go).
  • core_validatorapi_proxy_request_latency_seconds — the RAII recorder exists, no construction site.

Otherwise name-for-name parity with Charon's metric families is good; app_eth2_* request/error/latency coverage is opt-in per call site (~11 of 76 endpoints) and moves into the client wrapper.

Proposed change

  1. Add a spawn helper attaching Span::current() (the #588 suggestion) and adopt it at the production spawn sites; set one root span per long-running component.
  2. Add #[tracing::instrument] to the duty-pipeline entry points (fetch/propose/participate/broadcast/store paths), with skips to keep fields bounded.
  3. Wire the four dead metric families above (or delete any that are deliberately out of scope, with a note).
  4. While in layers/metrics.rs, cover the topic-resolution layer with tests: the TopicVisitor::record_debug fallback and nearest-enclosing-span resolution are untested (only same-span level filtering is).
Lenguaje dominante
Rust
Estrellas
8
Forks
5
Merge medio
3 d 1 h
PR fusionados (30 d)
2

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NethermindEth/pluto

Todos los issues de NethermindEth/pluto

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.