Table: aws_lambda_function_metric_invocations_daily - Query AWS Lambda Function Metrics using SQL
The AWS Lambda Function Metrics service allows you to monitor and troubleshoot your Lambda functions. It provides real-time metrics with granularity down to one minute and trace data sampling. By querying these metrics using SQL, you can gain insights into function execution such as memory usage, execution time, and failure rates.
Table Usage Guide
The aws_lambda_function_metric_invocations_daily
table in Steampipe provides you with information about the daily invocation metrics of AWS Lambda functions. This table enables you, as a DevOps engineer, to query function-specific details, including the number of invocations, the function name, and the timestamp of the data point. You can utilize this table to gather insights on function usage, such as the number of invocations over time, peak usage times, and more. The schema outlines the various attributes of the Lambda function metrics for you, including the function name, the namespace, the metric name, and the timestamp.
The aws_lambda_function_metric_invocations_daily
table provides you with metric statistics at 24 hour intervals for the last year.
Examples
Basic info
Gain insights into the daily usage patterns of your AWS Lambda functions. This query helps to understand the frequency and timing of function invocations, which can aid in optimizing resource allocation and cost management.
select name, timestamp, sumfrom aws_lambda_function_metric_invocations_dailyorder by name, timestamp;
select name, timestamp, sumfrom aws_lambda_function_metric_invocations_dailyorder by name, timestamp;
Lambda function daily invocations over 10 in last 3 days
Determine the areas in which AWS Lambda functions are being invoked more than 10 times daily over the past three days. This is useful for tracking function usage and identifying potential areas of optimization or troubleshooting.
select name, timestamp, round(sum :: numeric, 2) as sum_invocations, sample_countfrom aws_lambda_function_metric_invocations_dailywhere date_part('day', now() - timestamp) <= 3 and sum > 10order by name, timestamp;
select name, timestamp, round(sum, 2) as sum_invocations, sample_countfrom aws_lambda_function_metric_invocations_dailywhere julianday('now') - julianday(timestamp) <= 3 and sum > 10order by name, timestamp;
Schema for aws_lambda_function_metric_invocations_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_invocations_daily