comparison util/startup.lua @ 13988:260a6feebe5f

util.startup: Add metric bucket for zero DNS records Otherwise hard to tell the difference between 0 and 1 :)
author Kim Alvefur <zash@zash.se>
date Sat, 18 Oct 2025 00:53:43 +0200
parents ccbc4a46f42d
children a8aa17293d22
comparison
equal deleted inserted replaced
13987:4067a95336dd 13988:260a6feebe5f
448 if adns.instrument then 448 if adns.instrument then
449 local m = statsmanager.metric("histogram", "prosody_dns", "seconds", "DNS lookups", { "qclass"; "qtype" }, { 449 local m = statsmanager.metric("histogram", "prosody_dns", "seconds", "DNS lookups", { "qclass"; "qtype" }, {
450 buckets = { 1 / 1024; 1 / 256; 1 / 64; 1 / 16; 1 / 4; 1; 4 }; 450 buckets = { 1 / 1024; 1 / 256; 1 / 64; 1 / 16; 1 / 4; 1; 4 };
451 }); 451 });
452 local c = statsmanager.metric("histogram", "prosody_dns_response", "records", "DNS response records", { "qclass"; "qtype" }, { 452 local c = statsmanager.metric("histogram", "prosody_dns_response", "records", "DNS response records", { "qclass"; "qtype" }, {
453 buckets = { 1; 2; 4; 8; 16 } }) 453 buckets = { 0; 1; 2; 4; 8; 16 } })
454 local function m_times(qclass, qtype) return timed(m:with_labels(qclass, qtype)); end 454 local function m_times(qclass, qtype) return timed(m:with_labels(qclass, qtype)); end
455 local function m_counts(qclass, qtype, num) return c:with_labels(qclass, qtype):sample(num); end 455 local function m_counts(qclass, qtype, num) return c:with_labels(qclass, qtype):sample(num); end
456 adns.instrument(m_times, m_counts); 456 adns.instrument(m_times, m_counts);
457 end 457 end
458 end 458 end