Skip to content

docs(synthetics): canary schedule section in README#15352

Merged
mergify[bot] merged 5 commits intoaws:masterfrom
jonrhall:master
Sep 22, 2021
Merged

docs(synthetics): canary schedule section in README#15352
mergify[bot] merged 5 commits intoaws:masterfrom
jonrhall:master

Conversation

@jonrhall
Copy link
Copy Markdown
Contributor

This PR adds more extensive documentation for how to schedule CloudWatch Synthetics canary cron jobs via CDK, because today the service documentation for how to schedule cron jobs is lacking and takes developers a lot of investigation to figure out how to make it work successfully.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Jun 29, 2021

@peterwoodworth peterwoodworth added the @aws-cdk/aws-synthetics Related to Amazon CloudWatch Synthetics label Jul 6, 2021
Copy link
Copy Markdown
Contributor

@BenChaimberg BenChaimberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for improving our documentation! these are the most important contributions in my book, so sorry for the massive comment-to-changed-line ratio


Configure a run rate of up to 60 minutes with `synthetics.Schedule.rate`:

```js
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```js
```ts


If expanded access to scheduling the canary is needed, use `synthetics.Schedule.expression` with [cron expressions, as defined here](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_cron.html), for example:

```js
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```js
```ts



### Canary Schedule
You can set the canary `schedule` property by assigning it a value with the `synthetics.Schedule` [class](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-synthetics.Schedule.html).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"set the canary schedule property" is not really a helpful statement, how about something like "Specify the schedule on which a canary runs by providing a Schedule value to the schedule property."?

synthetics.Schedule.rate(Duration.minutes(5)), // Run every 5 minutes.
```

If expanded access to scheduling the canary is needed, use `synthetics.Schedule.expression` with [cron expressions, as defined here](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_cron.html), for example:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If expanded access to scheduling the canary is needed, use `synthetics.Schedule.expression` with [cron expressions, as defined here](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_cron.html), for example:
If expanded access to scheduling the canary is needed, use `Schedule.expression` with [cron expressions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_cron.html):

```js
synthetics.Schedule.expression('cron(0 0,8,16 * * ? *)'), // Run at 12am, 8am, 4pm UTC every day
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also add a small section about once

Configure a run rate of up to 60 minutes with `synthetics.Schedule.rate`:

```js
synthetics.Schedule.rate(Duration.minutes(5)), // Run every 5 minutes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
synthetics.Schedule.rate(Duration.minutes(5)), // Run every 5 minutes.
Schedule.rate(Duration.minutes(5)), // Run every 5 minutes.

### Canary Schedule
You can set the canary `schedule` property by assigning it a value with the `synthetics.Schedule` [class](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-synthetics.Schedule.html).

Configure a run rate of up to 60 minutes with `synthetics.Schedule.rate`:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Configure a run rate of up to 60 minutes with `synthetics.Schedule.rate`:
Configure a run rate of up to 60 minutes with `Schedule.rate`:

If expanded access to scheduling the canary is needed, use `synthetics.Schedule.expression` with [cron expressions, as defined here](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_cron.html), for example:

```js
synthetics.Schedule.expression('cron(0 0,8,16 * * ? *)'), // Run at 12am, 8am, 4pm UTC every day
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
synthetics.Schedule.expression('cron(0 0,8,16 * * ? *)'), // Run at 12am, 8am, 4pm UTC every day
Schedule.expression('cron(0 0,8,16 * * ? *)'), // Run at 12am, 8am, 4pm UTC every day

@kaizencc kaizencc assigned kaizencc and unassigned BenChaimberg Sep 22, 2021
@kaizencc kaizencc self-requested a review September 22, 2021 21:57
kaizencc
kaizencc previously approved these changes Sep 22, 2021
@mergify mergify bot dismissed kaizencc’s stale review September 22, 2021 21:59

Pull request has been modified.

@kaizencc kaizencc changed the title docs(synthetics): Updated CloudWatch Synthetics README with canary scheduling details. docs(synthetics): canary schedule section in README Sep 22, 2021
@kaizencc kaizencc self-requested a review September 22, 2021 21:59
@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: ef63e22
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit e84efd9 into aws:master Sep 22, 2021
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Sep 22, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

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

Labels

@aws-cdk/aws-synthetics Related to Amazon CloudWatch Synthetics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants