-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Labels
area/metricsCore metrics utilityCore metrics utilitybugUnexpected, reproducible and unintended software behaviourUnexpected, reproducible and unintended software behaviourstatus/confirmedThe scope is clear, ready for implementationThe scope is clear, ready for implementation
Description
Expected Behaviour
Flush metric set when data point is reached to prevent potential data loss, where 100+ data points are added thus being ignored silently by CloudWatch EMF when processed in the background.
Current Behaviour
More than 100 metric data points can be added.
Code snippet
using AWS.Lambda.Powertools.Metrics;
public class Function
{
[Metrics(CaptureColdStart = true)]
public async Task<APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigwProxyEvent,
ILambdaContext context)
{
Metrics.AddMetric("SuccessfulLocations", 1, MetricUnit.Count);
Metrics.AddMetric("SuccessfulLocations", 1, MetricUnit.Count);
// add other 100 values to the same metric
}
}
Possible Solution
Serialize and flush metric data set when a single metric reaches 100 data points.
Throw exception when adding a metric with 100 data points.
Dimensions etc should be kept intact.
Steps to Reproduce
Run the code added in code snippet
Powertools for AWS Lambda (.NET) version
latest
AWS Lambda function runtime
dotnet6
Debugging logs
No response
Metadata
Metadata
Assignees
Labels
area/metricsCore metrics utilityCore metrics utilitybugUnexpected, reproducible and unintended software behaviourUnexpected, reproducible and unintended software behaviourstatus/confirmedThe scope is clear, ready for implementationThe scope is clear, ready for implementation
Type
Projects
Status
👀 In review