Search code examples
pythonamazon-web-servicesaws-lambdamandrillamazon-cloudwatch

How to custom CloudWatch Metrics with AWS Lambda


I want know is any simple way can modify aws lambda (python) metrics?

I write a lambda to receive mandrill webhook, I want use CloudWatch to compare lambda exec time and webhook items (mandrill will send multi log in a webhook request).

The way I currently found not best practice I think.


Solution

  • Use the Python SDK to write the CloudWatch metric:

    https://boto3.readthedocs.io/en/latest/reference/services/cloudwatch.html#CloudWatch.Client.put_metric_data