Skip to content

Commit 3d37669

Browse files
committed
docs: add group behavior for overridable settings in cli
1 parent 0d838c4 commit 3d37669

File tree

1 file changed

+63
-1
lines changed

1 file changed

+63
-1
lines changed

site/content/docs/cli/constructs-reference.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,10 @@ This brings the following benefits:
392392
2. You can trigger all Checks in a group from the web UI and via a command line trigger.
393393
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.
394394

395+
> Groups can behave as a folder without shared configuartion for checks if no overrides are defined for certain propeties.
396+
395397
> [!WARNING]
396-
> 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!
398+
> Adding a check to a group that has defined group-level alert settings means the check will _only_ alert through the group's alert channels. Make sure your group has connected alert channels, or you might miss out on important alerts!
397399
398400
> 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.
399401
@@ -455,6 +457,66 @@ new ApiCheck('check-group-api-check-1', {
455457
> Note that you can configure two different `frequency` properties for API and Browser checks in a `CheckGroup` separately.
456458
> The CLI follows a fallback logic using `Check->CheckGroup->Project` configurations.
457459
460+
### Folder-like behavior
461+
462+
Groups can behave like folders, with no group-level configuration applied, meaning checks inside that group will run with its own check-level configuration.
463+
464+
The following group-level properties will have no effect on check runs if not defined (e.g. set as empty array `[]`, `null`, or `FALLBACK`):
465+
466+
- `runParallel`: `null` vs. overrideable configuration `true/false`.
467+
- `locations`: `[]` vs. overrideable configuration, , i.e. `['us-east-1', 'eu-west-1']`.
468+
- `privateLocations`: `[]` vs. overrideable configuration (slugs), i.e. `['datacenter-east-1']`.
469+
- `retryStrategy`: `FALLBACK` vs. [RetryStrategy](/docs/cli/constructs-reference/#retrystrategy) object.
470+
- `alertSettings`: `null` vs. [AlertSettings](/docs/cli/constructs-reference/#alertsettings) object.
471+
472+
> Note: group-level locations settings will override check-level configuation if one, or both of `locations` or `privateLocations` are defined to something other than an empty array `[]`.
473+
474+
```ts {title="group.check.ts"}
475+
import { CheckGroup, ApiCheck, Frequency } from 'checkly/constructs'
476+
477+
const group = new CheckGroup('check-group-1', {
478+
name: 'Group',
479+
activated: true,
480+
tags: ['api-group'],
481+
})
482+
483+
new ApiCheck('check-group-api-check-1', {
484+
name: 'API check #1',
485+
group,
486+
request: {
487+
method: 'GET',
488+
url: 'https://mac-demo-repo.vercel.app/api/hello',
489+
},
490+
locations: ['eu-west-3', 'eu-south-1'],
491+
retryStrategy: RetryStrategyBuilder.linearStrategy({
492+
baseBackoffSeconds: 60,
493+
maxRetries: 2,
494+
maxDurationSeconds: 600,
495+
sameRegion: true,
496+
}),
497+
alertSettings: {
498+
escalationType: RUN_BASED,
499+
runBasedEscalation: {
500+
failedRunThreshold: 1
501+
},
502+
timeBasedEscalation: {
503+
minutesFailingThreshold: 5
504+
},
505+
reminders: {
506+
amount: 0,
507+
interval: 5
508+
},
509+
parallelRunFailureThreshold: {
510+
enabled: true,
511+
percentage: 10
512+
}
513+
}
514+
})
515+
```
516+
517+
In this example, the API check that belongs to the group will run with its own settings for `locations`, `retryStrategy` and `alertSettings`.
518+
519+
458520
## `AlertChannel`
459521

460522
Alert channels let you get alert notifications when a Check fails. [Learn more about alerting in our docs](/docs/alerting/)

0 commit comments

Comments
 (0)