From 65386e9810670432e06c7fd62f91891f87678c6b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 18 Aug 2024 16:58:30 +0200 Subject: core.moduleapi: Default labels to empty list to fix error if omitted In a host-scoped module in the `if is_scoped` clause the resulting `array:append(nil)` call throws. --- core/moduleapi.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/core/moduleapi.lua b/core/moduleapi.lua index 870a6a50..cbb2da9c 100644 --- a/core/moduleapi.lua +++ b/core/moduleapi.lua @@ -558,6 +558,7 @@ end function api:metric(type_, name, unit, description, label_keys, conf) local metric = require "core.statsmanager".metric; local is_scoped = self.host ~= "*" + label_keys = label_keys or {}; if is_scoped then -- prepend `host` label to label keys if this is not a global module local orig_labels = label_keys -- cgit v1.2.3