Skip to content

Commit

Permalink
feat: have src, dst channel IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
jlehtimaki committed Oct 30, 2023
1 parent 8ce481c commit bb9794c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
19 changes: 13 additions & 6 deletions pkg/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ var (
channelStuckPacketsMetricName,
"Returns stuck packets for a channel.",
[]string{
"channel_id",
"src_channel_id",
"dst_channel_id",
"src_chain_id",
"dst_chain_id",
"status",
Expand All @@ -45,7 +46,8 @@ var (
channelSrcStuckPacketsMetricName,
"Returns source stuck packets for a channel.",
[]string{
"channel_id",
"src_channel_id",
"dst_channel_id",
"src_chain_id",
"dst_chain_id",
"status",
Expand All @@ -56,7 +58,8 @@ var (
channelDstStuckPacketsMetricName,
"Returns destination stuck packets for a channel.",
[]string{
"channel_id",
"src_channel_id",
"dst_channel_id",
"src_chain_id",
"dst_chain_id",
"status",
Expand Down Expand Up @@ -129,6 +132,7 @@ func (cc IBCCollector) Collect(ch chan<- prometheus.Metric) {
if err != nil {
status = errorStatus

fmt.Println("FOOOOBAAAAR")
log.Error(err.Error())
}

Expand All @@ -138,7 +142,8 @@ func (cc IBCCollector) Collect(ch chan<- prometheus.Metric) {
prometheus.GaugeValue,
float64(sp.StuckPackets.Total),
[]string{
sp.Name,
sp.Source,
sp.Destination,
(*cc.RPCs)[path.Chain1.ChainName].ChainID,
(*cc.RPCs)[path.Chain2.ChainName].ChainID,
status,
Expand All @@ -150,7 +155,8 @@ func (cc IBCCollector) Collect(ch chan<- prometheus.Metric) {
prometheus.GaugeValue,
float64(sp.StuckPackets.Source),
[]string{
sp.Name,
sp.Source,
sp.Destination,
(*cc.RPCs)[path.Chain1.ChainName].ChainID,
(*cc.RPCs)[path.Chain2.ChainName].ChainID,
status,
Expand All @@ -162,7 +168,8 @@ func (cc IBCCollector) Collect(ch chan<- prometheus.Metric) {
prometheus.GaugeValue,
float64(sp.StuckPackets.Destination),
[]string{
sp.Name,
sp.Source,
sp.Destination,
(*cc.RPCs)[path.Chain1.ChainName].ChainID,
(*cc.RPCs)[path.Chain2.ChainName].ChainID,
status,
Expand Down
6 changes: 4 additions & 2 deletions pkg/ibc/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ type ChannelsInfo struct {
}

type Channel struct {
Name string
Source string
Destination string
StuckPackets struct {
Source int
Destination int
Expand Down Expand Up @@ -133,7 +134,8 @@ func GetChannelsInfo(ibc *relayer.IBCdata, rpcs *map[string]config.RPC) (Channel

var channel Channel

channel.Name = c.Chain1.ChannelID
channel.Source = c.Chain1.ChannelID
channel.Destination = c.Chain2.ChannelID

switch c.Ordering {
case "none":
Expand Down

0 comments on commit bb9794c

Please sign in to comment.