Skip to content

Commit

Permalink
feat: add serverless-plugin-aws-alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
brettstack committed Apr 27, 2020
1 parent a9b27c4 commit 77f523a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start:ui": "cd packages/ui && npm start",
"start:api": "sls offline cloudside"
"start:api": "sls offline cloudside",
"package": "sls package",
"deploy": "sls deploy"
},
"keywords": [],
"author": "",
Expand All @@ -34,6 +36,7 @@
"serverless-domain-manager": "^3.3.2",
"serverless-iam-roles-per-function": "^2.0.2",
"serverless-offline": "^6.1.4",
"serverless-plugin-aws-alerts": "^1.4.0",
"serverless-plugin-split-stacks": "^1.9.3",
"serverless-plugin-tracing": "^2.0.0",
"serverless-prune-plugin": "^1.4.2",
Expand Down
17 changes: 16 additions & 1 deletion serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@ provider:
level: INFO # INFO, ERROR
environment:
USER_TABLE: !Ref UserTable
# IS_OFFLINE: ${{env:IS_OFFLINE}}
alerts:
dashboards: true
nameTemplate: $[functionName]-$[metricName]-Alarm
topics:
alarm:
topic: ${{self:service}}-${{self:provider.stage}}-alerts-alarm
notifications:
- protocol: email
endpoint: [email protected]
# TODO: Add short and long alarms for each
alarms:
- functionThrottles
- functionErrors
- functionInvocations
- functionDuration

package:
individually: true
Expand All @@ -31,6 +45,7 @@ plugins:
- serverless-plugin-split-stacks
- serverless-stack-output
- serverless-cloudside-plugin
- serverless-plugin-aws-alerts
- serverless-offline

custom:
Expand Down

0 comments on commit 77f523a

Please sign in to comment.