Skip to content

Address godeltaprof/http/pprof side effects and configurations #160

@korniltsev

Description

@korniltsev

When godeltaprof/http/pprof is imported we unconditionally register endpoints into a global default mux.

func init() {
prefix := routePrefix()
http.HandleFunc(prefix+"/debug/pprof/delta_heap", Heap)
http.HandleFunc(prefix+"/debug/pprof/delta_block", Block)
http.HandleFunc(prefix+"/debug/pprof/delta_mutex", Mutex)
}

Some users may not want that or may do this only in some cases deciding at runtime.

Another problem with that approach is that the registered profilers are not configurable - if we introduce any configuration knobs to the profilers - it is impossible to pass them with the current approach.

We may consider creating a new http/pprof/v2 package that does not register to default mux and allows configuring the profilers

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