Skip to content

EventBridge Scheduler InvocationAttemptCount vs Lambda Lambda Invocations

0

We have a set up where EventBridge schedules trigger a lambda, we are trying to validate if the schedules are working fine, during the process we have observed that the InvocationAttemptCount in scheduler group monitoring is not same as Invocations of lambda monitor, where InvocationAttemptCount is less than the invocation, all schedules are created in same schedule group and the lambda has no invocations other than this Failed invocations (execution errors, runtime exceptions, timeouts) in lambda monitoring has this error - ERROR librdkafka: Global error: AllBrokersDown (Local: All broker connections are down): 3/3 brokers are down but Iterator age, Async delivery failures, Recursive invocations, Throttles, Error count are zero throughout the period

1 Answer
0

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

answered 7 days ago
EXPERT
reviewed 7 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.