Extract Billed Duration for Lambda using CloudWatch Metric Filters

Viewed 707

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.

0 Answers
Related