Global `EnvFilter` prevents topic spans from being constructed at the default log level
メンテナーはふだん 4 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust
調査の方向性
Start in crates/tracing/src/init.rs, especially the subscriber construction around lines 90-93 and default_env_filter, then inspect crates/tracing/src/layers/metrics.rs and the existing tracing tests. Run the real pluto_tracing::init stack at the default info level and verify that topic labels are retained while console and Loki verbosity still follow --log-level. Add a regression test covering warn/error metrics and their topic labels.
索引モデルが issue の本文から書いたものです。
説明
Summary
EnvFilter is attached as a global layer on the subscriber stack, so it gates Subscriber::enabled for every layer — including MetricsLayer: init.rs#L90-L93.
Every topic span in the workspace is DEBUG-level, and the default --log-level is info (common.rs#L103, default_env_filter). At info the span is never constructed, MetricsLayer::on_new_span never fires, no SpanTopic extension is stored, and event_topic walks an empty scope.
Result: 100% of warn/error events are counted under topic="" at the default configuration. The topic mechanism only works under RUST_LOG=debug.
Evidence
Probed against the real MetricsLayer, both directions:
| subscriber stack | console filter | debug_span! constructed |
app_log_warn_total label |
|---|---|---|---|
EnvFilter global (current) |
info |
no (is_disabled=true) |
topic="" |
EnvFilter global (current) |
debug |
yes | topic="<name>" |
EnvFilter on fmt only + MetricsLayer.with_filter(LevelFilter::DEBUG) |
info |
yes | topic="<name>" |
The third row is the proposed fix: the console still emits at info (the WARN printed normally), while the metric keeps its label.
Scope
This predates the topic work and is not caused by it. It already affects the two topics on main — health and stacksnipe — and will silently neutralise all 17 topics once #588 / #669 lands.
Why it matters
app_log_{warn,error}_total{topic}is the only per-component signal for warn/error rate. With one label value it answers no question that the unlabelled counter does not already answer — which is exactly what #588 set out to fix.- Generated alert rules are silently degraded.
define.rs#L375buildsincrease(app_log_warn_total{topic!~"vmock|tracker"}[30s]) > 2. Against a pluto node every series carriestopic="", which matches!~"vmock|tracker"— so the exclusion never excludes anything and the rule is strictly more trigger-happy than intended. This directly undercuts the re-validation planned in #583. - Grafana panels collapse.
dash_charon_overview.json#L1701-L1714aggregatesby (topic); pluto contributes a single empty series next to charon's ~20. - It blocks #47 (
app/tracer). The same global filter drops debug-level spans before they can reach an OTLP exporter, so an OTel integration inherits the problem rather than working around it.
Charon contrast
The counter is level-independent by construction: incWarnCounter(ctx) is the first statement of log.Warn, before the logger is consulted — log.go#L107-L108, same for log.Error. Charon's topic rides on context.Context, so console verbosity and metric labelling are independent concerns. Pluto couples them through the span, which is what makes the filter placement load-bearing.
Proposed fix
Move EnvFilter off the subscriber and onto the layers that should honour the operator's verbosity — fmt and Loki — and give MetricsLayer its own LevelFilter::DEBUG filter so topic spans are always materialised:
let registry = Registry::default()
.with(fmt_layer.with_filter(env_filter))
.with(MetricsLayer.with_filter(LevelFilter::DEBUG));
Loki needs the same treatment (it currently sits behind the global filter too), and EnvFilter is not Clone, so the filter has to be built per layer from the same directive string.
The alternative — promoting every topic span to info — is a smaller diff but makes span names visible in default console output and leaves the counter level-dependent, which is the coupling charon does not have.
Acceptance
-
app_log_{warn,error}_totalcarries itstopiclabel with the subscriber built bypluto_tracing::initat the defaultinfolevel. - A regression test in
crates/tracingpins this against the real layer stack, not a hand-built one. -
--log-levelstill controls console and Loki verbosity exactly as before.
Context
Diagnosed while reviewing #669; see this comment for the original analysis. Related: #588 (topic labels), #631 (span propagation), #583 (alert-rule re-validation), #47 (app/tracer).
- 主要言語
- Rust
- スター
- 8
- フォーク
- 6
- 平均マージ
- 4日 3時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NethermindEth/pluto のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
NethermindEth/pluto#719 ·
メンテナーはふだん 4 日以内に返信
-
enhancement rust
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
NethermindEth/pluto#640 ·
メンテナーはふだん 4 日以内に返信
-
rust
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
NethermindEth/pluto#638 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
enhancement rust
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
NethermindEth/pluto#635 ·
メンテナーはふだん 4 日以内に返信
-
Improve `alpha test peers`: match Charon's probes; reduce timeouts対応中かも @varex83agent が 4 日前に担当しました。 オープンbug track:orchestration-cli
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
NethermindEth/pluto#632 ·
メンテナーはふだん 4 日以内に返信
NethermindEth/pluto の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
zcashlabs/thus-spoke-zakura#153 ·
メンテナーはふだん 1 日以内に返信
-
app bug windows-os
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
editor good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
funnyboy-roks/inq#54 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Bedrock request metadata forwarding does not work for /embeddings対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug llm translation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信