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

Metric oldest_timestamp gets updated without oldest_sequence as more packets are pending #2469

Closed
5 tasks
Tracked by #2457
AlianBenabdallah opened this issue Jul 26, 2022 · 0 comments · Fixed by #2457
Closed
5 tasks
Tracked by #2457
Labels
A: bug Admin: something isn't working I: telemetry Internal: related to Telemetry & metrics

Comments

@AlianBenabdallah
Copy link
Contributor

Summary of Bug

When a packet is pending, oldest_timestamp and oldest_sequence should both be fixed. However, when a new packet arrives, oldest_timestamp takes temporarily the value of the youngest pending packet.

Version

hermes 1.0.0-rc.0+6c23af53

Steps to Reproduce

You should run this on branch ali/fix_oldest_sequence (or master after merge) because the process used to generate pending packets has a high probability of failure and, if it fails, will generate a timeout. This branch handles correctly the oldest_* metrics when a timeout occurs. If you are not using this branch, a timeout will freeze the metrics.

  • Set up 2 chains and create channels between them
  • Run hermes start
  • Create a pending packet : hermes tx ft-transfer --dst-chain ibc-0 --src-chain ibc-1 --src-port transfer --src-channel channel-0 --amount 1000 --timeout-seconds 10 should work most of the times.
  • Wait 30s.
  • Ensure that a packet is indeed pending with hermes query packet pending --chain ibc-1 --port transfer --channel channel-0

You should see an output similar to this :

Success: Summary {
    src: PendingPackets {
        unreceived_packets: [
            Sequence(
                21,
            ),
        ],
        unreceived_acks: [],
    },
    dst: PendingPackets {
        unreceived_packets: [],
        unreceived_acks: [],
    },
}
  • Ensure that the oldest_* are frozen at a non zero value. If it's not the case then no packet is pending or the code is not running on the correct branch.
    You should see non zero metrics for these two fields :
# HELP oldest_sequence Sequence number of the oldest pending SendPacket event.
# TYPE oldest_sequence gauge
oldest_sequence{chain="ibc-1",channel="channel-0",counterparty="ibc-0",port="transfer"} 21
# HELP oldest_timestamp Local timestamp of the oldest pending SendPacket event
# TYPE oldest_timestamp gauge
oldest_timestamp{chain="ibc-1",channel="channel-0",counterparty="ibc-0",port="transfer"} **1658850385**
  • Now send more packets with hermes tx ft-transfer --dst-chain ibc-0 --src-chain ibc-1 --src-port transfer --src-channel channel-0 --amount 1000 --timeout-seconds 1000.
  • You should see these packets pending with hermes query packet pending --chain ibc-1 --port transfer --channel channel-0.
  • You should see the metrics being updated. In my case :
# HELP oldest_sequence Sequence number of the oldest pending SendPacket event.
# TYPE oldest_sequence gauge
oldest_sequence{chain="ibc-1",channel="channel-0",counterparty="ibc-0",port="transfer"} 21
# HELP oldest_timestamp Local timestamp of the oldest pending SendPacket event
# TYPE oldest_timestamp gauge
oldest_timestamp{chain="ibc-1",channel="channel-0",counterparty="ibc-0",port="transfer"} **1658850476**
  • Notice that oldest_timestamp was updated.
  • If you wait 30 more seconds and refresh, the old value should be back.

Acceptance Criteria

oldest_timestamp is correctly updated.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@AlianBenabdallah AlianBenabdallah changed the title Metric oldest_timestamp gets updated without oldest_sequence Metric oldest_timestamp gets updated without oldest_sequence as more packets are pending Jul 26, 2022
@AlianBenabdallah AlianBenabdallah added A: bug Admin: something isn't working A: admin Admin: general administrative & planning issue I: telemetry Internal: related to Telemetry & metrics and removed A: admin Admin: general administrative & planning issue labels Jul 26, 2022
@adizere adizere linked a pull request Jul 28, 2022 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Admin: something isn't working I: telemetry Internal: related to Telemetry & metrics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant