karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.12k stars 807 forks source link

add pprof option to metrics-adapter #4786

Closed chaosi-zju closed 1 month ago

chaosi-zju commented 1 month ago

What type of PR is this?

/kind feature

What this PR does / why we need it:

add pprof option to metrics-adapter.

refer to Profiling Karmada.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-metrics-adapter`: Introduced the `--profiling` and `--profiling-bind-address` flags to enable and control profiling.
codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 51.76%. Comparing base (dca5c1a) to head (2bfaccf). Report is 37 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4786 +/- ## ========================================== - Coverage 51.77% 51.76% -0.02% ========================================== Files 250 250 Lines 25000 24980 -20 ========================================== - Hits 12944 12931 -13 + Misses 11346 11340 -6 + Partials 710 709 -1 ``` | [Flag](https://app.codecov.io/gh/karmada-io/karmada/pull/4786/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/karmada-io/karmada/pull/4786/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io) | `51.76% <ø> (-0.02%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

RainbowMango commented 1 month ago

/lgtm /assign @chaunceyjiang

karmada-bot commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chaunceyjiang

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: - ~~[cmd/metrics-adapter/OWNERS](https://github.com/karmada-io/karmada/blob/master/cmd/metrics-adapter/OWNERS)~~ [chaunceyjiang] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
RainbowMango commented 1 month ago

Just added a release note to the PR description. cc @chaosi-zju

RainbowMango commented 1 month ago

Why the --profiling is enabled by default? I remember it should be disabled by default.

      --profiling                                                                                                                                                                                   
                Enable profiling via web interface host:port/debug/pprof/ (default true)
      --profiling-bind-address string                                                                                                                                                               
                The TCP address for serving profiling(e.g. 127.0.0.1:6060, :6060). This is only applicable if profiling is enabled. (default ":6060")