# Environment filtering on the Metrics tab

**URL:** <https://discuss.elastic.co/t/environment-filtering-on-the-metrics-tab/345725>\
**Category:** Elastic Observability\
**Created:** [October 25, 2023, 12:33pm UTC](https://discuss.elastic.co/t/environment-filtering-on-the-metrics-tab/345725 "2023-10-25T12:33:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![igorlovich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igorlovich/32/126861_2.png) [@igorlovich](https://discuss.elastic.co/u/igorlovich)\
**Post date:** [October 25, 2023, 12:33pm UTC](https://discuss.elastic.co/t/environment-filtering-on-the-metrics-tab/345725/1 "2023-10-25T12:33:43Z")

</div>

After upgrading the stack to 8.10 from 8.9 the filtering by environment on the Metrics tab (in APM) stopped working.

Specifying an Environment (e.g. production) results in no data showing. However selecting "All" in the drop down and adding service.environment:"production" to the search bar works correctly. This only happens on the Metrics tab; the other ones work fine.

Any ideas ?

Thank you

---

<div class="post-metadata">

**Author:** ![igorlovich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igorlovich/32/126861_2.png) [@igorlovich](https://discuss.elastic.co/u/igorlovich)\
**Post date:** [October 27, 2023, 6:23am UTC](https://discuss.elastic.co/t/environment-filtering-on-the-metrics-tab/345725/2 "2023-10-27T06:23:28Z")

</div>

I think I found the direct cause, but not an explanation. On the Metrics tab if I click on the menu of one of the visualizations (e.g. System memory usage) and choose "Explore data in Discover", on the discover page two filters are added  
service.name and service.environment; both have the SAME VALUE. service.environment is filtered on the service name instead of the value selected on the Environment drop-down on the APM page.

---

<div class="post-metadata">

**Author:** ![nekirc](https://avatars.discourse-cdn.com/v4/letter/n/85f322/32.png) [@nekirc](https://discuss.elastic.co/u/nekirc)\
**Post date:** [November 5, 2023, 4:52pm UTC](https://discuss.elastic.co/t/environment-filtering-on-the-metrics-tab/345725/3 "2023-11-05T16:52:32Z")

</div>

**Kibana version 8.10.4** :

**Elasticsearch version 8.10.4** :

**APM Server version 8.10.4** :

It is exactly as you wrote, after upgrading kibana to 8.10.4 and apm server to 8.10.4 the dropdown list stopped filtering the data correctly putting the same value of the service.name field into service.environment which cause to break all visualizations in APM \> Services \> _service\_name_ \> Metrics

Worth to mention this was working in 7.x.x Kibana / APM versions.

---

<div class="post-metadata">

**Author:** ![nekirc](https://avatars.discourse-cdn.com/v4/letter/n/85f322/32.png) [@nekirc](https://discuss.elastic.co/u/nekirc)\
**Post date:** [November 6, 2023, 7:52am UTC](https://discuss.elastic.co/t/environment-filtering-on-the-metrics-tab/345725/4 "2023-11-06T07:52:44Z")

</div>

I have found this was already posted as a bug and is well described on github page:

> <https://github.com/elastic/apm/issues/833>
>
> \*\*Describe the bug\*\*
> Metrics tab in observability APM is missing data. 
> 
> \*\*To… Reproduce\*\*
> We use nodejs APM integration where \`SERVICE\` env variable is set to \`ms-npp\` and \`ENVIRONMENT\` env variable is set to \`dev\`.
> Steps to reproduce the behavior:
> 1. Open: Observability -\> APM-\> Services
> 2. Pick \`Metrics\` tab
> 3. Choose \`dev\` from drop-down menu.
> 4. Metrics are missing
> 
> \*\*Expected behavior\*\*
> Metrics should be visible.
> 
> \*\*Debug logs\*\*
> 
> It looks like \`service.environment\` is populated with wrong value in Metrics dashboard as exploring dashboard data in discovery show that \`service.environment\` is assigned a service name. Fixing manually search filter in discovery show collected values. 
> 
> \<img width="2451" alt="Screenshot 2023-10-30 at 12 20 35" src="https://github.com/elastic/apm/assets/1272652/4fc1bcf1-e07e-4103-a75f-6c17e00e9f7f"\>
> 
> \<img width="875" alt="Screenshot 2023-10-30 at 12 21 54" src="https://github.com/elastic/apm/assets/1272652/c84c7fbd-e52c-4f56-8b5d-e5ad5db887d1"\>

---

<div class="post-metadata">

**Author:** ![igorlovich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igorlovich/32/126861_2.png) [@igorlovich](https://discuss.elastic.co/u/igorlovich)\
**Post date:** [November 6, 2023, 10:27am UTC](https://discuss.elastic.co/t/environment-filtering-on-the-metrics-tab/345725/5 "2023-11-06T10:27:27Z")

</div>

Thanks. I have referenced this discussion in the Bug report. I would imagine that if this was a widespread problem there would have been a lot more bug reports. It must be a specific use-case that provokes this behavior .

---

<div class="post-metadata">

**Author:** ![igorlovich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igorlovich/32/126861_2.png) [@igorlovich](https://discuss.elastic.co/u/igorlovich)\
**Post date:** [November 13, 2023, 3:44pm UTC](https://discuss.elastic.co/t/environment-filtering-on-the-metrics-tab/345725/6 "2023-11-13T15:44:30Z")

</div>

As announced in the bug report above upgrading to 8.11 resolved the problem
