From dd3c55a6667d548c3339446fe5d7efc5ce889d86 Mon Sep 17 00:00:00 2001 From: Jian Xiao <99709935+jianoaix@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:18:59 -0800 Subject: [PATCH] Fix the blob metrics fetch in data api (#40) --- disperser/dataapi/metrics_handlers.go | 2 +- disperser/dataapi/prometheus_client.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/disperser/dataapi/metrics_handlers.go b/disperser/dataapi/metrics_handlers.go index 41b3c12394..2748caad2b 100644 --- a/disperser/dataapi/metrics_handlers.go +++ b/disperser/dataapi/metrics_handlers.go @@ -79,7 +79,7 @@ func (s *server) calculateTotalStake(operators []*Operator, blockNumber uint32) pool = workerpool.New(maxWorkersGetOperatorState) ) - s.logger.Debug("Number of operators to calculate stake:", len(operators)) + s.logger.Debug("Number of operators to calculate stake:", "numOperators", len(operators), "blockNumber", blockNumber) for _, o := range operators { operatorId, err := ConvertHexadecimalToBytes(o.OperatorId) if err != nil { diff --git a/disperser/dataapi/prometheus_client.go b/disperser/dataapi/prometheus_client.go index 73d8f8b9d5..f0960e7ac1 100644 --- a/disperser/dataapi/prometheus_client.go +++ b/disperser/dataapi/prometheus_client.go @@ -39,7 +39,7 @@ func NewPrometheusClient(api prometheus.Api, cluster string) *prometheusClient { } func (pc *prometheusClient) QueryDisperserBlobSizeBytesPerSecond(ctx context.Context, start time.Time, end time.Time) (*PrometheusResult, error) { - query := fmt.Sprintf("eigenda_batcher_blobs_total{state=\"completed\",data=\"size\",cluster=\"%s\"}", pc.cluster) + query := fmt.Sprintf("eigenda_batcher_blobs_total{state=\"confirmed\",data=\"size\",cluster=\"%s\"}", pc.cluster) numSecondsInTimeRange := end.Sub(start).Seconds() step := uint64(numSecondsInTimeRange / maxNumOfDataPoints) if step < 1 {