diff --git a/fly/cmd/prom_gossip/main.go b/fly/cmd/prom_gossip/main.go index 78c3f956..7ce21487 100644 --- a/fly/cmd/prom_gossip/main.go +++ b/fly/cmd/prom_gossip/main.go @@ -272,17 +272,20 @@ func main() { } uniqueObs[hash] = time.Now() case batch := <-batchObsvC: + gossipByType.WithLabelValues("batch_observation").Inc() + addr := "0x" + string(hex.EncodeToString(batch.Msg.Addr)) + name := addr + idx, found := guardianIndexMap[strings.ToLower(addr)] + if found { + name = guardianIndexToNameMap[idx] + } for _, o := range batch.Msg.Observations { - gossipByType.WithLabelValues("observation").Inc() spl := strings.Split(o.MessageId, "/") chain, err := parseChainID(spl[0]) if err != nil { chain = vaa.ChainIDUnset } emitter := strings.ToLower(spl[1]) - addr := "0x" + string(hex.EncodeToString(batch.Msg.Addr)) - idx := guardianIndexMap[strings.ToLower(addr)] - name := guardianIndexToNameMap[idx] observationsByGuardianPerChain.WithLabelValues(name, chain.String()).Inc() if knownEmitters[emitter] { tbObservationsByGuardianPerChain.WithLabelValues(name, chain.String()).Inc()