-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Logs forwarder] Parse enhanced metrics from Lambda telemetry JSON lo…
…gs. (#859) * Parse enhanced metrics from Lambda telemetry JSON logs. These get emitted instead of regular REPORT logs if log format is set to JSON. * Address review comments. * Less try/catch * Organize constants * Remove unnecessary defensive JSON check
- Loading branch information
1 parent
0799b46
commit 50e34e8
Showing
6 changed files
with
393 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
..._files/TestEnhancedLambdaMetrics.test_generate_enhanced_lambda_metrics_json.approved.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
[ | ||
{ | ||
"name": "aws.lambda.enhanced.duration", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:false", | ||
"region:us-east-1", | ||
"account_id:172597598159", | ||
"aws_account:172597598159", | ||
"functionname:post-coupon-prod-us" | ||
], | ||
"timestamp": 10000, | ||
"value": 3.47065 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.billed_duration", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:false", | ||
"region:us-east-1", | ||
"account_id:172597598159", | ||
"aws_account:172597598159", | ||
"functionname:post-coupon-prod-us" | ||
], | ||
"timestamp": 10000, | ||
"value": 3.5 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.max_memory_used", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:false", | ||
"region:us-east-1", | ||
"account_id:172597598159", | ||
"aws_account:172597598159", | ||
"functionname:post-coupon-prod-us" | ||
], | ||
"timestamp": 10000, | ||
"value": 89 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.estimated_cost", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:false", | ||
"region:us-east-1", | ||
"account_id:172597598159", | ||
"aws_account:172597598159", | ||
"functionname:post-coupon-prod-us" | ||
], | ||
"timestamp": 10000, | ||
"value": 7.49168125e-06 | ||
} | ||
] |
47 changes: 47 additions & 0 deletions
47
...estEnhancedLambdaMetrics.test_parse_metrics_from_cold_start_json_report_log.approved.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[ | ||
{ | ||
"name": "aws.lambda.enhanced.duration", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:true" | ||
], | ||
"timestamp": null, | ||
"value": 0.0008100000000000001 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.billed_duration", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:true" | ||
], | ||
"timestamp": null, | ||
"value": 0.1 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.max_memory_used", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:true" | ||
], | ||
"timestamp": null, | ||
"value": 90 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.init_duration", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:true" | ||
], | ||
"timestamp": null, | ||
"value": 1.234 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.estimated_cost", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:true" | ||
], | ||
"timestamp": null, | ||
"value": 4.0833375e-07 | ||
} | ||
] |
38 changes: 38 additions & 0 deletions
38
...ved_files/TestEnhancedLambdaMetrics.test_parse_metrics_from_json_report_log.approved.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[ | ||
{ | ||
"name": "aws.lambda.enhanced.duration", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:false" | ||
], | ||
"timestamp": null, | ||
"value": 0.00062 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.billed_duration", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:false" | ||
], | ||
"timestamp": null, | ||
"value": 0.1 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.max_memory_used", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:false" | ||
], | ||
"timestamp": null, | ||
"value": 51 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.estimated_cost", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:false" | ||
], | ||
"timestamp": null, | ||
"value": 4.0833375e-07 | ||
} | ||
] |
56 changes: 56 additions & 0 deletions
56
...s/TestEnhancedLambdaMetrics.test_parse_metrics_from_timeout_json_report_log.approved.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[ | ||
{ | ||
"name": "aws.lambda.enhanced.duration", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:true" | ||
], | ||
"timestamp": null, | ||
"value": 30.0 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.billed_duration", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:true" | ||
], | ||
"timestamp": null, | ||
"value": 30.0 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.max_memory_used", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:true" | ||
], | ||
"timestamp": null, | ||
"value": 74 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.init_duration", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:true" | ||
], | ||
"timestamp": null, | ||
"value": 0.985413 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.estimated_cost", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:true" | ||
], | ||
"timestamp": null, | ||
"value": 6.270012500000001e-05 | ||
}, | ||
{ | ||
"name": "aws.lambda.enhanced.timeouts", | ||
"tags": [ | ||
"memorysize:128", | ||
"cold_start:true" | ||
], | ||
"timestamp": null, | ||
"value": 1.0 | ||
} | ||
] |
Oops, something went wrong.