comparison util/startup.lua @ 13982:ccbc4a46f42d

util.startup: Fix error in DNS instrumentation > attempt to call a nil value (method 'add')
author Kim Alvefur <zash@zash.se>
date Thu, 09 Oct 2025 13:45:52 +0200
parents 350e16e5f9aa
children 260a6feebe5f
comparison
equal deleted inserted replaced
13981:350e16e5f9aa 13982:ccbc4a46f42d
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 = { 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):add(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
459 459
460 function startup.init_data_store() 460 function startup.init_data_store()