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

client: add region request metrics which record caller info #9117

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

okJiang
Copy link
Member

@okJiang okJiang commented Mar 5, 2025

What problem does this PR solve?

Issue Number: Ref #8593

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
image

Related changes

Release note

None.

Signed-off-by: okJiang <[email protected]>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. labels Mar 5, 2025
Copy link
Contributor

ti-chi-bot bot commented Mar 5, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign binshi-bing for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 ti-chi-bot bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Mar 5, 2025
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 88.37209% with 5 lines in your changes missing coverage. Please review.

Project coverage is 76.25%. Comparing base (3b505f5) to head (f1aa468).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9117      +/-   ##
==========================================
- Coverage   76.36%   76.25%   -0.12%     
==========================================
  Files         473      473              
  Lines       71663    71699      +36     
==========================================
- Hits        54728    54672      -56     
- Misses      13514    13591      +77     
- Partials     3421     3436      +15     
Flag Coverage Δ
unittests 76.25% <88.37%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Subsystem: "server",
Name: "region_request_cnt",
Help: "Counter of region request.",
}, []string{"request", "caller_id", "caller_component", "err_msg"})
Copy link
Member

@rleungx rleungx Mar 5, 2025

Choose a reason for hiding this comment

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

Can we make it more simple, e.g., request-component-module?

Copy link
Member

Choose a reason for hiding this comment

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

ScanRegions-tidb-server->tidb-tikv-driver is kind of confusing and not readable.

Copy link
Member Author

Choose a reason for hiding this comment

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

request-component-module LGTM

However, there are caller_id and caller_component in the current code. If we use request-component-module here, it will cause confusion with the term component.

ScanRegions-tidb-server->tidb-tikv-driver is kind of confusing and not readable.

It is indeed easy to get confused, and I am still thinking of a better format. Since we chose to use a hyphen as a connector in the component, continuing to use a hyphen in Grafana might look a bit strange.

image

Maybe we should name the component using camel case? Such as RegionCache

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you think? cc @lhy1024 @JmPotato @bufferflies

Signed-off-by: okJiang <[email protected]>
Comment on lines +38 to +54
// client-go component
CodecPDClient Component = "codec-pd-client"
RegionCache Component = "region-cache"
StoreCache Component = "store-cache"
Oracles Component = "oracle"
Rawkv Component = "rawkv"
KvStore Component = "kv-store"
InterceptedPDClient Component = "intercepted-pd-client"

// TiDB component
Pitr Component = "pitr"
Ddl Component = "ddl"
ImportInto Component = "import-into"
TikvHandler Component = "tikv-handler"
GcWorker Component = "gc-worker"
GcJob Component = "gc-job"
DistributedGcJob Component = "distributed-gc-job"
Copy link
Member Author

@okJiang okJiang Mar 6, 2025

Choose a reason for hiding this comment

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

These names can be reviewed with these two PR https://github.com/pingcap/tidb/pull/59911/files and tikv/client-go#1516

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has signed the dco. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants