Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LatencyMetrics for DSE #565

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Changelog for Management API, new PRs should update the `main / unreleased` sect
```

## unreleased
* [BUGFIX] [#564](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/564) Fix LatencyMetrics for DSE

## v0.1.88 (2024-10-28)
* [CHANGE] [#556](https://github.com/k8ssandra/management-api-for-apache-cassandra/issues/556) Update Management API dependencies to address CVEs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,12 +528,21 @@ public void onTimerRemoved(String name) {
*/
private boolean isMicrosecondLatencyBuckets() {

// This should only catch Cassandra 4.1+ and 5+ versions. DSE 6.8 reports something like
// 4.0.0.6851 and 6.9 reports something like 4.0.0.693, both of which would follow C* 4.0.x
// nanosecond buckets
if (SERVER_MAJOR_VERSION > 4 || (SERVER_MAJOR_VERSION == 4 && SERVER_MINOR_VERSION > 0)) {
// Only Cassandra 4.1 and newer should use microsecond resolution.

boolean isCassandra = false;
try {
Class.forName("org.apache.cassandra.utils.CassandraVersion");
isCassandra = true;
} catch (ClassNotFoundException cfne) {
// DSE doesn't have CassandraVersion
}
if (isCassandra
&& (SERVER_MAJOR_VERSION > 4 || (SERVER_MAJOR_VERSION == 4 && SERVER_MINOR_VERSION > 0))) {
logger.info("Server version indicates metrics are microsecond resolution");
return true;
}
logger.info("Server version indicates metrics are nanosecond resolution");
return false;
}
}
Loading