Merge pull request #2844 from aledbf/fix-latency
Do not allow invalid latency values in metrics
This commit is contained in:
commit
bdb5ddc473
1 changed files with 7 additions and 5 deletions
|
@ -236,12 +236,14 @@ func (sc *SocketCollector) handleMessage(msg []byte) {
|
||||||
requestsMetric.Inc()
|
requestsMetric.Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if stats.Latency != -1 {
|
||||||
latencyMetric, err := sc.upstreamLatency.GetMetricWith(latencyLabels)
|
latencyMetric, err := sc.upstreamLatency.GetMetricWith(latencyLabels)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Error fetching latency metric: %v", err)
|
glog.Errorf("Error fetching latency metric: %v", err)
|
||||||
} else {
|
} else {
|
||||||
latencyMetric.Observe(stats.Latency)
|
latencyMetric.Observe(stats.Latency)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if stats.RequestTime != -1 {
|
if stats.RequestTime != -1 {
|
||||||
requestTimeMetric, err := sc.requestTime.GetMetricWith(requestLabels)
|
requestTimeMetric, err := sc.requestTime.GetMetricWith(requestLabels)
|
||||||
|
|
Loading…
Reference in a new issue