Skip to content

Commit 8565b9d

Browse files
committed
Fix the issue with the dnscrypt_proxy_blocked_queries_total metric
1 parent 47e7302 commit 8565b9d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

dnscrypt-proxy/monitoring_ui.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,12 @@ func (ui *MonitoringUI) UpdateMetrics(pluginsState PluginsState, msg *dns.Msg) {
285285
mc.cacheMisses++
286286
dlog.Debugf("Cache miss, total misses: %d", mc.cacheMisses)
287287
}
288+
289+
// Update blocked queries count
290+
if pluginsState.returnCode == PluginsReturnCodeReject {
291+
mc.blockCount++
292+
dlog.Debugf("Blocked query, total blocks: %d", mc.blockCount)
293+
}
288294
mc.countersMutex.Unlock()
289295

290296
// Invalidate cache since counters changed

0 commit comments

Comments
 (0)