Java
<!-- status: ga language: java -->
Java: zero-code instrumentation
The standard OpenTelemetry Java agent instruments common frameworks (servlets, Spring, JDBC, HTTP clients, Kafka) without a code change. Nothing Watchtower-specific is installed: the agent reads the standard OTEL_* variables.
Create a project, then an ingestion key (
wti_...) with theingest:tracesscope (addingest:logsandingest:metricsto send those too). The key is shown once.Point the agent at the gateway and pass the key in the
x-watchtower-keyheader:
export OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.example.com
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS=x-watchtower-key=wti_YOUR_KEY
export OTEL_SERVICE_NAME=my-serviceDownload
opentelemetry-javaagent.jarfrom the opentelemetry-java-instrumentation releases and start the service with it. The agent appends/v1/traces,/v1/logsand/v1/metricsto the endpoint.
java -javaagent:/opt/otel/opentelemetry-javaagent.jar -jar app.jarIn containers set JAVA_TOOL_OPTIONS=-javaagent:/opt/otel/opentelemetry-javaagent.jar instead of editing the command line.
Send one request to the service, then open the project's onboarding screen: it turns green when the first span arrives. Open the trace in the trace explorer.
Database findings and queues
The Database tab lists N+1 queries (10 or more child DB spans with one normalised statement under one parent) and wait states (spans carrying db.wait_event or db.lock.wait_ms). The Queues tab marks dead letters (names matching *.dlq, *-dlq, *.dead, *-dead, or messaging.destination.dead_letter=true) and lists messaging.message.schema_id values seen.