# Elasticsearch APM Configuration for Tomcat

**URL:** <https://discuss.elastic.co/t/elasticsearch-apm-configuration-for-tomcat/245791>\
**Category:** APM\
**Tags:** java\
**Created:** [August 20, 2020, 3:44pm UTC](https://discuss.elastic.co/t/elasticsearch-apm-configuration-for-tomcat/245791 "2020-08-20T15:44:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishakh](https://avatars.discourse-cdn.com/v4/letter/v/c89c15/32.png) [@vishakh](https://discuss.elastic.co/u/vishakh)\
**Post date:** [August 20, 2020, 3:44pm UTC](https://discuss.elastic.co/t/elasticsearch-apm-configuration-for-tomcat/245791/1 "2020-08-20T15:44:47Z")

</div>

**Kibana version** : 7.8.0  
**Elasticsearch version** : 7.8.0  
**APM Server version** : 7.8.0  
**OS Platform** : Amazon Linux  
**Tomcat Version** :  
Server version: Apache Tomcat/8.5.57  
Server built: Jul 16 2020 22:38:29 UTC  
Server number: 8.5.57.0  
OS Name: Linux  
OS Version: 4.14.114-83.126.amzn1.x86\_64  
Architecture: amd64  
JVM Version: 1.8.0\_252-b09  
JVM Vendor: Oracle Corporation

As our deployment doesn't match the generic setup, I'm referring to Apache Tomcat- Unix instructions from: [APM-Agent JAVA Configuration](https://www.elastic.co/guide/en/apm/agent/java/current/setup-javaagent.html)

**Question-1** : To the provided, 4 liner Catalina\_Opts can I add `export CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.secret_token= "` parameter as-well since we need to pass the secret-key for agent

**Question-2** : Currently, we do have an another instrumentation tool running on the same host-server binded to same tomcat. Does having ELK-APM on the same host and binding to same Tomcat process causes any performance bottleneck/impact?

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [August 21, 2020, 7:47am UTC](https://discuss.elastic.co/t/elasticsearch-apm-configuration-for-tomcat/245791/2 "2020-08-21T07:47:29Z")

</div>

Hi @vishakh,

1. Yes, you need to add `secret_token` parameter, or use the newer `api_key` option which uses API keys, which is a bit more flexible (you can have more than one key).

2. It depends.

Performance-wise our agent is engineered to have minimal impact, and having more than one instrumentation should not change that.

However, it's likely that there may be some conflicts, for example if both agents instrument the same classes, one agent could definitely overwrite changes made by the other, which in our case would mean our agent won't be able to monitor some transactions/spans. For example, having two APM agents will very likely make them instrument the same classes, however if the purpose of the agents is not the same (for example scanning dependencies as runtime), there should not have any issue.

Also, on a more technical level, if both agents rely on bytebuddy for bytecode modification, it is more likely to make them compatible because this library is designed for it.

What is the other agent name/purpose ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 11, 2020, 3:47am UTC](https://discuss.elastic.co/t/elasticsearch-apm-configuration-for-tomcat/245791/3 "2020-09-11T03:47:30Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
