# HG changeset patch # User Kim Alvefur # Date 1723993110 -7200 # Node ID 2fb79fe5439051db94d9de3e1152bac8bd89209a # Parent a97c11584042ac7dd1375af5112186b5e9c8eb0e 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. diff -r a97c11584042 -r 2fb79fe54390 core/moduleapi.lua --- a/core/moduleapi.lua Thu Aug 08 19:18:22 2024 +0200 +++ b/core/moduleapi.lua Sun Aug 18 16:58:30 2024 +0200 @@ -558,6 +558,7 @@ 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