Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track memory used by DoH buffers #72

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ func TestIntegration(t *testing.T) {
}

// Check some expected metrics are present
for _, metric := range []string{"go_info", "unbound_queries_total", "unbound_response_time_seconds", "unbound_cache_hits_total"} {
for _, metric := range []string{
"go_info",
"unbound_queries_total",
"unbound_response_time_seconds",
"unbound_cache_hits_total",
"unbound_query_https_total",
"unbound_memory_doh_bytes",
} {
if _, ok := metrics[metric]; !ok {
t.Errorf("Expected metric is missing: %s", metric)
}
Expand Down
11 changes: 8 additions & 3 deletions unbound_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ var (
"^num\\.query\\.tls\\.resume$"),
newUnboundMetric(
"query_https_total",
"Total number of queries that were made using HTTPS towards the Unbound server.",
"Total number of DoH queries that were made towards the Unbound server.",
prometheus.CounterValue,
nil,
"^num\\.query\\.https$"),
Expand Down Expand Up @@ -325,8 +325,13 @@ var (
"Total number of triggered Response Policy Zone actions, by type.",
prometheus.CounterValue,
[]string{"type"},
"^num\\.rpz\\.action\\.rpz-([\\w-]+)$",
),
"^num\\.rpz\\.action\\.rpz-([\\w-]+)$"),
newUnboundMetric(
"memory_doh_bytes",
"Memory used by DoH buffers, in bytes.",
prometheus.GaugeValue,
[]string{"buffer"},
"^mem\\.http\\.(\\w+)$"),
}
)

Expand Down
Loading