# Configuration (/docs/java/configuration)

Tracepanel for Java reads its settings from environment variables. They are
named as in the other SDKs.

## Turn it on and off [#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 [#settings]

| Variable | Default | What it sets |
| --- | --- | --- |
| `TRACEPANEL_ENABLED` | in development: a `dev` or `local` profile or DevTools in Spring Boot, development mode in Ktor | `0` turns Tracepanel off, `1` turns it on |
| `TRACEPANEL_SERVICE` | `spring.application.name`, or Ktor's `ktor.application.id` | the app's name in the console |
| `TRACEPANEL_DIR` | `.tracepanel` | the store, where the agent keeps the traces |
| `TRACEPANEL_ROOT` | the current directory | the project's directory, that paths in stacks are relative to |
| `TRACEPANEL_MAX_TRACES` | `2000` | how many traces the agent keeps |
| `TRACEPANEL_AGENT_BIN` | the agent the SDK downloads | the agent to start, such as a build of your own |
| `TRACEPANEL_AGENT` | `auto` | an agent that runs elsewhere, as `tcp:host:port`, which Tracepanel never starts |
| `TRACEPANEL_CACHE_DIR` | `~/.cache/tracepanel` | where the downloaded agent is kept |
| `TRACEPANEL_CONSOLE_REMOTE` | off | `1` lets other machines open the console, as an app in a container needs |

## Thresholds [#thresholds]

The agent finds the [issues](/docs/issues) by these thresholds:

| Variable | Default | What it sets |
| --- | --- | --- |
| `TRACEPANEL_N_PLUS_ONE_THRESHOLD` | `3` | how many repeats make an N+1 |
| `TRACEPANEL_N_PLUS_ONE_MIN_MS` | `5` | for Redis and other fast stores, the time the repeats must take together |
| `TRACEPANEL_SLOW_SQL_MS` | `100` | a slow query, SQL or MongoDB |
| `TRACEPANEL_SLOW_HTTP_MS` | `500` | a slow outgoing HTTP call |
| `TRACEPANEL_LONG_TRANSACTION_MS` | `500` | a long transaction |
| `TRACEPANEL_QUEUE_WAIT_MS` | `1000` | a task that waited long for a worker |
| `TRACEPANEL_LARGE_RESULT_ROWS` | `1000` | a query without a `LIMIT` that read too many rows |
