Network Error Logging

Feature Overview

Network Error Logging (NEL) is a browser-based reporting system that allows clients to report encountered network failure information to external endpoints. When enabled, EdgeOne delivers NEL policies in response headers, instructing clients to collect and submit network error information to designated log collection endpoints. By analyzing these logs, you can gain network visibility into the "last mile" between client users and EdgeOne edge nodes, enabling timely detection and localization of network errors.
Note:
"The last mile" refers to the network path between the end user and the first point of entry to the resource (such as a Tencent Cloud EdgeOne edge node). This path is critical because it is the only route for resource requests: if issues arise in the "last mile," users will be unable to connect to your service.

Use Cases

1. Enhance observability: For services demanding high user experience standards, such as online meetings, gaming, and financial transactions, NEL logs allow you to detect various network issues encountered by end users (e.g., DNS resolution failures, TCP connection timeouts). This enables rapid root cause identification and improves service stability.
2. Optimize routing policies:​ EdgeOne leverages the globally collected NEL data to optimize its intelligent routing system, directing user requests to edge nodes with superior network quality whenever possible, thereby enhancing overall acceleration performance.
3. Troubleshooting and diagnostics: When users report access anomalies but monitoring indicates no issues at the origin server or EdgeOne nodes, NEL logs provide detailed client-side error information. This helps quickly determine if the problem lies with the user's local network or an intermediate network path.

Working Principles

When you enable the NEL feature for your site, EdgeOne includes headers in all responses to domains under that site, instructing clients (such as browsers) on how to report network errors.

Response Header Example

EdgeOne will include the following two headers in the response:
Report-To: {"endpoints":[{"url":"https://nel.teo-rum.com/eo-cgi/nel"}],"group":"eo-nel","max_age":604800}
NEL: {"success_fraction":0.1,"report_to":"eo-nel","max_age":604800}

Log Reporting Example

The client reporting NEL report payload format is as follows:
{
"age": 20,
"type": "network-error",
"url": "https://example.com/previous-page",
"body": {
"elapsed_time": 18,
"method": "POST",
"phase": "dns",
"protocol": "http/1.1",
"referrer": "https://example.com/previous-page",
"sampling_fraction": 1,
"server_ip": "",
"status_code": 0,
"type": "dns.name_not_resolved",
"url": "https://example-host.com/"
}
}

Data Privacy and Security

EdgeOne values user data privacy and security. When processing NEL reports, we follow the rules below:
Geolocation information: We will parse the ASN and country/region belonging to the client IP address. This anonymized information is used for global network quality analysis and scheduling optimization.
IP address processing: The client's original IP is temporarily stored in memory (in milliseconds) during request processing to generate the anonymized geolocation information. After the NEL report is successfully received and processed, the original IP will be immediately purged from the system and not retained in any logs or persistent storage.

Directions

1. Log in to the Tencent Cloud EdgeOne console, enter Service Overview in the left menu bar, and click the site to be configured under Website Security Acceleration.
2. On the site details page, click Site Acceleration to enter the global site configuration page. Then click Network Optimization in the right sidebar.
3. Locate the Network Error Logging card, click switch to enable function.
Note:
1. The NEL feature is automatically enabled for sites on the Free plan. For sites on other plan tiers, it can be enabled manually.
2. To configure a custom NEL policy, you can use the Rule Engine - modifying HTTP node response headers feature.
3. Viewing the NEL reported logs and related statistical data is currently not supported. Please follow subsequent product updates for the availability of this capability.

Reference