Select Language:
If you’ve noticed that the number of times your Lambda function has been invoked doesn’t match the number of invocation attempts made by EventBridge Scheduler, don’t worry—this is completely normal. Understanding how these two metrics work can help clarify what’s happening.
When EventBridge Scheduler tries to run your Lambda function, it makes an attempt for each scheduled trigger. This is tracked by the “InvocationAttemptCount” metric, which shows how many times EventBridge has tried to call your Lambda. However, this count only increases when EventBridge successfully attempts to deliver the request.
Your Lambda function might have errors during execution, like the “AllBrokersDown” error you’re seeing, which indicates trouble connecting to Kafka. These errors happen after the Lambda function is invoked. Since Lambda functions are called asynchronously in this setup, even if a run fails, retries happen automatically in the background.
Here’s the key difference:
– The EventBridge “InvocationAttemptCount” counts how many times EventBridge attempted to invoke your Lambda.
– The Lambda’s “Invocations” metric counts how many times your function actually ran, regardless of success or failure.
If your logs show failed Lambda invocations but no throttling or delivery failures, it means EventBridge is successfully reaching your Lambda each time. The failures are happening during execution, not on delivery. When Lambda encounters errors, it retries automatically. This is why the “Invocations” count can be higher than the “InvocationAttemptCount”—Lambda is processing retries even after failures.
In simple terms, EventBridge is telling Lambda to run, and Lambda keeps trying, even if there’s an error during execution. This explains why your invocation count is higher than the number of attempts. To fix this, you might need to address the underlying cause of the Lambda failing during execution, such as fixing Kafka broker connection issues.
For more details, you can review the guides on monitoring EventBridge Scheduler and Lambda invocations on AWS:
– Monitoring EventBridge Scheduler with CloudWatch
– Invoking a Lambda function on a schedule
These resources can help you better track and troubleshoot your scheduled functions.




