From 2ffac2254cf2316f23f1198ee8b754b2c59de236 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Wed, 5 Jun 2024 08:22:08 +0200 Subject: [PATCH] Update metric type based on definition, add detailed description - Update metric type based on definition - Add detailed description for metric type if defined --- templates/metrics.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/metrics.twig b/templates/metrics.twig index 3d3be84..60d7eb7 100644 --- a/templates/metrics.twig +++ b/templates/metrics.twig @@ -2,7 +2,7 @@ {% if metric.help is defined and metric.help is not empty %} # HELP {{ key }} {{ metric.help }} {% endif %} -# TYPE {{ key }} gauge +# TYPE {{ key }} {% if metric.type is defined and metric.type is not empty %}{{ metric.help }}{% else %}gauge{% endif %} {% for subkey, submetric in metric.submetrics %} {{ key }}{% if submetric.labels is defined and submetric.labels is not empty %}{{ '{' }}{% for label, value in submetric.labels %}{{ label }}="{{ value }}"{% if not loop.last %},{% endif %}{% endfor %}{{ '}' }}{% endif %} {{ submetric.value }} {% endfor %}