Table: aws_lambda_function_metric_duration_daily - Query AWS Lambda Function Metrics using SQL
The AWS Lambda Function Metrics allows you to monitor and troubleshoot your Lambda functions. It provides near real-time metrics on the performance and health of your functions, including duration, which 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 daily metric duration gives insights into the function's performance and efficiency over a 24-hour period.
Table Usage Guide
The aws_lambda_function_metric_duration_daily
table in Steampipe provides you with information about daily duration metrics of AWS Lambda functions. This table allows you, as a DevOps engineer, to query duration-specific details, including average, maximum, and minimum execution times of functions, along with the total count of requests. You can utilize this table to monitor the performance of Lambda functions, such as identifying functions with long execution times, tracking daily changes in function duration, and more. The schema outlines the various attributes of the Lambda function duration metrics for you, including the timestamp, function name, region, and associated statistics.
The aws_lambda_function_metric_duration_daily
table provides you with metric statistics at 24 hour intervals for the last year.
Examples
Basic info
Analyze the daily performance metrics of AWS Lambda functions to understand their execution duration trends. This can help in assessing the efficiency of your serverless applications and optimizing resource allocation.
select name, timestamp, minimum, maximum, average, sample_countfrom aws_lambda_function_metric_duration_dailyorder by name, timestamp;
select name, timestamp, minimum, maximum, average, sample_countfrom aws_lambda_function_metric_duration_dailyorder by name, timestamp;
Lambda function daily maximum duration over 100 milliseconds
Discover the segments that have a daily maximum duration over 100 milliseconds in your Lambda functions. This allows you to identify potential performance issues and optimize your functions for better efficiency.
select name, timestamp, round(minimum :: numeric, 2) as min_duration, round(maximum :: numeric, 2) as max_duration, round(average :: numeric, 2) as avg_duration, sample_countfrom aws_lambda_function_metric_duration_dailywhere maximum > 100order by name, timestamp;
select name, timestamp, round(minimum, 2) as min_duration, round(maximum, 2) as max_duration, round(average, 2) as avg_duration, sample_countfrom aws_lambda_function_metric_duration_dailywhere maximum > 100order by name, timestamp;
Lambda function daily average duration less than 5 milliseconds
Identify instances where the average daily duration of AWS Lambda functions is less than 5 milliseconds, in order to assess the efficiency and performance of your serverless applications. This information can be used to optimize resource allocation and improve application responsiveness.
select name, timestamp, round(minimum :: numeric, 2) as min_duration, round(maximum :: numeric, 2) as max_duration, round(average :: numeric, 2) as avg_duration, sample_countfrom aws_lambda_function_metric_duration_dailywhere average < 5order by name, timestamp;
select name, timestamp, round(minimum, 2) as min_duration, round(maximum, 2) as max_duration, round(average, 2) as avg_duration, sample_countfrom aws_lambda_function_metric_duration_dailywhere average < 5order by name, timestamp;
Schema for aws_lambda_function_metric_duration_daily
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
average | double precision | The average of the metric values that correspond to the data point. | |
maximum | double precision | The maximum metric value for the data point. | |
metric_name | text | The name of the metric. | |
minimum | double precision | The minimum metric value for the data point. | |
name | text | The name of the function. | |
namespace | text | The metric namespace. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the resource is located. | |
sample_count | double precision | The number of metric values that contributed to the aggregate value of this data point. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
sum | double precision | The sum of the metric values for the data point. | |
timestamp | timestamp with time zone | The time stamp used for the data point. | |
unit | text | The standard unit for the data point. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_lambda_function_metric_duration_daily