Git Product home page Git Product logo

nel-collector's Introduction

Network Error Logging collector

This repository implements a collector for the Reporting and Network Error Logging (NEL) specifications. These specs allow site owners to instruct browsers and other user agents to collect and report on reliability information about the site. This gives you the same information as you'd get from your server logs, but collected from your clients. This client-side data set will include information about failed requests that never made it to your serving infrastructure.

This repository provides a full working implementation of the collector side of the specs. If you run this collector behind a publicly available URL, you can use that URL in NEL configuration headers for your web site or service. NEL-compliant user agents will send reports about requests to your domain to this collector. You can then route them to a metrics or logs collection service for further analysis.

nel-collector's People

Contributors

cstahl1 avatar dcreager avatar sambuddhabasu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nel-collector's Issues

Report uploads are now subject to CORS

Per w3c/reporting#41, report uploads are now subject to CORS. This has two ramifications:

  • Each upload will only contain reports about a single origin.
  • If the report origin is different than the origin of the collector, then browsers will send a CORS preflight request, and wait for a successful CORS response, before uploading the reports.

We need to update the collector to reply to CORS requests, otherwise we'll never receive any reports from browsers!

Expose a logger in pipeline/How do you take action on ErrDropped

p.ProcessReports(ctx, w, r)

This issue is comprised of 2 points:

  • Consider exposing a logger interface to log errors within the pipeline class
  • How can we catch/take action on ErrDropped, it doesn't seem to be bubbled up anywhere outside the class. ServeHTTP method calls it without looking for if there was an error and to my knowledge this doesn't get bubbled up to the HTTP server class (which does expose a logging interface)

I'm the first to admit i'm not the most advanced golang user, so let me know if i'm missing some implimentation detail that obviates the issue. I plan to impliment this at relatively large scale and knowing when we start dropping reports is going to be very valuable to log to our elastic stack.

Thanks!

Use file to configure processing pipeline

We have a nice pipeline abstraction for defining at runtime how to process all of the NEL reports that are uploaded to the collector. Right now, you have to manually instantiate the particular processors you want to use via Go code. We want this to be configurable via a config file, so that we can have a single binary that works regardless of how you want to process and publish the reports.

Hot-swap active processing pipeline at runtime

We want to be able to update the currently running pipeline at runtime, in response to a new configuration being pushed to an active NEL collector process.

To do that we need a new implementation of http.Handler that:

  • wraps another handler, delegating to it for all requests
  • allows you to atomically update the current wrapped handler in a thread-safe way

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.