Adding a method to enable pprof endpoints on Echo#1696
Conversation
In order to avoid making the pprof endpoints public in the same address than Echo is listening, a new goroutine is launched whith a stdlib http.Server that binds to localhost.
Codecov Report
@@ Coverage Diff @@
## master #1696 +/- ##
==========================================
- Coverage 84.72% 84.50% -0.22%
==========================================
Files 29 29
Lines 1938 1943 +5
==========================================
Hits 1642 1642
- Misses 188 193 +5
Partials 108 108
Continue to review full report at Codecov.
|
|
I'm not sure if it makes sense for this PR to not fail codecov. |
|
Would it be more reasonable to add this as a recipe to echo cookbook. To demonstrate how to add this feature (its only 4 lines).
Sidenote: some people even argue that underscore imports is best to add into application main.go to have those magic parts clearly visible at the top of application. |
|
I guess I overestimated my desire of "Use Echo and forget everything else" (patent pending 😉) |
|
This has been addressed earlier in #1591 (with PR #1592) and resulted in PR labstack/echo-contrib#42 which adds a pprof middleware without bloating the core. @pafuent So I think we should close this in favor of a dedicated middleware and add a cookbook entry instead. |
In order to avoid making the pprof endpoints public in the same address than Echo is listening, a new goroutine is launched with a stdlib http.Server that binds to localhost.