Lambda functions averaging fewer than 1 invocation a day over 30 days
What does ZopNight detect here?
ZopNight flags AWS Lambda functions whose total `Invocations`, summed over the last 30 days, works out to fewer than 1 per day, when the function still has a positive monthly cost in ZopNight. That cost comes from measured requests and duration, or from billed cost when billing data is connected.
Signal and threshold
| Field | Value |
|---|---|
| Rule IDs | RC-010 |
| Category | idle |
| Severity | medium |
| Metric | Invocations |
| Threshold | fewer than 1 invocation per day |
| Evaluation window | 30d |
| Source | ZopNight |
| Permissions used | lambda:ListFunctions · lambda:GetFunction · lambda:ListEventSourceMappings · cloudwatch:GetMetricStatistics |
Where it applies
Most idle functions are free; the ones that are not have something provisioned
Lambda pricing charges functions for the requests they serve and the duration their code runs, in GB-seconds. A function that is never called has no request or duration cost at all. Provisioned Concurrency changes that: you pay for the amount of concurrency you configure and for the period it is configured, whether or not it is invoked. SnapStart snapshots are another standing item, charged for as long as the function version is active.
That is why this rule only reports functions with a real monthly cost. ZopNight prices a function from its measured requests and duration, or from its billed cost when billing data is connected; it does not read provisioned concurrency settings itself. An idle function with nothing provisioned is clutter, not spend.
Counting invocations correctly
AWS’s metric guide
says invocation metrics should be read with the Sum statistic. The average of Invocations is not
useful for counting calls.
aws cloudwatch get-metric-statistics --namespace AWS/Lambda --metric-name Invocations \ --dimensions Name=FunctionName,Value=legacy-export \ --start-time 2026-08-26T00:00:00Z --end-time 2026-09-25T00:00:00Z \ --period 86400 --statistics Sum
aws lambda list-provisioned-concurrency-configs --function-name legacy-exportHow the daily rate is computed
ZopNight sums the hourly invocation totals across the last 30 days and divides by the number of days covered. The function is idle when that rate is below 1 invocation per day, so a function called 20 times in a month still qualifies. It must also have a positive monthly cost in ZopNight.
When no finding appears
A function with no invocation data at all is skipped: absent data is not treated as proof of no use. Functions called more than about once a day are left alone. So are idle functions with no cost, which is most of them. Functions that are used but tuned badly belong to Lambda Over-Provisioned Memory.
The saving is the whole function cost
saving = monthly cost of the function (measured request and duration cost, or its billed cost)cost after deletion = 0Removing an idle function
- List triggers:
aws lambda list-event-source-mappings --function-name legacy-export, and check EventBridge rules, API Gateway routes and S3 notifications. - Remove provisioned concurrency first if you want the charge to stop while you confirm:
aws lambda delete-provisioned-concurrency-config --function-name legacy-export --qualifier live - Save the code package from the
Code.LocationURL returned byaws lambda get-function --function-name legacy-export. - Delete:
aws lambda delete-function --function-name legacy-export