Aller au contenu principal

🌐 HTTP(S) Monitor

The HTTP(S) monitor is the most commonly used monitor type. It makes an HTTP request to a URL and checks whether the response matches your expectations.


🎯 Ce Qu'il Fait

  • Sends an HTTP request (GET, POST, PUT, PATCH, DELETE, HEAD) to your URL
  • Checks the response status code (e.g., 200, 301, 404)
  • Measures response time and TTFB (Time To First Byte)
  • Optionally checks for a keyword in the response body
  • Supports authentication (Basic Auth, Bearer Token)
  • Supports custom headers and request body
  • Can follow or ignore redirects
  • Can verify or skip SSL certificate validation
  • Captures the resolved IP address

⚙️ Configuration

Basic Settings

ParametreDescriptionExemple
NameA friendly name for this monitorMy Website
Address (URL)The full URL to checkhttps://example.com
Check IntervalHow often to check1 minute
TimeoutMax wait time for a response30 seconds

HTTP Settings

ParametreDescriptionPar Defaut
HTTP MethodGET, POST, PUT, PATCH, DELETE, HEADGET
Expected Status CodesWhich status codes mean "up"200
AuthenticationNone, Basic Auth, or Bearer TokenNone
Custom HeadersKey-value pairs of HTTP headersEmpty
Follow RedirectsWhether to follow 301/302 redirects✅ Yes
Verify SSLWhether to verify the SSL certificate✅ Yes
Max Response TimeMark as degraded if slower than this (ms)Not set
Request BodyJSON body for POST/PUT/PATCH requestsEmpty
ParametreDescription
KeywordText to search for in the response body
Keyword Should Exist✅ = text must be present, ❌ = text must be absent

📖 Exemples d'Utilisation

Example 1: Basic Website Check

Check if your homepage loads and returns a 200:

ParametreValeur
NameMy Website Homepage
URLhttps://www.example.com
MethodGET
Expected Status200
Interval1 minute

Example 2: API Health Endpoint

Check an API health endpoint that returns JSON:

ParametreValeur
NameAPI Health Check
URLhttps://api.example.com/health
MethodGET
Expected Status200
Keyword"status":"ok"
Keyword Should Exist✅ Yes
Interval30 seconds

Example 3: Authenticated API

Monitor an API that requires a Bearer token:

ParametreValeur
NameProtected API
URLhttps://api.example.com/v1/data
AuthenticationBearer Token
Password / Tokenyour-api-token-here
Expected Status200

Example 4: POST Endpoint

Test a webhook or POST endpoint:

ParametreValeur
NameWebhook Test
URLhttps://api.example.com/webhook
MethodPOST
Custom HeadersContent-Type: application/json
Request Body{"test": true}
Expected Status200, 201, 202

Example 5: Redirect Check

Verify that HTTP redirects to HTTPS:

ParametreValeur
NameHTTP to HTTPS Redirect
URLhttp://example.com
Follow Redirects❌ No
Expected Status301

📊 Ce Qui Est Enregistre

Each check stores:

MetriqueDescription
StatusUp, Down, or Degraded
Response TimeTotal time in milliseconds
Status CodeHTTP status code (200, 404, 500, etc.)
TTFBTime To First Byte
Resolved IPThe IP address the hostname resolved to
Error MessageDetails if the check failed

❓ Quand Est-Il "Hors Service" ?

The monitor is marked Down when ANY of these occur:

  1. ❌ Connection timeout (no response within timeout period)
  2. ❌ Response status code doesn't match expected codes
  3. ❌ DNS resolution failure
  4. ❌ SSL certificate error (if Verify SSL is enabled)
  5. ❌ Keyword not found (or found when it shouldn't be)

The monitor is marked Degraded when:

  1. ⚠️ Response time exceeds the Max Response Time threshold

💡 Conseils et Bonnes Pratiques

  1. Monitor a dedicated health endpoint (e.g., /health or /api/status) rather than your homepage — it's faster and less likely to be affected by CDN caching.

  2. Use keyword checks to verify that the page content is correct, not just that the server responds. A server might return 200 but show an error page.

  3. Set reasonable timeouts. If your API normally responds in 200ms, a 30-second timeout is too generous. Set it to 5-10 seconds for faster failure detection.

  4. Don't disable SSL verification in production unless you have a specific reason. Self-signed certs in staging? Sure. Production? Use a real certificate.

  5. Multiple status codes: If your endpoint might return 200 or 204, list both as expected: 200, 204.