4

I am trying to use the "REPORT" line of the Lambda CloudWatch logs to extract out the billed duration for monitoring.

I found this article, with the following metric filter.

Metric Filter:

[
  report_label="REPORT",
  request_id_label="RequestId:", request_id_value,
  duration_label="Duration:", duration_value, duration_unit="ms",
  billed_duration_label1="Billed", bill_duration_label2="Duration:", billed_duration_value, billed_duration_unit="ms",
  memory_size_label1="Memory", memory_size_label2="Size:", memory_size_value, memory_size_unit="MB",
  max_memory_used_label1="Max", max_memory_used_label2="Memory", max_memory_used_label3="Used:", max_memory_used_value, max_memory_used_unit="MB"
]

When I test it against one of the log streams, the value seems to match correctly: reference

However when I view the CloudWatch Logs, I am getting weird values(Billed values are supposed to be in multiples of 100ms) such as 101, 106 and so on.

CloudWatch Graph for the custom metric created:

CloudWatch Graph

Either I am doing something wrong with the metric filter setup or I am viewing the CloudWatch graphs wrong, any help is appreciated.

Note: I have tried different statistics(AVG/p99) to see if anyone them seem fine(multiples of 100ms) but none of them work.

Abhishek
  • 432
  • 5
  • 19
  • Amazon CloudWatch will only provide aggregate statistics over a given time period, such as Average, Min and Max. You will probably not see the "raw" amount unless there is only one execution in that particular time period. That is likely why you are seeing amounts that are not multiples of 100. – John Rotenstein Oct 02 '19 at 04:55
  • Try graphing extremes, Minimum and Maximum, they should be real observed values instead of calculations which is the case for other stats. – Dejan Peretin Oct 02 '19 at 07:46

0 Answers0