collect metrics on relay success and latency#67
Conversation
…ps and gas block limits
Remove the aggregate Err field from SentTx in both cosmos and ethereum chains. Rename SourceErr to BroadcastErr and RelayerErr to PostBroadcastErr to align with the txMode abstraction. Add Failed() and Error() methods that derive overall status from the specific error fields and TxResponse.
…elay config - add MsgIFTTransfer as a case in both ethereum and cosmos TxFactory BuildTxs/CreateMsg, with baseline support for high-throughput runs - replace implicit HandlePostBroadcast with explicit RelayConfig that specifies a relayer URL and which message types should be relayed - remove txMode interface and mode.go from both chains - move relayer config from ift.relayer to top-level relay in spec - use SuggestGasTipCap instead of hardcoded 2 gwei default for EVM gas fee estimation - fix EVM IFT timeout to use Unix seconds instead of nanoseconds
Greptile SummaryThis PR instruments the relayer gRPC client with three Prometheus metrics: a success counter, a failure counter (both labeled by
Confidence Score: 4/5Safe to merge after fixing the unconditional metric registration in the Ethereum runner. One P1 finding: the Ethereum runner bypasses the MetricsEnabled guard and unconditionally registers relay metrics, inconsistent with the Cosmos runner and liable to panic if two relay-enabled Ethereum runners are created in the same process. chains/ethereum/runner/runner.go — unconditional iftrelayer.NewMetrics() call needs MetricsEnabled guard Important Files Changed
|
| Buckets: []float64{0.01, 0.05, 0.1, 0.25, 0.5, 1, 2, 5, 10}, | ||
| }, []string{"chain_id"}), | ||
| } | ||
| prometheus.MustRegister(m.Success, m.Failure, m.Duration) |
There was a problem hiding this comment.
MustRegister panics on duplicate registration
prometheus.MustRegister panics if the same metric name is registered twice in the default global registry. If NewMetrics() is called more than once in the same process — for example, in integration tests that instantiate a runner for each test case — the second call will panic. Consider using prometheus.Register with an already-registered check, or accepting a prometheus.Registerer as a parameter so callers can use isolated registries for tests.
4e14063 to
3f2c7c9
Compare
# Conflicts: # chains/cosmos/runner/runner.go # chains/ethereum/ift/contract.go # chains/ethereum/runner/runner.go # ift/relayer/client.go
Instrument relayer client to collect metrics on relay success/failure counts and relay request latency.