Skip to content

Commit 7058411

Browse files
committed
internal/metrics: Use constant for unknown result type
1 parent 21991c9 commit 7058411

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

internal/metrics/dns.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const (
1313
ResultSafeBrowsing = "safe_browsing"
1414
ResultSafeSearch = "safe_search"
1515
ResultParental = "parental"
16+
ResultUnknown = "unknown"
1617
)
1718

1819
// DNSQueries tracks DNS queries by their processing result

internal/stats/unit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ func (u *unit) add(e *Entry) {
345345
case RParental:
346346
resultLabel = metrics.ResultParental
347347
default:
348-
resultLabel = "unknown"
348+
resultLabel = metrics.ResultUnknown
349349
}
350350
metrics.IncrementDNSQueryByResult(resultLabel)
351351
metrics.ObserveDNSResponseTime(resultLabel, e.ProcessingTime)

0 commit comments

Comments
 (0)