-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description same as #1158 but targeted at main
- Loading branch information
1 parent
e8f6401
commit 570aa7e
Showing
5 changed files
with
64 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,17 @@ const ( | |
// MetricsSubsystem is a subsystem shared by all metrics exposed by this | ||
// package. | ||
MetricsSubsystem = "mempool" | ||
|
||
TypeLabel = "type" | ||
|
||
FailedPrecheck = "precheck" | ||
FailedAdding = "adding" | ||
FailedRecheck = "recheck" | ||
|
||
EvictedNewTxFullMempool = "full-removed-incoming" | ||
EvictedExistingTxFullMempool = "full-removed-existing" | ||
EvictedTxExpiredBlocks = "expired-ttl-blocks" | ||
EvictedTxExpiredTime = "expired-ttl-time" | ||
) | ||
|
||
// Metrics contains metrics exposed by this package. | ||
|
@@ -61,6 +72,7 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics { | |
for i := 0; i < len(labelsAndValues); i += 2 { | ||
labels = append(labels, labelsAndValues[i]) | ||
} | ||
typedCounterLabels := append(append(make([]string, 0, len(labels)+1), labels...), TypeLabel) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
evan-forbes
Author
Member
|
||
return &Metrics{ | ||
Size: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ | ||
Namespace: namespace, | ||
|
@@ -82,14 +94,14 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics { | |
Subsystem: MetricsSubsystem, | ||
Name: "failed_txs", | ||
Help: "Number of failed transactions.", | ||
}, labels).With(labelsAndValues...), | ||
}, typedCounterLabels).With(labelsAndValues...), | ||
|
||
EvictedTxs: prometheus.NewCounterFrom(stdprometheus.CounterOpts{ | ||
Namespace: namespace, | ||
Subsystem: MetricsSubsystem, | ||
Name: "evicted_txs", | ||
Help: "Number of evicted transactions.", | ||
}, labels).With(labelsAndValues...), | ||
}, typedCounterLabels).With(labelsAndValues...), | ||
|
||
SuccessfulTxs: prometheus.NewCounterFrom(stdprometheus.CounterOpts{ | ||
Namespace: namespace, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What is this for? I just saw this cause a panic in prometheus