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

Running several wasm modules but exposing a single pprof endpoint #107

Open
alban opened this issue Feb 5, 2025 · 0 comments
Open

Running several wasm modules but exposing a single pprof endpoint #107

alban opened this issue Feb 5, 2025 · 0 comments

Comments

@alban
Copy link

alban commented Feb 5, 2025

I have a Go application (inspektor-gadget/inspektor-gadget#3992) that can potentially run several independent WASM modules with wazero. I am trying to use wzprof to expose pprof on a single TCP port, but it does not seem supported:

  • wzprof.Handler() is instantiated for a specific Profiling instance. I cannot call wzprof.ProfilingFor multiple times for a single http handler.
  • wzprof.Handler() cannot use a different path than "/debug/pprof/" because the handler would fail on pprof.go#L146 (strings.CutPrefix), so I cannot use several http handlers on separate URLs for different WASM modules.

At the moment, I listen on a different TCP port for each WASM module. Is it possible to use wzprof.Handler() in a different way to avoid using different TCP ports?

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

No branches or pull requests

1 participant