{
// 1. Install the core engine FIRST
install(new OtelModule(
new OtelLogback(), // Injects Trace IDs into application logs
new OtelServerMetrics(), // Exports HTTP server metrics (e.g., Netty, Undertow, Jetty)
new OtelHikari() // Traces database connection pools
));
// 2. Add the tracing filter to the routing pipeline
use(new OtelHttpTracing());
// 3. Define routes
get("/books", ctx -> "List of books");
}
{ // 1. Install the core engine FIRST install(new OtelModule( new OtelLogback(), // Injects Trace IDs into application logs new OtelServerMetrics(), // Exports HTTP server metrics (e.g., Netty, Undertow, Jetty) new OtelHikari() // Traces database connection pools )); // 2. Add the tracing filter to the routing pipeline use(new OtelHttpTracing()); // 3. Define routes get("/books", ctx -> "List of books"); }