Skip to content

Commit 6950ead

Browse files
committed
More fixes for prometheus counters
1 parent 8565b9d commit 6950ead

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

dnscrypt-proxy/monitoring_ui.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,13 @@ func (ui *MonitoringUI) UpdateMetrics(pluginsState PluginsState, msg *dns.Msg) {
287287
}
288288

289289
// Update blocked queries count
290-
if pluginsState.returnCode == PluginsReturnCodeReject {
290+
// Count all types of blocked queries: REJECT (blocked by name/IP), DROP (dropped), and CLOAK (cloaked)
291+
if pluginsState.returnCode == PluginsReturnCodeReject ||
292+
pluginsState.returnCode == PluginsReturnCodeDrop ||
293+
pluginsState.returnCode == PluginsReturnCodeCloak {
291294
mc.blockCount++
292-
dlog.Debugf("Blocked query, total blocks: %d", mc.blockCount)
295+
dlog.Debugf("Blocked query (return code: %s), total blocks: %d",
296+
PluginsReturnCodeToString[pluginsState.returnCode], mc.blockCount)
293297
}
294298
mc.countersMutex.Unlock()
295299

0 commit comments

Comments
 (0)