Skip to content

Commit 54c1fce

Browse files
committed
Add troubleshooting docs
1 parent 9c2c780 commit 54c1fce

File tree

4 files changed

+95
-6
lines changed

4 files changed

+95
-6
lines changed

docs/configuration.asciidoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ So a minimal version of a configuration might look like this:
3636
-Delastic.apm.server_url=http://localhost:8300
3737
----
3838

39-
[[core]]
39+
[[config-core]]
4040
=== Core configuration options
4141
[float]
4242
[[config-active]]
@@ -244,7 +244,7 @@ A list of instrumentations which should be disabled. Valid options are `jdbc`, `
244244
| `elastic.apm.disabled_instrumentations` | `ELASTIC_APM_DISABLED_INSTRUMENTATIONS`
245245
|============
246246

247-
[[http]]
247+
[[config-http]]
248248
=== HTTP configuration options
249249
[float]
250250
[[config-capture-body]]
@@ -329,7 +329,7 @@ NOTE: All errors that are captured during a request by an ignored user agent are
329329
| `elastic.apm.ignore_user_agents` | `ELASTIC_APM_IGNORE_USER_AGENTS`
330330
|============
331331

332-
[[logging]]
332+
[[config-logging]]
333333
=== Logging configuration options
334334
[float]
335335
[[config-logging-log-level]]
@@ -379,7 +379,7 @@ it's content is deleted when the application starts.
379379
| `elastic.apm.logging.log_file` | `ELASTIC_APM_LOGGING.LOG_FILE`
380380
|============
381381

382-
[[reporter]]
382+
[[config-reporter]]
383383
=== Reporter configuration options
384384
[float]
385385
[[config-secret-token]]
@@ -517,7 +517,7 @@ This setting is useful to limit memory consumption if you experience a sudden sp
517517
| `elastic.apm.max_queue_size` | `ELASTIC_APM_MAX_QUEUE_SIZE`
518518
|============
519519

520-
[[stacktrace]]
520+
[[config-stacktrace]]
521521
=== Stacktrace configuration options
522522
[float]
523523
[[config-application-packages]]

docs/index.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ include::./intro.asciidoc[Introduction]
1212
include::./configuration.asciidoc[Configuration]
1313
include::./public-api.asciidoc[API documentation]
1414
include::./opentracing.asciidoc[OpenTracing API documentation]
15+
include::./troubleshooting.asciidoc[Trouble shooting]
1516
endif::[]

docs/troubleshooting.asciidoc

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
ifdef::env-github[]
2+
NOTE: For the best reading experience,
3+
please view this documentation at https://www.elastic.co/guide/en/apm/agent/java[elastic.co]
4+
endif::[]
5+
6+
[[trouble-shooting]]
7+
== Troubleshooting
8+
Something isn't quite working as expected?
9+
Here are some guidelines how to find out what's going wrong.
10+
11+
Don't worry if you can't figure out what the problem is.
12+
Open a topic in the https://discuss.elastic.co/c/apm:[APM discuss forum]
13+
and we will help you out.
14+
If you do so, please attach your debug logs so that we can analyze the problem.
15+
16+
[float]
17+
[[trouble-shooting-logging]]
18+
=== Logging
19+
There are several <<config-logging, logging related configuration options>>.
20+
The most important one is <<config-logging-log-level>>.
21+
Set the log level to `DEBUG` or even `TRACE` to get more information about the behavior of the agent.
22+
23+
24+
[float]
25+
[[trouble-shooting-debugging]]
26+
=== Debugging
27+
Sometimes reading the logs is just not enough to debug a problem.
28+
As the agent is OpenSource and released on Maven Central,
29+
debugging the agent code is really easy.
30+
31+
In order for your IDE to download the sources,
32+
first declare a dependency to the agent.
33+
34+
NOTE: The agent is added via the `-javaagent` flag.
35+
So you have to make sure that you declare the dependency in a way that the agent is not on the classpath twice.
36+
For example,
37+
when you are developing a web application,
38+
make sure that the agent is not packaged in your war in `WEB-INF/lib`.
39+
In the debug window of your IDE,
40+
make sure that `elastic-apm-agent` does not appear in the `-classpath`.
41+
42+
[source,xml]
43+
.pom.xml
44+
----
45+
<dependency>
46+
<groupId>co.elastic.apm</groupId>
47+
<artifactId>elastic-apm-agent</artifactId>
48+
<version>${elastic-apm.version}</version>
49+
<scope>provided</scope>
50+
</dependency>
51+
----
52+
53+
NOTE: Even when setting the `scope` to `provided`,
54+
IntelliJ sometimes adds the agent on the classpath anyway.
55+
One workaround is to set the `scope` to `test`.
56+
57+
[source,groovy]
58+
.build.gradle
59+
----
60+
compileOnly "co.elastic.apm:elastic-apm-agent:$elasticApmVersion"
61+
----
62+
63+
64+
[float]
65+
[[trouble-shooting-common-issues]]
66+
=== Common problems
67+
68+
[float]
69+
[[trouble-shooting-no-data]]
70+
==== There is no data in the Kibana APM UI
71+
72+
The most common source of this problem are connection issues between the agent and the APM server.
73+
74+
If the APM server does not receive data from the agent,
75+
check if the agent is able to establish a connection to the server.
76+
In the agent logs,
77+
look out for logs containing `Elastic APM server is available`
78+
and `Elastic APM server is not available`.
79+
80+
If you see the message `Elastic APM server is not available`,
81+
the agent has problems connecting to the APM server.
82+
Check the setting of <<config-server-url>> and make sure the agent is able to connect to the server.
83+
Try to execute `curl -v <apm-server-url>/healthcheck` from the machine the agent is running on.
84+
The server should respond with a 200 status code.
85+
86+
If the APM server does not respond successfully,
87+
have a look at the APM server logs to verify that the server is actually running.
88+
Also make sure to configure your firewalls so that the host the agent runs on can open HTTP connections to the APM server.

elastic-apm-agent/src/test/resources/configuration.asciidoc.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ So a minimal version of a configuration might look like this:
3333
----
3434

3535
<#list config as category, options>
36-
[[${category?lower_case?replace(" ", "-")}]]
36+
[[config-${category?lower_case?replace(" ", "-")}]]
3737
=== ${category} configuration options
3838
<#list options as option>
3939
<#if !option.tags?seq_contains("internal")>

0 commit comments

Comments
 (0)