# No services were found

**URL:** <https://discuss.elastic.co/t/no-services-were-found/158722>\
**Category:** APM\
**Created:** [November 29, 2018, 9:40am UTC](https://discuss.elastic.co/t/no-services-were-found/158722 "2018-11-29T09:40:18Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![b0rr3g0](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@b0rr3g0](https://discuss.elastic.co/u/b0rr3g0)\
**Post date:** [November 29, 2018, 9:40am UTC](https://discuss.elastic.co/t/no-services-were-found/158722/1 "2018-11-29T09:40:18Z")

</div>

Hi there,

Im trying to set up a full APM e2e scenario with the following stack:  
ELK 6.5.1  
APM 6.5.1  
APM Agent for Java: 1.1.0  
Microservices: Spring Boot 2.1

My set up for each of the microservices is:  
java -javaagent:elastic-apm-agent-1.1.0.jar  
-Delastic.apm.service\_name=myservice  
-Delastic.apm.server\_url=http://apm-server:8200  
-Delastic.apm.application\_packages=com.mypackage  
-jar myservice.jar

Everything is working fine so far as I am to able to see the traces in the timeline but the issue is that in the services tab I see "No services were found" when I should see it.

 ![Selecci%C3%B3n_282](https://us1.discourse-cdn.com/elastic/original/3X/d/b/dbcfc354f29ffb7f555f555dbe9f6b098589a8c4.png)

 ![Selecci%C3%B3n_283](https://us1.discourse-cdn.com/elastic/original/3X/4/9/497b266c8e90f99e91402704db35119b2ce8efb3.png)

Any tips about what I am doing wrong?

Thanks a lot.  
David

---

<div class="post-metadata">

**Author:** ![sqren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sqren/32/26110_2.png) [@sqren](https://discuss.elastic.co/u/sqren)\
**Post date:** [November 29, 2018, 2:58pm UTC](https://discuss.elastic.co/t/no-services-were-found/158722/2 "2018-11-29T14:58:50Z")

</div>

Hi David,

That's very interesting.  
Just so I understand correctly: On the "Services" tab you see "No services were found", but if you click "Traces" you see a list of traces that you can click on, and thereby get to the second screenshot?

Couple of things to try:

- The search query `context.service.name :*` should not make any difference, but try to clear it - just in case.
- Try expanding the time range. Right now it is 24 hours. What if you change it to 30 days?

If the above steps fail, try running the following query in Kibana Dev Tools:

```auto
GET apm*/_search
{
  "bool": {
    "filter": [
      {
        "bool": {
          "should": [
            { "term": { "processor.event": "transaction" } },
            { "term": { "processor.event": "error" } }
          ]
        }
      }
    ]
  }
}

```

It should return all the transaction/error documents that are used to generate the service list. I'm curious to hear if it comes back empty.

---

<div class="post-metadata">

**Author:** ![cmcornejocrespo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cmcornejocrespo/32/37946_2.png) [@cmcornejocrespo](https://discuss.elastic.co/u/cmcornejocrespo)\
**Post date:** [November 29, 2018, 8:09pm UTC](https://discuss.elastic.co/t/no-services-were-found/158722/3 "2018-11-29T20:09:01Z")

</div>

Hi Søren,

Thanks for the reply.

I work alongside David and I've been trying what you suggested and have the following outcome:

- I have removed the search query and still no see services
- I have expanded the range and the same problem
- When I try out your query I get:  
 ![Untitled](https://us1.discourse-cdn.com/elastic/original/3X/8/7/87ae044ef39fe164e97e273648ec94fb9e182d09.png)

My apm-server setup is:

 ![apm](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bbc59a03c6191b0b2ea8a0e340bf8b1cb651138f.png)

Thanks for your help again.  
Carlos M.

---

<div class="post-metadata">

**Author:** ![sqren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sqren/32/26110_2.png) [@sqren](https://discuss.elastic.co/u/sqren)\
**Post date:** [November 29, 2018, 9:28pm UTC](https://discuss.elastic.co/t/no-services-were-found/158722/4 "2018-11-29T21:28:46Z")

</div>

Hi Carlos,

My bad. The query should have been:

```auto
GET apm*/_search
{
  "query": {
    "bool": {
      "filter": [
        {
          "bool": {
            "should": [
              {
                "term": {
                  "processor.event": "transaction"
                }
              },
              {
                "term": {
                  "processor.event": "error"
                }
              }
            ]
          }
        }
      ]
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![cmcornejocrespo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cmcornejocrespo/32/37946_2.png) [@cmcornejocrespo](https://discuss.elastic.co/u/cmcornejocrespo)\
**Post date:** [November 30, 2018, 7:01am UTC](https://discuss.elastic.co/t/no-services-were-found/158722/5 "2018-11-30T07:01:23Z")

</div>

Hi Søren,

Attaching the output in a [gist](https://gist.github.com/cmcornejocrespo/798dac62ce2229e2093f01f4edc76a3c#file-query-output)

Hope it helps.

Regards,  
Carlos M.

---

<div class="post-metadata">

**Author:** ![Sam21](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Sam21](https://discuss.elastic.co/u/Sam21)\
**Post date:** [November 30, 2018, 10:19am UTC](https://discuss.elastic.co/t/no-services-were-found/158722/6 "2018-11-30T10:19:04Z")

</div>

Hi Carlos,

Can you please help me to understand how did you get Traces tab beside Services on APM UI.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![sqren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sqren/32/26110_2.png) [@sqren](https://discuss.elastic.co/u/sqren)\
**Post date:** [November 30, 2018, 10:41am UTC](https://discuss.elastic.co/t/no-services-were-found/158722/7 "2018-11-30T10:41:44Z")

</div>

Great, so we've established that you have transaction documents in Elasticsearch.  
The following is the endpoint that returns the list of services to the UI. By accessing it directly do you get an error or a 200 response? And is the response empty or not?  
`<kibana host>/api/apm/services?start=2018-01-29T10%3A36%3A11.547Z&end=2018-11-30T10%3A36%3A11.547Z`

Please also look in the Kibana logs for errors, after accessing the above url.

Lastly, the following aggregation is exactly what is used to build the list of services.

```auto
{
    "size": 0,
    "query": {
      "bool": {
        "filter": [
          {
            "bool": {
              "should": [
                {
                  "term": {
                    "processor.event": "transaction"
                  }
                },
                {
                  "term": {
                    "processor.event": "error"
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "aggs": {
      "services": {
        "terms": {
          "field": "context.service.name",
          "size": 500
        },
        "aggs": {
          "avg": {
            "avg": {
              "field": "transaction.duration.us"
            }
          },
          "agents": {
            "terms": {
              "field": "context.service.agent.name",
              "size": 1
            }
          },
          "events": {
            "terms": {
              "field": "processor.event",
              "size": 2
            }
          }
        }
      }
    }
  }

```

I would be very surprised if the `api/apm/services` endpoint something very differently than the above ES query.

---

<div class="post-metadata">

**Author:** ![AlvaroLobato](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alvarolobato/32/28546_2.png) [@AlvaroLobato](https://discuss.elastic.co/u/AlvaroLobato)\
**Post date:** [November 30, 2018, 5:26pm UTC](https://discuss.elastic.co/t/no-services-were-found/158722/8 "2018-11-30T17:26:01Z")

</div>

Hi Sam21,

The traces view is a new screen related to Distributed Tracing, it comes with 6.5

---

<div class="post-metadata">

**Author:** ![Sam21](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Sam21](https://discuss.elastic.co/u/Sam21)\
**Post date:** [December 1, 2018, 3:35am UTC](https://discuss.elastic.co/t/no-services-were-found/158722/9 "2018-12-01T03:35:12Z")

</div>

Hi Alvaro,

Thanks for responding. I am using APM-Server version 6.5.0. Do we require to make any specific configuration to enable distributed tracing?

---

<div class="post-metadata">

**Author:** ![cmcornejocrespo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cmcornejocrespo/32/37946_2.png) [@cmcornejocrespo](https://discuss.elastic.co/u/cmcornejocrespo)\
**Post date:** [December 3, 2018, 4:07pm UTC](https://discuss.elastic.co/t/no-services-were-found/158722/10 "2018-12-03T16:07:07Z")

</div>

Hi Søren,

I get a 400 when accessing the endpoint that returns the list of services to the UI. It complains about fielddata=true on processor.event and context.service.name (which I guess fixing it will solve my problem 😀)

`[illegal_argument_exception] Fielddata is disabled on text fields by default. Set fielddata=true on [processor.event] in ...... Set fielddata=true on [processor.event] .... Set fielddata=true on [context.service.name] i... Set fielddata=true on [context.service.name] ... Set fielddata=true on [context.service.name] .... Set fielddata=true on [context.service.name]...`

I couldn't figure out the query to set fielddata=true on these fields, any tips?

Last bit is that none of these fields are aggregatable, when they should???

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/e/ee14ecc484e2e0ae6e9343ea2d7f07e1e7e82bfc.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/4/b4f414b2a6da63040ee7e90fd8f197b2d0a2c352.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/a/ba91a3c8a2c7cc43f650702df1e7c2e360aad6ab.png)

Regards,  
Carlos M.

---

<div class="post-metadata">

**Author:** ![sqren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sqren/32/26110_2.png) [@sqren](https://discuss.elastic.co/u/sqren)\
**Post date:** [December 4, 2018, 1:41pm UTC](https://discuss.elastic.co/t/no-services-were-found/158722/11 "2018-12-04T13:41:03Z")

</div>

Hi Carlos,

It sounds like the index template for the APM indices is missing. Running the following command should show you a list of the APM index templates:

```auto
GET _template/apm*

```

Normally the template is created automatically when starting apm-server. Can you restart apm-server and look for `template/load.go:129`, and what message it says. For instance:

```auto
INFO template/load.go:129 Template already exists and will not be overwritten.

```

Please view `apm-server.yml` and ensure the following options are not disabled - they are enabled by default:

```auto
setup.template.enabled: true
setup.template.overwrite: true

```

How did you install apm-server? And did you upgrade from a previous version?

---

<div class="post-metadata">

**Author:** ![cmcornejocrespo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cmcornejocrespo/32/37946_2.png) [@cmcornejocrespo](https://discuss.elastic.co/u/cmcornejocrespo)\
**Post date:** [December 4, 2018, 2:35pm UTC](https://discuss.elastic.co/t/no-services-were-found/158722/12 "2018-12-04T14:35:29Z")

</div>

Hi Søren,

I was about to reply to you about what you just said. The problem was indeed due to having disabled (don't know why I had that disabled) the kibana template.

Everything is working fine after enabling it back.

Thank you for the time you spent helping me out.

Kind Regards,  
Carlos M.

---

<div class="post-metadata">

**Author:** ![sqren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sqren/32/26110_2.png) [@sqren](https://discuss.elastic.co/u/sqren)\
**Post date:** [December 4, 2018, 2:46pm UTC](https://discuss.elastic.co/t/no-services-were-found/158722/13 "2018-12-04T14:46:26Z")

</div>

Glad to hear you got it working 👍

---

<div class="post-metadata">

**Author:** ![sqren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sqren/32/26110_2.png) [@sqren](https://discuss.elastic.co/u/sqren)\
**Post date:** [December 4, 2018, 2:46pm UTC](https://discuss.elastic.co/t/no-services-were-found/158722/14 "2018-12-04T14:46:32Z")

</div>


