Module lambda

namespace metrics

namespace metrics

function concurrentExecutions

concurrentExecutions(change?: LambdaMetricChange): cloudwatch.Metric

Emitted as an aggregate metric for all functions in the account, and for functions that have a custom concurrency limit specified. Not applicable for versions or aliases. Measures the sum of concurrent executions for a given function at a given point in time. Must be viewed as an average metric if aggregated across a time period.

Units: Count

function deadLetterErrors

deadLetterErrors(change?: LambdaMetricChange): cloudwatch.Metric

Incremented when Lambda is unable to write the failed event payload to your configured Dead Letter Queues. This could be due to the following:

  • Permissions errors
  • Throttles from downstream services
  • Misconfigured resources
  • Timeouts

Units: Count

function duration

duration(change?: LambdaMetricChange): cloudwatch.Metric

Measures the elapsed wall clock time from when the function code starts executing as a result of an invocation to when it stops executing. The maximum data point value possible is the function timeout configuration. The billed duration will be rounded up to the nearest 100 millisecond. Note that AWS Lambda only sends these metrics to CloudWatch if they have a nonzero value.

Units: Count

function errors

errors(change?: LambdaMetricChange): cloudwatch.Metric

Measures the number of invocations that failed due to errors in the function (response code 4XX). This replaces the deprecated ErrorCount metric. Failed invocations may trigger a retry attempt that succeeds. This includes:

  • Handled exceptions (for example, context.fail(error))
  • Unhandled exceptions causing the code to exit
  • Out of memory exceptions
  • Timeouts
  • Permissions errors

This does not include invocations that fail due to invocation rates exceeding default concurrent limits (error code 429) or failures due to internal service errors (error code 500).

Units: Count

function invocations

invocations(change?: LambdaMetricChange): cloudwatch.Metric

Measures the number of times a function is invoked in response to an event or invocation API call. This replaces the deprecated RequestCount metric. This includes successful and failed invocations, but does not include throttled attempts. This equals the billed requests for the function. Note that AWS Lambda only sends these metrics to CloudWatch if they have a nonzero value.

Units: Count

function iteratorAge

iteratorAge(change?: LambdaMetricChange): cloudwatch.Metric

Emitted for stream-based invocations only (functions triggered by an Amazon DynamoDB stream or Kinesis stream). Measures the age of the last record for each batch of records processed. Age is the difference between the time Lambda received the batch, and the time the last record in the batch was written to the stream.

Units: Milliseconds

interface LambdaMetricChange

interface LambdaMetricChange extends MetricChange

property color

color?: pulumi.Input<string>;

The six-digit HTML hex color code to be used for this metric.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

property dimensions

dimensions?: pulumi.Input<Record<string, any>>;

The new dimension for this metric. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be cleared.

property executedVersion

executedVersion?: undefined | string;

Filters the metric data by Lambda function versions. This only applies to alias invocations.

property extendedStatistic

extendedStatistic?: pulumi.Input<number>;

The new percentile statistic for the metric associated with the alarm. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default.

property function

function?: aws.lambda.Function;

Optional Function this metric should be filtered down to.

property label

label?: pulumi.Input<string>;

The label to display for this metric in the graph legend. If this is not specified, the metric is given an autogenerated label that distinguishes it from the other metrics in the widget.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

property period

period?: pulumi.Input<number>;

The new period in seconds over which the specified stat is applied. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default (300s).

property resource

resource?: undefined | string;

Filters the metric data by Lambda function resource, such as function version or alias.

property statistic

statistic?: pulumi.Input<MetricStatistic>;

The new statistic to apply to the alarm’s associated metric. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default.

property unit

unit?: pulumi.Input<MetricUnit>;

The new unit for this metric. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default.

property visible

visible?: pulumi.Input<boolean>;

Set this to true to have the metric appear in the graph, or false to have it be hidden. The default is true.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

property yAxis

yAxis?: pulumi.Input<"left" | "right">;

Where on the graph to display the y-axis for this metric. The default is left.

Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

type LambdaMetricName

type LambdaMetricName = "Invocations" | "Errors" | "DeadLetterErrors" | "Duration" | "Throttles" | "IteratorAge" | "ConcurrentExecutions" | "UnreservedConcurrentExecutions";

function metric

metric(metricName: LambdaMetricName, change: LambdaMetricChange): Metric

Creates an AWS/Lambda metric with the requested [metricName]. See https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-metrics.html for list of all metric-names.

Note, individual metrics can easily be obtained without supplying the name using the other [metricXXX] functions.

You can use the following dimensions to refine the metrics returned for your Lambda functions:

  1. “FunctionName”. Filters the metric data by Lambda function.
  2. “Resource”. Filters the metric data by Lambda function resource, such as function version or alias.
  3. “ExecutedVersion”. Filters the metric data by Lambda function versions. This only applies to alias invocations.

function throttles

throttles(change?: LambdaMetricChange): cloudwatch.Metric

Measures the number of Lambda function invocation attempts that were throttled due to invocation rates exceeding the customer’s concurrent limits (error code 429). Failed invocations may trigger a retry attempt that succeeds.

Units: Count

function unreservedConcurrentExecutions

unreservedConcurrentExecutions(change?: LambdaMetricChange): cloudwatch.Metric

Emitted as an aggregate metric for all functions in the account only. Not applicable for functions, versions, or aliases. Represents the sum of the concurrency of the functions that do not have a custom concurrency limit specified. Must be viewed as an average metric if aggregated across a time period.

Units: Count