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

admin: Add optional /debug/pprof/profile endpoint #2516

Merged
merged 4 commits into from
Nov 16, 2023
Merged

admin: Add optional /debug/pprof/profile endpoint #2516

merged 4 commits into from
Nov 16, 2023

Conversation

olix0r
Copy link
Member

@olix0r olix0r commented Nov 14, 2023

This change introduces a new, optional /debug/pprof/profile endpoint to
the proxy's admin server. This endpoint is feature-gated and, initially,
it will not be included in release builds.

When the feature is enabled, profiling requests are only permitted over
the loopback interface.

The development Dockerfile is updated to prevent stripping debug
symbols so the pprof data is hydrated with debug symbols.

@olix0r olix0r requested a review from a team as a code owner November 14, 2023 20:57
@olix0r olix0r marked this pull request as draft November 14, 2023 20:59
@olix0r olix0r changed the title admin: Optional /debug/pprof/profile endpoint admin: Add an optional /debug/pprof/profile endpoint Nov 14, 2023
@olix0r olix0r force-pushed the ver/pprof branch 3 times, most recently from 00540a2 to c5f943f Compare November 14, 2023 22:31
@olix0r olix0r changed the title admin: Add an optional /debug/pprof/profile endpoint admin: Add optional /debug/pprof/profile endpoint Nov 14, 2023
@olix0r olix0r marked this pull request as ready for review November 14, 2023 22:32
@olix0r olix0r marked this pull request as draft November 14, 2023 22:34
This change introduces a new, optional /debug/pprof/profile.pb.gz
endpoint to the proxy's admin server. This endpoint is feature-gated
and, initially, it will not be included in release builds. It replicates
Go's /debug/pprof/profile, but it always returns gzipped protobuf (i.e.
as can be read by pprof pprofutils).

When the feature is enabled, profiling requests are only permitted over
the loopback interface.

The development Dockerfile is updated to prevent stripping debug
symbols when pprof is enabled so that the pprof data has useful names.
@olix0r olix0r marked this pull request as ready for review November 15, 2023 20:21
Copy link
Contributor

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

looks good to me! i commented on a few minor nits.

linkerd/app/admin/src/pprof.rs Outdated Show resolved Hide resolved
linkerd/app/admin/src/pprof.rs Outdated Show resolved Hide resolved
linkerd/app/admin/src/pprof.rs Outdated Show resolved Hide resolved
linkerd/app/admin/src/server.rs Outdated Show resolved Hide resolved
linkerd/app/admin/src/server.rs Outdated Show resolved Hide resolved
@olix0r olix0r merged commit 9f7e7ac into main Nov 16, 2023
28 checks passed
@olix0r olix0r deleted the ver/pprof branch November 16, 2023 21:09
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Nov 17, 2023
* Include server address in server error logs (linkerd/linkerd2-proxy#2500)
* dev: v42 (linkerd/linkerd2-proxy#2501)
* Separate tls::ServerName and identity::Id types (linkerd/linkerd2-proxy#2506)
* Use reference-counted strings in dns::Name (linkerd/linkerd2-proxy#2509)
* build(deps): bump tj-actions/changed-files from 39.2.0 to 40.1.1 (linkerd/linkerd2-proxy#2508)
* build(deps): bump actions/checkout from 4.1.0 to 4.1.1 (linkerd/linkerd2-proxy#2485)
* ci: Fix check-each workflow (linkerd/linkerd2-proxy#2511)
* ci: Turn off debuginfo in ci test builds (linkerd/linkerd2-proxy#2512)
* ci: Fix fuzzer listing (linkerd/linkerd2-proxy#2513)
* Use heap indirection to manage type signatures (linkerd/linkerd2-proxy#2510)
* dev: optimize image build (linkerd/linkerd2-proxy#2452)
* dev: Disable nightly install for now (linkerd/linkerd2-proxy#2515)
* meshtls: Extract TLS id verification out of TLS backends (linkerd/linkerd2-proxy#2507)
* Update DEFAULT_OUTBOUND_TCP_QUEUE_CAPACITY to 10K (linkerd/linkerd2-proxy#2521)
* admin: Add optional /debug/pprof/profile endpoint (linkerd/linkerd2-proxy#2516)

Signed-off-by: Oliver Gould <[email protected]>
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Nov 17, 2023
* Include server address in server error logs (linkerd/linkerd2-proxy#2500)
* dev: v42 (linkerd/linkerd2-proxy#2501)
* Separate tls::ServerName and identity::Id types (linkerd/linkerd2-proxy#2506)
* Use reference-counted strings in dns::Name (linkerd/linkerd2-proxy#2509)
* build(deps): bump tj-actions/changed-files from 39.2.0 to 40.1.1 (linkerd/linkerd2-proxy#2508)
* build(deps): bump actions/checkout from 4.1.0 to 4.1.1 (linkerd/linkerd2-proxy#2485)
* ci: Fix check-each workflow (linkerd/linkerd2-proxy#2511)
* ci: Turn off debuginfo in ci test builds (linkerd/linkerd2-proxy#2512)
* ci: Fix fuzzer listing (linkerd/linkerd2-proxy#2513)
* Use heap indirection to manage type signatures (linkerd/linkerd2-proxy#2510)
* dev: optimize image build (linkerd/linkerd2-proxy#2452)
* dev: Disable nightly install for now (linkerd/linkerd2-proxy#2515)
* meshtls: Extract TLS id verification out of TLS backends (linkerd/linkerd2-proxy#2507)
* Update DEFAULT_OUTBOUND_TCP_QUEUE_CAPACITY to 10K (linkerd/linkerd2-proxy#2521)
* admin: Add optional /debug/pprof/profile endpoint (linkerd/linkerd2-proxy#2516)

* proxy: Use debian12 distroless base image

Signed-off-by: Oliver Gould <[email protected]>
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