Conversation
#424) `charon_listener_blocks_received_total` only emits when the listener subcommand runs in `listen` mode. In `replay` mode, the metric is empty so `label_values()` returns nothing, leaving the `$chain` template variable empty. Every panel that filters `chain=~"$chain"` then renders $0 / empty, including the predicted-profit stat panel (line 226) which during today's demo showed $0 even though the underlying metric `charon_executor_profit_usd_cents_sum{chain="bnb"}` correctly reported 3952448 (= $39,524.48). Switch the variable source to `charon_scanner_positions`, a gauge emitted unconditionally on every scanner tick (set in three branches of charon-cli/src/main.rs: empty scan set, fetch_positions failure, and normal path). Replay invokes the same run_block_pipeline that emits these gauges, so `chain="bnb"` is always present on first scrape. Verified against a live replay: profit panel populates at $39,524.48 once `--hold-secs 1800` keeps the exporter alive for Prometheus to scrape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
\$chaintemplate variable fromcharon_scanner_positionsinstead ofcharon_listener_blocks_received_total.listenmode; scanner gauge emits in bothlistenandreplay.Closes #424.
Why this fix
Validated against a live replay against block 91323624 today:
But the Grafana panel showed $0. Root cause was the empty
\$chainvariable makingchain=~""match nothing. Switching the source resolves it. See the linked issue for full diagnosis + reproduction.Test plan
charon_scanner_positionsis a registered gauge withchainlabel, set unconditionally on every scanner tick (crates/charon-cli/src/main.rs:1958, 1998, 2026).\$chainconsumers indeploy/grafana/charon.jsonfilter against metrics that carry the samechain="bnb"label.--hold-secs 1800.grafana-lint.ymlworkflow passes.docker compose -f local-stack.yml up -d+ replay-with-hold → panel populates without manual datasource hacks.Files
deploy/grafana/charon.json— 1 hunk, 3 insertions, 3 deletions.