# UI Filters in APM not Working

**URL:** <https://discuss.elastic.co/t/ui-filters-in-apm-not-working/236272>\
**Category:** APM\
**Tags:** ui\
**Created:** [June 9, 2020, 6:38am UTC](https://discuss.elastic.co/t/ui-filters-in-apm-not-working/236272 "2020-06-09T06:38:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vladimiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimiro/32/46559_2.png) [@Vladimiro](https://discuss.elastic.co/u/Vladimiro)\
**Post date:** [June 9, 2020, 6:38am UTC](https://discuss.elastic.co/t/ui-filters-in-apm-not-working/236272/1 "2020-06-09T06:38:10Z")

</div>

Hi,

I am running Kibana 7.7.0. After upgrading to APM Server 7.7.1 (from 7.4.0) I noticed that UI filters in APM page do not work anymore: does not filter by environment, host etc.  
If I look at my browser (Chrome or Firefox) dev tools I can see that requests like

```
`https://kibana.foo.fo/s/myspace/api/apm/services/MyService/transaction_groups?start=2020-06-09T05%3A58%3A58.424Z&end=2020-06-09T06%3A20%3A40.865Z&transactionType=custom&uiFilters=%7B%22kuery%22%3A%22host.hostname%20%3A%20%5C%22myhost%5C%22%22%2C%22environment%22%3A%22dev%22%7D`

```

return results which are not filtered according to the criteria. The strange thing is that filtering works for some time after the indexes are created for the first time: If I stop APM Server, delete all APM indexes and restart, then filtering works for "some time". Can you help me solve this?

Best

Vladimiro

---

<div class="post-metadata">

**Author:** ![dgieselaar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dgieselaar/32/46947_2.png) [@dgieselaar](https://discuss.elastic.co/u/dgieselaar)\
**Post date:** [June 10, 2020, 9:20am UTC](https://discuss.elastic.co/t/ui-filters-in-apm-not-working/236272/2 "2020-06-10T09:20:14Z")

</div>

Hello @Vladimiro! I cannot reproduce your issue right away. I might need some more info:

- What page are you looking at?
- What filters are you applying?
- What data do you expect to be filtered while it's not? does it apply to all pieces of data, or just one instance (e.g. the transaction group list)?
- Are you using the query bar (in the header) to filter, or the [contextual filters](https://www.elastic.co/guide/en/kibana/current/filters.html#contextual-filters)?

---

<div class="post-metadata">

**Author:** ![Vladimiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimiro/32/46559_2.png) [@Vladimiro](https://discuss.elastic.co/u/Vladimiro)\
**Post date:** [June 10, 2020, 9:45am UTC](https://discuss.elastic.co/t/ui-filters-in-apm-not-working/236272/3 "2020-06-10T09:45:46Z")

</div>

Hi Dario,

Any page of APM UI (so under /s/myspace/app/apm#/services) is affected.  
Query bar is not working: all transactions are returned and metrics (TPM, latency percentiles) are calculated by aggregating as if no query was defined. Even if a filter with a non-existing label for example, all transaction data are returned.

Same for contextual filters: e.g. Environment, Host.

Data look stored correctly on the indices: service.environment is set, labels are set, host.hostname is set.

I have just switched back to APM Server 7.4.0 and for the moment everything works well.

Best

Vladimiro

---

<div class="post-metadata">

**Author:** ![Vladimiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimiro/32/46559_2.png) [@Vladimiro](https://discuss.elastic.co/u/Vladimiro)\
**Post date:** [June 12, 2020, 9:10am UTC](https://discuss.elastic.co/t/ui-filters-in-apm-not-working/236272/4 "2020-06-12T09:10:37Z")

</div>

Hi,

Today (after an apm-transaction index rollover) it stopped working again.

best

vladimiro

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [June 12, 2020, 9:49am UTC](https://discuss.elastic.co/t/ui-filters-in-apm-not-working/236272/5 "2020-06-12T09:49:33Z")

</div>

Hi @Vladimiro,  
sorry to hear that you are experiencing these issues.

Please check the APM Server logs for any errors.

It would also be interesting to check if any of the managed indices are unhealthy or show any problems. Navigating to _Management/Index Management_ should give you more information about the healthiness of the indices. Alternatively you could run `GET apm*/_ilm/explain` and check for potential issues.

Additionally I'd be interested in seeing if the APM templates are set up properly - have you customized anything related to ILM or template setup in your `apm-server.yml`?  
For checking if the apm templates are set up as expected, you can run `GET _template/apm*`. This should return you a template with a mapping containing amongst others these `dynamic_templates`:

```auto

        {
          "labels" : {
            "path_match" : "labels.*",
            "mapping" : {
              "type" : "keyword"
            },
            "match_mapping_type" : "string"
          }
        },
        {
          "labels" : {
            "path_match" : "labels.*",
            "mapping" : {
              "type" : "boolean"
            },
            "match_mapping_type" : "boolean"
          }
        },
        {
          "labels" : {
            "path_match" : "labels.*",
            "mapping" : {
              "scaling_factor" : 1000000,
              "type" : "scaled_float"
            },
            "match_mapping_type" : "*"
          }
        },

```

If everything mentioned looks ok, could you maybe provide us an example transaction document containing some of the fields you would like to query on? Please remove all sensitive information before providing a document here.

---

<div class="post-metadata">

**Author:** ![Vladimiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimiro/32/46559_2.png) [@Vladimiro](https://discuss.elastic.co/u/Vladimiro)\
**Post date:** [June 12, 2020, 1:18pm UTC](https://discuss.elastic.co/t/ui-filters-in-apm-not-working/236272/6 "2020-06-12T13:18:36Z")

</div>

Hi Silvia,  
Thanks for your reply. Hereunder the information you requested.

**APM Errors**  
Today I am experiencing occasional errors like this:  
`Jun 12 11:44:44 apm apm-server[32307]: 2020-06-12T13:44:44.949+0200#011ERROR#011[request]#011middleware/log_middleware.go:74#011data validatio n error#011{"request_id": "d9a0d7e9-7b4a-460b-b2ce-4b44da5f61b1", "method": "POST", "URL": "/intake/v2/events", "content_length": -1, "remote_ address": "*", "user-agent": "elasticapm-java/1.12.0", "response_code": 400, "error": "read tcp *:8200->*:40094: i/o timeout"}`

Also visible in the Monitoring graphs

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

**Index Management Errors**  
Nothing here

**ILM Explain**  
[https://pastebin.com/A2pNCaFY](https://pastebin.com/A2pNCaFY)

**APM Templates**  
[https://pastebin.com/gtuJuuSE](https://pastebin.com/gtuJuuSE)

**Sample Transaction**  
[https://pastebin.com/zkx31CKS](https://pastebin.com/zkx31CKS)

I want to point out that my issue is not that I cannot retrieve the transaction I pasted. It is probably collected amidst all the others that are not filtered out by the filters.

Again many thanks for your help.

Best

Vladimiro

---

<div class="post-metadata">

**Author:** ![simitt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simitt/32/106406_2.png) [@simitt](https://discuss.elastic.co/u/simitt)\
**Post date:** [June 16, 2020, 12:56pm UTC](https://discuss.elastic.co/t/ui-filters-in-apm-not-working/236272/7 "2020-06-16T12:56:07Z")

</div>

Hi @Vladimiro,  
thanks for providing these additional details. I cannot see anything suspicious in the files you provided, so I am going to consult with some colleagues and hope we are able to come back to you soon.

---

<div class="post-metadata">

**Author:** ![dgieselaar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dgieselaar/32/46947_2.png) [@dgieselaar](https://discuss.elastic.co/u/dgieselaar)\
**Post date:** [June 16, 2020, 1:08pm UTC](https://discuss.elastic.co/t/ui-filters-in-apm-not-working/236272/8 "2020-06-16T13:08:06Z")

</div>

@Vladimiro: can you share a screenshot of the APM UI, one where you have no filters and one where you have filters applied? Again please scrub out any sensitive information.

---

<div class="post-metadata">

**Author:** ![Vladimiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimiro/32/46559_2.png) [@Vladimiro](https://discuss.elastic.co/u/Vladimiro)\
**Post date:** [June 23, 2020, 4:04am UTC](https://discuss.elastic.co/t/ui-filters-in-apm-not-working/236272/9 "2020-06-23T04:04:43Z")

</div>

Hi @dgieselaar,

Here are 2 screenshots: with and without filtering by environment. Data shown is the same, whilst in dev I have almost no data.

Best

Vladimiro

 ![apm_w_filter](https://us1.discourse-cdn.com/elastic/original/3X/f/b/fbbe2f188d4b4c4443dbde8ce87ff512a7f956e9.png) ![apm_wo_filter](https://us1.discourse-cdn.com/elastic/original/3X/d/e/de046a4bdbf2d8ae2b56ebd820aedd0db78f19ba.png)

---

<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:** [July 21, 2020, 4:04am UTC](https://discuss.elastic.co/t/ui-filters-in-apm-not-working/236272/10 "2020-07-21T04:04:52Z")

</div>

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