Skip to content

Edge

The edge is what sits between your visitors and your services: today, the Cloudflare zones in front of your sites. An edge problem looks like an origin problem from the outside, so Korai shows the edge in its own section, Observability › Edge, next to your services. It appears once a Cloudflare zone is connected in Integrations and its first figures have arrived, a few minutes after the first read.

Observability › Edge: requests, 52x against the origin’s own 5xx, cache and origin latency

An admin connects Cloudflare once, in Settings › Integrations › Add provider › Cloudflare:

  1. In Cloudflare, open My Profile › API Tokens › Create Token › Custom token.

  2. Cloudflare groups the permissions in policies, one per scope:

    • Add new policy › Zone: include the zones to read (or all zones), then search and tick Read on Zone and on Analytics.
    • For Workers, an Account policy with your account and Read on Account Analytics. Without Workers, delete the Account policy the page starts with.

    Nothing with Edit: Korai only reads. Then Continue to summary › Create token and copy it. (On the older token page the same permissions read Zone › Zone › Read, Zone › Analytics › Read and Account › Account Analytics › Read.)

  3. Paste the token in Korai and press Test and add. Korai tests it by listing the zones it reaches; a refused token is not kept, and the token is never shown again, only its last four characters.

  4. Choose the zones and the environment of each. Korai suggests one from the host (staging.example.com is staging). The environment becomes the deployment_environment label, so the environment selector at the top filters it.

Korai reads, per zone and per minute, the requests by host with what the visitor got and what your origin answered, the cache status and bandwidth, the origin response time (p50 and p95), the firewall events by action and rule, and the Workers invocations, errors and CPU time. The figures arrive about five minutes late. They are Cloudflare’s own analytics, which Cloudflare samples on busy zones. Single requests and their ray ids come from the request logs, if you send them (see Request logs).

What visitors got from Cloudflare next to what your origin answered:

  • Requests / min, the 52x share (Cloudflare answered 520 to 527 because your origin did not answer, timed out or broke the connection), the origin 5xx share (your origin itself answered with a 5xx), cache hits and the worst origin p95. The shares add up the whole range you choose.
  • 5xx at the edge draws both kinds of 5xx on one chart, minute by minute. A 52x burst with nothing in your service’s own errors means the request never reached it.
  • Responses by status, requests by host, the hosts with the most 5xx, origin latency by host, and requests and bandwidth by cache status.

The Cloudflare firewall: requests blocked in the range, events per minute by action (block, challenge, log) and the rules that act most.

Invocations per minute, error share and CPU time p99 for each Worker script. The tab shows only when a zone runs Workers.

The single requests Cloudflare served, from its request logs. The tab shows once the logs arrive (see Request logs), even for a zone whose analytics Korai does not read.

  • Choose the last hour, 6 hours or 24 hours, and all requests, errors, 5xx or 4xx.
  • The line above the table counts the requests of the window by edge status, so a burst of 522 stands out.
  • The table lists the newest 50: time, edge status, what the origin answered (not reached for a 52x, cache when Cloudflare served it without asking the origin), method, host and path, cache status, origin time, data centre and country, and the ray id. Sort by any column.
  • Click a request to open it in Logs, with the minutes around it. Open in Logs opens the whole window with the same status filter, to search any field the logs carry.

A ray id from a cf-ray response header (with or without its -MAD data centre suffix) also finds its request in Go to ID (Ctrl/Cmd+K).

Cloudflare sends its request logs with Logpush, straight to your observability data, the same way your OpenTelemetry collectors send theirs. Korai’s Cloudflare token stays read-only: someone allowed to edit logs in Cloudflare creates the job. Send request logs (on the Edge page) shows the steps with your own address:

  1. In the Cloudflare dashboard, open the zone, then Analytics & Logs › Logpush › Create a Logpush job.
  2. Choose an HTTP destination and paste the URL Korai shows. It ends in header_Authorization=Basic%20<CREDENTIAL>: replace <CREDENTIAL> with your ingest user and its token, joined by a colon and encoded in Base64 (printf '%s' 'user:token' | base64 | tr -d '\n'). It is the credential your collectors already use; Korai never shows it.
  3. Dataset HTTP requests, with the fields Korai lists (ray id, host, method, path, the edge and origin statuses, cache status, timings, bytes, country and data centre). The client IP is left out on purpose, as personal data: add it only if you need it.
  4. On a busy zone, set a sample rate in the job (0.1 keeps one request in ten) or a filter (for example only status 400 and above): every request is a log line, and log lines count towards your plan’s ingest.
  5. Save. Cloudflare sends a test line, then a batch every minute or so; the Requests tab appears a few minutes later.

The lines land in the cloudflare log stream, so Logs, saved queries and log monitors work on them as on any other log.

The zone, host and environment filters, the time range, Compare and auto-refresh work as in any dashboard. The same panels are the built-in Cloudflare (edge) dashboard in Observability › Dashboards: clone it to make your own.

Suggested monitors, at the top of the page, opens the alerts that fit Cloudflare. Each one is created with one click as an ordinary monitor you can edit, mute and send to your channels in Observability › Reliability › Monitors:

Monitor Fires when
Origin unreachable (52x) over 0.5 % of visitors get a 520 to 527 from Cloudflare (critical at 2 %)
Origin errors over 1 % of requests get a 5xx from your origin (critical at 5 %)
Origin p95 the slowest host’s origin p95 is over 1 s (critical at 3 s)
Workers errors over 1 % of Workers invocations fail (critical at 5 %)
Blocked requests the firewall blocks more requests in 15 minutes than the number you type

Admins connect and remove Cloudflare; operators create the suggested monitors; everyone can see the page.