mikestaub
mikestaub

Reputation: 2173

How to figure out lambdas that are contributing to my invocation counts/costs

I have 2 dozen lambdas. I noticed my bill was high this month and I see have 700k invocations. Is there an easy way to view all the stats for all my lambdas in one view, and ‘sort by invocations within period’? This kind of dashboard would be very valuable.

Upvotes: 4

Views: 3517

Answers (2)

Taavi Rehemägi
Taavi Rehemägi

Reputation: 77

You can use a serverless monitoring service like Dashbird to get the exact cost of any AWS Lambda function and also the insights to optimise those costs.

Upvotes: 1

Yogesh_D
Yogesh_D

Reputation: 18764

You can go to Cloudwatch Metrics to get a list of invocations across all your lambdas. This will not give you a count but rather stats over your desired period and should help you arrive at the what lambda has greater invocations.

Just hit up this url. You should see a list all of all the lambdas that you have in your account in us-east-1. If your region is something else change the region.

And then select all the lambdas. On the top you should see a way to specify the time, limit that to say a few weeks or even a month. I have set it to the last 4 weeks in the URL.

In the graphed metrics make sure you set the Statistics Field to "Sum" to ensure you see a sum of invocations. This should give you an idea of what Lambdas are invoking the most.

However this is part of the story. The duration that a lambda executes for also matters you can use this url to figure out the duration of lambda executions over time.

These two metrics should help you get to the bottom of what lambda is the most invocations or is being executed with the longest duration.

If you want to automate this, you can also get actual stats in scripts by using the list metrics and get metric statistics clis.

Upvotes: 4

Related Questions