kibana/docs/apm/lambda.asciidoc
Brandon Morelli 4ed60697e9
[APM] Documentation updates (#160568)
### Summary

This PR makes a handful of updates to the APM app documentation:

- [x] **Alerts tab, workflow, and grouping**
- Rewrote most of our [alerting
documentation](https://kibana_160568.docs-preview.app.elstc.co/guide/en/kibana/master/apm-alerts.html#apm-alert-view-active)
to explain the new granularity level of alerts, address new alert names,
and explain the different ways to view active alerts.
- Updated the
[Services](https://kibana_160568.docs-preview.app.elstc.co/guide/en/kibana/master/services.html)
documentation to describe the alert badge and link to alerting docs.
  - _Closes https://github.com/elastic/observability-docs/issues/2887_
  - _Closes https://github.com/elastic/observability-docs/issues/2888_
  - _Closes https://github.com/elastic/observability-docs/issues/2878_
- [x] **Infrastructure tab**
- Added a new [top-level
page](https://kibana_160568.docs-preview.app.elstc.co/guide/en/kibana/master/infrastructure.html)
explaining what this page is useful for.
  - _Closes https://github.com/elastic/observability-docs/issues/2892_
- [x] **Log views and correlation**
- Added a new [top-level page
](https://kibana_160568.docs-preview.app.elstc.co/guide/en/kibana/master/logs.html)that
links to our log correlation docs.
- Updated our [transaction
documentation](https://kibana_160568.docs-preview.app.elstc.co/guide/en/kibana/master/transactions.html#transaction-trace-sample)
with new information and a link to our log correlation docs.
  - _Closes https://github.com/elastic/observability-docs/issues/2891_
- [x] **New AWS Lambda metrics**
- Most of the new charts have tooltips explaining what the charts do. I
updated the screenshot and added some additional information to the
[overview](https://kibana_160568.docs-preview.app.elstc.co/guide/en/kibana/master/apm-lambda.html)
to highlight some of the new features of this page.
  - _Closes https://github.com/elastic/observability-docs/issues/2890_
- [x] **New screenshots**
- I updated any screenshots I noticed were outdated while working on the
above content. Screenshot updates are not necessarily related to the
changes described above.
2023-06-30 11:02:58 -07:00

52 lines
2.3 KiB
Text

[role="xpack"]
[[apm-lambda]]
=== Observe Lambda functions
Elastic APM provides performance and error monitoring for AWS Lambda functions.
See how your Lambda functions relate to and depend on other services, and
get insight into function execution and runtime behavior, like lambda duration, cold start rate, cold start duration, compute usage, memory usage, and more.
To set up Lambda monitoring, see the relevant
{apm-guide-ref}/monitoring-aws-lambda.html[quick start guide].
[role="screenshot"]
image::apm/images/lambda-overview.png[lambda overview]
[float]
[[apm-lambda-cold-start-info]]
==== Cold starts
A cold start occurs when a Lambda function has not been used for a certain period of time. A lambda worker receives a request to run the function and prepares an execution environment.
Cold starts are an unavoidable byproduct of the serverless world, but visibility into how they impact your services can help you make better decisions about factors like how much memory to allocate to a function, whether to enable provisioned concurrency, or if it's time to consider removing a large dependency.
[float]
[[apm-lambda-cold-start-rate]]
===== Cold start rate
The cold start rate (i.e. proportion of requests that experience a cold start) is displayed per service and per transaction.
Cold start is also displayed in the trace waterfall, where you can drill-down into individual traces and see trace metadata like AWS request ID, trigger type, and trigger request ID.
[role="screenshot"]
image::apm/images/lambda-cold-start-trace.png[lambda cold start trace]
[float]
[[apm-lambda-cold-start-latency]]
===== Latency distribution correlation
The <<correlations-latency,latency correlations>> feature can be used to visualize the impact of Lambda cold starts on latency--just select the `faas.coldstart` field.
[role="screenshot"]
image::apm/images/lambda-correlations.png[lambda correlations example]
[float]
[[apm-lambda-service-config]]
==== AWS Lambda function grouping
The default APM agent configuration results in one APM service per AWS Lambda function,
where the Lambda function name is the service name.
In some use cases, it makes more sense to logically group multiple lambda functions under a single
APM service. You can achieve this by setting the `ELASTIC_APM_SERVICE_NAME` environment variable
on related Lambda functions to the same value.