Skip to content

Add Cassandra compaction progress metrics via JMX handler#19290

Open
jkoronaAtCisco wants to merge 2 commits into
open-telemetry:mainfrom
jkoronaAtCisco:cassandra_compaction_metrics
Open

Add Cassandra compaction progress metrics via JMX handler#19290
jkoronaAtCisco wants to merge 2 commits into
open-telemetry:mainfrom
jkoronaAtCisco:cassandra_compaction_metrics

Conversation

@jkoronaAtCisco

Copy link
Copy Markdown
Member

Adds two Cassandra compaction byte-progress metrics to the experimental-cassandra JMX target system, implemented as a code-based ExperimentalJmxMetricHandler because the source data can't be expressed in declarative YAML.

  • cassandra.compaction.progress.bytes — bytes completed for in-flight compactions
  • cassandra.compaction.progress.total — total bytes for in-flight compactions

Both carry cassandra.compaction.task_type, cassandra.keyspace, and cassandra.table attributes.

These come from org.apache.cassandra.db:type=CompactionManager's Compactions attribute, which returns a list of maps (one per in-flight compaction). Producing the metrics requires iterating that list, grouping entries by the composite key, filtering to byte-measured compactions, and parsing string-encoded BigInteger values — none of which the YAML rule syntax supports.

This builds on the experimental-cassandra target system added in #19080, and supersedes the handler portion of open-telemetry/opentelemetry-java-contrib#2912, which prototyped these metrics in jmx-scraper; that contrib PR will be closed once this lands.

Copilot AI review requested due to automatic review settings July 21, 2026 13:05
@jkoronaAtCisco
jkoronaAtCisco requested a review from a team as a code owner July 21, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Cassandra in-flight compaction byte-progress metrics to the experimental JMX target system.

Changes:

  • Implements and registers a code-based Cassandra compaction handler.
  • Adds unit and container integration coverage.
  • Documents the new gauges and attributes.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
CHANGELOG.md Adds an enhancement entry.
instrumentation/jmx-metrics/library/cassandra.md Documents the new metrics.
.../CassandraCompactionProgressHandler.java Queries, groups, and records compaction progress.
.../ExperimentalJmxMetricHandler Registers the handler through SPI.
.../experimental-cassandra.yaml Activates the handler for CompactionManager.
.../CassandraCompactionProgressHandlerTest.java Tests parsing, filtering, and grouping.
.../CassandraTest.java Exercises metrics against Cassandra.

Comment thread CHANGELOG.md Outdated
return 0;
}
try {
return new BigInteger(value.toString()).longValue();
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 21, 2026

Copy link
Copy Markdown

Pull request dashboard status

Status last refreshed: 2026-07-22 00:43:02 UTC.

  • Waiting on: Author
  • Next steps:
    • Investigate required status check failures.
    • Address or respond to 1 review feedback item:
      • Inline threads: 1
      • For each item, link to the commit that addresses it, explain why no change is needed, or ask a follow-up question.

This automated status or its linked feedback items may be incorrect. If something looks wrong, report it with the result you expected.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants