6

How can I check the running Lambda functions running using the aws cli?

It seems that there is no a command to check it:

aws lambda XXXX

I have several scripts running, and I'd like to monitor the situation. It is enough to show how many functions are running.

Thank you

2 Answers 2

4

Watching or monitoring the cloud watch logs would be the best way to monitor if a lambda is running or not. These logs are not real time, but may be near real time enough for your needs. You could ask CloudWatch for the last X minutes of log for a particular lambda and monitor the timing of the log statements. As Aniket Chopade stated though, knowing why you're trying to do this could help someone provide a better solution.

Sign up to request clarification or add additional context in comments.

Comments

4

You will not see any state such as "running" in CLI ouput.

From users perspective, Lambda functions are always up running (actually right word is invokable) because they respond to triggers.

There is concept of keeping them "warm" , that means keeping one physical instance alive having containers running in it. But again these level of details are hidden from lambda's users.

I am curious why you want to know such state for lambda functions.

3 Comments

Since I'm running several times the same lambda with different inputs, I would like to see how long they have been running for, what inputs they are running with, where I can find their logs and so on. I would like to create some kind of dashboard to have a global overview of running instances of my lambda function. I'm not interested in the "template" of my lambda but only the currently running instances. (I think it was the same for OP)
Cloudwatch logs will show you how long one invocation ran, what inputs it ran with. But if you want to see currently running (warm) lambdas then that is something AWS hides from its users. If dashboard which you mentioned is a mandatory requirement then you may want to check something like Fargate where you can run your containers without provisioning physical compute (EC2)
Thanks for your answer. I'm only concerned with invocations, I don't really care about the lambda being warm or not. I think I'm gonna cheat and make my lambdas write their state into S3 and query the bucket to know how things are going. (The logs can be both huge and numerous so I'd like to avoid parsing them just to know what is running).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.