Compare commits

...

1 Commits

Author SHA1 Message Date
Manu NALEPA
080cd7b125 Add commitment_count_in_gossip_processed_blocks gauge for blob KZG commitments 2026-01-13 21:14:56 +01:00
3 changed files with 28 additions and 0 deletions

View File

@@ -256,6 +256,20 @@ var (
Help: "Count the number of data column sidecars obtained via the execution layer.",
},
)
commitmentCount = promauto.NewGauge(
prometheus.GaugeOpts{
Name: "commitment_count_in_gossip_processed_blocks",
Help: "The number of blob KZG commitments in the most recently processed block.",
},
)
maxBlobsPerBlock = promauto.NewGauge(
prometheus.GaugeOpts{
Name: "max_blobs_per_block",
Help: "The maximum number of blobs allowed in a block.",
},
)
)
func (s *Service) updateMetrics() {

View File

@@ -81,6 +81,18 @@ func (s *Service) beaconBlockSubscriber(ctx context.Context, msg proto.Message)
return errors.Wrap(err, "process pending atts for block")
}
if block.Body() == nil {
log.Errorf("nil block body for root %#x", root)
}
commitments, err := block.Body().BlobKzgCommitments()
if err != nil {
return errors.Wrap(err, "blob Kzg commitments")
}
commitmentCount.Set(float64(len(commitments)))
maxBlobsPerBlock.Set(float64(params.BeaconConfig().MaxBlobsPerBlock(block.Slot())))
return nil
}

View File

@@ -0,0 +1,2 @@
### Added
- `commitment_count_in_gossip_processed_blocks` gauge metric to track the number of blob KZG commitments in processed beacon blocks.