Skip to content

[feat](cloud) Expose approximate rowset metric - #67502

Open
jayakasadev wants to merge 3 commits into
apache:masterfrom
jayakasadev:jaya/approximate-rowsets-metric
Open

[feat](cloud) Expose approximate rowset metric#67502
jayakasadev wants to merge 3 commits into
apache:masterfrom
jayakasadev:jaya/approximate-rowsets-metric

Conversation

@jayakasadev

Copy link
Copy Markdown

What problem does this PR solve?

Issue Number: close #67458

Related PR: N/A

Problem Summary:

  • writes are rejected with TOO_MANY_VERSION errors when a tablet has too many versions. The code checks _approximate_num_rowsets, but its not emitted as a metric.
  • tablet_version_num_distribution is similar, but it updates less frequently and skips tablets that are currently being written to
  • added tablet_approximate_num_rowsets_distribution which uses _approximate_num_rowsets and includes active tablets
    • allows users to create alerts before getting TOO_MANY_VERSION errors

Release note

Add tablet_approximate_num_rowsets_distribution for cloud-mode tablet version-limit monitoring

Check List (For Author)

  • Test

    • Unit Test
      • Added CloudTabletMgrTest.TestApproximateRowsetsMetricIncludesActiveTablets.
    • Manual test
      • build-support/clang-format.sh
      • build-support/check-format.sh
      • build-support/check-build-hygiene.sh
      • git diff --check
  • Behavior changed:

    • Yes.
      • Cloud BEs expose the new tablet_approximate_num_rowsets_distribution Prometheus histogram.
  • Does this need documentation?

    • No.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

### What problem does this PR solve?

Issue Number: close apache#67458

Related PR: N/A

Problem Summary: Cloud write admission checks each tablet's _approximate_num_rowsets, but Prometheus exposed only the materialized version-count distribution and omitted recently accessed tablets. Register a separate histogram from the exact admission counter before the inactive-tablet filter so active tablets are included. A focused unit test verifies an active tablet is excluded from the existing report yet included in the new metric.

### Release note

Add tablet_approximate_num_rowsets_distribution for cloud-mode tablet version-limit monitoring.

### Check List (For Author)

- Test: Header hygiene and formatting checks passed. Focused BE unit test was attempted but local configuration cannot proceed without third-party artifacts; Docker build image extraction also fails on this host.
- Behavior changed: Yes. Cloud BEs expose a new Prometheus histogram.
- Does this need documentation: No.
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@jayakasadev jayakasadev changed the title [feature](cloud) Expose approximate rowset metric [feat](cloud) Expose approximate rowset metric Sep 3, 2026
@jayakasadev

Copy link
Copy Markdown
Author

run buildall

Set a nonzero inactive-report window in the approximate-rowsets metric test so the test tablet takes the active-tablet path. Restore the global after the assertion to avoid changing later tests.
@jayakasadev

Copy link
Copy Markdown
Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.33% (34666/45415)
Line Coverage 61.37% (391109/637341)
Region Coverage 57.46% (328310/571408)
Branch Coverage 58.36% (149882/256814)

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.

[Enhancement] Expose the actual tablet version-limit counter (_approximate_num_rowsets) as a Prometheus metric

2 participants