Skip to content

Commit 50c7393

Browse files
authored
Merge pull request #349 from code-dot-org/molly/update-alarms
Update error rate alarms
2 parents cc44f43 + a9c6961 commit 50c7393

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

beta-template.yml.erb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,10 @@ Resources:
700700
MetricStat:
701701
Metric:
702702
Namespace: Javabuilder
703-
MetricName: Javabuilder <%=name%> "SEVERE" errors
703+
MetricName: SevereError
704+
Dimensions:
705+
- Name: functionName
706+
Value: !Ref BuildAndRunJava<%=name%>ProjectFunction
704707
Period: 300
705708
Stat: Sum
706709
- Id: m2
@@ -734,7 +737,7 @@ Resources:
734737
- Id: e1
735738
Label: Errors / Invocations
736739
ReturnData: true
737-
Expression: (m1 / m2) * 100
740+
Expression: ((m1 - m3) / m2) * 100
738741
- Id: m1
739742
ReturnData: false
740743
MetricStat:
@@ -757,6 +760,17 @@ Resources:
757760
Value: !Ref BuildAndRunJava<%=name%>ProjectFunction
758761
Period: 300
759762
Stat: Sum
763+
- Id: m3
764+
ReturnData: false
765+
MetricStat:
766+
Metric:
767+
Namespace: AWS/Lambda
768+
MetricName: Duration
769+
Dimensions:
770+
- Name: FunctionName
771+
Value: !Ref BuildAndRunJava<%=name%>ProjectFunction
772+
Period: 300
773+
Stat: TC(89000:)
760774
761775
<%=name%>SlowCleanupTimeAlarm:
762776
Type: AWS::CloudWatch::Alarm

cicd/2-cicd/deploy-cicd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if [ "$TARGET_BRANCH" == "main" ]
2020
then
2121
STACK_NAME="javabuilder-cicd"
2222
else
23-
STACK_NAME=${"javabuilder-$TARGET_BRANCH-cicd"}
23+
STACK_NAME="javabuilder-${TARGET_BRANCH}-cicd"
2424
fi
2525

2626
MODE=${MODE-'standard'}

cicd/3-app/javabuilder/template.yml.erb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,10 @@ Resources:
694694
MetricStat:
695695
Metric:
696696
Namespace: Javabuilder
697-
MetricName: Javabuilder <%=name%> "SEVERE" errors
697+
MetricName: SevereError
698+
Dimensions:
699+
- Name: functionName
700+
Value: !Ref BuildAndRunJava<%=name%>ProjectFunction
698701
Period: 300
699702
Stat: Sum
700703
- Id: m2
@@ -728,7 +731,7 @@ Resources:
728731
- Id: e1
729732
Label: Errors / Invocations
730733
ReturnData: true
731-
Expression: (m1 / m2) * 100
734+
Expression: ((m1 - m3) / m2) * 100
732735
- Id: m1
733736
ReturnData: false
734737
MetricStat:
@@ -751,6 +754,17 @@ Resources:
751754
Value: !Ref BuildAndRunJava<%=name%>ProjectFunction
752755
Period: 300
753756
Stat: Sum
757+
- Id: m3
758+
ReturnData: false
759+
MetricStat:
760+
Metric:
761+
Namespace: AWS/Lambda
762+
MetricName: Duration
763+
Dimensions:
764+
- Name: FunctionName
765+
Value: !Ref BuildAndRunJava<%=name%>ProjectFunction
766+
Period: 300
767+
Stat: TC(89000:)
754768
755769
<%=name%>SlowCleanupTimeAlarm:
756770
Type: AWS::CloudWatch::Alarm

cicd/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ TARGET_BRANCH=mybranch cicd/2-cicd/deploy-cicd.sh
5858
### Deploying an Adhoc environment
5959

6060
You can create an Adhoc environment by setting the `MODE` flag on the cicd deploy script. This will create a CI/CD pipeline that will watch for updates to your `TARGET_BRANCH`. The difference between a standard deployment and an adhoc pipeline can be seen in "cicd.template.yml" by following where the `Conditions` are used. In short, an adhoc creates an adhoc environment using "adhoc.config.yml", while a standard deployment will create a Test environment and a Prod environment using the relevent config files.
61+
Note: your branch name cannot contain the character `\`, as this causes issues in AWS.
6162

6263
```
6364
TARGET_BRANCH=mybranch MODE=adhoc cicd/2-cicd/deploy-cicd.sh

0 commit comments

Comments
 (0)