Skip to content

Commit

Permalink
Update journey to cover flow upto trace waterfall
Browse files Browse the repository at this point in the history
  • Loading branch information
achyutjhunjhunwala committed Jul 28, 2023
1 parent 605a260 commit d3b0971
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 36 deletions.
21 changes: 17 additions & 4 deletions x-pack/performance/journeys/apm_service_inventory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,20 @@ export const journey = new Journey({
})
);
},
}).step('Go to Service Inventory Page', async ({ page, kbnUrl }) => {
await page.goto(kbnUrl.get(`app/apm/services`));
await page.waitForSelector(`[data-test-subj="apmUnifiedSearchBar"]`);
});
})
.step('Navigate to Service Inventory Page', async ({ page, kbnUrl }) => {
await page.goto(kbnUrl.get(`app/apm/services`));
await page.waitForSelector(`[data-test-subj="serviceLink_nodejs"]`);
})
.step('Navigate to Service Overview Page', async ({ page, kbnUrl }) => {
await page.click(`[data-test-subj="serviceLink_nodejs"]`);
await page.waitForSelector(`[data-test-subj="apmMainTemplateHeaderServiceName"]`);
})
.step('Navigate to Transactions tabs', async ({ page, kbnUrl }) => {
await page.click(`[data-test-subj="transactionsTab"]`);
await page.waitForSelector(`[data-test-subj="apmTransactionDetailLinkLink"]`);
})
.step('Wait for Trace Waterfall on the page to load', async ({ page, kbnUrl }) => {
await page.click(`[data-test-subj="apmTransactionDetailLinkLink"]`);
await page.waitForSelector(`[data-test-subj="apmWaterfallButton"]`);
});
93 changes: 61 additions & 32 deletions x-pack/performance/synthtrace_data_generators/apm_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,74 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { apm, timerange } from '@kbn/apm-synthtrace-client';
import { apm, httpExitSpan, timerange } from '@kbn/apm-synthtrace-client';

export function generateData({ from, to }: { from: number; to: number }) {
const range = timerange(from, to);
const synthGo1 = apm
.service({
name: 'synth-go-1',
environment: 'production',
agentName: 'go',
})
.instance('my-instance');
const synthGo2 = apm
.service({ name: 'synth-go-2', environment: 'production', agentName: 'go' })
const transactionName = '240rpm/75% 1000ms';

const synthRum = apm
.service({ name: 'synth-rum', environment: 'production', agentName: 'rum-js' })
.instance('my-instance');
const synthNode = apm
.service({
name: 'synth-node-1',
environment: 'production',
agentName: 'nodejs',
})
.service({ name: 'synth-node', environment: 'production', agentName: 'nodejs' })
.instance('my-instance');
const synthGo = apm
.service({ name: 'synth-go', environment: 'production', agentName: 'go' })
.instance('my-instance');

return range.interval('1m').generator((timestamp) => {
return [
synthGo1
.transaction({ transactionName: 'GET /apple 🍎' })
.timestamp(timestamp)
.duration(1000)
.success(),
synthGo2
.transaction({ transactionName: 'GET /banana 🍌' })
.timestamp(timestamp)
.duration(1000)
.success(),
synthNode
.transaction({ transactionName: 'GET /apple 🍎' })
.timestamp(timestamp)
.duration(1000)
.success(),
];
return synthRum
.transaction({ transactionName })
.duration(400)
.timestamp(timestamp)
.children(
// synth-rum -> synth-node
synthRum
.span(
httpExitSpan({
spanName: 'GET /api/products/top',
destinationUrl: 'http://synth-node:3000',
})
)
.duration(300)
.timestamp(timestamp)

.children(
// synth-node
synthNode
.transaction({ transactionName: 'Initial transaction in synth-node' })
.duration(300)
.timestamp(timestamp)
.children(
synthNode
// synth-node -> synth-go
.span(
httpExitSpan({
spanName: 'GET synth-go:3000',
destinationUrl: 'http://synth-go:3000',
})
)
.timestamp(timestamp)
.duration(400)

.children(
// synth-go
synthGo

.transaction({ transactionName: 'Initial transaction in synth-go' })
.timestamp(timestamp)
.duration(200)
.children(
synthGo
.span({ spanName: 'custom_operation', spanType: 'custom' })
.timestamp(timestamp)
.duration(100)
.success()
)
)
)
)
);
});
}

0 comments on commit d3b0971

Please sign in to comment.