---
### ✨ Have you heard of <a href="https://github.com/cdklabs/cdk-monitoring-constructs">cdk-monitoring-constructs</a>? ✨</span>
Watchful on steroids. Check it out! 🔝
---
# cdk-watchful
> Watching your CDK back since 2019
Watchful is an [AWS CDK](https://github.com/awslabs/aws-cdk) construct library that makes it easy
to monitor CDK apps. It automatically synthesizes alarms and dashboards for supported AWS resources.
```python
# my_table: dynamodb.Table
# my_function: lambda.Function
# my_rest_api: apigw.RestApi
wf = Watchful(self, "watchful")
wf.watch_dynamo_table("My Cute Little Table", my_table)
wf.watch_lambda_function("My Function", my_function)
wf.watch_api_gateway("My REST API", my_rest_api)
```
And...
![](https://raw.githubusercontent.com/eladb/cdk-watchful/master/example/sample.png)
## Initialize
To get started, just define a `Watchful` construct in your CDK app.
You can initialize using an email address, SQS ARN or both:
```python
import aws_cdk.aws_sns as sns
import aws_cdk.aws_sqs as sqs
alarm_sqs = sqs.Queue.from_queue_arn(self, "AlarmQueue", "arn:aws:sqs:us-east-1:444455556666:alarm-queue")
alarm_sns = sns.Topic.from_topic_arn(self, "AlarmTopic", "arn:aws:sns:us-east-2:444455556666:MyTopic")
wf = Watchful(self, "watchful",
alarm_email="your@email.com",
alarm_sqs=alarm_sqs,
alarm_sns=alarm_sns,
alarm_action_arns=["arn:aws:sqs:us-east-1:444455556666:alarm-queue"]
)
```
## Add Resources
Watchful manages a central dashboard and configures default alarming for:
* Amazon DynamoDB: `watchful.watchDynamoTable`
* AWS Lambda: `watchful.watchLambdaFunction`
* Amazon API Gateway: `watchful.watchApiGateway`
* [Request yours](https://github.com/eladb/cdk-watchful/issues/new)
## Watching Scopes
Watchful can also watch complete CDK construct scopes. It will automatically
discover all watchable resources within that scope (recursively), add them
to your dashboard and configure alarms for them.
```python
# storage_layer: Stack
# wf: Watchful
wf.watch_scope(storage_layer)
```
## Example
See a more complete [example](https://github.com/eladb/cdk-watchful/blob/master/example/index.ts).
## Contributing
Contributions of all kinds are welcome and celebrated. Raise an issue, submit a PR, do the right thing.
To set up a dev environment:
1. Clone this repo
2. `yarn`
Development workflow (change code and run tests automatically):
```shell
yarn test:watch
```
Build (like CI):
```shell
yarn build
```
And then publish as a PR.
## License
[Apache 2.0](https://github.com/eladb/cdk-watchful/blob/master/LICENSE)
Raw data
{
"_id": null,
"home_page": "https://github.com/eladb/cdk-watchful.git",
"name": "cdk-watchful",
"maintainer": "",
"docs_url": null,
"requires_python": "~=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Amazon Web Services<aws-cdk-dev@amazon.com>",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/20/9e/560f5c780d8db939e58d30274eeb31f0bf7ba71c10b817b1081e4a35c951/cdk-watchful-0.6.454.tar.gz",
"platform": null,
"description": "---\n\n\n### \u2728 Have you heard of <a href=\"https://github.com/cdklabs/cdk-monitoring-constructs\">cdk-monitoring-constructs</a>? \u2728</span>\n\nWatchful on steroids. Check it out! \ud83d\udd1d\n\n---\n\n\n# cdk-watchful\n\n> Watching your CDK back since 2019\n\nWatchful is an [AWS CDK](https://github.com/awslabs/aws-cdk) construct library that makes it easy\nto monitor CDK apps. It automatically synthesizes alarms and dashboards for supported AWS resources.\n\n```python\n# my_table: dynamodb.Table\n# my_function: lambda.Function\n# my_rest_api: apigw.RestApi\n\n\nwf = Watchful(self, \"watchful\")\nwf.watch_dynamo_table(\"My Cute Little Table\", my_table)\nwf.watch_lambda_function(\"My Function\", my_function)\nwf.watch_api_gateway(\"My REST API\", my_rest_api)\n```\n\nAnd...\n\n![](https://raw.githubusercontent.com/eladb/cdk-watchful/master/example/sample.png)\n\n## Initialize\n\nTo get started, just define a `Watchful` construct in your CDK app.\nYou can initialize using an email address, SQS ARN or both:\n\n```python\nimport aws_cdk.aws_sns as sns\nimport aws_cdk.aws_sqs as sqs\n\n\nalarm_sqs = sqs.Queue.from_queue_arn(self, \"AlarmQueue\", \"arn:aws:sqs:us-east-1:444455556666:alarm-queue\")\nalarm_sns = sns.Topic.from_topic_arn(self, \"AlarmTopic\", \"arn:aws:sns:us-east-2:444455556666:MyTopic\")\n\nwf = Watchful(self, \"watchful\",\n alarm_email=\"your@email.com\",\n alarm_sqs=alarm_sqs,\n alarm_sns=alarm_sns,\n alarm_action_arns=[\"arn:aws:sqs:us-east-1:444455556666:alarm-queue\"]\n)\n```\n\n## Add Resources\n\nWatchful manages a central dashboard and configures default alarming for:\n\n* Amazon DynamoDB: `watchful.watchDynamoTable`\n* AWS Lambda: `watchful.watchLambdaFunction`\n* Amazon API Gateway: `watchful.watchApiGateway`\n* [Request yours](https://github.com/eladb/cdk-watchful/issues/new)\n\n## Watching Scopes\n\nWatchful can also watch complete CDK construct scopes. It will automatically\ndiscover all watchable resources within that scope (recursively), add them\nto your dashboard and configure alarms for them.\n\n```python\n# storage_layer: Stack\n# wf: Watchful\n\n\nwf.watch_scope(storage_layer)\n```\n\n## Example\n\nSee a more complete [example](https://github.com/eladb/cdk-watchful/blob/master/example/index.ts).\n\n## Contributing\n\nContributions of all kinds are welcome and celebrated. Raise an issue, submit a PR, do the right thing.\n\nTo set up a dev environment:\n\n1. Clone this repo\n2. `yarn`\n\nDevelopment workflow (change code and run tests automatically):\n\n```shell\nyarn test:watch\n```\n\nBuild (like CI):\n\n```shell\nyarn build\n```\n\nAnd then publish as a PR.\n\n## License\n\n[Apache 2.0](https://github.com/eladb/cdk-watchful/blob/master/LICENSE)\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Watching your CDK apps since 2019",
"version": "0.6.454",
"project_urls": {
"Homepage": "https://github.com/eladb/cdk-watchful.git",
"Source": "https://github.com/eladb/cdk-watchful.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e67d486759cef2327b658d765f9754a0f2007f1ac9c01a006affdb0343dc4a6d",
"md5": "0b9b0c7a0eec08e5114ace521c3751d8",
"sha256": "7eadd57f8cc4a5a24d92a14f3b60e274b6cfe4027cdecf7545d5d6d53abef8d7"
},
"downloads": -1,
"filename": "cdk_watchful-0.6.454-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0b9b0c7a0eec08e5114ace521c3751d8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.7",
"size": 195233,
"upload_time": "2023-07-02T00:13:44",
"upload_time_iso_8601": "2023-07-02T00:13:44.153003Z",
"url": "https://files.pythonhosted.org/packages/e6/7d/486759cef2327b658d765f9754a0f2007f1ac9c01a006affdb0343dc4a6d/cdk_watchful-0.6.454-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "209e560f5c780d8db939e58d30274eeb31f0bf7ba71c10b817b1081e4a35c951",
"md5": "79afd165c6055a650f9f9a73aba5c06a",
"sha256": "c80f5e748510f714b16c4020fa9907d383999392e2587e42cd5742112e8002a1"
},
"downloads": -1,
"filename": "cdk-watchful-0.6.454.tar.gz",
"has_sig": false,
"md5_digest": "79afd165c6055a650f9f9a73aba5c06a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.7",
"size": 196896,
"upload_time": "2023-07-02T00:13:46",
"upload_time_iso_8601": "2023-07-02T00:13:46.457271Z",
"url": "https://files.pythonhosted.org/packages/20/9e/560f5c780d8db939e58d30274eeb31f0bf7ba71c10b817b1081e4a35c951/cdk-watchful-0.6.454.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-02 00:13:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "eladb",
"github_project": "cdk-watchful",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cdk-watchful"
}