---
title: Understand the Lambda data structure
source: https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/ui-data/understand-lambda-data-structure
---

Our [serverless monitoring for AWS Lambda](https://docs.newrelic.com/docs/introduction-new-relic-monitoring-aws-lambda) offers in-depth performance monitoring for your Lambda functions. This document will explain the source, structure, and storage of your Lambda data.

## Sources of Lambda data [#data-source]

Our Lambda monitoring data comes from these two sources:

-   Our APM agent instrumentation (or similar customer-created instrumentation)
-   AWS CloudWatch metrics

For details on how this data is configured and how it flows to New Relic, see the [enablement procedures](https://docs.newrelic.com/docs/install-enable-new-relics-monitoring-aws-lambda).

The data displayed in [the UI](https://docs.newrelic.com/docs/lambda-monitoring-ui) is a combination of these data sources. For example, the **Overview** page displays data reported by instrumentation, while the **Metrics** page displays CloudWatch data.

## Event definitions and attributes [#data-structure]

Lambda data is stored in our database (NRDB) as [events](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/getting-started/glossary#event) (data objects with associated [attributes](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/getting-started/glossary#attribute)).

Lambda data is attached to the following event types. Select an event name to see its attributes.

-   [`AwsLambdaInvocation` event](/attribute-dictionary/?event=AwsLambdaInvocation): Captures overall timing and associated metadata. A Lambda invocation generates a single `AwsLambdaInvocation` event.
-   [`AwsLambdaInvocationError` event](/attribute-dictionary/?event=AwsLambdaInvocationError): If an error occurs during a Lambda, this event will be generated.
-   [`Span`](/attribute-dictionary/?event=Span): This includes detail about a segment of a Lambda function. Spans are used for [distributed tracing](https://docs.newrelic.com/docs/apm/distributed-tracing/getting-started/introduction-distributed-tracing). Distributed tracing relies on [data sampling](https://docs.newrelic.com/docs/apm/distributed-tracing/getting-started/how-new-relic-distributed-tracing-works#sampling); 10% of invocations are sampled to generate spans.
-   Custom event types: With some agent APIs, custom events can be created and associated with a particular Lambda invocation, and then queried with NRQL.

For more about limits on event storage, see [Access and requirements](https://docs.newrelic.com/docs/introduction-new-relic-monitoring-aws-lambda#requirements).
