Merge pull request #295 from jzelinskie/prom-errs
frontend/*: only record ClientErrors to Prometheus
This commit is contained in:
commit
bb93e478b8
2 changed files with 10 additions and 2 deletions
|
@ -39,7 +39,11 @@ var promResponseDurationMilliseconds = prometheus.NewHistogramVec(
|
||||||
func recordResponseDuration(action string, af *bittorrent.AddressFamily, err error, duration time.Duration) {
|
func recordResponseDuration(action string, af *bittorrent.AddressFamily, err error, duration time.Duration) {
|
||||||
var errString string
|
var errString string
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if _, ok := err.(bittorrent.ClientError); ok {
|
||||||
errString = err.Error()
|
errString = err.Error()
|
||||||
|
} else {
|
||||||
|
errString = "internal error"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var afString string
|
var afString string
|
||||||
|
|
|
@ -42,7 +42,11 @@ var promResponseDurationMilliseconds = prometheus.NewHistogramVec(
|
||||||
func recordResponseDuration(action string, af *bittorrent.AddressFamily, err error, duration time.Duration) {
|
func recordResponseDuration(action string, af *bittorrent.AddressFamily, err error, duration time.Duration) {
|
||||||
var errString string
|
var errString string
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if _, ok := err.(bittorrent.ClientError); ok {
|
||||||
errString = err.Error()
|
errString = err.Error()
|
||||||
|
} else {
|
||||||
|
errString = "internal error"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var afString string
|
var afString string
|
||||||
|
|
Loading…
Reference in a new issue