- Newest
- Most votes
- Most comments
The discrepancy you're observing between EventBridge Scheduler's InvocationAttemptCount and Lambda's Invocations metric is expected behavior and relates to how these services handle failed invocations.
The InvocationAttemptCount metric is emitted for every invocation attempt that EventBridge Scheduler makes to invoke your Lambda function. This metric specifically tracks when EventBridge Scheduler attempts to call the target API.
However, when EventBridge Scheduler invokes Lambda functions, it does so asynchronously. In your case, the Lambda function is experiencing execution errors (the AllBrokersDown error you're seeing), which are runtime failures that occur after the function has been successfully invoked and starts executing.
The key distinction is:
- EventBridge Scheduler's InvocationAttemptCount tracks successful delivery attempts to Lambda
- Lambda's Invocations metric counts all invocations that actually execute, including those that fail during execution
Since your Lambda monitoring shows failed invocations with execution errors but zero throttles and zero async delivery failures, this indicates that EventBridge Scheduler is successfully delivering the invocation requests to Lambda, but the Lambda function itself is failing during execution due to the Kafka broker connectivity issue. Each time Lambda retries the failed invocation (which happens automatically for asynchronous invocations), it increments the Lambda Invocations count, but EventBridge Scheduler only counts its initial delivery attempt.
This explains why your Lambda Invocations count is higher than the InvocationAttemptCount - Lambda is processing and retrying the invocations even though they're failing during execution.
Sources
Monitoring Amazon EventBridge Scheduler with Amazon CloudWatch - EventBridge Scheduler
Invoke a Lambda function on a schedule - AWS Lambda
Relevant content
- asked 2 years ago
- asked a year ago
- AWS OFFICIALUpdated 4 months ago
