···8888 // the arns of all secrets that should be exposed to the api pods.
8989 secrets: SecretsMap<
9090 | 'SESSION_SECRET'
9191- | 'PERSPECTIVE_API_KEY'
9291 | 'GROQ_SECRET_KEY'
9392 | 'SENDGRID_API_KEY'
9493 | 'GOOGLE_PLACES_API_KEY'
···299298 // TODO: this if condition is very hacky, but we need to set different metrics
300299 // per env before we can do this properly.
301300 if (stage === 'Prod') {
302302- // If we had more than 30 rate limit errors
303303- // in two out of three of the last 1 minute periods, alarm.
304304- withSnsNotifications(
305305- new Metric({
306306- namespace: 'coop-signals',
307307- metricName: 'Perspective Rate Limit Error',
308308- statistic: 'sum',
309309- period: Duration.minutes(1),
310310- }).createAlarm(this, 'PerspectiveRateLimitErrorAlarm', {
311311- alarmName: 'Recurring Perspective Rate Limit Errors',
312312- threshold: 30,
313313- evaluationPeriods: 3,
314314- datapointsToAlarm: 2,
315315- }),
316316- monitoringAlertsTopic,
317317- );
318318-319301 gateway.restApi.methods.forEach((method) => {
320302 // Similarly, alert if 500s are too high.
321303 withSnsNotifications(