Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document CloudWatch alarms #607

Open
Nemo64 opened this issue Mar 29, 2020 · 3 comments
Open

document CloudWatch alarms #607

Nemo64 opened this issue Mar 29, 2020 · 3 comments

Comments

@Nemo64
Copy link
Contributor

Nemo64 commented Mar 29, 2020

I'd like documentation about CloudWatch alarms.

I'm not fluent in that topic yet but i'll have to experiment with it in the future so I can add something in the coming weeks.

I mean something like this CloudFormation template:

        EmailTopic:
            Type: AWS::SNS::Topic
            Properties:
                Subscription:
                    -   Endpoint: [email protected]
                        Protocol: "email"
        Alarm:
            Type: AWS::CloudWatch::Alarm
            Properties:
                ActionsEnabled: true
                AlarmActions:
                    - !Ref EmailTopic
                AlarmDescription: HTTP 4xx
                AlarmName: HTTP 4xx
                ComparisonOperator: GreaterThanThreshold
                DatapointsToAlarm: 1
                EvaluationPeriods: 1
                Dimensions:
                    - Name: ApiName
                      Value: ${self:provider.stage}-${self:service}
                MetricName: 4XXError
                Namespace: AWS/ApiGateway
                Period: 60
                Statistic: Sum
                Threshold: 1
                TreatMissingData: notBreaching

One thing that I think is especially important is to monitor is lambda scaling since the default account limit is 1000 concurrent instances and 1000 lambda instance running none-stop will be very expensive and while amazon claims that CloudFront protects agains d-dos attacks, I still want to know if someone runs an ab -c 1000 on my endpoint.... which isn't really a d-dos.

@victormacko
Copy link
Contributor

There's a serverless plugin called 'serverless-plugin-aws-alerts' which might help here.

@Nemo64
Copy link
Contributor Author

Nemo64 commented Mar 29, 2020

Good hint, although by quickly looking over it, it seems like a slightly different syntax for vanilla alarms. I think I have to experiment more with it to see what problems that plugin tries to solve.

@mnapoli
Copy link
Member

mnapoli commented Apr 5, 2020

That's interesting, I would be 👍 to merge a documentation about this.

This could fit well as a new article in the Environment section:

Capture d’écran 2020-04-05 à 12 17 14

One thing to keep in mind if you put some examples: explain clearly what the alerts are about. The code example you posted is interesting, but to be honest it's hard to clearly understand when the alarm triggers exactly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants