Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 1.26 KB

README.md

File metadata and controls

40 lines (25 loc) · 1.26 KB

🐨 Tracing Headers 🐨

Introduction

This add-on deals with RFC002 request tracing, session and User-Agent headers:

  • tracingFromContext extracts tracing headers from an incoming request.

  • outgoingHeaders builds tracing headers for an outgoing request.

Usage

import { TracingHeaders } from 'seek-koala';

// Get our incoming tracing information
const tracing = TracingHeaders.tracingFromContext(ctx);

// Pass an appID as a basis for our `User-Agent`
const appID = {
  name: 'ca-example-service',
  version: '1234',
};

// Generate headers for an outgoing request
const headers = TracingHeaders.outgoingHeaders(appID, tracing);
const client = axios.create({ headers });

Session Headers

While there is no RFC for session headers there are three defacto session headers recognised:

  • X-EC-SEEK-SessionId reflects the value of the candidate’s JobseekerSessionId cookie.

  • X-EC-SEEK-VisitorId reflects the value of the candidate’s JobseekerVisitorId cookie.

  • X-Session-Id is an ad-hoc header that is defined contextually by the system using it.

Unlike X-Request-Id, session headers are not automatically generated if they're absent in the incoming request.