-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
APM UI changes for serverless services / AWS lambda (#122775)
* Adapted service UI for AWS lambda / serverless services * Add unit tests for isServerlessAgent function * Add story for cold start badge * Add unit tests for service icons and icon details * Add aws_lambda checks to isMetricsTabHidden and isJVMsTabHidden unit tests * Add API test for coldstart_rate chart * Change service icon API tests to use synthrace and test for serverless property * Change service details API tests to use synthrace and add test for serverless * Add e2e tests for cold start rate chart * Add cold start badge to transaction flyout * Add beta badge to cloud details in a lambda context * Add support for multiple lambda functions in a single service Co-authored-by: Alexander Wert <alexander.wert@elastic.co> Co-authored-by: Casper Hübertz <casper@formgeist.com>
- Loading branch information
1 parent
ecba478
commit 78643f4
Showing
48 changed files
with
2,240 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
.../ftr_e2e/cypress/integration/read_only_user/service_overview/aws_lambda/aws_lamba.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* 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 url from 'url'; | ||
import { synthtrace } from '../../../../../synthtrace'; | ||
import { generateData } from './generate_data'; | ||
|
||
const start = '2021-10-10T00:00:00.000Z'; | ||
const end = '2021-10-10T00:15:00.000Z'; | ||
|
||
const serviceOverviewHref = url.format({ | ||
pathname: '/app/apm/services/synth-python/overview', | ||
query: { rangeFrom: start, rangeTo: end }, | ||
}); | ||
|
||
const apiToIntercept = { | ||
endpoint: | ||
'/internal/apm/services/synth-python/transactions/charts/coldstart_rate?*', | ||
name: 'coldStartRequest', | ||
}; | ||
|
||
describe('Service overview - aws lambda', () => { | ||
before(async () => { | ||
await synthtrace.index( | ||
generateData({ | ||
start: new Date(start).getTime(), | ||
end: new Date(end).getTime(), | ||
}) | ||
); | ||
}); | ||
|
||
after(async () => { | ||
await synthtrace.clean(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.loginAsReadOnlyUser(); | ||
}); | ||
|
||
it('displays a cold start rate chart and not a transaction breakdown chart', () => { | ||
const { endpoint, name } = apiToIntercept; | ||
|
||
cy.intercept('GET', endpoint).as(name); | ||
cy.visit(serviceOverviewHref); | ||
cy.wait(`@${name}`); | ||
|
||
cy.contains('Cold start rate'); | ||
cy.contains('Time spent by span type').should('not.exist'); | ||
}); | ||
}); |
41 changes: 41 additions & 0 deletions
41
...m/ftr_e2e/cypress/integration/read_only_user/service_overview/aws_lambda/generate_data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* 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 { apm, timerange } from '@elastic/apm-synthtrace'; | ||
|
||
const dataConfig = { | ||
serviceName: 'synth-python', | ||
rate: 10, | ||
transaction: { | ||
name: 'GET /apple 🍎', | ||
duration: 1000, | ||
}, | ||
}; | ||
|
||
export function generateData({ start, end }: { start: number; end: number }) { | ||
const { rate, transaction, serviceName } = dataConfig; | ||
const instance = apm | ||
.service(serviceName, 'production', 'python') | ||
.instance('instance-a'); | ||
|
||
const traceEvents = timerange(start, end) | ||
.interval('1m') | ||
.rate(rate) | ||
.flatMap((timestamp) => [ | ||
...instance | ||
.transaction(transaction.name) | ||
.defaults({ | ||
'service.runtime.name': 'AWS_Lambda_python3.8', | ||
'faas.coldstart': true, | ||
}) | ||
.timestamp(timestamp) | ||
.duration(transaction.duration) | ||
.success() | ||
.serialize(), | ||
]); | ||
|
||
return traceEvents; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.