]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
format_open_telemetry: Populate the `unit` field.
authorFlorian Forster <octo@collectd.org>
Wed, 3 Jan 2024 12:42:11 +0000 (13:42 +0100)
committerFlorian Forster <octo@collectd.org>
Wed, 3 Jan 2024 16:16:28 +0000 (17:16 +0100)
src/utils/format_open_telemetry/format_open_telemetry.cc

index 691835f9e24e672a37326594a3257395726c103e..f65fcc762797e859b1b17531344b54da2d8c344c 100644 (file)
@@ -106,6 +106,9 @@ static void add_metric(ScopeMetrics *sm, metric_family_t const *fam) {
   if (fam->help != NULL) {
     m->set_description(fam->help);
   }
+  if (fam->unit != NULL) {
+    m->set_unit(fam->unit);
+  }
 
   switch (fam->type) {
   case METRIC_TYPE_COUNTER: