/fastly-template-rust-nel

Package template for a Rust based Network Error Logging Fastly Compute service

Primary LanguageRustMIT LicenseMIT

Fastly Compute starter kit for Network Error Logging

A Rust based compute starter kit for a Network Error Logging reporting endpoint.

For more details about this and other starter kits for Fastly Compute, see the Fastly developer hub

What is network error logging?

From MDN:

Network Error Logging is a mechanism that can be configured via the NEL HTTP response header. This experimental header allows web sites and applications to opt-in to receive reports about failed (and, if desired, successful) network fetches from supporting browsers.

Our starter kit will bootstrap a Fastly service that can receive network error reports, parse them, enrich them with information available at the edge, and dispatch them to your logging provider.

Features

  • Exposes a POST /reports endpoint to receive NEL reports
  • Deserializes individual reports from JSON to Rust data structures
  • Adds additional information at the edge, such as geo IP data
  • Sends reports to a logging endpoint as individual JSON lines
  • Responds with a synthetic 204 response to the client

Requirements

The following resources need to exist on your active Fastly service version for this starter kit to work:

Security issues

Please see our SECURITY.md for guidance on reporting security-related issues.