From: Florian Forster Date: Thu, 1 Feb 2024 11:30:42 +0000 (+0100) Subject: open_telemetry_collector plugin: Unify the setting of `family->type`. X-Git-Tag: collectd-6.0.0.rc3~4^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0240e08ad5dd75fecfaf9e8544ffa7f87cb15d8e;p=thirdparty%2Fcollectd.git open_telemetry_collector plugin: Unify the setting of `family->type`. --- diff --git a/src/open_telemetry_collector.cc b/src/open_telemetry_collector.cc index 7b9f7932a..6aad492a8 100644 --- a/src/open_telemetry_collector.cc +++ b/src/open_telemetry_collector.cc @@ -173,7 +173,6 @@ static grpc::Status unmarshal_data_point(NumberDataPoint dp, // (#4266) // fam->type = METRIC_TYPE_FPCOUNTER; // m.value.fpcounter = dp.as_double(); - fam->type = METRIC_TYPE_COUNTER; m.value.counter = offset.counter + (counter_t)dp.as_double(); break; } @@ -181,7 +180,6 @@ static grpc::Status unmarshal_data_point(NumberDataPoint dp, break; case NumberDataPoint::kAsInt: if (is_cumulative) { - fam->type = METRIC_TYPE_COUNTER; m.value.counter = offset.counter + (counter_t)dp.as_int(); break; } @@ -270,6 +268,7 @@ static grpc::Status dispatch_metric(Metric mpb, label_set_t resource, break; } case Metric::kSum: { + fam.type = METRIC_TYPE_COUNTER; grpc::Status s = unmarshal_sum_metric(mpb.sum(), &fam); if (!s.ok()) { metric_family_metric_reset(&fam);