Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
limit number of error types tracked
Browse files Browse the repository at this point in the history
  • Loading branch information
fitzoh committed Feb 26, 2020
1 parent 401b2ca commit 43ea289
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/mt-parrot/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (

var (
httpError = stats.NewCounter32("parrot.monitoring.error;error=http")
decodeError = stats.NewCounter32("parrot.monitoring.error;error=decode")
parsePartitionError = stats.NewCounter32("parrot.monitoring.error;error=parsePartition")
invalidError = stats.NewCounter32("parrot.monitoring.error;error=invalid")
)

type seriesStats struct {
Expand All @@ -38,15 +37,15 @@ func monitor() {
httpError.Inc()
}
if query.DecodeErr != nil {
decodeError.Inc()
invalidError.Inc()
}

for _, s := range query.Decoded {
log.Infof("%d - %d", s.Datapoints[0].Ts, s.Datapoints[len(s.Datapoints)-1].Ts)
partition, err := strconv.Atoi(s.Target)
if err != nil {
log.Debug("unable to parse partition", err)
parsePartitionError.Inc()
invalidError.Inc()
continue
}
serStats := seriesStats{}
Expand Down

0 comments on commit 43ea289

Please sign in to comment.