1001Ferramentas
📡 Security

Network Error Logging (NEL) Builder

Build NEL and Report-To headers to send network error reports to your own endpoint with sampling fractions.

Getting reports on errors that never reached your server

Every monitoring tool has one blind spot: it measures what arrived. A request that failed on DNS, on a refused connection, on an invalid certificate or on a dropped network never shows up in your logs, because it never arrived. Network error logging closes that gap — the browser itself reports the failure, later, once it has a connection again.

Fill in the group, the collector URL and the sampling rates, and the page assembles the two required headers. There are two because the responsibilities are separate: one declares the reporting group and where to send, the other switches logging on and states what fraction of cases to report. Missing either is the commonest reason a configuration produces no reports at all.

The sampling rates deserve attention. The success rate is usually kept very low, because successful requests are the overwhelming majority and reporting them all would generate huge volume with no new information. The failure rate is usually kept at a hundred per cent, since failures are rare and are exactly what you want to see. Note too that the collector must accept cross-origin requests, and that it should not sit on the monitored domain — if that domain's network goes down, the report would never get out.

Frequently asked questions

Why two headers?
Because the report delivery mechanism is generic and used by other features, such as content security policy violations. One header defines the reporting groups and their destinations; the other merely points at which group to use for network errors. Separating them allows reusing the same destination for several report types.
Does it work in every browser?
In Chromium-based ones, yes. Firefox and Safari do not implement it, so coverage is partial and the numbers represent only a slice of your audience. That does not invalidate the data — network failures do not pick browsers — but it does get in the way if you treat absolute volume as a metric.
Where should the collector live?
Off the monitored domain, and preferably on independent infrastructure. A collector on the same domain becomes unavailable along with it, exactly when the report matters. Several monitoring services offer a ready-made collector for this format.

Related Tools