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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for managing the server's lifecycle and cancellation. |
| pprofPort | int | The port number on which the profiling server will listen. |
| handlers | map[string]http.Handler | A map of additional HTTP handlers to register, where keys are URL paths and values are http.Handler instances. |
Returns
| Type | Description |
|---|---|
error | An error if the server fails to start or handlers cannot be configured. |