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

pageserver: label tenant_slots metric by slot type #7603

Merged
merged 2 commits into from
May 6, 2024
Merged

Conversation

jcsp
Copy link
Contributor

@jcsp jcsp commented May 3, 2024

Problem

The current tenant_slots metric becomes less useful once we have lots of secondaries, because we can't tell how many tenants are really attached (without doing a sum() on some other metric).

Summary of changes

  • Add a mode label to this metric
  • Update the metric with slot_added and slot_removed helpers that are called at all the places we mutate the tenants map.
  • Add a debug assertion at shutdown that checks the metrics add up to the right number, as a cheap way of validating that we're calling the metric hooks in all the right places.

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

  • Do not forget to reformat commit message to not include the above checklist

@jcsp jcsp added c/storage/pageserver Component: storage: pageserver a/tech_debt Area: related to tech debt labels May 3, 2024
Copy link

github-actions bot commented May 3, 2024

2880 tests run: 2759 passed, 0 failed, 121 skipped (full report)


Flaky tests (1)

Postgres 16

  • test_vm_bit_clear_on_heap_lock: debug

Code coverage* (full report)

  • functions: 28.0% (6622 of 23608 functions)
  • lines: 46.7% (47101 of 100779 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
9f4271a at 2024-05-03T14:22:29.373Z :recycle:

@jcsp jcsp force-pushed the jcsp/slot-stats branch 2 times, most recently from 0a4b5fa to 90cdc3f Compare May 3, 2024 11:48
@jcsp jcsp marked this pull request as ready for review May 3, 2024 16:57
@jcsp jcsp requested a review from a team as a code owner May 3, 2024 16:57
@jcsp jcsp requested a review from arpad-m May 3, 2024 16:57
@jcsp jcsp merged commit 67a2215 into main May 6, 2024
54 checks passed
@jcsp jcsp deleted the jcsp/slot-stats branch May 6, 2024 13:07
conradludgate pushed a commit that referenced this pull request May 8, 2024
## Problem

The current `tenant_slots` metric becomes less useful once we have lots
of secondaries, because we can't tell how many tenants are really
attached (without doing a sum() on some other metric).

## Summary of changes

- Add a `mode` label to this metric
- Update the metric with `slot_added` and `slot_removed` helpers that
are called at all the places we mutate the tenants map.
- Add a debug assertion at shutdown that checks the metrics add up to
the right number, as a cheap way of validating that we're calling the
metric hooks in all the right places.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a/tech_debt Area: related to tech debt c/storage/pageserver Component: storage: pageserver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants