initKtorServletService

fun initKtorServletService(initKtor: Application.() -> Unit = {}, servletInit: HttpServletGroup.() -> Unit = {})

Initializes the Ktor servlet service, metrics, Zipkin tracing, and health checks.

This method should be called once during subclass initialization, after adding any extra services with addService. It conditionally sets up admin servlets via an embedded Ktor server, then delegates to initMetricsAndHealthChecks to wire up Prometheus metrics, JMX reporting, Zipkin tracing, health checks, and the Guava ServiceManager.

Parameters

initKtor

An optional Ktor Application configuration block for custom Ktor setup.

servletInit

An optional block to register additional servlets in the HttpServletGroup.

Throws

if the service has already been initialized.