Closed
Description
Expected Behaviour
When capturing cold starts Metrics write FunctionName to the EMF output, the FunctionName is retrieves from the LambdaContext passed to the handler.
StorageResolution should be the int representation of the enum and not the string representation, ie: Instead of"High"
should be 1
Current Behaviour
In an AOT published Lambda when you have the following code
[Metrics(Namespace = "ns", Service = "svc", CaptureColdStart = true)]
public void HandleWithParamAndLambdaContext(string input, ILambdaContext context)
{
}
Should output
{
"_aws": {
"Timestamp": 1720714102216,
"CloudWatchMetrics": [
{
"Namespace": "ns",
"Metrics": [
{
"Name": "ColdStart",
"Unit": "Count"
}
],
"Dimensions": [
[
"FunctionName"
],
[
"Service"
]
]
}
]
},
"FunctionName": "pt-8",
"Service": "svc",
"ColdStart": 1
}
But instead was outputing
{
"_aws": {
"Timestamp": 1720714102216,
"CloudWatchMetrics": [
{
"Namespace": "ns",
"Metrics": [
{
"Name": "ColdStart",
"Unit": "Count"
}
],
"Dimensions": [
[
"FunctionName"
],
[
"Service"
]
]
}
]
},
"FunctionName": null, <--- should not be null
"Service": "svc",
"ColdStart": 1
}
Code snippet
In an AOT published Lambda have the following code
[Metrics(Namespace = "ns", Service = "svc", CaptureColdStart = true)]
public void HandleWithParamAndLambdaContext(string input, ILambdaContext context)
{
}
Possible Solution
No response
Steps to Reproduce
In an AOT published Lambda have the following code
[Metrics(Namespace = "ns", Service = "svc", CaptureColdStart = true)]
public void HandleWithParamAndLambdaContext(string input, ILambdaContext context)
{
}
Powertools for AWS Lambda (.NET) version
1.7.0
AWS Lambda function runtime
dotnet6
Debugging logs
No response
Metadata
Metadata
Assignees
Type
Projects
Status
🏗 In progress