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

feat: improve proxy handler of yurthub #2301

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

rambohe-ch
Copy link
Member

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

/kind feature

What this PR does / why we need it:

  1. remove latency metrics(proxyLatencyCollector) of yurthub, because this metric is not useful for end users.
  2. remove WithMaxInFlightLimit handler, because requests are aggregated by multiplexer in yurthub, so requests limit is not needed for controlling requests volume.
  3. remove WithCacheHeaderCheck handler, because Edge-Cache header is rarely used.
  4. improve WithRequestClientComponent handler, add whole user agent into request context, and truncate user agent by callers.
  5. improve proxy handler not to depend on working mode.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

@rambohe-ch rambohe-ch requested a review from a team as a code owner February 6, 2025 14:33
@rambohe-ch rambohe-ch force-pushed the improve-proxy-handler branch from c8e9437 to 73556a3 Compare February 6, 2025 14:55
Copy link

sonarqubecloud bot commented Feb 6, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
5.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 36.58537% with 52 lines in your changes missing coverage. Please review.

Please upload report for BASE (master@ffb736a). Learn more about missing BASE report.
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/yurthub/proxy/util/util.go 3.57% 27 Missing ⚠️
pkg/yurthub/util/util.go 0.00% 10 Missing ⚠️
pkg/yurthub/proxy/remote/loadbalancer.go 0.00% 6 Missing ⚠️
pkg/yurthub/cachemanager/cache_manager.go 83.87% 3 Missing and 2 partials ⚠️
pkg/yurthub/proxy/proxy.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #2301   +/-   ##
=========================================
  Coverage          ?   45.51%           
=========================================
  Files             ?      408           
  Lines             ?    27049           
  Branches          ?        0           
=========================================
  Hits              ?    12310           
  Misses            ?    13522           
  Partials          ?     1217           
Flag Coverage Δ
unittests 45.51% <36.58%> (?)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rambohe-ch
Copy link
Member Author

@zyjhtangtang @YTGhost PTAL

@zyjhtangtang
Copy link
Contributor

/LGTM

@zyjhtangtang zyjhtangtang merged commit 5543dde into openyurtio:master Feb 7, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants