Skip to content

Commit

Permalink
Cleanup the code
Browse files Browse the repository at this point in the history
  • Loading branch information
kris-szlapa committed Oct 8, 2024
1 parent 00bf17c commit 9b8f2a9
Showing 1 changed file with 1 addition and 80 deletions.
81 changes: 1 addition & 80 deletions packages/cdk/resource/dashboards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,86 +22,7 @@ export const createDashboard = (scope: Construct) => {
]
})

// Create a widget for API Gateway 4XX Errors
const apiGatewayErrorsWidget = new cw.GraphWidget({
height: 5,
width: 8,
title: "API Gateway 4XXError",
region: "eu-west-2",
left: [
new cw.Metric({
namespace: "AWS/ApiGateway",
metricName: "4XXError",
dimensionsMap: {
ApiName: "pfp-apigw"
},
region: "eu-west-2"
}),
new cw.Metric({
namespace: "AWS/ApiGateway",
metricName: "4XXError",
dimensionsMap: {
ApiName: "psu-apigw"
},
region: "eu-west-2"
}),
new cw.Metric({
namespace: "AWS/ApiGateway",
metricName: "4XXError",
dimensionsMap: {
ApiName: "tracker-auth-apigw-cognito"
},
region: "eu-west-2"
})
],
view: cw.GraphWidgetView.TIME_SERIES,
stacked: false,
legendPosition: cw.LegendPosition.RIGHT,
period: Duration.minutes(5),
statistic: "Average"
})

// Create a widget for API Gateway 5XX Errors
const apiGateway5XXErrorsWidget = new cw.GraphWidget({
height: 5,
width: 8,
title: "API Gateway 5XXError",
region: "eu-west-2",
left: [
new cw.Metric({
namespace: "AWS/ApiGateway",
metricName: "5XXError",
dimensionsMap: {
ApiName: "pfp-apigw"
},
region: "eu-west-2"
}),
new cw.Metric({
namespace: "AWS/ApiGateway",
metricName: "5XXError",
dimensionsMap: {
ApiName: "psu-apigw"
},
region: "eu-west-2"
}),
new cw.Metric({
namespace: "AWS/ApiGateway",
metricName: "5XXError",
dimensionsMap: {
ApiName: "tracker-auth-apigw-cognito"
},
region: "eu-west-2"
})
],
view: cw.GraphWidgetView.TIME_SERIES,
stacked: false,
legendPosition: cw.LegendPosition.RIGHT,
period: Duration.minutes(5),
statistic: "Average"
})

// Add both widgets to the dashboard
dashboard.addWidgets(apiGatewayErrorsWidget, apiGateway5XXErrorsWidget)
dashboard.addWidgets()

return dashboard
}

0 comments on commit 9b8f2a9

Please sign in to comment.