Skip to content

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

Open

Description

@alban

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?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions