-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(@aws-cdk/aws-apigatewayv2): Incorrect metric names for 4xx and 5xx #14503
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-apigatewayv2Related to Amazon API Gateway v2Related to Amazon API Gateway v2bugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1
Description
My code:
add_http_api_alarm(api: apigw.HttpApi, alarm_name: string) {
const metric = new cloudwatch.MathExpression({
expression: "IF(invocations > 100, (client_errors + server_errors) * 100, 0) / invocations",
period: cdk.Duration.hours(1),
usingMetrics: {
client_errors: api.metricClientError({statistic:"sum"}),
server_errors: api.metricServerError({statistic:"sum"}),
invocations: api.metricCount({statistic: "sum"})
}
});
No data is being shown for metricClientError or metricServerError. That is because the CDK is incorrectly calling it 4XXError instead of 4xx required by HTTP APIs https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-metrics.html
cdk version 1.100.0 (build d996c6d)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-apigatewayv2Related to Amazon API Gateway v2Related to Amazon API Gateway v2bugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1