4141 + r"Max\s+Memory\s+Used:\s+(?P<{}>\d+)\s+MB" .format (MAX_MEMORY_USED_METRIC_NAME )
4242)
4343
44+ # Pull memorysize tag and cold start from report
45+ TAGS_TO_PARSE_FROM_REPORT = [
46+ MEMORY_ALLOCATED_FIELD_NAME ,
47+ ]
48+
4449METRICS_TO_PARSE_FROM_REPORT = [
4550 DURATION_METRIC_NAME ,
4651 BILLED_DURATION_METRIC_NAME ,
@@ -440,6 +445,11 @@ def parse_metrics_from_report_log(report_log_line):
440445 return []
441446
442447 metrics = []
448+ tags = []
449+
450+ # loop is to account for adding cold start
451+ for tag in TAGS_TO_PARSE_FROM_REPORT :
452+ tags .append (tag + ":" + regex_match .group (tag ))
443453
444454 for metric_name in METRICS_TO_PARSE_FROM_REPORT :
445455 metric_point_value = float (regex_match .group (metric_name ))
@@ -451,6 +461,10 @@ def parse_metrics_from_report_log(report_log_line):
451461 "{}.{}" .format (ENHANCED_METRICS_NAMESPACE_PREFIX , metric_name ),
452462 metric_point_value ,
453463 )
464+
465+ if tags :
466+ dd_metric .add_tags (tags )
467+
454468 metrics .append (dd_metric )
455469
456470 estimated_cost_metric_point = DatadogMetricPoint (
@@ -460,6 +474,10 @@ def parse_metrics_from_report_log(report_log_line):
460474 float (regex_match .group (MEMORY_ALLOCATED_FIELD_NAME )),
461475 ),
462476 )
477+
478+ if tags :
479+ estimated_cost_metric_point .add_tags (tags )
480+
463481 metrics .append (estimated_cost_metric_point )
464482
465483 return metrics
0 commit comments