How to set up Network Error Logging for CDN monitoring.

Updated: 2 Dec 20264 minBart PluskotaCDN, DNS & Security Expert
Diagram for “Add edge compute without locking yourself in”: Logic in the socket, not soldered to the board — compute that can move platforms.

Network Error Logging (NEL) lets browsers report the requests that failed before they ever reached your CDN. Your edge logs only record what arrived; a DNS lookup that never resolved, a TCP connection that was reset or a TLS handshake that died in a mobile network leaves no trace there. With two response headers, Chromium-based browsers remember a reporting policy for your origin and later send a JSON report of each failure to a collector you choose.

What NEL sees that your logs cannot

Every report carries a phase (DNS, connection or application), an error type such as dns.name_not_resolved, tcp.reset or http.error, the protocol, the server address the browser tried and, for completed requests, the status code. That is the last-mile view: a resolver in one country returning stale records, one mobile operator dropping QUIC, a certificate a corporate proxy rejects. It complements real-user monitoring, which measures pages that loaded, and the edge logs that describe the requests that arrived.

Step 1: send the two headers

NEL still relies on the legacy Reporting API. As web.dev's guide notes, the newer Reporting-Endpoints header does not carry NEL, so you need Report-To:

Report-To: {"group":"nel","max_age":2592000,"endpoints":[{"url":"https://reports.example.net/nel"}]}
NEL: {"report_to":"nel","max_age":2592000,"failure_fraction":1.0,"success_fraction":0.01}

Both must be served over HTTPS. max_age is how long, in seconds, the browser keeps the policy; 30 days, as above, covers users who visit monthly. The endpoints list accepts several URLs with priorities, which gives the collector its own failover.

Step 2: choose the sampling

failure_fraction defaults to 1 and should stay there: failures are the point. success_fraction defaults to 0; a small value such as 1% gives you a baseline, so you can tell whether 300 failures from one network are a crisis or noise. Add include_subdomains only if the reporting group does too, and remember that for subdomains it covers DNS errors alone.

Step 3: put the collector somewhere else

The collector receives a POST of JSON reports, often minutes after the failure. Host it on a different provider and domain from the site it watches: a collector behind the same CDN fails with it, and the reports you most need never arrive. Store the reports with a timestamp, the client's network (derived from its address, then discard the address) and country. Cloudflare offers this ready-made: its documentation describes NEL on every plan, with reports grouped by network and country and client addresses not logged. For scale, an HTTP Archive study found that Cloudflare accounted for most of the roughly 11.7% of domains sending NEL in 2023.

Step 4: read the reports

Group by phase first. A rise in DNS-phase failures points at your authoritative servers or a regional resolver; connection-phase failures cluster by network and usually mean routing, filtering or a protocol a carrier blocks; application-phase errors line up with what your edge logs already show. Alert on a change in failure rate per network, not on raw counts. When one CDN's address range dominates the failures, our guide to when your CDN is the outage covers the next move.

The limits to accept

Only Chromium-based browsers send reports, the W3C specification is still a working draft, and a browser learns the policy only after one successful response, so first-time visitors who fail are invisible. Treat NEL as a sample of real failures, not a census, and keep synthetic monitoring for the paths you must watch continuously.

Not sure which of your users fail before they reach the edge? The assessment adds the network-error view to your monitoring.