Agent-skills observability-edot-java-instrument
install
source · Clone the upstream repo
git clone https://github.com/elastic/agent-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/elastic/agent-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/observability/edot-java-instrument" ~/.claude/skills/elastic-agent-skills-observability-edot-java-instrument && rm -rf "$T"
manifest:
skills/observability/edot-java-instrument/SKILL.mdsource content
EDOT Java Instrumentation
Read the setup guide before making changes:
Guidelines
- Use
(download from Maven Central, not a Maven/Gradle compile dependency)elastic-otel-javaagent.jar - Attach via
or-javaagent:/path/to/elastic-otel-javaagent.jar
— without this the agent does nothingJAVA_TOOL_OPTIONS="-javaagent:/path/to/elastic-otel-javaagent.jar" - Set exactly three required environment variables:
OTEL_SERVICE_NAME
— must be the managed OTLP endpoint or EDOT Collector URL. Never use an APM Server URL (noOTEL_EXPORTER_OTLP_ENDPOINT
, noapm-server
, no:8200
)/intake/v2/events
—OTEL_EXPORTER_OTLP_HEADERS
or"Authorization=ApiKey <key>""Authorization=Bearer <token>"
- Do NOT set
,OTEL_TRACES_EXPORTER
, orOTEL_METRICS_EXPORTER
— the defaults are already correctOTEL_LOGS_EXPORTER - Never run both classic Elastic APM agent and EDOT agent on the same JVM
Examples
See the EDOT Java setup guide for complete Dockerfile and docker-compose examples.