Skip to content

Bulk monitors guide #1338

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

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
dac0a36
new guide, modified docs, drive by copy editing of an older guide
serverless-mom Jul 29, 2025
5b124f2
new page summary
serverless-mom Jul 29, 2025
8728cb4
proofreading edits
serverless-mom Jul 29, 2025
68006c0
guide rewrite
serverless-mom Jul 30, 2025
5dff046
fix bash scripting
serverless-mom Jul 31, 2025
7006ec4
new guide
serverless-mom Jul 31, 2025
07b6488
merge conflicts
serverless-mom Aug 1, 2025
b6ce9e5
final edits
serverless-mom Aug 1, 2025
7eba844
Update site/content/guides/claude-code-monitoring.md
serverless-mom Aug 1, 2025
bb7f06f
Update site/content/guides/claude-code-monitoring.md
serverless-mom Aug 1, 2025
1172fcd
Update site/content/guides/claude-code-monitoring.md
serverless-mom Aug 1, 2025
26ade4a
Update site/content/guides/claude-code-monitoring.md
serverless-mom Aug 1, 2025
04e5d9f
Update site/content/guides/claude-code-monitoring.md
serverless-mom Aug 1, 2025
c46b62e
Update site/content/guides/claude-code-monitoring.md
serverless-mom Aug 1, 2025
be0d5ae
polish and rewrites
serverless-mom Aug 1, 2025
406e162
new guide
serverless-mom Aug 1, 2025
392b248
Update site/content/guides/claude-code-monitoring.md
serverless-mom Aug 4, 2025
2dda78a
Merge branch 'main' into claudeCodeGuide
serverless-mom Aug 4, 2025
2fbdac2
edits
serverless-mom Aug 4, 2025
aab4907
Update site/content/guides/claude-code-monitoring.md
serverless-mom Aug 4, 2025
cc8707f
Update site/content/guides/claude-code-monitoring.md
serverless-mom Aug 4, 2025
24c6234
edits
serverless-mom Aug 4, 2025
8a834d3
Merge branch 'claudeCodeGuide' of github.com:checkly/docs.checklyhq.c…
serverless-mom Aug 4, 2025
7d05930
edits
serverless-mom Aug 4, 2025
9f3b5da
Merge branch 'claudeCodeGuide' into bulkMonitorsGuide
serverless-mom Aug 4, 2025
5f1b85f
Merge branch 'main' into bulkMonitorsGuide
serverless-mom Aug 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ site/resources/
__checks__/screenshots
.vercel
checkly-github-report.md
CLAUDE.md
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion site/content/docs/ai/use-checkly-with-ai-ide.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ menu:

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice to have: A short intro sentence briefly summarizing the use case behind this. For example "When working with AI IDEs, you can provide them with context on Checkly, which enables automated generation of Checkly constructs, helping you speed up your monitor creation workflow."

Also: As a reader it'll be interesting to know if I can chose from one of the options listed below or if its recommended to provide as much context as possible e.g. reference the docs site + download the custom rules.

## Docs

You can index our docs pages in your IDE to leverage better code generation results. To do so, follow the guides for your IDE of choice:
You can index our docs pages in your IDE to leverage better code generation results. To do so, follow the guides for your IDE of choice:

Make sure to index the following url:
Expand All @@ -35,6 +36,8 @@ of our docs pages in plain text format. You can use this file to index our docs
We prepared a first set of AI rules which you can use to teach your AI IDE of choice on how to generate code for Checkly.
Go into the root of your IDE's workspace and download the rules according to your IDE's config parameters.
When asking questions about Checkly, manually add the downloaded rules files to your prompt.
Go into the root of your IDE's workspace and download the rules according to your IDE's config parameters.
When asking questions about Checkly, manually add the downloaded rules files to your prompt.

### GitHub Copilot

Expand Down Expand Up @@ -122,7 +125,7 @@ API Checks, Browser checks, Multistep checks and all other constructs.
{{< tab "Mac and Linux" >}}

```bash
mkdir \p .claude &&
mkdir -p .claude &&
curl -o .claude/checkly.rules.md https://www.checklyhq.com/docs/ai/checkly.rules.md -L
echo "- examine checkly.rules.md for code generation rules" >> .claude/CLAUDE.md
```
Expand Down
299 changes: 299 additions & 0 deletions site/content/guides/claude-code-monitoring.md

Large diffs are not rendered by default.

204 changes: 204 additions & 0 deletions site/content/guides/monitor-many-urls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
---
title: Monitor 500 pages in 2 minutes with Checkly
displayTitle: Monitor 500 pages in 2 minutes with Checkly
Copy link
Contributor

Choose a reason for hiding this comment

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

I found the headline slightly misleading when reading it for the first time. "Creating monitors" would be more tangible if we want to be explicit.

description: >-
By leveraging arrays, sitemap parsing, and dynamic monitor creation, you can ensure comprehensive coverage of your website, API routes, and third-party services—all from a single configuration file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: should we remove the part about third-party services? From a support POV, we recommend not monitoring sites you don't control (you can't fix it if it goes down, it can change at any moment, and third-parties have every right to block this kind of traffic)

author: Nočnica Mellifera
avatar: 'images/avatars/nica-mellifera.png'
tags:
- FAQ
---

Checkly’s model of [Monitoring as Code](https://www.checklyhq.com/guides/getting-started-with-monitoring-as-code/) lets you create site monitors right from your IDE. With the recent release of uptime monitoring, we have the ability to monitor every single URL, API route, and even third party service that makes up our product. We don’t want to write out dozens or hundreds of files for all this monitoring coverage.

If this is your first interaction with Monitoring as Code, check out our guide on [creating URL Monitors with Monitoring as Code](https://www.checklyhq.com/guides/url-monitoring/). That guide is all you need to create a project with a first monitor.

## tl;dr Here’s how to create lots of monitors at once

Here’s a single file that will create URL monitors from an array:

```ts
//urlArrayMonitors.check.ts
//this will create URL monitors in your Checkly dashboard

import { Frequency, UrlMonitor, UrlAssertionBuilder } from 'checkly/constructs'

//just two URLs in this example, add as many as you want
const sitemapUrls = [
'https://docs.anthropic.com/de/api/admin-api/workspace_members/get-workspace-member',
'https://docs.anthropic.com/de/api/admin-api/workspace_members/list-workspace-members'
]

//create paths and friendly names for each monitor
sitemapUrls.forEach((url, index) => {
const urlPath = new URL(url).pathname.replace(/\//g, '-').replace(/^-+|-+$/g, '') || 'root'
const monitorId = `checkly-${urlPath}-ping`
const monitorName = `${urlPath.replace(/-/g, ' ')} pinger`

//create each monitor with a five minute interval
new UrlMonitor(monitorId, {
frequency: Frequency.EVERY_5M,
name: monitorName,
activated: true,
request: {
url: url,
skipSSL: false,
followRedirects: true,
assertions: [
UrlAssertionBuilder.statusCode().equals(200),
]
}
})
})
```

This takes an array of URLs and creates a new monitor with a unique ID and name. We can test run these tests with `npx checkly test` and both monitors will run in our CLI’s default region.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I'm missing something but its unclear to me what to do with this file. Where does it live? Where do the generated monitors land? How can I execute it?


![A terminal](/guides/images/monitor-many-urls-01.png)

You can add as many URLs as you’d like to the array and get them monitored at the settings listed. Some lines from this file are worth noting:

```ts
const urlPath = new URL(url).pathname.replace(/\//g, '-').replace(/^-+|-+$/g, '') || 'root'
```

Depending on how you format your input array, this cleanup step may be unnecessary.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be helpful to provide more context on what this cleanup step does so I can understand whether I need it or not.


```ts
const monitorId = `checkly-${urlPath}-ping`
```

The monitor’s logical ID should stay as stable as possible in later updates. When you deploy this monitor to Checkly, a matching ID will be updated with the history of the monitor preserved. A new Logical ID will mean a new monitor is created, and any IDs that were previously deployed from this project that are now missing will be deleted! If you want to double-check your settings, be sure to run the preview command `npx checkly deploy -p` before deploying (for more detail on this, check out the [guide to creating URL Monitors](https://www.checklyhq.com/guides/url-monitoring/)). By contrast, feel free to update the syntax on the `name` value as much as you would like, this just updates the displayed name.

```ts
UrlAssertionBuilder.statusCode().equals(200),
```

A URL Monitor is the most basic type of monitor that Checkly offers, so the `UrlAssertionBuilder` class only allows you to check the status code. For more advanced assertions on the response, try an [API check](https://www.checklyhq.com/docs/api-checks/#cli-example).

## Parse a Sitemap and Monitor Every URL

As just one extension of this concept, rather than manually downloading and parsing a list of URLs into an array, why don’t we parse our site’s sitemap into a list of URLs to monitor? This extension of the check above grabs a sitemap from a given URL and parses it to create our URL array.

```ts
// sitemapUrlMonitors.check.js
import * as https from 'https';
import { Frequency, UrlMonitor, UrlAssertionBuilder } from 'checkly/constructs'
const sitemapUrl = 'https://openai.com/sitemap.xml/webinar/';

function downloadSitemap(url: string): Promise<string> {
return new Promise((resolve, reject) => {
https.get(url, (response) => {
let data = '';

response.on('data', (chunk) => {
data += chunk;
});

response.on('end', () => {
resolve(data);
});

response.on('error', (error) => {
reject(error);
});
}).on('error', (error) => {
reject(error);
});
});
}

function parseSitemap(xmlContent: string): string[] {
const urls: string[] = [];
// Simple regex to extract URLs from <loc> tags
// this should work for most sitemaps but isn't universal.
const locRegex = /<loc>(.*?)<\/loc>/g;
let match;

while ((match = locRegex.exec(xmlContent)) !== null) {
urls.push(match[1]);
}

return urls;
}

console.log(`Downloading sitemap from: ${sitemapUrl}`);

try {
const xmlContent = await downloadSitemap(sitemapUrl);
console.log('Sitemap downloaded successfully');

const sitemapUrls = parseSitemap(xmlContent);
console.log(`Found ${sitemapUrls.length} URLs in sitemap`);
console.log('\nSitemap URLs:');
console.log(sitemapUrls);

//create paths and friendly names for each monitor
sitemapUrls.forEach((url, index) => {
const urlPath = new URL(url).pathname.replace(/\//g, '-').replace(/^-+|-+$/g, '') || 'root'
const monitorId = `checkly-${urlPath}-ping`
const monitorName = `Checkly ${urlPath.replace(/-/g, ' ')} Monitor`

//create each monitor with a five minute interval
new UrlMonitor(monitorId, {
frequency: Frequency.EVERY_5M,
name: monitorName,
activated: true,
request: {
url: url,
skipSSL: false,
followRedirects: true,
assertions: [
UrlAssertionBuilder.statusCode().equals(200),
]
}
})
})
} catch (error) {
console.error('Error:', error);
process.exit(1);
}
```

Let's test these URL monitors and preview their deployment with:

```bash
npx checkly test && npx checkly deploy -p
```

If you're using the sitemap URL above (for a list of OpenAI webinar pages), you'll get a short list of monitors that have been tested:

![A terminal](/guides/images/monitor-many-urls-02.png)

Followed by the deployment preview:

![A terminal](/guides/images/monitor-many-urls-03.png)

If these look correct, you’re ready to run `npx checkly deploy` and create your new monitors!

## Next Steps: Grouping, and More Advanced Checks
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be worth mentioning the global config file here as well?


With all of our monitors managed with a single file, we can update their configuration just by changing the values in the `new UrlMonitor` block above. However, as we have more detailed and nuanced monitoring, it would be nice to have a single place to manage configuration for timing, alerting, and notification channels for a group of checks. All of that is possible with Checkly Groups.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Might be good to add a link to the groups doc here. https://www.checklyhq.com/docs/groups/

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with Laura, we should either link to the groups construct here or add an example code snippet below. Otherwise its a little unclear how to act on this.


Next, we’d like to apply these tools to more advanced check types like API checks and Browser checks written with Playwright. Check out our documentation on [dynamic monitor creation](https://www.checklyhq.com/docs/cli/dynamic-check-creation/) to see examples of these more complex checks.

# Conclusion

Can you really monitor 500 pages in two minutes? Absolutely!

With Checkly’s **Monitoring as Code** approach, scaling your monitoring to hundreds or even thousands of pages is effortless. By leveraging Checkly constructs, sitemap parsing, and dynamic monitor creation, you can ensure comprehensive coverage of your website, API routes, and third-party services—all from a single configuration file.

**Key Takeaways:**

- Bulk URL Monitoring: Easily create multiple URL monitors from an array or sitemap.
- Flexible Configuration: Adjust frequency, assertions, and naming dynamically.
- Preview Before Deploy: Use `npx checkly deploy -p` to verify changes before applying them.
- Extend to Advanced Checks: Apply the same principles to [API checks](https://www.checklyhq.com/docs/api-checks/) and [browser checks](https://www.checklyhq.com/docs/browser-checks/).

For more details on structuring and managing your monitors, check out our guides on:

- [Creating URL Monitors](https://www.checklyhq.com/docs/url-monitors/)
- [Dynamic Monitor Creation](https://www.checklyhq.com/docs/cli/dynamic-check-creation/)
- [Organizing Checks with Groups](https://www.checklyhq.com/docs/groups/)

Ready to supercharge your monitoring? Start deploying with Checkly and keep your applications reliable at scale! 🚀
Loading