Skip to content

Commit ebc7b57

Browse files
authored
Clarify that first ElasticApmAttacher.attach() wins (#797)
1 parent 5fccf62 commit ebc7b57

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/setup-attach-api.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ which is part of the JDK distribution and does not typically come with the JRE d
2020
Currently, this does not work in combination with OSGi containers (which includes most application servers).
2121
The symptom is that there will be a lot of exceptions like this: `java.lang.NoClassDefFoundError: co/elastic/apm/agent/servlet/ServletApiAdvice`.
2222

23+
There can only be one agent instance with one configuration per JVM.
24+
So if you deploy multiple web applications to the same application server and call `ElasticApmAttacher.attach()` in each application,
25+
the first `attach()` wins and the second one will be ignored.
26+
That also means that if you are configuring the agent with `elasticapm.properties`,
27+
the application which attaches first gets to decide the configuration.
28+
See the default value description of the <<config-service-name>> configuration option for ways to have different `service.name`s for each deployment.
2329

2430
[float]
2531
[[setup-attach-api-usage]]

0 commit comments

Comments
 (0)