From 763f48b754cd5d38a98d9a321c1343fe511983f0 Mon Sep 17 00:00:00 2001 From: Joonas Lehtimaki Date: Fri, 12 Jan 2024 10:57:44 +0200 Subject: [PATCH 1/3] feat: add chainName for clientExpiry --- pkg/collector/ibc_collector.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/collector/ibc_collector.go b/pkg/collector/ibc_collector.go index efabaa4..c665655 100644 --- a/pkg/collector/ibc_collector.go +++ b/pkg/collector/ibc_collector.go @@ -24,8 +24,10 @@ var ( "Returns light client expiry in unixtime.", []string{ "host_chain_id", - "client_id", "target_chain_id", + "src_chain_name", + "dst_chain_name", + "client_id", "discord_ids", "status", }, @@ -93,8 +95,10 @@ func (cc IBCCollector) Collect(ch chan<- prometheus.Metric) { float64(ci.ChainAClientExpiration.Unix()), []string{ (*cc.RPCs)[path.Chain1.ChainName].ChainID, - path.Chain1.ClientID, (*cc.RPCs)[path.Chain2.ChainName].ChainID, + path.Chain1.ChainName, + path.Chain2.ChainName, + path.Chain1.ClientID, discordIDs, status, }..., @@ -106,8 +110,10 @@ func (cc IBCCollector) Collect(ch chan<- prometheus.Metric) { float64(ci.ChainBClientExpiration.Unix()), []string{ (*cc.RPCs)[path.Chain2.ChainName].ChainID, - path.Chain2.ClientID, (*cc.RPCs)[path.Chain1.ChainName].ChainID, + path.Chain2.ChainName, + path.Chain1.ChainName, + path.Chain2.ClientID, discordIDs, status, }..., From 97018a4f9dff14879b5c1a62e92c817726ada661 Mon Sep 17 00:00:00 2001 From: Joonas Lehtimaki Date: Fri, 12 Jan 2024 14:17:20 +0200 Subject: [PATCH 2/3] chore: rename clientExpiryMetric labels --- pkg/collector/ibc_collector.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/collector/ibc_collector.go b/pkg/collector/ibc_collector.go index c665655..1c3a3a1 100644 --- a/pkg/collector/ibc_collector.go +++ b/pkg/collector/ibc_collector.go @@ -23,8 +23,8 @@ var ( clientExpiryMetricName, "Returns light client expiry in unixtime.", []string{ - "host_chain_id", - "target_chain_id", + "src_chain_id", + "dst_chain_id", "src_chain_name", "dst_chain_name", "client_id", From 254b9e59042e63c79d92b1bf4ca600943bfa7c00 Mon Sep 17 00:00:00 2001 From: Joonas Lehtimaki Date: Fri, 12 Jan 2024 14:17:39 +0200 Subject: [PATCH 3/3] feat: update README.md with updated labels --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a604b1..5672fea 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # relayer_exporter + Prometheus exporter for ibc clients and wallet balance. Returns metrics about clients expiration date. Returns wallet balance for configured addresses. ## Configuration + Exporter needs config file in yaml format like following ```yaml @@ -41,11 +43,16 @@ without having it defined. For provided accounts it fetches wallet balances using endpoints defined in rpc list. ## Metrics + ``` # HELP cosmos_ibc_client_expiry Returns light client expiry in unixtime. # TYPE cosmos_ibc_client_expiry gauge -cosmos_ibc_client_expiry{client_id="07-tendermint-23",host_chain_id="archway-1",status="success",target_chain_id="agoric-3"} 1.698153269e+09 -cosmos_ibc_client_expiry{client_id="07-tendermint-75",host_chain_id="agoric-3",status="success",target_chain_id="archway-1"} 1.698153256e+09 +cosmos_ibc_client_expiry{client_id="07-tendermint-0",discord_ids="400514913505640451",dst_chain_id="cosmoshub-4",dst_chain_name="cosmoshub",src_chain_id="archway-1",src_chain_name="archway",status="success"} 1.706270594e+09 +cosmos_ibc_client_expiry{client_id="07-tendermint-1152",discord_ids="400514913505640451",dst_chain_id="archway-1",dst_chain_name="archway",src_chain_id="cosmoshub-4",src_chain_name="cosmoshub",status="success"} 1.706270401e+09 +# HELP cosmos_ibc_stuck_packets Returns stuck packets for a channel. +# TYPE cosmos_ibc_stuck_packets gauge +cosmos_ibc_stuck_packets{discord_ids="400514913505640451",dst_chain_id="archway-1",dst_chain_name="archway",dst_channel_id="channel-0",src_chain_id="cosmoshub-4",src_chain_name="cosmoshub",src_channel_id="channel-623",status="success"} 0 +cosmos_ibc_stuck_packets{discord_ids="400514913505640451",dst_chain_id="cosmoshub-4",dst_chain_name="cosmoshub",dst_channel_id="channel-623",src_chain_id="archway-1",src_chain_name="archway",src_channel_id="channel-0",status="success"} 0 # HELP cosmos_wallet_balance Returns wallet balance for an address on a chain # TYPE cosmos_wallet_balance gauge cosmos_wallet_balance{account="archway1l2al7y78500h5akvgt8exwnkpmf2zmk8ky9ht3",chain_id="constantine-3",denom="aconst",status="success"} 4.64e+18