Skip to content

Commit 732df41

Browse files
authored
Merge pull request #152 from santubvb/patch-1
Updating failedScrapes, incase of zero rows returned first time when SQL exported started(on initial time sql exported started)
2 parents 4d97970 + db62fb4 commit 732df41

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

query.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ func (q *Query) Run(conn *connection) error {
6666
if q.AllowZeroRows {
6767
failedScrapes.WithLabelValues(conn.driver, conn.host, conn.database, conn.user, q.jobName, q.Name).Set(0.0)
6868
} else {
69+
failedScrapes.WithLabelValues(conn.driver, conn.host, conn.database, conn.user, q.jobName, q.Name).Set(1.0)
70+
failedQueryCounter.WithLabelValues(q.jobName, q.Name).Inc()
6971
return fmt.Errorf("zero rows returned")
7072
}
7173
}

0 commit comments

Comments
 (0)