Skip to content

jcperez/request-id-propagation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

request-id-propagation

Node.js demo app for request-id propagation

Table of Contents

  1. Overview
  2. Getting Started

Overview

This implementation shows how to propagate a piece of information (e.g. a request id) and have that value available during the entire request lifecycle.

This is very useful, because we can identify all the log entries that belong to an specific request when handling concurrent requests, without having to pass down these values to every function we call.

This solution uses cls-hooked which only runs on Node >= 8.2.1. For Node version < 8 is recommended to use continuation-local-storage

▲ Back to Top

Getting Started

Prerequisites

You need to have the following tools installed on your computer.

Local Setup

To setup the project:

  1. In the project folder, install the dependencies.
    npm install
  2. Start the project.
    node index.js
    Demo server runs locally at http://localhost:3000/.

About

Node.js demo app for request-id propagation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published