Skip to content

Conversation

@SerjKol80
Copy link

What problem does this PR solve?

Issue Number: Close #9855

What is changed and how does it work?

Add 'store' label to metric pd_cluster_status.

Check List

Tests

  • Unit test

Code changes

  • Metrics only

Side effects

  • metric pd_cluster_status now needs to be aggregated in metic system across all stores if you need value across whole cluster.

Related changes
N/A

Release note

metric "pd_cluster_status" now has additional label "store" containing ID of the store.

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has signed the dco. contribution This PR is from a community contributor. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Oct 31, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Oct 31, 2025

Hi @SerjKol80. Thanks for your PR.

I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 31, 2025
@rleungx rleungx requested a review from bufferflies November 3, 2025 05:40
@rleungx
Copy link
Member

rleungx commented Nov 3, 2025

/ok-to-test

@ti-chi-bot ti-chi-bot bot added ok-to-test Indicates a PR is ready to be tested. and removed needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Nov 3, 2025
ObserveHotStat(store, storesStats)
}
stats := storeStats.stats
tikvStats := stats.engineStatistics[core.EngineTiKV]
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to add a new test for it?

Copy link
Author

Choose a reason for hiding this comment

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

@lhy1024
Since we don't have aggregation logic anymore, then the test was removed for that part.
So, the only thing that might be tested in a new logic is if actual metric is emitted. I looked through existing tests and didn't dint find any tests validating actual metric emission. Thus, no new tests.

Name: "status",
Help: "Status of the cluster.",
}, []string{"type", "engine"})
}, []string{"type", "engine", "store"})
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to update metrics/grafana/pd.json?

Copy link
Author

@SerjKol80 SerjKol80 Nov 4, 2025

Choose a reason for hiding this comment

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

@lhy1024
I don't think so. All queries for pd_cluster_status metrics already aggregate that metric with sum(). Thus, there should no be any changes there. The description of that metrics should be updated, but I wasn't able to find doc describing metrics in this repo.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Nov 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lhy1024

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Nov 5, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-11-05 07:29:51.714334856 +0000 UTC m=+255241.157364725: ☑️ agreed by lhy1024.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Nov 5, 2025
@SerjKol80
Copy link
Author

@lhy1024
Thank you. Would you initiate the merge. It looks like I don't have permission.

@lhy1024
Copy link
Contributor

lhy1024 commented Nov 6, 2025

@bufferflies PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved contribution This PR is from a community contributor. dco-signoff: yes Indicates the PR's author has signed the dco. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'store' label to metric pd_cluster_status.

3 participants