Skip to content

Commit 7056827

Browse files
authoredMar 13, 2025··
Merge pull request #103 from jackshirazi/java-troubleshooting
Update troubleshooting.md
2 parents 373d64a + 18be2cd commit 7056827

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed
 

‎docs/_edot-sdks/java/troubleshooting.md

+49-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,52 @@ parent: EDOT Java
77

88
# Troubleshooting the EDOT Java Agent
99

10-
TODO
10+
The sections below are in the order you should follow, unless you have already identified the section you need.
11+
12+
This guide assumes you have tested the other components in the route from application+agent to Elastic Observability (eg collector or APM server, Elasticsearch, and Kibana) and that the problem has been isolated to the application+agent.
13+
14+
## General
15+
16+
Ensure you have set a service name (eg `-Dotel.service.name=Service1` or environment variable `OTEL_SERVICE_NAME` set to `Service1`) otherwise by default the data (traces, metrics, logs) will be sent to `unknown_service_java` - you may be getting data but it may all be under that service
17+
18+
## Connectivity to endpoint
19+
20+
Check _from_ the host/VM/pod/container/image running the app, that connectivity is available to the APM server or collector. The examples here use a default URL, which you should replace with the endpoint you are using:
21+
22+
- OpenTelemetry or EDOT collector without authentication: `curl -i http://127.0.0.1:4318/v1/traces -X POST -d '{}' -H content-type:application/json`
23+
- APM server without authentication: `curl --verbose -X GET http://127.0.0.1:8200`
24+
- APM server with secret token authentication: `curl -X POST http://127.0.0.1:8200/ -H "Authorization: Bearer <secret_token>"`
25+
- APM server with API key authentication: `curl -X POST http://127.0.0.1:8200/ -H "Authorization: ApiKey <api_key>"`
26+
27+
The collector should produce output similar to
28+
```
29+
{"partialSuccess":{}}
30+
```
31+
32+
The APM server should produce output similar to
33+
```
34+
{
35+
"build_date": "2021-12-18T19:59:06Z",
36+
"build_sha": "24fe620eeff5a19e2133c940c7e5ce1ceddb1445",
37+
"publish_ready": true,
38+
"version": "8.17.3"
39+
}
40+
```
41+
42+
43+
## Is it the agent?
44+
45+
Determine if the issue is related to the agent by
46+
47+
1. Starting the application with no agent and seeing if the issue is not present, but then the issue is again present when restarting with the agent
48+
2. Check end-to-end connectivity without the agent by running one or more of the example apps in https://github.com/elastic/elastic-otel-java/blob/main/examples/troubleshooting/README.md . These use the OpenTelemetry SDK rather than the auto-instrumentation, ie there is no agent present, and create traces, metrics and logs, so provide confirmation that the issue is specific to the agent or can otherwise identify that the issue is something else
49+
50+
## Agent DEBUG
51+
52+
Debug output is enabled with `-Dotel.javaagent.debug=true` or environment variable `OTEL_JAVAAGENT_DEBUG` to `true`.
53+
54+
Once debug is enabled, look for:
55+
- Errors and exceptions
56+
- For the expected traces or metrics - or lack of them (maybe the [technology isn't instrumented?](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md))
57+
58+

0 commit comments

Comments
 (0)