Mercurial > prosody-modules
comparison mod_prometheus/mod_prometheus.lua @ 3126:888375de933c
mod_prometheus: Prefix metric names with "prosody_".
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
|---|---|
| date | Thu, 21 Jun 2018 22:11:01 +0200 |
| parents | 07a2ba55de4d |
| children | 36770ae1148f |
comparison
equal
deleted
inserted
replaced
| 3125:07a2ba55de4d | 3126:888375de933c |
|---|---|
| 104 | 104 |
| 105 local response = {}; | 105 local response = {}; |
| 106 local timestamp = tostring(get_timestamp()); | 106 local timestamp = tostring(get_timestamp()); |
| 107 for section, data in pairs(data.data) do | 107 for section, data in pairs(data.data) do |
| 108 for key, value in pairs(data) do | 108 for key, value in pairs(data) do |
| 109 local name = section.."_"..key; | 109 local name = "prosody_"..section.."_"..key; |
| 110 t_insert(response, repr_help(name, "TODO: add a description here.")); | 110 t_insert(response, repr_help(name, "TODO: add a description here.")); |
| 111 t_insert(response, repr_type(name, "gauge")); | 111 t_insert(response, repr_type(name, "gauge")); |
| 112 t_insert(response, repr_sample(name, {}, value, timestamp)); | 112 t_insert(response, repr_sample(name, {}, value, timestamp)); |
| 113 end | 113 end |
| 114 end | 114 end |
