-
Notifications
You must be signed in to change notification settings - Fork 725
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
api: Add Request Info Middleware #4526
Conversation
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
/run-all-tests |
/run-all-tests |
/retest |
/run-all-tests |
Codecov Report
@@ Coverage Diff @@
## master #4526 +/- ##
==========================================
+ Coverage 74.71% 74.88% +0.17%
==========================================
Files 279 281 +2
Lines 27627 27706 +79
==========================================
+ Hits 20641 20749 +108
+ Misses 5129 5113 -16
+ Partials 1857 1844 -13
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
/cc @rleungx |
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
/run-all-tests |
/run-all-tests |
/rebuild |
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
10a564e
to
b7ec272
Compare
/merge |
@disksing: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests 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 ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 924f302
|
return route | ||
} | ||
|
||
// registerRouteHandleFunc is used to registers a new route which will be registered matcher or service by opts for the URL path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment needs to be changed.
* close tikv#4494 Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * close tikv#4494: add priority comment Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * add request info middleware Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * close tikv#4494 Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * change service label getter and setter Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * add lock Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * add audit middleware Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * add audit middleware Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * tikv#4538 Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix check Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix check Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * change service label placement Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * merge master Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * add const service label and could be dynamically turned on and off service middleware Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix statics check Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix statics check Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix statics check Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix statics check Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix function name Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * add benchmark test Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix r.Body nil panic Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * add benchmark test Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * change export Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * change export Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix statics check Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix typo problem Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * change service label method Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix statics Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix router Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix router Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * add http proto Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * add http proto Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * change default value Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * use middleware func shortname Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix comment Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * change const to iota Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * change register method Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * for test Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * for test Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix race Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> * fix race Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com> Co-authored-by: ShuNing <nolouch@gmail.com>
Signed-off-by: Cabinfever_B cabinfeveroier@gmail.com
What problem does this PR solve?
close #4538
This PR is used to support the information-gathering.
This PR should be merged after #4491 and #4495
What is changed and how it works?
This PR creates a middleware to handle the information-gathering for audit middleware and rate limit middleware.
RequestInfo
includes below fieldsFor the HTTP API interfaces which need to be audited and limited, we should register their service labels on /server/api/router.go
Benchmark test
for
serviceInfoMiddleware
in integration testBased on the above test,
serviceMiddleware
won't have a big performance impact on the HTTP API.Check List
Tests
Code changes
Side effects
Release note