Skip to content

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) and assertion 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 fieldDefaultLimits and notes
nameEmptyRequired. Up to 200 characters, on one line.
check interval60 secondsAt least 1 second. Your plan's minimum interval still applies: below it the form shows Your plan checks at most every N seconds.
timeout10 secondsIn seconds. A value above 60 seconds counts as 60 seconds.
locationsNone (runs from us-west)Choose from the regions shown. The check runs from each one you pick.
on failure — notifyNone (all team channels)Pick channels to limit who is alerted. Shown only when your team has channels.
request (method)GETGET, POST, PUT, PATCH, DELETE or HEAD.
request (URL)EmptyRequired. Starts with http:// or https://. No spaces. Up to 8,192 bytes.
headersNoneSelect + add header. Up to 50. A row with no name is dropped.
bodyEmptyThe text to send. The form says GET ignores body.
assertionsstatus_code eq 200Every 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.score and json_schema.
  • Operators: eq, neq, contains, lt, gt, matches. json_schema takes no operator.
  • A header row needs a header name. Without one you see Enter the header name.
  • Through the API only: json.<dotted.path> and tls.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:

TypeOperatorValue
status_codeeq200
bodycontains"status":"ok"
response_time_mslt800
The same monitor through the API (CreateUrlMonitor)
json
{
  "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_code assertion 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).

Last updated