-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add error count prom metric (#14670)
* add error count prom metric * address review comments * add comment for response writer * update changelog
- Loading branch information
Showing
5 changed files
with
57 additions
and
21 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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package rpc | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
) | ||
|
||
var ( | ||
httpRequestLatency = promauto.NewHistogramVec( | ||
prometheus.HistogramOpts{ | ||
Name: "http_request_latency_seconds", | ||
Help: "Latency of HTTP requests in seconds", | ||
Buckets: []float64{0.001, 0.01, 0.025, 0.1, 0.25, 1, 2.5, 10}, | ||
}, | ||
[]string{"endpoint", "code", "method"}, | ||
) | ||
httpRequestCount = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Name: "http_request_count", | ||
Help: "Number of HTTP requests", | ||
}, | ||
[]string{"endpoint", "code", "method"}, | ||
) | ||
httpErrorCount = promauto.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Name: "http_error_count", | ||
Help: "Total HTTP errors for beacon node requests", | ||
}, | ||
[]string{"endpoint", "code", "method"}, | ||
) | ||
) |
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