Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libs/tendermint/state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ func (blockExec *BlockExecutor) ApplyBlock(
now := time.Now().UnixNano()
blockExec.metrics.IntervalTime.Set(float64(now-blockExec.metrics.lastBlockTime) / 1e6)
blockExec.metrics.lastBlockTime = now
blockExec.metrics.CommittedHeight.Set(float64(block.Height))
}()

if err := blockExec.ValidateBlock(state, block); err != nil {
Expand Down
8 changes: 8 additions & 0 deletions libs/tendermint/state/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ type Metrics struct {
AbciTime metrics.Gauge
// Time during commiting app state
CommitTime metrics.Gauge

CommittedHeight metrics.Gauge
}

// PrometheusMetrics returns Metrics build using Prometheus client library.
Expand Down Expand Up @@ -64,6 +66,12 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics {
Name: "block_commit_time",
Help: "Time during commiting app state in ms.",
}, labels).With(labelsAndValues...),
CommittedHeight: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "monitor_block_height",
Help: "The block height.",
}, labels).With(labelsAndValues...),
}
}

Expand Down