Skip to content

Commit 1bd577f

Browse files
docs: prefer slack app alert guidance (#1350)
1 parent e12e48f commit 1bd577f

8 files changed

Lines changed: 17 additions & 28 deletions

File tree

examples/advanced-project-js/src/__checks__/utils/alert-channels.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { URL } = require('node:url')
22

33
const {
44
EmailAlertChannel,
5-
SlackAlertChannel,
5+
SlackAppAlertChannel,
66
WebhookAlertChannel,
77
} = require('checkly/constructs')
88

@@ -25,11 +25,8 @@ const emailChannel = new EmailAlertChannel('email-channel-1', {
2525
...sendDefaults,
2626
})
2727

28-
const slackChannel = new SlackAlertChannel('slack-channel-1', {
29-
url: new URL(
30-
'https://hooks.slack.com/services/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'
31-
),
32-
channel: '#ops',
28+
const slackChannel = new SlackAppAlertChannel('slack-channel-1', {
29+
slackChannels: ['#ops'],
3330
...sendDefaults,
3431
})
3532

examples/advanced-project/src/__checks__/utils/alert-channels.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { URL } from 'node:url'
22
import {
33
EmailAlertChannel,
4-
SlackAlertChannel,
4+
SlackAppAlertChannel,
55
WebhookAlertChannel
66
} from 'checkly/constructs'
77

@@ -25,9 +25,8 @@ export const emailChannel = new EmailAlertChannel('email-channel-1', {
2525
...sendDefaults
2626
})
2727

28-
export const slackChannel = new SlackAlertChannel('slack-channel-1', {
29-
url: new URL('https://hooks.slack.com/services/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'),
30-
channel: '#ops',
28+
export const slackChannel = new SlackAppAlertChannel('slack-channel-1', {
29+
slackChannels: ['#ops'],
3130
...sendDefaults
3231
})
3332

packages/cli/src/ai-context/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Agent Skills are a standardized format for giving AI agents specialized knowledg
2222
- Create and manage API checks, Browser Checks, URL monitors, and other monitors
2323
- Set up Playwright-based Browser and Multistep checks and Playwright Check Suites
2424
- Configure Heartbeat Monitors for cron jobs and scheduled tasks
25-
- Define alert channels (email, Slack, phone, webhooks, etc.)
25+
- Define alert channels (email, Slack App, phone, webhooks, etc.)
2626
- Build dashboards and status pages
2727
- Follow monitoring-as-code best practices with the Checkly CLI
2828

packages/cli/src/ai-context/context.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const REFERENCES = [
4545
},
4646
{
4747
id: 'configure-alert-channels',
48-
description: 'Email (`EmailAlertChannel`), Phone (`PhoneCallAlertChannel`), Slack (`SlackAlertChannel`), and Slack App (`SlackAppAlertChannel`) alert channels',
48+
description: 'Email (`EmailAlertChannel`), Phone (`PhoneCallAlertChannel`), Slack App (`SlackAppAlertChannel`), and other alert channels',
4949
},
5050
{
5151
id: 'configure-supporting-constructs',
@@ -276,11 +276,6 @@ const playwrightChecks = new PlaywrightCheck("multi-browser-check", {
276276
exampleConfigPath: 'resources/alert-channels/phone-call/test-user.check.ts',
277277
reference: 'https://www.checklyhq.com/docs/constructs/phone-call-alert-channel/',
278278
},
279-
SLACK_ALERT_CHANNEL: {
280-
templateString: '<!-- EXAMPLE: SLACK_ALERT_CHANNEL -->',
281-
exampleConfigPath: 'resources/alert-channels/slack/general.check.ts',
282-
reference: 'https://www.checklyhq.com/docs/constructs/slack-alert-channel/',
283-
},
284279
SLACK_APP_ALERT_CHANNEL: {
285280
templateString: '<!-- EXAMPLE: SLACK_APP_ALERT_CHANNEL -->',
286281
exampleConfigPath: 'resources/alert-channels/slack-app/alerts-ops-alice.check.ts',

packages/cli/src/ai-context/references/configure-alert-channels.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ Here are some examples of how to create different types of alert channels.
77

88
All available alerts are described in the [Checkly docs](https://www.checklyhq.com/docs/constructs/overview/).
99

10-
*Important*: Don't make up email addresses, phone numbers, Slack URLs or similar static values. Scan the project to discover a valid configuration or ask what the values should be.
10+
*Important*: Don't make up email addresses, phone numbers, Slack channel names or similar static values. Scan the project to discover a valid configuration or ask what the values should be.
11+
12+
For new Slack notifications, prefer `SlackAppAlertChannel`. It uses the Checkly Slack App and only needs Slack `#channel` names or `@user` handles in `slackChannels`.
1113

1214
## Email Alert Channel
1315

@@ -17,10 +19,6 @@ All available alerts are described in the [Checkly docs](https://www.checklyhq.c
1719

1820
<!-- EXAMPLE: PHONE_CALL_ALERT_CHANNEL -->
1921

20-
## Slack Alert Channel
21-
22-
<!-- EXAMPLE: SLACK_ALERT_CHANNEL -->
23-
2422
## Slack App Alert Channel
2523

2624
<!-- EXAMPLE: SLACK_APP_ALERT_CHANNEL -->

packages/cli/src/constructs/alert-channel.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ export class AlertChannelRef extends Construct {
122122
* sendDegraded: false
123123
* })
124124
*
125-
* // Slack alert channel with SSL monitoring
126-
* const slackAlert = new SlackAlertChannel('team-slack', {
127-
* url: 'https://hooks.slack.com/services/...',
125+
* // Slack App alert channel with SSL monitoring
126+
* const slackAlert = new SlackAppAlertChannel('team-slack', {
127+
* slackChannels: ['#alerts'],
128128
* sslExpiry: true,
129129
* sslExpiryThreshold: 7 // Alert 7 days before SSL expiry
130130
* })

packages/cli/src/constructs/check.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ export interface CheckProps {
191191
* const emailChannel = new EmailAlertChannel('team-email', {
192192
* address: 'team@example.com'
193193
* })
194-
* const slackChannel = new SlackAlertChannel('team-slack', {
195-
* url: 'https://hooks.slack.com/...'
194+
* const slackChannel = new SlackAppAlertChannel('team-slack', {
195+
* slackChannels: ['#alerts']
196196
* })
197197
*
198198
* // Reference the channels in your check

skills/checkly/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Agent Skills are a standardized format for giving AI agents specialized knowledg
2222
- Create and manage API checks, Browser Checks, URL monitors, and other monitors
2323
- Set up Playwright-based Browser and Multistep checks and Playwright Check Suites
2424
- Configure Heartbeat Monitors for cron jobs and scheduled tasks
25-
- Define alert channels (email, Slack, phone, webhooks, etc.)
25+
- Define alert channels (email, Slack App, phone, webhooks, etc.)
2626
- Build dashboards and status pages
2727
- Follow monitoring-as-code best practices with the Checkly CLI
2828

0 commit comments

Comments
 (0)