Skip to content

Commit e54bd30

Browse files
committed
Change count metrics to report absolute instead of cumulative value
1 parent 0005e65 commit e54bd30

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/datadog/metrics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const std::string Metric::name() { return name_; }
1212
const std::string Metric::type() { return type_; }
1313
const std::vector<std::string> Metric::tags() { return tags_; }
1414
bool Metric::common() { return common_; }
15-
uint64_t Metric::value() { return value_; }
15+
uint64_t Metric::value() { return value_.exchange(0); }
1616

1717
CounterMetric::CounterMetric(const std::string name,
1818
const std::vector<std::string> tags, bool common)

src/datadog/tracer_telemetry.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ void TracerTelemetry::capture_metrics() {
100100
.count();
101101
for (auto& m : metrics_snapshots_) {
102102
auto value = m.first.get().value();
103-
if (value == 0) {
104-
continue;
105-
}
106103
m.second.emplace_back(timepoint, value);
107104
}
108105
}

0 commit comments

Comments
 (0)