Skip to content

Commit

Permalink
make Stage part of the metricNamespace for the email-lambda race …
Browse files Browse the repository at this point in the history
…condition metric, rather than use a dimension since dimensions aren't supported (fails at cloudforming)
  • Loading branch information
twrichards committed Nov 29, 2024
1 parent 214e1b8 commit ac464db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
10 changes: 2 additions & 8 deletions cdk/lib/__snapshots__/stack.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,7 @@ Object {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"EvaluationPeriods": 1,
"MetricName": "EmailLambdaRaceCondition",
"Namespace": "Pinboard",
"Namespace": "Pinboard/TEST",
"Period": 300,
"Statistic": "Average",
"Tags": Array [
Expand Down Expand Up @@ -1632,14 +1632,8 @@ Object {
},
"MetricTransformations": Array [
Object {
"Dimensions": Array [
Object {
"Key": "Stage",
"Value": "TEST",
},
],
"MetricName": "EmailLambdaRaceCondition",
"MetricNamespace": "Pinboard",
"MetricNamespace": "Pinboard/TEST",
"MetricValue": "1",
},
],
Expand Down
5 changes: 1 addition & 4 deletions cdk/lib/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -654,10 +654,7 @@ export class PinBoardStack extends GuStack {
`/aws/lambda/${emailLambda.functionName}`
),
metricName: "EmailLambdaRaceCondition",
metricNamespace: "Pinboard",
dimensions: {
Stage: this.stage,
},
metricNamespace: `Pinboard/${this.stage}`,
filterPattern: {
logPatternString: EMAIL_LAMBDA_RACE_CONDITION_LOG_LINE_SNIPPET,
},
Expand Down

0 comments on commit ac464db

Please sign in to comment.