Installation
Add Tracepanel to your Spring Boot or Ktor app with Gradle or Maven, and open the panel.
Tracepanel for Java is four libraries on Maven Central, under
dev.tracepanel: tracepanel-spring-boot and tracepanel-ktor,
tracepanel-core that both depend on, and tracepanel-junit for
tests. Your app adds one of the first two.
The libraries share the minor version with the agent, 0.16 today, and download
the agent of the same minor the first time. See the
changelog.
Add it to your app
Add the dependency for development only, so the production build leaves it out:
// build.gradle.kts
dependencies {
developmentOnly("dev.tracepanel:tracepanel-spring-boot:0.16.0")
}Run the app with the dev profile, or with Spring Boot DevTools among its
dependencies:
./gradlew bootRun --args='--spring.profiles.active=dev'Spring Boot picks up Tracepanel by its auto-configuration: there is no code to add.
When it turns on
Tracepanel turns on in development only. In Spring Boot, that is a dev,
development or local profile, or Spring Boot DevTools on the classpath.
Elsewhere it stays off, even if the dependency reached a production build by
mistake, and says so once in the log. In Ktor, it is Ktor's development mode.
In both, TRACEPANEL_ENABLED=1 turns it on anyway and TRACEPANEL_ENABLED=0
turns it off. When it is off, it installs nothing.
The agent
The agent is a separate program that keeps the traces, finds the issues and
serves the console. You don't install it. The first time the app starts, the
SDK downloads the agent of its version for your platform, checks it against
the checksum the SDK was built with, and keeps it in ~/.cache/tracepanel/
for every project. Without a network, it runs tracepanel-agent from the
PATH. TRACEPANEL_AGENT_BIN names another one. See
How it works.
The agent comes from Maven Central, as dev.tracepanel:tracepanel-agent,
and from its npm package when Maven Central has none. The checksum is the
binary's, so it holds wherever the agent comes from.
Behind a mirror or a proxy
Where your company mirrors Maven Central, with Artifactory or Nexus, the SDK
uses the mirror that ~/.m2/settings.xml names, with the login of the
server with its id. ${env.NAME} in the login works. A password Maven
encrypted doesn't: set the repository yourself, with the login in its URL.
export TRACEPANEL_MAVEN_REPOSITORY=https://user:token@artifactory.corp/maven2/Gradle keeps its repositories in the build, where the SDK can't read them.
With Gradle and a mirror, set TRACEPANEL_MAVEN_REPOSITORY.
Where the network goes through a proxy, the download goes through
HTTPS_PROXY, as curl and npm read it. NO_PROXY lists the hosts that
skip it. Without these, the SDK uses the JVM's proxy: -Dhttps.proxyHost
and -Dhttps.proxyPort, or -Djava.net.useSystemProxies=true for the
system's.
export HTTPS_PROXY=http://user:password@proxy.corp:3128If the proxy asks for a Basic login, start the JVM with
-Djdk.http.auth.tunneling.disabledSchemes=. Without it, the JDK sends no
login to an https site through a proxy.
Open the panel
Open a page of your app, or its Swagger UI. A badge in the corner opens the
panel. The console is at /__tracepanel__/
on your app. Every response carries Tracepanel-Id and Server-Timing, and
the SDK exposes them on CORS responses, so a single-page app on another
origin reads them too.
The console answers this machine only: the traces hold SQL parameters, logs and
errors, and EXPLAIN runs queries. When the app runs in a container, or on a
shared dev server, TRACEPANEL_CONSOLE_REMOTE=1 lets other machines open it.
Values under a secret's name (password, token, api_key, session, …) are
masked before they are recorded: in the query of an outgoing call's URL, which
also loses its user:password@, and in a SQL parameter bound to such a column
(password = ?, INSERT INTO users (email, password)). A name is read word
by word, as in every SDK: authToken is masked, author and tokenCount
aren't. See Privacy and safety.
Add .tracepanel/ to your .gitignore: it holds the project's traces.