Skip to content

Commit

Permalink
Add probe_dns_flag_do metric BROKEN
Browse files Browse the repository at this point in the history
This adds reporting of the DNSSEC OK flag

Does not currently work.

Ref #551

Signed-off-by: Kim Alvefur <[email protected]>
  • Loading branch information
Zash committed Mar 23, 2024
1 parent 220d785 commit 3189f96
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions prober/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
Name: "probe_dns_additional_rrs",
Help: "Returns number of entries in the additional resource record list",
})
probeDNSFlagDo := prometheus.NewGauge(prometheus.GaugeOpts{
Name: "probe_dns_flag_do",
Help: "Returns whether or not the query had the DNSSEC OK flag set",
})
probeDNSQuerySucceeded := prometheus.NewGauge(prometheus.GaugeOpts{
Name: "probe_dns_query_succeeded",
Help: "Displays whether or not the query was executed successfully",
Expand All @@ -155,6 +159,7 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
registry.MustRegister(probeDNSAnswerRRSGauge)
registry.MustRegister(probeDNSAuthorityRRSGauge)
registry.MustRegister(probeDNSAdditionalRRSGauge)
registry.MustRegister(probeDNSFlagDo)
registry.MustRegister(probeDNSQuerySucceeded)

qc := uint16(dns.ClassINET)
Expand Down Expand Up @@ -281,6 +286,13 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
probeDNSAdditionalRRSGauge.Set(float64(len(response.Extra)))
probeDNSQuerySucceeded.Set(1)

// FIXME This does not work. Need to opt-in?
if opt := response.IsEdns0(); opt != nil && opt.Do() {
probeDNSFlagDo.Set(1)
} else {
probeDNSFlagDo.Set(0)
}

if qt == dns.TypeSOA {
probeDNSSOAGauge = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "probe_dns_serial",
Expand Down

0 comments on commit 3189f96

Please sign in to comment.