Tracepanel

Configuration

The environment variables that turn the Java SDK on and off, name your app, move the store and set the thresholds of issues.

Tracepanel for Java reads its settings from environment variables. They are named as in the other SDKs. The thresholds can also be set in the app's own configuration. See Thresholds.

Turn it on and off

Tracepanel turns on in development only: in Spring Boot with a dev, development or local profile or with DevTools on the classpath, in Ktor in its development mode. TRACEPANEL_ENABLED=0 turns it off, and TRACEPANEL_ENABLED=1 turns it on anywhere.

Settings

VariableDefaultWhat it sets
TRACEPANEL_ENABLEDin development: a dev or local profile or DevTools in Spring Boot, development mode in Ktor0 turns Tracepanel off, 1 turns it on
TRACEPANEL_SERVICEspring.application.name, or Ktor's ktor.application.idthe app's name in the console
TRACEPANEL_DIR.tracepanelthe store, where the agent keeps the traces
TRACEPANEL_ROOTthe current directorythe project's directory, that paths in stacks are relative to
TRACEPANEL_MAX_TRACES2000how many traces the agent keeps
TRACEPANEL_AGENT_BINthe agent the SDK downloadsthe agent to start, such as a build of your own
TRACEPANEL_AGENTautoan agent that runs elsewhere, as tcp:host:port, which Tracepanel never starts
TRACEPANEL_OTLP127.0.0.1:4318where the agent takes OpenTelemetry spans, as HOST:PORT, or off. See The OTLP port
TRACEPANEL_CACHE_DIR~/.cache/tracepanelwhere the downloaded agent is kept
TRACEPANEL_MAVEN_REPOSITORYthe mirror in ~/.m2/settings.xml, else Maven Centralthe Maven repository the agent is downloaded from
TRACEPANEL_NPM_REGISTRYnpm's registry setting, else https://registry.npmjs.org/the npm registry the agent is downloaded from, when the Maven repository has none
HTTPS_PROXY, NO_PROXYthe JVM's proxythe proxy for the agent's download, and the hosts it skips
TRACEPANEL_CONSOLE_REMOTEoff1 lets other machines open the console, as an app in a container needs
TRACEPANEL_CAPTURE_REQUESTon0 leaves out what each request carried: headers, query, cookies, body, session
TRACEPANEL_PROFILEoff1 profiles every trace, not only the requests the panel asks for
TRACEPANEL_PROFILE_MEMORYoff1 counts every profiled trace's memory too, not only a request's that asks. In Spring or Ktor, tracepanel.profile-memory. See Memory
TRACEPANEL_PROFILE_ENABLEDon0 profiles nothing
TRACEPANEL_PROFILE_INTERVAL_MS1how often a profiled trace is sampled, in milliseconds

Thresholds

The agent finds the issues by these thresholds:

VariableDefaultWhat it sets
TRACEPANEL_N_PLUS_ONE_THRESHOLD3how many repeats make an N+1
TRACEPANEL_N_PLUS_ONE_MIN_MS5for Redis and other fast stores, the time the repeats must take together
TRACEPANEL_SLOW_SQL_MS100a slow query, SQL or MongoDB
TRACEPANEL_SLOW_HTTP_MS500a slow outgoing HTTP call
TRACEPANEL_LONG_TRANSACTION_MS500a long transaction
TRACEPANEL_QUEUE_WAIT_MS1000a task that waited long for a worker
TRACEPANEL_LARGE_RESULT_ROWS1000a query without a LIMIT that read too many rows

TRACEPANEL_SLOW_SQL_MS and TRACEPANEL_LONG_TRANSACTION_MS take a limit per database too, by its kind:

export TRACEPANEL_SLOW_SQL_MS=100,snowflake=3000

This holds every database to 100 ms, and Snowflake to 3 s. The kind is the JDBC driver's product name, in lowercase and without spaces, such as postgresql, snowflake or googlebigquery. Without a limit of its own, the agent holds an analytical warehouse, such as Snowflake, BigQuery, Databricks, Redshift or ClickHouse, to 2 s per query.

The thresholds can live in the app's own configuration too, each named after its variable in lowercase with dashes. In Spring's application.properties or YAML:

tracepanel.slow-sql-ms=100,snowflake=3000

In Ktor's application.conf, the same key is tracepanel.slow-sql-ms. A variable that is set wins.

On this page