Upadte cassandra counters to be non-monotonic where appopriate (#113)

This commit is contained in:
Sam DeHaan 2021-10-15 11:22:48 -04:00 committed by GitHub
parent 323f91ebeb
commit 3627c835e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View File

@ -147,12 +147,18 @@ public abstract class AbstractIntegrationTest {
}
protected void assertSum(Metric metric, String name, String description, String unit) {
assertSum(metric, name, description, unit, true);
}
protected void assertSum(
Metric metric, String name, String description, String unit, boolean isMonotonic) {
assertThat(metric.getName()).isEqualTo(name);
assertThat(metric.getDescription()).isEqualTo(description);
assertThat(metric.getUnit()).isEqualTo(unit);
assertThat(metric.hasSum()).isTrue();
assertThat(metric.getSum().getDataPointsList())
.satisfiesExactly(point -> assertThat(point.getAttributesList()).isEmpty());
assertThat(metric.getSum().getIsMonotonic()).isEqualTo(isMonotonic);
}
protected void assertTypedGauge(

View File

@ -161,7 +161,8 @@ class CassandraIntegrationTest extends AbstractIntegrationTest {
metric,
"cassandra.storage.load.count",
"Size of the on disk data size this node manages",
"by"),
"by",
false),
metric ->
assertSum(
metric,
@ -173,6 +174,7 @@ class CassandraIntegrationTest extends AbstractIntegrationTest {
metric,
"cassandra.storage.total_hints.in_progress.count",
"Number of hints attempting to be sent currently",
"1"));
"1",
false));
}
}

View File

@ -123,7 +123,7 @@ def storageLoad = otel.mbean("${storage},name=Load")
otel.instrument(storageLoad,
"cassandra.storage.load.count",
"Size of the on disk data size this node manages", "by", "Count",
otel.&longCounterCallback)
otel.&longUpDownCounterCallback)
def storageTotalHints = otel.mbean("${storage},name=TotalHints")
otel.instrument(storageTotalHints,
@ -135,7 +135,7 @@ def storageTotalHintsInProgress = otel.mbean("${storage},name=TotalHintsInProgre
otel.instrument(storageTotalHintsInProgress,
"cassandra.storage.total_hints.in_progress.count",
"Number of hints attempting to be sent currently", "1", "Count",
otel.&longCounterCallback)
otel.&longUpDownCounterCallback)
def compaction = "${cassandraMetrics}:type=Compaction"
def compactionPendingTasks = otel.mbean("${compaction},name=PendingTasks")