Closes #84094 by adding configuration xpack.apm.maxServiceSelection. (#86234)

This commit is contained in:
Oliver Gupte 2020-12-17 09:15:07 -05:00 committed by GitHub
parent bf60796cd3
commit 1007c8713a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -44,6 +44,7 @@ export const config = {
telemetryCollectionEnabled: schema.boolean({ defaultValue: true }),
metricsInterval: schema.number({ defaultValue: 30 }),
maxServiceEnvironments: schema.number({ defaultValue: 100 }),
maxServiceSelection: schema.number({ defaultValue: 50 }),
}),
};
@ -76,6 +77,7 @@ export function mergeConfigs(
apmConfig.serviceMapMaxTracesPerRequest,
'xpack.apm.ui.enabled': apmConfig.ui.enabled,
'xpack.apm.maxServiceEnvironments': apmConfig.maxServiceEnvironments,
'xpack.apm.maxServiceSelection': apmConfig.maxServiceSelection,
'xpack.apm.ui.maxTraceItems': apmConfig.ui.maxTraceItems,
'xpack.apm.ui.transactionGroupBucketSize':
apmConfig.ui.transactionGroupBucketSize,

View file

@ -21,7 +21,8 @@ export async function getServiceNames({
setup: Setup;
searchAggregatedTransactions: boolean;
}) {
const { apmEventClient } = setup;
const { apmEventClient, config } = setup;
const maxServiceSelection = config['xpack.apm.maxServiceSelection'];
const params = {
apm: {
@ -40,7 +41,7 @@ export async function getServiceNames({
services: {
terms: {
field: SERVICE_NAME,
size: 50,
size: maxServiceSelection,
min_doc_count: 0,
},
},

View file

@ -79,6 +79,9 @@ export async function inspectSearchParams(
case 'xpack.apm.maxServiceEnvironments':
return 100;
case 'xpack.apm.maxServiceSelection':
return 50;
}
},
}