add postage - #2
Open
bit-aloo wants to merge 1 commit into
Open
Conversation
bit-aloo
force-pushed
the
2026-01-27-add-postage
branch
from
January 27, 2026 05:30
338b1a8 to
562adc6
Compare
bit-aloo
pushed a commit
that referenced
this pull request
Apr 29, 2026
…st assertions
Replaces string-concatenation form ("name{k=\"v\"}") with a structured
Metric<'a> { name, labels } type. Bare-name callers stay unchanged via
From<&str>; labeled callers use Metric::with_labels(name, &[(k, v), ...]).
Benefits over the previous string-prefix matching:
- Label matching is order-independent (current code passed by accident
thanks to the prometheus crate's BTreeMap label ordering)
- Subset matching: query a single label, ignore extras on the line
- Type-safe k/v pairs, no quote escaping at call sites
- Single match path used by parse_metric_value, assert_metric_*,
assert_metric_present/not_present, and poll_until_metric_gte
Leverages the new API in monitoring_integration tests to assert on the
specific (client_id, channel_id, user_identity) tuple each topology
produces, rather than matching the first series for a metric name.
Catches mis-attributed shares that the bare-name form would silently
accept:
- Test #1 (sv2 mining device): adds an explicit user_id to the fixture
so the user_identity label is a meaningful 'test-miner' rather than
empty.
- Test #2 (pool + tProxy + 1 SV1): asserts the SV1 worker name flows
through to the pool's view of tProxy's channel as
'user_identity.miner1'.
- Test #3 (aggregated): asserts JDC's 'IT-test' identity on the pool
side and the SV1 worker name on tProxy's server view.
- Test #4 (block found): unchanged \u2014 sv2_client_blocks_found_total is
a scalar gauge (no labels), so a bare-name selector is correct here.
Addresses stratum-mining#336 and the related review feedback on stratum-mining#338.
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.
No description provided.