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

Add destination chain to confirmed packet metrics #3302

Merged
merged 5 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Add the destination chain to the labels of the confirmed packet metrics
([#3297](https://github.com/informalsystems/hermes/issues/3297))
8 changes: 7 additions & 1 deletion crates/relayer/src/supervisor/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,13 @@ fn init_telemetry(
telemetry!(init_worker_by_type, WorkerType::Packet);

if config.mode.packets.tx_confirmation {
telemetry!(init_per_channel, chain_id, channel_id, port_id);
telemetry!(
init_per_channel,
chain_id,
counterparty_chain_id,
channel_id,
port_id
);
}
}

Expand Down
3 changes: 3 additions & 0 deletions crates/relayer/src/worker/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ fn receive_packet_metrics(path: &Packet, summary: &RelaySummary) {
telemetry!(
receive_packets_confirmed,
&path.src_chain_id,
&path.dst_chain_id,
&path.src_channel_id,
&path.src_port_id,
count as u64,
Expand All @@ -439,6 +440,7 @@ fn acknowledgment_metrics(path: &Packet, summary: &RelaySummary) {
telemetry!(
acknowledgment_packets_confirmed,
&path.src_chain_id,
&path.dst_chain_id,
&path.src_channel_id,
&path.src_port_id,
count as u64,
Expand All @@ -457,6 +459,7 @@ fn timeout_metrics(path: &Packet, summary: &RelaySummary) {
telemetry!(
timeout_packets_confirmed,
&path.src_chain_id,
&path.dst_chain_id,
&path.src_channel_id,
&path.src_port_id,
count as u64,
Expand Down
8 changes: 8 additions & 0 deletions crates/telemetry/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,15 @@ impl TelemetryState {
pub fn init_per_channel(
&self,
src_chain: &ChainId,
dst_chain: &ChainId,
src_channel: &ChannelId,
src_port: &PortId,
) {
let cx = Context::current();

let labels = &[
KeyValue::new("src_chain", src_chain.to_string()),
KeyValue::new("dst_chain", dst_chain.to_string()),
KeyValue::new("src_channel", src_channel.to_string()),
KeyValue::new("src_port", src_port.to_string()),
];
Expand Down Expand Up @@ -359,6 +361,7 @@ impl TelemetryState {
pub fn receive_packets_confirmed(
&self,
src_chain: &ChainId,
dst_chain: &ChainId,
src_channel: &ChannelId,
src_port: &PortId,
count: u64,
Expand All @@ -368,6 +371,7 @@ impl TelemetryState {
if count > 0 {
let labels = &[
KeyValue::new("src_chain", src_chain.to_string()),
KeyValue::new("dst_chain", dst_chain.to_string()),
KeyValue::new("src_channel", src_channel.to_string()),
KeyValue::new("src_port", src_port.to_string()),
];
Expand All @@ -380,6 +384,7 @@ impl TelemetryState {
pub fn acknowledgment_packets_confirmed(
&self,
src_chain: &ChainId,
dst_chain: &ChainId,
src_channel: &ChannelId,
src_port: &PortId,
count: u64,
Expand All @@ -389,6 +394,7 @@ impl TelemetryState {
if count > 0 {
let labels = &[
KeyValue::new("src_chain", src_chain.to_string()),
KeyValue::new("dst_chain", dst_chain.to_string()),
KeyValue::new("src_channel", src_channel.to_string()),
KeyValue::new("src_port", src_port.to_string()),
];
Expand All @@ -402,6 +408,7 @@ impl TelemetryState {
pub fn timeout_packets_confirmed(
&self,
src_chain: &ChainId,
dst_chain: &ChainId,
src_channel: &ChannelId,
src_port: &PortId,
count: u64,
Expand All @@ -411,6 +418,7 @@ impl TelemetryState {
if count > 0 {
let labels = &[
KeyValue::new("src_chain", src_chain.to_string()),
KeyValue::new("dst_chain", dst_chain.to_string()),
KeyValue::new("src_channel", src_channel.to_string()),
KeyValue::new("src_port", src_port.to_string()),
];
Expand Down
8 changes: 4 additions & 4 deletions guide/src/documentation/telemetry/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ acknowledgement_events{chain="ibc-0",channel="channel-0",counterparty="ibc-1",po
acknowledgement_events{chain="ibc-1",channel="channel-0",counterparty="ibc-0",port="transfer"} 2
# HELP acknowledgment_packets_confirmed Number of confirmed acknowledgment packets. Available if relayer runs with Tx confirmation enabled
# TYPE acknowledgment_packets_confirmed counter
acknowledgment_packets_confirmed{src_chain="ibc-0",src_channel="channel-0",src_port="transfer"} 2
acknowledgment_packets_confirmed{src_chain="ibc-1",src_channel="channel-0",src_port="transfer"} 2
acknowledgment_packets_confirmed{dst_chain="ibc-1", src_chain="ibc-0",src_channel="channel-0",src_port="transfer"} 2
acknowledgment_packets_confirmed{dst_chain="ibc-0", src_chain="ibc-1",src_channel="channel-0",src_port="transfer"} 2
# HELP backlog_oldest_sequence Sequence number of the oldest SendPacket event in the backlog
# TYPE backlog_oldest_sequence gauge
backlog_oldest_sequence{chain="ibc-0",channel="channel-0",counterparty="ibc-1",port="transfer"} 0
Expand Down Expand Up @@ -82,8 +82,8 @@ queries_cache_hits{chain="ibc-1",query_type="query_connection"} 17
queries_cache_hits{chain="ibc-1",query_type="query_latest_height"} 64
# HELP receive_packets_confirmed Number of confirmed receive packets. Available if relayer runs with Tx confirmation enabled
# TYPE receive_packets_confirmed counter
receive_packets_confirmed{src_chain="ibc-0",src_channel="channel-0",src_port="transfer"} 2
receive_packets_confirmed{src_chain="ibc-1",src_channel="channel-0",src_port="transfer"} 2
receive_packets_confirmed{dst_chain="ibc-1", src_chain="ibc-0",src_channel="channel-0",src_port="transfer"} 2
receive_packets_confirmed{dst_chain="ibc-0", src_chain="ibc-1",src_channel="channel-0",src_port="transfer"} 2
# HELP send_packet_events Number of SendPacket events received
# TYPE send_packet_events counter
send_packet_events{chain="ibc-0",channel="channel-0",counterparty="ibc-1",port="transfer"} 2
Expand Down