From b62d3906a650d8b58ad1d45b068638823ce05121 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 6 Jan 2025 09:20:38 +0800 Subject: [PATCH] chore(taiko-client): add more metrics for `TxBuilderWithFallback` (#18711) --- packages/taiko-client/internal/metrics/metrics.go | 2 ++ packages/taiko-client/proposer/transaction_builder/fallback.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/taiko-client/internal/metrics/metrics.go b/packages/taiko-client/internal/metrics/metrics.go index 0b2fdced5ad..99e13a18480 100644 --- a/packages/taiko-client/internal/metrics/metrics.go +++ b/packages/taiko-client/internal/metrics/metrics.go @@ -32,6 +32,8 @@ var ( ProposerPoolContentFetchTime = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_pool_content_fetch_time"}) ProposerEstimatedCostCalldata = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_estimated_cost_calldata"}) ProposerEstimatedCostBlob = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_estimated_cost_blob"}) + ProposerProposeByCalldata = factory.NewCounter(prometheus.CounterOpts{Name: "proposer_propose_by_calldata"}) + ProposerProposeByBlob = factory.NewCounter(prometheus.CounterOpts{Name: "proposer_propose_by_blob"}) // Prover ProverLatestVerifiedIDGauge = factory.NewGauge(prometheus.GaugeOpts{Name: "prover_latestVerified_id"}) diff --git a/packages/taiko-client/proposer/transaction_builder/fallback.go b/packages/taiko-client/proposer/transaction_builder/fallback.go index e8b98fc71e7..903966672fe 100644 --- a/packages/taiko-client/proposer/transaction_builder/fallback.go +++ b/packages/taiko-client/proposer/transaction_builder/fallback.go @@ -131,10 +131,12 @@ func (b *TxBuilderWithFallback) BuildOntake( if costCalldata.Cmp(costBlob) < 0 { log.Info("Building a type-2 transaction", "costCalldata", costCalldata, "costBlob", costBlob) + metrics.ProposerProposeByCalldata.Inc() return txWithCalldata, nil } log.Info("Building a type-3 transaction", "costCalldata", costCalldata, "costBlob", costBlob) + metrics.ProposerProposeByBlob.Inc() return txWithBlob, nil }