# Agent sends data to APM server but cannot see the service name in APM UI

**URL:** <https://discuss.elastic.co/t/agent-sends-data-to-apm-server-but-cannot-see-the-service-name-in-apm-ui/158909>\
**Category:** APM\
**Created:** [November 30, 2018, 2:06pm UTC](https://discuss.elastic.co/t/agent-sends-data-to-apm-server-but-cannot-see-the-service-name-in-apm-ui/158909 "2018-11-30T14:06:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shiv94](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shiv94](https://discuss.elastic.co/u/shiv94)\
**Post date:** [November 30, 2018, 2:06pm UTC](https://discuss.elastic.co/t/agent-sends-data-to-apm-server-but-cannot-see-the-service-name-in-apm-ui/158909/1 "2018-11-30T14:06:45Z")

</div>

I am trying to use APM, configured APM server and Java agent in the same machine as shown in the documentation.

apm-server.yml

apm-server:  
host: "localhost:8200"  
output.elasticsearch:  
hosts: ["server-1:9200"]  
indices:  
- index: "apm-%{[beat.version]}-sourcemap"  
when.contains:  
processor.event: "sourcemap"  
- index: "apm-%{[beat.version]}-error-%{+yyyy.MM.dd}"  
when.contains:  
processor.event: "error"  
- index: "apm-%{[beat.version]}-transaction-%{+yyyy.MM.dd}"  
when.contains:  
processor.event: "transaction"  
- index: "apm-%{[beat.version]}-span-%{+yyyy.MM.dd}"  
when.contains:  
processor.event: "span"  
- index: "apm-%{[beat.version]}-metric-%{+yyyy.MM.dd}"  
when.contains:  
processor.event: "metric"  
- index: "apm-%{[beat.version]}-onboarding-%{+yyyy.MM.dd}"  
when.contains:  
processor.event: "onboarding"

I have installed Java agent in the same machine and created a sample helloworld project using servlets and tomacat.

setenv.sh

export CATALINA\_OPTS="$CATALINA\_OPTS -javaagent:/root/elastic-apm-agent-1.1.0.jar"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.service\_name=my-service"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.application\_packages=org.example"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.server\_urls=http://localhost:8200"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.active=true"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.capture\_body=all"  
export CATALINA\_OPTS="$CATALINA\_OPTS -Delastic.apm.log\_level=DEBUG"

When I start the tomcat server I can see a log entry in APM server as following

2018-11-29T10:09:35.913-0500 INFO template/load.go:82 Loading template for Elasticsearch version: 6.4.1  
2018-11-29T10:09:36.159-0500 INFO template/load.go:145 Elasticsearch template with name 'apm-6.5.1' loaded  
2018-11-29T10:09:36.159-0500 INFO pipeline/output.go:105 Connection to backoff(elasticsearch([http://server-1:9200](http://server-1:9200))) established  
2018-11-29T10:18:31.520-0500 INFO [request] beater/common\_handlers.go:272 handled request {"request\_id": "ba321c65-9b2c-4f85-b944-45cda49de6c3", "method": "GET", "URL": "/", "content\_length": 0, "remote\_address": "127.0.0.1", "user-agent": "Java/1.8.0\_191", "response\_code": 200}  
2018-11-29T10:32:57.186-0500 INFO [request] beater/common\_handlers.go:272 handled request {"request\_id": "6ec62ab7-5d17-40a4-ab13-ead9c6ef5300", "method": "GET", "URL": "/", "content\_length": 0, "remote\_address": "127.0.0.1", "user-agent": "Java/1.8.0\_191", "response\_code": 200}  
2018-11-29T15:02:48.719-0500 INFO [request]

But why can't I see the service name in APM UI and dashboards

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/e/ae964c3053f8ffd9d09d0af1622cbb20f11501be.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/4/441474c99d89fd09dac51f7120c13405bba14fbd.png)

---

<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:** [November 30, 2018, 3:05pm UTC](https://discuss.elastic.co/t/agent-sends-data-to-apm-server-but-cannot-see-the-service-name-in-apm-ui/158909/2 "2018-11-30T15:05:01Z")

</div>

Hi,

Thanks for trying out Elastic APM!

> [@shiv94](#):
>
> {"request\_id": "6ec62ab7-5d17-40a4-ab13-ead9c6ef5300", "method": "GET", "URL": "/", "content\_length": 0, "remote\_address": "127.0.0.1", "user-agent": "Java/1.8.0\_191", "response\_code": 200}

That is only a log for the healthcheck and it seems like no actual data has made it to the server, that would go to the URL `/v2/events`.

> [@shiv94](#):
>
> I have installed Java agent in the same machine and created a sample helloworld project using servlets and tomacat.

The agent currently only supports `HttpServlet`s, this is something to be aware of.

If you have used `HttpServlet`s and it's still not working, please enable debug logging for the agent and upload the whole agent log here.

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![shiv94](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shiv94](https://discuss.elastic.co/u/shiv94)\
**Post date:** [November 30, 2018, 3:47pm UTC](https://discuss.elastic.co/t/agent-sends-data-to-apm-server-but-cannot-see-the-service-name-in-apm-ui/158909/3 "2018-11-30T15:47:10Z")

</div>

Thanks for the response. I have used HttpServlets, there was a problem with tomcat server. your information helped me to find a solution.

Thanks 🙂

---

<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:** [November 30, 2018, 3:58pm UTC](https://discuss.elastic.co/t/agent-sends-data-to-apm-server-but-cannot-see-the-service-name-in-apm-ui/158909/4 "2018-11-30T15:58:41Z")

</div>

If you could take the time, it would be great if you could describe your solution as it might help others with similar problems 🙂

---

<div class="post-metadata">

**Author:** ![shiv94](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@shiv94](https://discuss.elastic.co/u/shiv94)\
**Post date:** [November 30, 2018, 4:18pm UTC](https://discuss.elastic.co/t/agent-sends-data-to-apm-server-but-cannot-see-the-service-name-in-apm-ui/158909/5 "2018-11-30T16:18:55Z")

</div>

yeah sure.

Tomcat server was running already and I tried to start the tomcat server again it showed me the output as

Using CATALINA\_BASE: /opt/apache-tomcat-8.5.35  
Using CATALINA\_HOME: /opt/apache-tomcat-8.5.35  
Using CATALINA\_TMPDIR: /opt/apache-tomcat-8.5.35/temp  
Using JRE\_HOME: /usr  
Using CLASSPATH: /opt/apache-tomcat-8.5.35/bin/bootstrap.jar:/opt/apache-tomcat-8.5.35/bin/tomcat-juli.jar  
Tomcat started.

But, in the logs I found

Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed  
at org.apache.catalina.connector.Connector.initInternal(Connector.java:995)  
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)  
... 12 more  
Caused by: java.net.BindException: Address already in use

I killed the existing process and started the tomcat server again then in the logs I can see the transactions.

---

<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:** [December 21, 2018, 12:19pm UTC](https://discuss.elastic.co/t/agent-sends-data-to-apm-server-but-cannot-see-the-service-name-in-apm-ui/158909/6 "2018-12-21T12:19:02Z")

</div>

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