Monitor AWS Lambda metrics: errors, latency, and concurrency

Interpret Lambda invocation, error, duration, concurrency, and backlog signals, and distinguish standard metrics from logs and enhanced telemetry.

Best practices
Illustration of application infrastructure and operations

Managed compute still needs monitoring. Lambda can fail through function errors, timeouts, throttling, slow dependencies, and delayed event processing. Standard CloudWatch metrics provide part of that picture; initialization timing, billed duration, memory details, and traces come from additional telemetry sources.

There is no universal normal level for every function. Compare the right statistic and dimensions against the function's traffic pattern and service objectives.

Invocation and failure metrics

Signal Meaning What to investigate
Invocations Executions of function code, including function errors Unexpected traffic changes; a drop does not by itself prove the upstream stopped
Errors Invocations ending in a function error, including code and runtime errors Exceptions, timeouts, and runtime/configuration failures
DeadLetterErrors Failed attempts to deliver asynchronous events to a dead-letter queue Permissions, target configuration, and size limits
Throttles Invocation requests rejected by throttling Concurrency, scaling, and relevant service limits

Use Sum over the same window for count metrics. Errors / Invocations measures the function error rate when the denominator is nonzero. Throttled requests are not included in either count, so that ratio does not cover every rejected request. Inspect invocation-level failures separately.

Execution time, initialization, and memory

Duration and billed duration

Duration measures function execution time and excludes cold-start initialization. Examine p95/p99 alongside volume and averages to understand the tail. An increase can involve slow dependencies, code paths, or resource contention; traces and logs help distinguish them.

Billed duration is a billing measure exposed in execution reports, not an interchangeable name for the standard Duration metric. Initialization and extension work can affect the billed amount under the applicable billing rules.

Init Duration and cold starts

Use initialization reports or appropriate enhanced telemetry to measure cold starts. A large p99–p50 gap does not establish that cold starts caused the tail, and runtime-specific initialization time is not a fixed number.

Potential mitigations include provisioned concurrency, supported SnapStart configurations, and reducing initialization work or package size. SnapStart is not limited to Java; check current supported runtimes and constraints. It cannot simply be combined with every other feature, including provisioned concurrency.

Memory used versus memory configured

The REPORT log includes memory fields; Lambda Insights can provide enhanced memory metrics when enabled. These are not all standard AWS/Lambda metrics emitted under the same names.

CPU allocation scales with configured memory, so low memory utilization alone does not prove overprovisioning. A higher memory setting may shorten a CPU-bound function enough to improve cost or latency. Test representative workloads and compare duration, billed cost, and memory headroom before resizing.

Concurrency

ConcurrentExecutions shows concurrently executing function instances; inspect the maximum at the relevant function or regional scope against available capacity. Reserved concurrency, account limits, and scaling constraints affect throttling.

ProvisionedConcurrencySpilloverInvocations counts executions using standard concurrency when provisioned capacity is occupied. Spillover can encounter a cold start, but can also reuse a warm on-demand environment. It is not a cold-start counter.

Stream and queue backlog

For Kinesis and DynamoDB Streams, IteratorAge indicates the age of the last record in a batch when it reaches the function. Rising age can reflect processing failures, retries, throttling, or throughput constraints—not just a need for a larger batch.

SQS does not use this Lambda IteratorAge signal. Inspect queue metrics such as ApproximateAgeOfOldestMessage, visible-message count, and applicable event-source mapping metrics. Diagnose retry and ordering behavior before increasing parallelism.

Set alerts around the workload

Verify function, region, dimensions, statistics, and collection intervals first. For Guance's AWS Lambda integration, configure the documented cloud synchronization permissions and compare counts with the same CloudWatch time window. Verify logs and traces through their own collection paths.

The following are starting points for discussion, not universal production thresholds:

Signal Example condition Qualification
Error rate Above 1% for five minutes Require sufficient volume and align severity with the service objective
Throttles Any occurrence Assess expected retries, traffic bursts, and user impact
Duration p99 Above half the configured timeout An early warning heuristic, not a timeout-sizing rule
IteratorAge Rises for 15 minutes Set the actual budget from acceptable processing delay
Expected invocation Missing from its scheduled window Define missing-data behavior and allow for delivery delay

Frequently asked questions

How should I choose a timeout?

Use observed execution behavior, dependency timeouts, retries, and the caller's deadline. A multiple of p99 is only a starting hypothesis. API Gateway integration limits vary by API type and quota settings; 29 seconds is not a universal limit for every gateway configuration. Consider orchestration or a different compute model for long-running work.

What should I monitor when a function rarely runs?

For scheduled work, detect a missing expected invocation or completion. An inactive function may have no data rather than an explicit zero, so configure the alarm or heartbeat accordingly. Monitor the scheduler and failed deliveries as well.

How do traces complement metrics?

Metrics show a trend; traces can locate time and failures within an invocation. Guance's Lambda extension integration is a separate setup from cloud-metric synchronization.

References

Get a tailored plan

Contact us

Join the community

Scan with WeChat
to join the community

Try Guance

Start online and pay only for what you use.

Get started

Choose a Guance plan

Code hosting