runner(metrics): instance-label qualification matches by substring, so a label like upstream_instance suppresses node attribution

Open Beginner friendly
#265 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
observability

Research direction

Start at crates/moonpool-sim/src/runner/app_metrics.rs:192 in qualify_series_key and inspect how INSTANCE_LABEL is used. Review MetricSeries::parse in crates/moonpool-core/src/metrics/query.rs:134 for the stated out-of-scope limitation. Done means an upstream_instance label no longer suppresses node attribution, while distinct nodes reporting the same upstream retain separate keys and histories.

Written by the indexing model from the issue text.

Description

bug simulation

Found during the pre-release source audit of 8d9e779 (read-only, nothing compiled or run). Severity: low. Status: confirmed.

Where

crates/moonpool-sim/src/runner/app_metrics.rs:192 (qualify_series_key)

What

The check is inner.contains("instance="), a substring test over the whole label group. Any application label whose name ends in instance (for example upstream_instance="10.0.1.3") short-circuits the splice, so the node's IP is never added and two nodes reporting the same upstream collapse onto one key, overwriting each other's history.

Proposed fix

Split the label group on , and compare the key side exactly against INSTANCE_LABEL. The comma/quote round-trip limitation in MetricSeries::parse (crates/moonpool-core/src/metrics/query.rs:134) is already documented as out of scope and is not part of this issue.

Dominant language
Rust
Stars
49
Forks
3
Avg merge
1h 4m
Merged PRs (30d)
41

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PierreZ/moonpool

All issues in PierreZ/moonpool

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.