diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/RumHome.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/RumHome.tsx index 88d1823f05ccc..26a44180b837d 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/RumHome.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/RumHome.tsx @@ -27,7 +27,7 @@ export function RumHome() { const { isSmall, isXXL } = useBreakPoints(); - const envStyle = isSmall ? {} : { maxWidth: 200 }; + const envStyle = isSmall ? {} : { maxWidth: 500 }; return ( @@ -59,7 +59,7 @@ export function RumHome() { function PageHeader() { const { isSmall } = useBreakPoints(); - const envStyle = isSmall ? {} : { maxWidth: 200 }; + const envStyle = isSmall ? {} : { maxWidth: 400 }; return (
diff --git a/x-pack/plugins/apm/server/lib/rum_client/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/rum_client/__snapshots__/queries.test.ts.snap index f939a9c39c63c..da4a86195f1b6 100644 --- a/x-pack/plugins/apm/server/lib/rum_client/__snapshots__/queries.test.ts.snap +++ b/x-pack/plugins/apm/server/lib/rum_client/__snapshots__/queries.test.ts.snap @@ -64,13 +64,7 @@ Object { }, }, ], - "must_not": Array [ - Object { - "term": Object { - "service.environment": "staging", - }, - }, - ], + "must_not": Array [], }, }, "size": 0, diff --git a/x-pack/plugins/apm/server/lib/rum_client/ui_filters/get_es_filter.test.ts b/x-pack/plugins/apm/server/lib/rum_client/ui_filters/get_es_filter.test.ts new file mode 100644 index 0000000000000..710ea38ddb01d --- /dev/null +++ b/x-pack/plugins/apm/server/lib/rum_client/ui_filters/get_es_filter.test.ts @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getEsFilter } from './get_es_filter'; + +describe('getEfFilters', function () { + it('should return environment in include filters', function () { + const result = getEsFilter({ + browser: ['Chrome'], + environment: ['production'], + }); + + expect(result).toEqual([ + { terms: { 'user_agent.name': ['Chrome'] } }, + { term: { 'service.environment': ['production'] } }, + ]); + }); + + it('should not return environment in exclude filters', function () { + const result = getEsFilter( + { browserExcluded: ['Chrome'], environment: ['production'] }, + true + ); + + expect(result).toEqual([{ terms: { 'user_agent.name': ['Chrome'] } }]); + }); +}); diff --git a/x-pack/plugins/apm/server/lib/rum_client/ui_filters/get_es_filter.ts b/x-pack/plugins/apm/server/lib/rum_client/ui_filters/get_es_filter.ts index 5f587f82e979d..76ef9fb95089f 100644 --- a/x-pack/plugins/apm/server/lib/rum_client/ui_filters/get_es_filter.ts +++ b/x-pack/plugins/apm/server/lib/rum_client/ui_filters/get_es_filter.ts @@ -34,5 +34,8 @@ export function getEsFilter(uiFilters: UxUIFilters, exclude?: boolean) { }; }) as ESFilter[]; - return [...mappedFilters, ...environmentQuery(uiFilters.environment)]; + return [ + ...mappedFilters, + ...(exclude ? [] : environmentQuery(uiFilters.environment)), + ]; }