-
Notifications
You must be signed in to change notification settings - Fork 37
Checkly Groups Makeover - First Draft of dev docs rewrite #1264
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
Changes from all commits
aea7dc7
ffdd77e
e1b92c1
88e02df
7502879
3c96062
d21e2d6
6294345
37a8a2b
c28cf81
2219e63
7d18cff
bedf817
8924468
069d741
958608c
66c3a3b
c452605
87e00c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -382,35 +382,34 @@ TcpAssertionBuilder.responseData().contains('ping') | |||||
"{ source: 'RESPONSE_DATA', regex: '', property: '', comparison: 'CONTAINS', target: 'ping' }" | ||||||
``` | ||||||
|
||||||
## `CheckGroup` | ||||||
## `CheckGroupV2` | ||||||
|
||||||
You can explicitly organize Checks in Check Groups. | ||||||
|
||||||
This brings the following benefits: | ||||||
Use the CheckGroupV2 construct to organize your Checks into groups. This comes with the following benefits: | ||||||
|
||||||
1. Your Checks are organized in a folder in the Checkly web UI. | ||||||
2. You can trigger all Checks in a group from the web UI and via a command line trigger. | ||||||
3. You can manage group-level configuration like the runtime, activated & muted-state, tags and alert channels that trickle down to all the Checks in the group. | ||||||
|
||||||
> [!WARNING] | ||||||
> Adding a check to a group means having it _only_ alert through the group's alert channels. Make sure your group has connected alert channels, or you might miss out on important alerts! | ||||||
> If you add a check to a group with group-level alert settings ON, the check will only send alerts through the group’s alert channels. Make sure the group has at least one alert channel connected, otherwise you won’t receive any alerts for that check. | ||||||
|
||||||
> Note: you will notice that managing shared configuration between Checks is very easy just using JS/TS. You might not need Check Groups for that purpose. | ||||||
|
||||||
#### Adding Checks to a Check Group | ||||||
|
||||||
You can add a Check to a group in two ways. | ||||||
|
||||||
1. By passing the `CheckGroup` object for the `group` property of a Check. | ||||||
1. By passing the `CheckGroupV2` object for the `group` property of a Check. | ||||||
2. For Browser Checks, we allow you to use the `testMatch` glob pattern to include any `.spec.js|ts` file, without having to | ||||||
create a `BrowserCheck` construct. This works the same ast the `testMatch` glob at the Project level. | ||||||
|
||||||
```ts {title="group.check.ts"} | ||||||
import { CheckGroup, ApiCheck, Frequency } from 'checkly/constructs' | ||||||
import { CheckGroupV2, ApiCheck, Frequency } from 'checkly/constructs' | ||||||
|
||||||
const group = new CheckGroup('check-group-1', { | ||||||
const group = new CheckGroupV2('check-group-1', { | ||||||
name: 'Group', | ||||||
activated: true, | ||||||
muted: false, | ||||||
frequency: Frequency.EVERY_15M, | ||||||
locations: ['us-east-1', 'eu-west-1'], | ||||||
tags: ['api-group'], | ||||||
|
@@ -431,33 +430,83 @@ new ApiCheck('check-group-api-check-1', { | |||||
}) | ||||||
``` | ||||||
|
||||||
- `name`: A friendly name for your Check Group. | ||||||
- `name` (required): A friendly name for your Check Group. | ||||||
- `activated`: Boolean that determines whether the Checks in the group are running or not. When set to true (default), all activated Checks within the group will run. When set to false, no Checks in the group will run, regardless of whether they are activated or not. | ||||||
- `muted`: Boolean that controls alerting behavior for the group. When set to false (default), alerting follows the individual Check’s muted setting. When set to true, no alerts will be sent for any Checks in the group — even if the individual Checks are not muted. | ||||||
- `concurrency`: A number indicating the amount of concurrent Checks to run when a group is triggered. | ||||||
- `frequency`: How often to run the Checks within the group, i.e. `Frequency.EVERY_15M` for every fifteen minutes. | ||||||
- `locations`: An array of location codes where to run the Checks in the group, i.e. `['us-east-1', 'eu-west-1']`. | ||||||
- `privateLocations`: An array of [Private Locations](/docs/private-locations/) slugs, i.e. `['datacenter-east-1']`. | ||||||
- `alertChannels`: An array of `AlertChannel` objects to which to send alert notifications. | ||||||
- `activated`: A boolean value if all the Checks in the group are activated. | ||||||
- `muted`: A boolean value if alert notifications from the Checks in the group are muted, i.e. not sent out. | ||||||
- `tags`: An array of tags. Group tags trickle down to tags on the individual Checks. i.e. `['product', 'api']` | ||||||
- `runtimeId`: The ID of which [runtime](/docs/runtimes/specs/) to use for the Checks in the group. | ||||||
- `environmentVariables`: An array of objects defining variables in the group scope, i.e. `[{ key: 'DEBUG', value: 'true', secret: true | locked: true }]` | ||||||
- `locations`: An array of one or more [public locations](/docs/monitoring/global-locations) where Checks in this group should run (e.g. `['us-east-1', 'eu-west-1']`). If this or `privateLocations` is set, it overrides the location settings of all Checks in the group. | ||||||
- `privateLocations`: An array of one or more [private locations](/docs/private-locations) where Checks in this group should run (e.g. `['datacenter-east-1']`). If this or `locations` is set, it overrides the location settings of all Checks in the group. | ||||||
- `alertChannels`: An array of [AlertChannel](#alertchannel) objects to be alerted on when checks in this group fail or recover. | ||||||
- `tags`: An array of tags i.e. `['product', 'api']`. Group tags trickle down to tags on the individual Checks. | ||||||
- `runtimeId`: The ID of which [runtime](/docs/runtimes/specs/) to use for the Checks in the group. Use this if the checks in this group require a different runtime than your account default. | ||||||
- `environmentVariables`: An array of objects defining [environment variables in the group scope](/docs/groups/variables), i.e. `[{ key: 'DEBUG', value: 'true', secret: true | locked: true }]`. | ||||||
- `localSetupScript`: Any JS/TS code as a string to run before each API Check in this group. | ||||||
- `localTearDownScript`: Any JS/TS code as a string to run after each API Check in this group. | ||||||
- `retryStrategy`: A [RetryStrategy](#retrystrategy) object configuring [retries](/docs/alerting-and-retries/) for failed check runs. | ||||||
- `apiCheckDefaults`: A set of defaults for API Checks. This should not be needed. Just compose shared defaults using JS/TS. | ||||||
- `retryStrategy`: A [RetryStrategy](#retrystrategy) object configuring [retries](/docs/alerting-and-retries/) for failed Check runs. If set, all checks in the group use the group's retry strategy. If not set, individual Check settings are used. | ||||||
- `apiCheckDefaults`: A set of [defaults for API Checks](/docs/groups/api-check-defaults/). This should not be needed. Just compose shared defaults using JS/TS. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's apiCheckDefaults? given this text I'd deprecate this option entirely. Such a funny paragraph you run into :)
Suggested change
we'd also need to deprecate in the docs page 😅 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. they're not deprecated as far as I can see - I'm proposing that they do become deprecated based on the docs saying "you don't need this, just use JS/TS code to do it" - I'd check usage before doing such deprecation, but still, felt inconsistent There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah! I thought @sorccu mentioned that they are in fact deprecated, but maybe I mixed something up :) |
||||||
- `browserChecks`: A set of defaults for Browser Checks. This should not be needed. Just compose shared defaults using JS/TS. | ||||||
- `runParallel`: A boolean value if check should run in parallel (all locations at the same time) or round-robin. | ||||||
- `alertEscalationPolicy`: An [AlertEscalationPolicy](#alertescalationpolicy) object configuring [alert-settings](/docs/alerting-and-retries/) for check runs. | ||||||
- `runParallel`: Controls how Checks in the group are executed across locations. When `true`, all Checks run in parallel across all configured locations. When `false`, they run in round-robin mode. If **not set**, each Check uses its own scheduling strategy. | ||||||
- `alertEscalationPolicy`: An [AlertEscalationPolicy](#alertescalationpolicy) object defines [alert-settings](/docs/alerting-and-retries/) for Check runs. If **set**, it overrides the alert settings of all checks in the group. If **not set**, each Check uses its own alert configuration. | ||||||
|
||||||
> When adding checks to a group using `testMatch`, the CLI searches for files using the corresponding [check file](/docs/cli/using-check-test-match/#checkscheckmatch) as a base path. | ||||||
> When you use `testMatch` to add Checks to a group, the CLI searches for matching files using the corresponding [Check file](/docs/cli/using-check-test-match/#checkscheckmatch) as a base path. | ||||||
|
||||||
> Note that you can configure two different `frequency` properties for API and Browser checks in a `CheckGroup` separately. | ||||||
> The CLI follows a fallback logic using `Check->CheckGroup->Project` configurations. | ||||||
|
||||||
## `CheckGroup` (deprecated) | ||||||
|
||||||
As of CLI release v6.0 the CheckGroup construct is deprecated and will be removed in a future version. We recommend migrating to [CheckGroupV2](#checkgroupv2), which offers more intuitive behavior and better control. | ||||||
|
||||||
In the deprecated `CheckGroup`, the properties `runParallel`, `locations`, `privateLocations`, `alertEscalationPolicy`, and `retryStrategy` were always treated as overrides. Even when not explicitly set, default values were applied and used to override the Check’s individual settings. With `CheckGroupV2`, no value means no override. If these fields are left undefined, Checks will use their own individual configuration. | ||||||
|
||||||
Please double-check your group definitions when migrating to make sure your Check behavior stays consistent. For a full overview of what’s changing and what to watch out for, check out our [migration guide](https://feedback.checklyhq.com/changelog/checkly-groups-update-organize-checks-your-way). | ||||||
|
||||||
## `AlertSettings` | ||||||
|
||||||
[Alert settings](/docs/alerting-and-retries/alert-settings/#alert-settings) let you to control when and how often you will be notified when a Check starts failing, degrades or recovers. | ||||||
|
||||||
Here’s what the configuration object looks like: | ||||||
|
||||||
- `reminders`: Defines how many reminder notifications to send (amount) and the time interval between them in minutes (interval) while an alert is active. | ||||||
- `escalationType`: Specifies the escalation strategy. Possible values include `RUN_BASED` (escalate after a number of failed runs) or `TIME_BASED` (escalate after a time threshold). | ||||||
- `runBasedEscalation`: Configures run-based escalation. `failedRunThreshold` defines how many failed runs trigger escalation. | ||||||
- `timeBasedEscalation`: Configures time-based escalation. `minutesFailingThreshold` defines how long a Check must be failing before escalation. | ||||||
- `parallelRunFailureThreshold`: Optional. Enables escalation based on the percentage of parallel runs that fail. Use `enabled` to toggle this, and `percentage` to define the failure threshold. | ||||||
|
||||||
```ts {title="api.check.ts"} | ||||||
import { ApiCheck, RetryStrategyBuilder } from 'checkly/constructs' | ||||||
|
||||||
new ApiCheck('retrying-check', { | ||||||
name: 'Check With Retries', | ||||||
request: { | ||||||
method: 'GET', | ||||||
url: 'https://danube-web.shop/api/books' | ||||||
} | ||||||
alertSettings: { | ||||||
reminders: { | ||||||
amount: 0, | ||||||
interval: 5 | ||||||
}, | ||||||
escalationType: "RUN_BASED", | ||||||
runBasedEscalation: { | ||||||
failedRunThreshold: 1 | ||||||
}, | ||||||
timeBasedEscalation: { | ||||||
minutesFailingThreshold: 5 | ||||||
}, | ||||||
parallelRunFailureThreshold: { | ||||||
enabled: false, | ||||||
percentage: 10 | ||||||
} | ||||||
} | ||||||
}) | ||||||
``` | ||||||
|
||||||
## `AlertChannel` | ||||||
|
||||||
Alert channels let you get alert notifications when a Check fails. [Learn more about alerting in our docs](/docs/alerting/) | ||||||
Alert channels let you get alert notifications when a Check fails. [Learn more about alerting in our docs](/docs/alerting/). | ||||||
|
||||||
All alert channels share a set of common properties to define when / how they should alert derived from the abstract class | ||||||
`AlertChannel` | ||||||
|
||||||
|
Uh oh!
There was an error while loading. Please reload this page.