Skip to content

Commit

Permalink
suppress prom invalid label value problem (#118)
Browse files Browse the repository at this point in the history
* suppress prom invalid label value problem

* Extend the fetch interval to once a week
  • Loading branch information
Yiming Yu authored Feb 24, 2020
1 parent 53c057f commit 3ef42d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/prom/prom.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func ProxyTime(cluster, node string, ts int64) {
if proxyTimer == nil {
return
}
node = ""
proxyTimer.WithLabelValues(cluster, node).Observe(float64(ts))
}

Expand All @@ -91,6 +92,7 @@ func HandleTime(cluster, node, cmd string, ts int64) {
if handlerTimer == nil {
return
}
cmd = ""
handlerTimer.WithLabelValues(cluster, node, cmd).Observe(float64(ts))
}

Expand All @@ -99,6 +101,7 @@ func ErrIncr(cluster, node, cmd, err string) {
if gerr == nil {
return
}
cmd = ""
gerr.WithLabelValues(cluster, node, cmd, err).Inc()
}

Expand Down
2 changes: 1 addition & 1 deletion proxy/proto/redis/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (c *cluster) fetchproc() {
for {
select {
case <-c.action:
case <-time.After(30 * time.Minute):
case <-time.After(7 * 24 * time.Hour):
}
c.tryFetch()
time.Sleep(time.Second)
Expand Down

0 comments on commit 3ef42d6

Please sign in to comment.