Skip to content

Add pprof HTTP endpoints to metrics server

Tomasz Maczukin requested to merge feature/add-pprof-integration into master

What does this MR do?

Adds pprof endpoints to existing metrics server, to help debug what's happening with Runner while it is running.

Why was this MR needed?

In v1.8.0 we've introduced HTTP metrics server with Prometheus metrics collected while Runner is working. Those information are helpful however we've noticed that in some cases we need to have a detailed information about data flows and function calls inside of a running Runner's process. That's why we've decided to add pprof integration.

After merging this MR pprof endpoints will be available on the same host:port as the integrated metrics server, under the /debug/pprof/ URI.

Are there points in the code the reviewer needs to double check?

I've analyzed the net/http/pprof package to check if importing it (which automatically registers some endpoints to an existing HTTP server) will add any complexity or resources usage overhead. In my opinion it doesn't add anything until the endpoint is called (and only then data is collected). But it would be nice if someone else would look on this.

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Tests
    • Added for this feature/bug
    • All builds are passing
  • Branch has no merge conflicts with master (if you do - rebase it please)

What are the relevant issue numbers?

/cc @ayufan

Merge request reports