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()
|
||||
}
|
||||
|
||||
if stats.Latency != -1 {
|
||||
latencyMetric, err := sc.upstreamLatency.GetMetricWith(latencyLabels)
|
||||
if err != nil {
|
||||
glog.Errorf("Error fetching latency metric: %v", err)
|
||||
} else {
|
||||
latencyMetric.Observe(stats.Latency)
|
||||
}
|
||||
}
|
||||
|
||||
if stats.RequestTime != -1 {
|
||||
requestTimeMetric, err := sc.requestTime.GetMetricWith(requestLabels)
|
||||
|
|
Loading…
Reference in a new issue