We would really love for you to contribute in any way to SLIC Watch!
When contributing to this repository, it would be great if you could first discuss the change you wish to make via issue, email, or any other method with the owners of this repository.
Note that we have a code of conduct. Please follow it in all your interactions with the project.
There are are a number of areas where you can contribute right now.
- Have feedback? Did you find a bug? Let us know in the Issues.
- We may label some of the open issues with the "help wanted" label. You can see them here. Let us know in the issue if you are planning to work on it so we can share ideas.
- Sometimes we will label issues as "good first issue". If you are new to open source or just to some of the areas this project covers, these issues are a great way to get started. The list is here.
See the pull request template.
For every AWS service, there are metrics and dimensions that can be observed. SLIC Watch should come with sane defaults. When we want to create alarms and dashboards, you need to identify the metrics that are most important for visualisation in dashboards and alerting through alarms.
The following is a checklist of steps that must be followed to add support for alarms and dashboards relating to a new AWS resource.
- Identify the metrics and statistics for the service. The set of metrics you want to alert on might be different to those you wish to visualise in the dashboard.
- Update the serverless-test-project to add an example of the kind of resource you want to monitor with SLIC Watch. We have a separate YAML file for Serverless Framework v2 and v3, both of which include a common resources file. You may need to update that file in addition to serverless.yml and serverless-v2.yml.
- Unit tests use a compiled CloudFormation stack generated from the
serverless-test-project
. This needs to be manually generated for each new supported feature. a. Once you have added the new resource toserverless-test-project
, compile the project to generate the CloudFormation JSON by runningserverless package
b. Copyserverless-test-project/.serverless/cloudformation-template-update-stack.json
to serverless-plugin/tests/resources/cloudformation-template-stack.json. c. Manually editserverless-plugin/tests/resources/cloudformation-template-stack.json
to remove anyAWS::CloudWatch::Dashboard
andAWS::CloudWatch::Alarm
resources. This is important since we need the unit tests to generate these resources, so they cannot exist in the source template - Snapshot tests are used to detect breaking or problematic changes in generated templates. They are automatically run with
npm test
but can be run in isolation withnpm run test:snapshots
. Snapshots can be regenerated (if you really are sure that they should be updated!) withnpm run test:snapshots:generate
- Add alarms:
a. Create a new
alarms-<service>.js
module in serverless-plugin. One of the existingalarms-<service>.js
modules may be used as a template. b. Update serverless-plugin/alarms.js to wire in the newalarms-<service>
module. c. Create a unit test for the new alarm module and update alarms.test.js to add coverage for the new resource. This will use the CloudFormation template you updated above. - Add dashboard widgets: a. Add support for the new dashboard widgets in serverless-plugin/dashboard.js b. Update dashboard.test.js to add coverage for the new resource
- Update SLIC Watch configuration support: a. Add default values for your resource's alarm and dashboard configuration in default-config.js. b. Update the JSON schema for SLIC Watch configuration (config-schema.js). Here, you can define the supported alarm metrics and widgets.
- Manually (or using automation) integration test the new feature
a. The method will vary based on the resource type, but the idea is to trigger alarms and generate metrics to validate that both alarms and dashboards are working as expected. You can use the resource you added to
serverless-test-project
for this. b. For example integration tests, see the Python-based notebooks in testing. - Update the README.md: a. Include the updated default configuration b. Add the new resource type to the list of features c. Update the dashboard screenshots to include your new widget with metrics shown (using Dark Mode in the CloudWatch Console!)