fastly / fastly-template-rust-nel

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compute@Edge starter kit for Network Error Logging

A Rust based Compute@Edge starter kit for a Network Error Logging reporting endpoint.

For more details about this and other starter kits for Compute@Edge, 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.

About

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

License:MIT License


Languages

Language:Rust 100.0%