Skip to main content

StartProfilingServerWithDefaultHandlers

StartProfilingServerWithDefaultHandlers forwards the call to StartProfilingServer Also registers: 1. the prometheus HTTP handler on '/metrics' path shared with the profiling server. 2. A healthcheck (L7) handler on '/healthcheck'. 3. A version handler on '/version' provides information about the specific build. 4. A config handler on '/config' provides a dump of the currently loaded config.

def StartProfilingServerWithDefaultHandlers(
ctx: context.Context,
pprofPort: int,
handlers: map[string]http.Handler
) - > error

Starts the profiling server and registers default HTTP handlers for metrics, health checks, version information, and configuration dumps. This function forwards the call to StartProfilingServer after configuring the global HTTP handler.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for managing the server's lifecycle and cancellation.
pprofPortintThe port number on which the profiling server will listen.
handlersmap[string]http.HandlerA map of additional HTTP handlers to register, where keys are URL paths and values are http.Handler instances.

Returns

TypeDescription
errorAn error if the server fails to start or handlers cannot be configured.