Skip to content

refine poll_until_metric_gte to support label-specific assertions #336

@gimballock

Description

@gimballock

Context

poll_until_metric_gte in integration-tests/lib/prometheus_metrics_assertions.rs currently matches any label combination for a metric name. For example, polling sv2_client_shares_accepted_total returns true if any channel has shares, regardless of which channel_id or user_identity.

Goal

Add a variant (or extend the existing function with an optional label selector) so tests can make precise assertions like:

sv2_client_shares_accepted_total{channel_id="1",user_identity="user1"} >= 1

This would make polling assertions as precise as the static assert_metric_eq helper, which already supports full label selectors via parse_metric_value.

Suggested approach

Add poll_until_labeled_metric_gte(addr, metric_with_labels, min, timeout) that delegates to the existing parse_metric_value for label-aware matching, rather than the current line-scan approach.

Raised in PR #281 by @GitGab19.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo 📝

    Status

    Todo 📝

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions