Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telemetry: introduce backlog_* metrics, plus minor fixes #2451

Closed
Tracked by #2457
adizere opened this issue Jul 21, 2022 · 3 comments · Fixed by #2457
Closed
Tracked by #2457

Telemetry: introduce backlog_* metrics, plus minor fixes #2451

adizere opened this issue Jul 21, 2022 · 3 comments · Fixed by #2457
Milestone

Comments

@adizere
Copy link
Member

adizere commented Jul 21, 2022

This is a follow-up to the work for #2408 and PR #2409.

Suggestions

We discussed yesterday with operators and here are some takeaways, also based on my observations so far:

  1. Even after a channel is cleared, oldest_* metrics can remain to the same value (i.e., not reset to 0).

  2. I think we should clarify what the oldest_timestamp is, it seems this field is a local timestamp to the Hermes process, not an on-chain packet timestamp (when the packet was created), which is not clear from the telemetry help message, specifically:

    # HELP oldest_timestamp The timestamp of the oldest sequence number in seconds
    # TYPE oldest_timestamp gauge
    oldest_timestamp{chain="ibc-0",channel="channel-3",counterparty="ibc-1",port="transfer"} 0

  3. Let's rename oldest_* metrics to backlog_* and additionally:

    • make it clear these metrics are per-channel
    • add a backlog_size metric to capture the number of pending packets in a channel.
@AlianBenabdallah
Copy link
Contributor

AlianBenabdallah commented Jul 21, 2022

About 1., if a packet times out then it stays recorded in sequences_histories. Thus, the condition where the oldest_* fields are cleared can never be reached because set is never empty.
https://github.com/informalsystems/ibc-rs/blob/7e422494746273001ea223a75ebcb3a1c14eb9af/telemetry/src/state.rs#L488

You can provoke a timeout with two chains running and this command :

hermes tx ft-transfer --dst-chain ibc-1 --src-chain ibc-0 --src-port transfer --src-channel channel-0 --amount 1000 --timeout-seconds 1

@AlianBenabdallah
Copy link
Contributor

AlianBenabdallah commented Jul 22, 2022

After more investigations, I think that sequences_histories is correctly handled only when a packet is successfully transferred and an ack is received.

Any other case will lead to inconsistencies in the metrics.

For example, if an error occurs and the packet is not relayed (account sequence mismatch) or the ack is never relayed or if a packet times out, the value is never removed from sequence_histories.

@adizere adizere modified the milestones: v1.1, v1.0.0 Jul 25, 2022
@adizere adizere linked a pull request Jul 27, 2022 that will close this issue
11 tasks
@adizere adizere changed the title Follow-up to metrics improvements Telemetry: introduce backlog_* metrics, plus minor fixes Jul 29, 2022
@adizere
Copy link
Member Author

adizere commented Jul 29, 2022

Closed with #2457.

Follow-up in: #2479

@adizere adizere closed this as completed Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@adizere @AlianBenabdallah and others