Skip to content

Commit

Permalink
filtering hasdata by processor event
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Jul 22, 2020
1 parent a93c327 commit 43b48e9
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion x-pack/plugins/apm/server/lib/observability_overview/has_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { PROCESSOR_EVENT } from '../../../common/elasticsearch_fieldnames';
import { ProcessorEvent } from '../../../common/processor_event';
import { Setup } from '../helpers/setup_request';

export async function hasData({ setup }: { setup: Setup }) {
Expand All @@ -15,7 +17,24 @@ export async function hasData({ setup }: { setup: Setup }) {
indices['apm_oss.metricsIndices'],
],
terminateAfter: 1,
size: 0,
body: {
size: 0,
query: {
bool: {
filter: [
{
terms: {
[PROCESSOR_EVENT]: [
ProcessorEvent.error,
ProcessorEvent.metric,
ProcessorEvent.transaction,
],
},
},
],
},
},
},
};

const response = await client.search(params);
Expand Down

0 comments on commit 43b48e9

Please sign in to comment.