Skip to content

Commit

Permalink
Only log errors when there actually was an error
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusv committed Nov 30, 2018
1 parent b7522eb commit f4f3a31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ func main() {
val = 1
}
ch <- prometheus.MustNewConstMetric(rpcFailedDesc, prometheus.GaugeValue, val, rpc)
level.Warn(logger).Log("msg", "error querying RPC", "rpc", rpc, "err", err)
if err != nil {
level.Warn(logger).Log("msg", "error querying RPC", "rpc", rpc, "err", err)
}
}

reg := prometheus.NewRegistry()
Expand Down

0 comments on commit f4f3a31

Please sign in to comment.