Skip to content

Commit

Permalink
Scalability testing: Run Kibana with APM enabled (#125372)
Browse files Browse the repository at this point in the history
* update config to enable apm

* wait 60 sec to get apm traces

* use suggested apm config

* set ELASTIC_APM_MAX_QUEUE_SIZE to collect full traces

* send APM data to Kibana stats

* increase delay shutdown
  • Loading branch information
dmlemeshko authored Feb 11, 2022
1 parent 2c4e476 commit 0f57c23
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Binary file added logs.tar.gz
Binary file not shown.
27 changes: 27 additions & 0 deletions x-pack/test/load/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import { resolve } from 'path';
import { FtrConfigProviderContext } from '@kbn/test';
import { GatlingTestRunner } from './runner';

// These "secret" values are intentionally written in the source.
const APM_SERVER_URL = 'https://142fea2d3047486e925eb8b223559cae.apm.europe-west1.gcp.cloud.es.io';
const APM_PUBLIC_TOKEN = 'pWFFEym07AKBBhUE2i';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const kibanaCommonTestsConfig = await readConfigFile(
require.resolve('../../../test/common/config.js')
Expand Down Expand Up @@ -40,6 +44,29 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
'--no-base-path',
'--env.name=development',
],
env: {
ELASTIC_APM_ACTIVE: process.env.ELASTIC_APM_ACTIVE,
ELASTIC_APM_CENTRAL_CONFIG: false,
ELASTIC_APM_TRANSACTION_SAMPLE_RATE: '0.1',
ELASTIC_APM_BREAKDOWN_METRICS: false,
ELASTIC_APM_CAPTURE_SPAN_STACK_TRACES: false,
ELASTIC_APM_METRICS_INTERVAL: '120s',
ELASTIC_APM_MAX_QUEUE_SIZE: 20480,
ELASTIC_SANITIZE_FIELD_NAMES:
'password,passwd,pwd,secret,*key,*token*,*session*,*credit*,*card*,*auth*,set-cookie,pw,pass,connect.sid',
ELASTIC_APM_ENVIRONMENT: process.env.CI ? 'ci' : 'development',
ELASTIC_APM_SERVER_URL: APM_SERVER_URL,
ELASTIC_APM_SECRET_TOKEN: APM_PUBLIC_TOKEN,
ELASTIC_APM_GLOBAL_LABELS: Object.entries({
simulation: process.env.GATLING_SIMULATIONS
? process.env.GATLING_SIMULATIONS
: 'unknown simulation',
})
.filter(([, v]) => !!v)
.reduce((acc, [k, v]) => (acc ? `${acc},${k}=${v}` : `${k}=${v}`), ''),
},
// delay shutdown by 150 seconds to ensure that APM can report the data it collects during test execution
delayShutdown: 150_000,
},
};
}

0 comments on commit 0f57c23

Please sign in to comment.