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

server, metrics: remove the connection count on server, only use the metrics #51996

Merged
merged 1 commit into from Mar 22, 2024

Conversation

YangKeao
Copy link
Member

What problem does this PR solve?

Issue Number: close #51889

Problem Summary:

  1. The connection count is not correct, if the session resets the resource group manually.
  2. Maintaining a separated map on server to count the connection for each resource group seems to be not necessary. We can use the GaugeVec itself. The connection count is not used anywhere else.
  3. The grafana panel of connection count is confusing. I added a legend and now it looks like:

image

Maybe someone prefers to sum up them together. Actually I think both are fine, feel free to comment your opinion.

Personally, I don't like the idea to use the uncontrollable string as a label 🤦, because the prometheus will have much greater pressure when these labels multiply together.

As for now, it seems not a big issue, but it'll become much worse if anyone adds more similar labels.

What changed and how does it work?

  1. Use the GaugeVec as the only counter of the connection.
  2. Also increase and decrease the counter when the user set resource group manually.
  3. Modify the grafana definition. I found that some modification on the json file is not represented in the jsonnet, so I also fix them.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Release note

Fix the issue that the connection count is not calculated and shown correctly.

@ti-chi-bot ti-chi-bot bot added release-note size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 21, 2024
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Merging #51996 (5227466) into master (bdc64e5) will decrease coverage by 15.7416%.
Report is 31 commits behind head on master.
The diff coverage is 98.8372%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #51996         +/-   ##
=================================================
- Coverage   70.7175%   54.9760%   -15.7416%     
=================================================
  Files          1477       1592        +115     
  Lines        438748     615070     +176322     
=================================================
+ Hits         310272     338141      +27869     
- Misses       109008     253582     +144574     
- Partials      19468      23347       +3879     
Flag Coverage Δ
integration 36.7681% <92.8571%> (?)
unit 70.5660% <98.8372%> (+0.0505%) ⬆️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 50.9566% <ø> (+5.1306%) ⬆️

@YangKeao
Copy link
Member Author

/retest

Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
Copy link
Member

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

ti-chi-bot bot commented Mar 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nolouch, tiancaiamao

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

Copy link

ti-chi-bot bot commented Mar 22, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-22 06:39:20.076872865 +0000 UTC m=+1617987.099119254: ☑️ agreed by tiancaiamao.
  • 2024-03-22 07:58:03.282013223 +0000 UTC m=+1622710.304259611: ☑️ agreed by nolouch.

@ti-chi-bot ti-chi-bot bot merged commit 07ef009 into pingcap:master Mar 22, 2024
23 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #53056.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request May 7, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.5 release-note 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.

Connection count metric can be less than the real value
4 participants