You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I would like to know time taken & success/failure ration for a service call from lambda function.
Describe the solution you'd like
Currently Metrics annotation only supports capturing cold start, it would be really if we can get time/success/failure count for the method being executed(similar to DCM/DLM :)).
Describe alternatives you've considered
Currently we are using Guava's stopwatch & manually instrumenting the code.
Hi @vigneshtdev Thanks for opening the issue. Since this belongs to core utility Metrics, I would like to hear thoughts from Python folks as well. Moving this to roadmap for further discussion.
@heitorlessa Thoughts on this? Adding built in support for Metrics annotation/decorator to capture success/failure/duration metrics conditionally like cold start
One reason I can think of is with the default metrics provided by lambda it's difficult to distinguish between failures occurring in static block & failures in handleRequest
Errors – The number of invocations that result in a function error. Function errors include exceptions thrown by your code and exceptions thrown by the Lambda runtime. The runtime returns errors for issues such as timeouts and configuration errors.
Also in case these annotations can be used on non-handleRequest methods then we can analyse individual service calls easily
Provide basic functionality like measuring time/success/failure count for function through @Metrics annotation · Issue #24 · aws-powertools/powertools-lambda
Activity
pankajagrawal16 commentedon Jul 19, 2021
Hi @vigneshtdev Thanks for opening the issue. Since this belongs to core utility Metrics, I would like to hear thoughts from Python folks as well. Moving this to roadmap for further discussion.
@heitorlessa Thoughts on this? Adding built in support for Metrics annotation/decorator to capture success/failure/duration metrics conditionally like cold start
heitorlessa commentedon Jul 27, 2021
I'd love to hear more on why the Lambda function default metrics themselves are not sufficient.
I've typically seen this request in cases where customers have a "fat" Lambda function, in which case you could create your own middleware to handle errors with Powertools that also create a metric as you see fit.
Is that the case? If so, I'd like to hear more customer demand on this before we consider it.
vigneshtdev commentedon Jul 27, 2021
One reason I can think of is with the default metrics provided by lambda it's difficult to distinguish between failures occurring in static block & failures in
handleRequest
https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html
Errors – The number of invocations that result in a function error. Function errors include exceptions thrown by your code and exceptions thrown by the Lambda runtime. The runtime returns errors for issues such as timeouts and configuration errors.
Also in case these annotations can be used on non-handleRequest methods then we can analyse individual service calls easily
dreamorosi commentedon Jul 17, 2025
We haven't received any significant traction on this item in the past 4 years, because of this we'll close it as not planned.