Skip to content

Commit fbee4ed

Browse files
authored
Use signBlockPayload metric properly (#209)
1 parent 4a04d5b commit fbee4ed

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

op-signer/app.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ func (s *SignerApp) initPprof(cfg *Config) error {
9494
func (s *SignerApp) initMetrics(cfg *Config) error {
9595
registry := opmetrics.NewRegistry()
9696
registry.MustRegister(service.MetricSignTransactionTotal)
97+
registry.MustRegister(service.MetricSignBlockPayloadTotal)
9798
s.registry = registry // some things require metrics registry
9899

99100
if !cfg.MetricsConfig.Enabled {

op-signer/service/metrics.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,11 @@ var (
99
Help: ""},
1010
[]string{"client", "status", "error"},
1111
)
12+
13+
MetricSignBlockPayloadTotal = prometheus.NewCounterVec(
14+
prometheus.CounterOpts{
15+
Name: "signer_signblockpayload_total",
16+
Help: ""},
17+
[]string{"client", "status", "error"},
18+
)
1219
)

op-signer/service/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func (s *OpsignerService) signBlockPayload(
194194

195195
labels := prometheus.Labels{"client": clientInfo.ClientName, "status": "error", "error": ""}
196196
defer func() {
197-
MetricSignTransactionTotal.With(labels).Inc()
197+
MetricSignBlockPayloadTotal.With(labels).Inc()
198198
}()
199199

200200
msg, err := getMsg()

0 commit comments

Comments
 (0)