forked from cometbft/cometbft
/
metrics.gen.go
109 lines (104 loc) · 5.11 KB
/
metrics.gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// Code generated by metricsgen. DO NOT EDIT.
package state
import (
"github.com/go-kit/kit/metrics/discard"
prometheus "github.com/go-kit/kit/metrics/prometheus"
stdprometheus "github.com/prometheus/client_golang/prometheus"
)
func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics {
labels := []string{}
for i := 0; i < len(labelsAndValues); i += 2 {
labels = append(labels, labelsAndValues[i])
}
return &Metrics{
BlockProcessingTime: prometheus.NewHistogramFrom(stdprometheus.HistogramOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "block_processing_time",
Help: "Time spent processing FinalizeBlock",
Buckets: stdprometheus.LinearBuckets(1, 10, 10),
}, labels).With(labelsAndValues...),
ConsensusParamUpdates: prometheus.NewCounterFrom(stdprometheus.CounterOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "consensus_param_updates",
Help: "Number of consensus parameter updates returned by the application since process start.",
}, labels).With(labelsAndValues...),
ValidatorSetUpdates: prometheus.NewCounterFrom(stdprometheus.CounterOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "validator_set_updates",
Help: "Number of validator set updates returned by the application since process start.",
}, labels).With(labelsAndValues...),
PruningServiceBlockRetainHeight: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "pruning_service_block_retain_height",
Help: "PruningServiceBlockRetainHeight is the accepted block retain height set by the data companion",
}, labels).With(labelsAndValues...),
PruningServiceBlockResultsRetainHeight: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "pruning_service_block_results_retain_height",
Help: "PruningServiceBlockResultsRetainHeight is the accepted block results retain height set by the data companion",
}, labels).With(labelsAndValues...),
PruningServiceTxIndexerRetainHeight: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "pruning_service_tx_indexer_retain_height",
Help: "PruningServiceTxIndexerRetainHeight is the accepted transactions indices retain height set by the data companion",
}, labels).With(labelsAndValues...),
PruningServiceBlockIndexerRetainHeight: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "pruning_service_block_indexer_retain_height",
Help: "PruningServiceBlockIndexerRetainHeight is the accepted blocks indices retain height set by the data companion",
}, labels).With(labelsAndValues...),
ApplicationBlockRetainHeight: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "application_block_retain_height",
Help: "ApplicationBlockRetainHeight is the accepted block retain height set by the application",
}, labels).With(labelsAndValues...),
BlockStoreBaseHeight: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "block_store_base_height",
Help: "BlockStoreBaseHeight shows the first height at which a block is available",
}, labels).With(labelsAndValues...),
ABCIResultsBaseHeight: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "abciresults_base_height",
Help: "ABCIResultsBaseHeight shows the first height at which abci results are available",
}, labels).With(labelsAndValues...),
TxIndexerBaseHeight: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "tx_indexer_base_height",
Help: "TxIndexerBaseHeight shows the first height at which tx indices are available",
}, labels).With(labelsAndValues...),
BlockIndexerBaseHeight: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "block_indexer_base_height",
Help: "BlockIndexerBaseHeight shows the first height at which block indices are available",
}, labels).With(labelsAndValues...),
}
}
func NopMetrics() *Metrics {
return &Metrics{
BlockProcessingTime: discard.NewHistogram(),
ConsensusParamUpdates: discard.NewCounter(),
ValidatorSetUpdates: discard.NewCounter(),
PruningServiceBlockRetainHeight: discard.NewGauge(),
PruningServiceBlockResultsRetainHeight: discard.NewGauge(),
PruningServiceTxIndexerRetainHeight: discard.NewGauge(),
PruningServiceBlockIndexerRetainHeight: discard.NewGauge(),
ApplicationBlockRetainHeight: discard.NewGauge(),
BlockStoreBaseHeight: discard.NewGauge(),
ABCIResultsBaseHeight: discard.NewGauge(),
TxIndexerBaseHeight: discard.NewGauge(),
BlockIndexerBaseHeight: discard.NewGauge(),
}
}