Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit 68006c0

Browse files
guide rewrite
1 parent 8728cb4 commit 68006c0

6 files changed

Lines changed: 102 additions & 219 deletions

File tree

93.5 KB
Loading
271 KB
Loading
243 KB
Loading
182 KB
Loading

site/content/guides/url-monitoring-claude-code.md

Lines changed: 0 additions & 219 deletions
This file was deleted.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: Create Uptime Monitoring in minutes with Checkly
3+
description: >-
4+
Use the power of Checkly to monitor hundreds of pages in minutes.
5+
author: Nočnica Mellifera
6+
avatar: 'images/avatars/nica-mellifera.png'
7+
tags:
8+
- FAQ
9+
---
10+
This guide will show you how to monitor all the pages of your site, creating URL monitors and then deploying those checks with the Checkly CLI.
11+
12+
While you can create monitors from within the Checkly web UI, this tutorial will use the Checkly CLI and the principle of [Monitoring as Code](https://www.checklyhq.com/guides/getting-started-with-monitoring-as-code/) to create a new project as a code repository to contain all your uptime monitoring.
13+
14+
## Set up your Checkly repository
15+
16+
Start by [installing the Checkly CLI](https://www.checklyhq.com/docs/cli/installation/), then create a repository that will be the ‘project’ that contains all your Checkly monitors managed as code. If you don’t already have a project, create one with:
17+
18+
```bash
19+
npm create checkly@latest
20+
```
21+
22+
If you’d like to follow the tutorial examples below, clone the [uptime monitoring demo](https://github.com/serverless-mom/uptimeMonitoring) repository, and copy everything in the `/__checks__` folder to your own project.
23+
24+
## Create URL Monitoring to check all your pages’ status codes
25+
26+
Checkly’s URL Monitors are the cheapest and fastest tool to just check the status code of a web page. They’re particularly useful for third-party services or pages that your service relies on. In general, a URL monitor will look like this:
27+
28+
```ts
29+
//httpbinPinger.check.ts
30+
import { Frequency, UrlMonitor, UrlAssertionBuilder } from 'checkly/constructs'
31+
32+
new UrlMonitor('url-pinger-1', {
33+
frequency: Frequency.EVERY_10S,
34+
name: 'URL pinger 1',
35+
activated: true,
36+
request: {
37+
url: 'https://httpbin.org/get',
38+
skipSSL: false,
39+
followRedirects: true,
40+
assertions: [
41+
UrlAssertionBuilder.statusCode().equals(200),
42+
]
43+
}
44+
})
45+
```
46+
47+
Save this file in the `/__checks__` directory. A couple important notes about the configuration of a URL monitor:
48+
49+
- The first string passed is the monitor’s logical ID, changing this value and running `checkly deploy` will delete the previous monitor and create a new one. So generally this should remain static
50+
- This example contains a [frequency](https://www.checklyhq.com/docs/cli/constructs-reference/#urlmonitor). Without a frequency a new URL monitor will use your project default frequency
51+
52+
Read more in the full [documentation of the UrlMonitor](https://www.checklyhq.com/docs/cli/constructs-reference/#urlmonitor) class.
53+
54+
Go ahead and create multiple URL monitors as separate files so we can try deploying more than one URL monitor at a time. If you’re envisioning monitoring dozens or hundreds of sites with URL Monitoring, don’t worry: you won’t have to create hundreds of files, a guide I’ll publish later this week will cover the bulk creation of monitors.
55+
56+
![A line chart](/guides/images/url-monitoring-01.png)
57+
58+
## Test your monitors and deploy them to Checkly
59+
60+
With our monitors written, lets run them all with `npx checkly test` .
61+
62+
The Checkly CLI will scan for every `check.ts` file in the `/__checks__` folder and run them from the Checkly network.
63+
64+
![A terminal](/guides/images/url-monitoring-02.png)
65+
66+
One of the immediate benefits of using Checkly is evident here: since these monitors don’t run from your local workstation, you’ll be running these checks exactly like your users do, you can even configure the CLI to run the tests from multiple locations!
67+
68+
Once we’re happy with our test results, it’s time to deploy. To check that this deployment will go as planned, we can run the deploy command first with the preview flag `-p` . The preview flag lets see what monitors **would be** created if you would deploy them to the Checkly infrastructure. Especially if you're creating monitoring resources dynamically, it's recommended checking your resulting monitoring setup.
69+
70+
```tsx
71+
npx checkly deploy -p
72+
```
73+
74+
![A terminal](/guides/images/url-monitoring-03.png)
75+
*We’ll get a list of new URL monitors that will be created*
76+
77+
Since we’re only adding URL Monitors in a new project, this should show only monitors being created. If anything else shows up, review your [project settings](https://www.checklyhq.com/docs/cli/project-structure/) before deploying.
78+
79+
When everything’s ready, deploy with
80+
81+
```bash
82+
npx checkly deploy
83+
```
84+
85+
You’ll see a report very like the preview above, showing new monitors created. As the checks run, you’ll generate a dashboard in the Checkly UI.
86+
87+
![A Checkly dashboard](/guides/images/url-monitoring-04.png)
88+
*See past performance of your monitor in the Checkly dashboard.*
89+
90+
## Conclusion
91+
92+
With just a few commands, you've created a robust monitoring system that runs from Checkly's global network rather than your local machine. This approach gives you the real user perspective your application monitoring needs. The Monitoring as Code methodology keeps your checks version-controlled and easily reproducible across environments.
93+
94+
Your URL monitors are now running continuously, providing immediate alerts when issues arise and historical data to track your site's reliability over time. The Checkly dashboard gives you centralized visibility into all your endpoints, making it simple to spot patterns and respond quickly to outages.
95+
96+
As your monitoring needs grow, you can expand this foundation with [browser checks](https://www.checklyhq.com/docs/browser-checks/) or [Playwright check suites](https://www.checklyhq.com/docs/playwright-checks/reference/) for complex user flows, API monitoring for backend services, and bulk monitor creation for large-scale deployments. The CLI-first approach ensures your monitoring infrastructure scales alongside your applications.
97+
98+
## Further Reading: Complete Uptime Monitoring
99+
100+
- To learn about all the new monitors offered by Checkly Uptime monitoring, check our [complete guide on Uptime Monitoring](https://www.checklyhq.com/guides/uptime-monitoring/).
101+
- With this project you’ve started your Monitoring as Code journey, learn more in our [guide to the Checkly CLI](https://www.checklyhq.com/docs/cli/)
102+
- With these basic monitors set up, start creating synthetics checks in [Playwright using Playwright Codegen](https://www.checklyhq.com/learn/playwright/codegen/).

0 commit comments

Comments
 (0)