# Configure Elastic APM for Tomcat

**URL:** <https://discuss.elastic.co/t/configure-elastic-apm-for-tomcat/146608>\
**Category:** APM\
**Created:** [August 30, 2018, 4:05am UTC](https://discuss.elastic.co/t/configure-elastic-apm-for-tomcat/146608 "2018-08-30T04:05:22Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![Senz79](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/senz79/32/42874_2.png) [@Senz79](https://discuss.elastic.co/u/Senz79)\
**Post date:** [September 3, 2018, 8:00am UTC](https://discuss.elastic.co/t/configure-elastic-apm-for-tomcat/146608/21 "2018-09-03T08:00:56Z")

</div>

2018-09-03T13:09:05.980+0530 INFO [handler] beater/handlers.go:161 Path /v1/client-side/errors added to request handler  
2018-09-03T13:09:05.981+0530 INFO [handler] beater/handlers.go:161 Path /v1/rum/errors added to request handler  
2018-09-03T13:09:05.981+0530 INFO [handler] beater/handlers.go:161 Path /v1/metrics added to request handler  
2018-09-03T13:09:05.981+0530 INFO [handler] beater/handlers.go:161 Path /v1/rum/sourcemaps added to request handler  
2018-09-03T13:09:05.981+0530 INFO [handler] beater/handlers.go:161 Path /v1/client-side/transactions added to request handler  
2018-09-03T13:09:05.981+0530 INFO [handler] beater/handlers.go:161 Path /v1/rum/transactions added to request handler  
2018-09-03T13:09:05.982+0530 INFO [handler] beater/handlers.go:161 Path /v1/errors added to request handler  
2018-09-03T13:09:05.982+0530 INFO [handler] beater/handlers.go:161 Path /v1/client-side/sourcemaps added to request handler  
2018-09-03T13:09:05.982+0530 INFO [handler] beater/handlers.go:161 Path /v1/transactions added to request handler  
2018-09-03T13:09:05.982+0530 INFO [server] beater/server.go:69 Starting apm-server [59fbf0b6146ca5c50a94d1c435d0cf704e5b2a3f built 2018-08-17 22:12:40 +0000 UTC]. Hit CTRL-C to stop it.  
2018-09-03T13:09:05.983+0530 INFO [server] beater/server.go:70 Listening on: 127.0.0.1:8200  
2018-09-03T13:09:05.983+0530 INFO [server] beater/server.go:75 RUM endpoints disabled  
2018-09-03T13:09:05.984+0530 INFO [request] beater/handlers.go:282 handled request {"request\_id": "40db9bf2-4048-41db-b752-aca56b38bb19", "method": "GET", "URL": "/healthcheck", "content\_length": 0, "remote\_address": "127.0.0.1", "user-agent": "Go-http-client/1.1", "response\_code": 200}

2018-09-03T13:09:05.984+0530 INFO [http\_client] beater/client.go:49 HTTP Server ready  
2018-09-03T13:09:05.985+0530 INFO [onboarding] beater/onboarding.go:36 Publishing onboarding document  
2018-09-03T13:09:06.991+0530 INFO elasticsearch/client.go:708 Connected to Elasticsearch version 6.4.0  
2018-09-03T13:09:06.994+0530 INFO template/load.go:129 Template already exists and will not be overwritten.  
2018-09-03T13:09:07.729+0530 INFO [request] beater/handlers.go:282 handled request {"request\_id": "2cd84490-933f-4f66-a25e-b0d33a4aa45a", "method": "GET", "URL": "/healthcheck", "content\_length": 0, "remote\_address": "127.0.0.1", "user-agent": "co/elastic/apm/shaded/okhttp/3.9.1", "resp  
onse\_code": 200}  
2018-09-03T13:09:17.749+0530 INFO [request] beater/handlers.go:282 handled request {"request\_id": "7b227711-cefb-4927-bd6a-9f4b83b7b681", "method": "GET", "URL": "/healthcheck", "content\_length": 0, "remote\_address": "127.0.0.1", "user-agent": "co/elastic/apm/shaded/okhttp/3.9.1", "resp  
onse\_code": 200}  
2018-09-03T13:09:27.750+0530 INFO [request] beater/handlers.go:282 handled request {"request\_id": "042f5e73-671f-43ec-84ec-2e841a5a763b", "method": "GET", "URL": "/healthcheck", "content\_length": 0, "remote\_address": "127.0.0.1", "user-agent": "co/elastic/apm/shaded/okhttp/3.9.1", "resp  
onse\_code": 200}  
2018-09-03T13:09:36.095+0530 INFO [monitoring] log/log.go:141 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"apm-server":{"server":{"request":{"count":4},"response":{"count":4,"valid":{"count":4,"ok":4}}}},"beat":{"cpu":{"system":{"ticks":249,"time":{"ms":249}},"total  
":{"ticks":420,"time":{"ms":420},"value":420},"user":{"ticks":171,"time":{"ms":171}}},"info":{"ephemeral\_id":"13923c1a-a48e-48e2-9bd0-cfe4875db646","uptime":{"ms":30345}},"memstats":{"gc\_next":4194304,"memory\_alloc":2749872,"memory\_total":5791224,"rss":20779008}},"libbeat":{"config":{"module":{"runn  
ing":0}},"output":{"events":{"acked":1,"batches":1,"total":1},"read":{"bytes":837},"type":"elasticsearch","write":{"bytes":735}},"pipeline":{"clients":1,"events":{"active":0,"published":1,"retry":1,"total":1},"queue":{"acked":1}}},"system":{"cpu":{"cores":4}}}}}  
2018-09-03T13:09:37.752+0530 INFO [request] beater/handlers.go:282 handled request {"request\_id": "642dc002-e260-45d9-bba1-25556e6a1392", "method": "GET", "URL": "/healthcheck", "content\_length": 0, "remote\_address": "127.0.0.1", "user-agent": "co/elastic/apm/shaded/okhttp/3.9.1", "resp  
onse\_code": 200}

---

<div class="post-metadata">

**Author:** ![Senz79](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/senz79/32/42874_2.png) [@Senz79](https://discuss.elastic.co/u/Senz79)\
**Post date:** [September 3, 2018, 8:17am UTC](https://discuss.elastic.co/t/configure-elastic-apm-for-tomcat/146608/22 "2018-09-03T08:17:31Z")

</div>

I found this in the tomcat startup log  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/6/06ec447133fd0dba31e903f06820dc3df7ce97c3.png)

How to provide the service name with JAR?

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [September 3, 2018, 10:29am UTC](https://discuss.elastic.co/t/configure-elastic-apm-for-tomcat/146608/23 "2018-09-03T10:29:38Z")

</div>

See the [configuration documentation](https://www.elastic.co/guide/en/apm/agent/java/current/configuration.html). You can, for example, add an `elasticsearch.properties` file in the same folder as `elastic-apm-agent.jar`.

---

<div class="post-metadata">

**Author:** ![Senz79](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/senz79/32/42874_2.png) [@Senz79](https://discuss.elastic.co/u/Senz79)\
**Post date:** [September 3, 2018, 10:59am UTC](https://discuss.elastic.co/t/configure-elastic-apm-for-tomcat/146608/24 "2018-09-03T10:59:08Z")

</div>

The issue is resolved now I can read both .JAR and Tomcat data in kibana. Below is the snapshot from Kibana. The reason Tomcat was not reading the data was because service\_name was not defined. Thus **elasticapm.properties`file You can place a`elasticapm.properties` in the same directory the agent jar resides in** , is mandatory configuration.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/1/f12ee717fe1797136c3cea434ee8f1c5071ecf0a.png)

Thanks a lot for all the discussion and direction.

---

<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 24, 2018, 6:59am UTC](https://discuss.elastic.co/t/configure-elastic-apm-for-tomcat/146608/25 "2018-09-24T06:59:10Z")

</div>

Closed on September 24, 2018, 6:59am UTC

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

[Previous page](https://discuss.elastic.co/t/configure-elastic-apm-for-tomcat/146608.md?page=1)
