2.2URL
What it checks#
A URL monitor sends one HTTP request on a schedule and checks the response. Use it for web pages, health endpoints and simple public APIs. It follows up to 10 redirects. On https it also records when the site's certificate expires. It sends an expiry warning to the monitor's alert channels when 30, 14, 7, 3 and 1 days are left.
When it is up, degraded or down#
- Up: a response arrived and every assertion passed. An assertion is a rule the response must meet. With no assertions, any 2xx (success) status is up.
- Degraded: the check passed but was slower than your slow limit, if you set one.
- Down: no response arrived (connection error, timeout or TLS error), or an assertion failed. Examples:
status 503(no assertions, not 2xx) andassertion status_code == 200: got 503. - A certificate that is expired, not trusted, or made for another host makes the request fail. The check is then down.
Configuration#
| Dashboard field | Default | Limits and notes |
|---|---|---|
| name | Empty | Required. Up to 200 characters, on one line. |
| check interval | 60 seconds | At least 1 second. Your plan's minimum interval still applies: below it the form shows Your plan checks at most every N seconds. |
| timeout | 10 seconds | In seconds. A value above 60 seconds counts as 60 seconds. |
| locations | None (runs from us-west) | Choose from the regions shown. The check runs from each one you pick. |
| on failure — notify | None (all team channels) | Pick channels to limit who is alerted. Shown only when your team has channels. |
| request (method) | GET | GET, POST, PUT, PATCH, DELETE or HEAD. |
| request (URL) | Empty | Required. Starts with http:// or https://. No spaces. Up to 8,192 bytes. |
| headers | None | Select + add header. Up to 50. A row with no name is dropped. |
| body | Empty | The text to send. The form says GET ignores body. |
| assertions | status_code eq 200 | Every assertion must pass. Up to 50. A row with no value is not saved. |
URL errors in the form: A URL is required, Start with http:// or https://, No spaces in a URL.
Assertions supported#
- In the dashboard:
status_code,body,header,response_time_ms,redirect.count,redirect.final_url,security.scoreandjson_schema. - Operators:
eq,neq,contains,lt,gt,matches.json_schematakes no operator. - A
headerrow needs a header name. Without one you seeEnter the header name. - Through the API only:
json.<dotted.path>andtls.days_until_expiry. If a monitor already has one, you can still see and edit it in the dashboard.
Chapter 4 explains each assertion.
Example#
Check that a health endpoint answers fast and says it is healthy. In the dashboard, add these assertions:
| Type | Operator | Value |
|---|---|---|
status_code | eq | 200 |
body | contains | "status":"ok" |
response_time_ms | lt | 800 |
{
"name": "acme.io — health",
"url": "https://acme.io/health",
"method": "GET",
"intervalSeconds": 60,
"timeoutMs": 10000,
"assertions": [
{"type": "status_code", "op": "ASSERTION_OP_EQ", "value": "200"},
{"type": "body", "op": "ASSERTION_OP_CONTAINS",
"value": "\"status\":\"ok\""},
{"type": "response_time_ms", "op": "ASSERTION_OP_LT", "value": "800"}
]
}Good to know#
- Once you add any assertion, your assertions alone decide the result. Keep a
status_codeassertion if the status matters to you. - The response time is the time until the response headers arrive. Reading the body is not counted.
- Only the first 1 MiB of the body is read for assertions.
- URL monitors do not fill in team secrets. To send a token or password, use an API monitor (2.3).