diff --git a/pkg/collector/collector.go b/pkg/collector/collector.go index 0a8288b..5454ae9 100644 --- a/pkg/collector/collector.go +++ b/pkg/collector/collector.go @@ -80,6 +80,7 @@ func (cc IBCCollector) Collect(ch chan<- prometheus.Metric) { go func(path *relayer.IBCdata) { defer wg.Done() + // Client info ci, err := ibc.GetClientsInfo(path, cc.RPCs) status := successStatus @@ -103,6 +104,9 @@ func (cc IBCCollector) Collect(ch chan<- prometheus.Metric) { []string{(*cc.RPCs)[path.Chain2.ChainName].ChainID, path.Chain2.ClientID, (*cc.RPCs)[path.Chain1.ChainName].ChainID, status}..., ) + // Stuck packets + status = successStatus + stuckPackets, err := ibc.GetChannelsInfo(path, cc.RPCs) if err != nil { status = errorStatus diff --git a/pkg/ibc/ibc.go b/pkg/ibc/ibc.go index 5369faa..b287c33 100644 --- a/pkg/ibc/ibc.go +++ b/pkg/ibc/ibc.go @@ -135,6 +135,13 @@ func GetChannelsInfo(ibc *relayer.IBCdata, rpcs *map[string]config.RPC) (Channel return ChannelsInfo{}, fmt.Errorf("Error: %w for %v", err, cdB) } + // test that RPC endpoints are working + if _, _, err := relayer.QueryLatestHeights( + ctx, chainA, chainB, + ); err != nil { + return channelInfo, fmt.Errorf("Error: %w for %v", err, cdA) + } + for i, c := range channelInfo.Channels { var order chantypes.Order