Skip to content

Expose net/http/pprof handlers#1603

Open
jmunson wants to merge 1 commit into
aptly-dev:masterfrom
jmunson:jmunson/enable-pprof
Open

Expose net/http/pprof handlers#1603
jmunson wants to merge 1 commit into
aptly-dev:masterfrom
jmunson:jmunson/enable-pprof

Conversation

@jmunson

@jmunson jmunson commented Jul 7, 2026

Copy link
Copy Markdown

Expose net/http/pprof handlers under /api/debug/pprof/* when the new enablePprofEndpoint (JSON) / enable_pprof_endpoint (YAML) config option is true. The endpoint is disabled by default.

These are useful for adhoc debugging orperformance analysis, or ongoing performance monitoring when polled with Grafana Alloy

Tests have been added to demonstrate the endpoints responding when enabling and not when not enabled - I'm unsure how much value that is adding but wanted to err on the safe side of test coverage, but feel free to drop them if they are superfluous.

Checklist

  • allow Maintainers to edit PR (rebase, run coverage, help with tests, ...)
  • unit-test added (if change is algorithm)
  • functional test added/updated (if change is functional)
  • man page updated (if applicable)
  • bash completion updated (if applicable)
  • documentation updated
  • author name in AUTHORS

@jmunson jmunson force-pushed the jmunson/enable-pprof branch 3 times, most recently from 76aa2d2 to 3f4ba90 Compare July 8, 2026 15:23
@jmunson

jmunson commented Jul 8, 2026

Copy link
Copy Markdown
Author

Sorry when I wrote this I only ran my own new tests and didn't notice I broke the other tests, so I'm chipping away at those still

@jmunson

jmunson commented Jul 8, 2026

Copy link
Copy Markdown
Author

I believe the above timeout is unrelated so I'll leave this as is but let me know if you'd like me to take a deeper look

(edit: triggered it again with a no-op change, seems fine now)

enablePprofEndpoint (JSON) / enable_pprof_endpoint (YAML) config option
is true. The endpoint is disabled by default.
@jmunson jmunson force-pushed the jmunson/enable-pprof branch from 3f4ba90 to 953c587 Compare July 8, 2026 16:55
@neolynx neolynx self-assigned this Jul 8, 2026
@neolynx neolynx requested a review from a team July 8, 2026 18:22
@neolynx neolynx modified the milestones: 1.6.0, 1.6.4 Jul 8, 2026
@neolynx neolynx added the needs review Ready for review & merge label Jul 8, 2026
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.07%. Comparing base (f59b0d2) to head (953c587).

Files with missing lines Patch % Lines
api/router.go 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1603      +/-   ##
==========================================
- Coverage   77.37%   77.07%   -0.31%     
==========================================
  Files         165      165              
  Lines       15747    15763      +16     
==========================================
- Hits        12185    12150      -35     
- Misses       2356     2410      +54     
+ Partials     1206     1203       -3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Ready for review & merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants