Software / code / prosody
Comparison
core/moduleapi.lua @ 13514:a1bc6533bbba
Merge 0.12->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 18 Aug 2024 17:01:47 +0200 |
| parent | 13368:80a1ce9974e5 |
| parent | 13513:2fb79fe54390 |
| child | 13604:a4217361c1c6 |
comparison
equal
deleted
inserted
replaced
| 13512:0b742bbbb819 | 13514:a1bc6533bbba |
|---|---|
| 651 end | 651 end |
| 652 | 652 |
| 653 function api:metric(type_, name, unit, description, label_keys, conf) | 653 function api:metric(type_, name, unit, description, label_keys, conf) |
| 654 local metric = require "prosody.core.statsmanager".metric; | 654 local metric = require "prosody.core.statsmanager".metric; |
| 655 local is_scoped = self.host ~= "*" | 655 local is_scoped = self.host ~= "*" |
| 656 label_keys = label_keys or {}; | |
| 656 if is_scoped then | 657 if is_scoped then |
| 657 -- prepend `host` label to label keys if this is not a global module | 658 -- prepend `host` label to label keys if this is not a global module |
| 658 local orig_labels = label_keys | 659 local orig_labels = label_keys |
| 659 label_keys = array { "host" } | 660 label_keys = array { "host" } |
| 660 label_keys:append(orig_labels) | 661 label_keys:append(orig_labels) |