Skip to content

[bridge] Update last observed action sequence metrics #27550

Description

@grandpig

Description

The bridge_last_observed_actions_seq_num metric is currently not updated when
the bridge watchers observe a BridgeAction.

In crates/sui-bridge/src/orchestrator.rs, both the Sui gRPC watcher and the
Ethereum watcher call with_label_values(...):

metrics
    .last_observed_actions_seq_num
    .with_label_values(&[
        action.chain_id().to_string().as_str(),
        action.action_type().to_string().as_str(),
    ]);

However, the returned gauge is never updated with action.seq_number().

The metric is an IntGaugeVec whose description is:

The latest observed action sequence number per chain_id and action_type

with_label_values() only gets or creates the labeled gauge. It does not change its value, so newly created series remain at the default value of zero.

Impact

This can make monitoring dashboards incorrectly suggest that:

  • no action has been observed for a chain/action type;
  • the corresponding action sequence has not progressed; or
  • the bridge watcher or syncer is stalled.

Expected behavior

Whenever either watcher observes a BridgeAction, the corresponding gauge should be set to action.seq_number().

Proposed fix

Update both watcher paths to call:

metrics
    .last_observed_actions_seq_num
    .with_label_values(&[&chain_id, &action_type])
    .set(action.seq_number() as i64);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions