Skip to content

Commit d6d5851

Browse files
authored
[AWSX] fix(logs-forwarder): parse lambda metrics from valid json objects only (#983)
1 parent 1254103 commit d6d5851

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

aws/logs_monitoring/enhanced_lambda_metrics.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ def parse_metrics_from_json_report_log(log_message):
277277
except json.JSONDecodeError:
278278
return []
279279

280+
if not isinstance(body, dict):
281+
return []
282+
280283
stage = body.get("type", "")
281284
record = body.get("record", {})
282285
record_metrics = record.get("metrics", {})

0 commit comments

Comments
 (0)