-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Metrics in metrics.go | ||
|
||
This file defines two metrics that are used to monitor the performance and behavior of the pricefeeder application. | ||
|
||
## pricefeeder_voting_periods_total | ||
|
||
This is a counter metric that keeps track of the total number of voting periods the pricefeeder has participated in. A voting period is a specific duration during which votes are collected. This metric is incremented each time the pricefeeder participates in a voting period. | ||
|
||
```go | ||
var NumVotingPeriods = promauto.NewCounter(prometheus.CounterOpts{ | ||
Name: "pricefeeder_voting_periods_total", | ||
Help: "The total number of voting periods this pricefeeder has participated in", | ||
}) | ||
``` | ||
|
||
## pricefeeder_price_source_latency_seconds | ||
|
||
This is a histogram metric that measures the latency of querying a price source in seconds. The latency is the amount of time it takes for the pricefeeder to receive a response after it has sent a request to the price source. This metric is useful for monitoring the performance of the price sources and identifying any potential issues or delays. | ||
|
||
```go | ||
var PriceSourceLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{ | ||
Name: "pricefeeder_price_source_latency_seconds", | ||
Help: "The latency of querying a price source in seconds", | ||
Buckets: prometheus.DefBuckets, | ||
}, []string{"source"}) | ||
``` | ||
|
||
The source label is used to differentiate the latencies of different price sources. |