# Integrations (/docs/java/integrations)

Tracepanel records the parts of your app below with no code of yours. Each is
on as soon as its library is on the classpath.

## Spring Boot [#spring-boot]

Spring Boot 3.5 and 4 with Spring MVC, in Java or Kotlin.

![Swagger UI of a Spring Boot app with the panel docked at the bottom, showing the call tree of GET /api/catalog/products: the controller method, its transaction and two N+1 queries](/screenshots/java-spring-boot.png)

| What | What a trace gets |
| --- | --- |
| Requests | Each request, named by its route (`GET /owners/{id}`), with the controller method that served it as a span. |
| Errors | The exception a handler throws, with your frames and the source around them. An exception the app answers with a 4xx is the answer, not an error. |
| Answers later | A handler that answers later (a Kotlin suspend function, a `Callable`, a `DeferredResult`) is one trace until its answer. A suspend function's queries are in it on whichever thread they run. |
| Tasks and jobs | An `@Async` method's run is a task, linked to the request that queued it. An `@Scheduled` method's run and a `CommandLineRunner`'s or an `ApplicationRunner`'s are jobs. |
| The user | The principal's name from Spring Security, when the app has it, or the user your code names with `Tracepanel.setUser(id, username)`. The username stays on your machine. |

## Ktor [#ktor]

Ktor 3, with the `Tracepanel` plugin installed.

![Swagger UI of a Ktor app with the panel docked at the bottom, showing the call tree of GET /api/catalog/products: the route handler, its transaction and three N+1 queries](/screenshots/java-ktor.png)

| What | What a trace gets |
| --- | --- |
| Calls | Each call, named by its route (`GET /books/{id}`), with its handler as a span of the same name. Its coroutines carry the trace to every thread they run on, so the queries of a suspended transaction on `Dispatchers.IO` are in it. |
| Errors | The exception a call fails with. One that StatusPages answers with a 4xx is the answer, not an error. |
| Pages | An HTML page gets the badge, however it was written, `respondText` or `respondHtml`. |
| The user | The user your code names with `call.tracepanelUser(id, username)`. |

## Libraries [#libraries]

| Library | What Tracepanel records |
| --- | --- |
| JDBC | Each SQL statement, whatever runs it (Spring Data JPA, Hibernate, `JdbcTemplate`, jOOQ, Exposed), with its parameters, the rows it returned and the line of your code that ran it, and each transaction. In Ktor, through the DataSource `Jdbc.dataSource` wraps. `EXPLAIN` runs from the console. |
| HTTP clients | Each call through `RestClient`, `RestTemplate`, `WebClient`, the JDK's `HttpClient` (a bean, or one wrapped with `HttpCalls.wrap(client)`) and Ktor's client with `TracepanelClient`. Each carries a `traceparent`, so the app it reaches links its trace to the call. |
| Redis | Each command through Lettuce (Spring Data Redis, the cache), with its N+1 and duplicates. |
| MongoDB | Each command (Spring Data MongoDB), with its N+1 and duplicates. |
| Kafka, RabbitMQ | Each message a `KafkaTemplate` or a `RabbitTemplate` sends, with its N+1. Each message a `@KafkaListener` or `@RabbitListener` receives is a trace of its own, linked to the one that sent it. |
| Logback | The records written during a request, with the line that logged them. |

A request that carries a W3C `traceparent` continues its caller's trace.
