1.1.0 • Published 6 years ago

@bbc/http-transport-xray v1.1.0

Weekly downloads
5
License
Apache-2.0
Repository
-
Last release
6 years ago

HTTP Transport X-Ray

Create X-Ray subsegments and add Tracing Header

Installation

npm install --save @bbc/http-transport-xray

Usage

Use per call. Pass in a segment to create a subsegment for that call, identified by the host name.

const HttpTransport = require('@bbc/http-transport');
const AWSXRay = require('aws-xray-sdk');
const xray = require('@bbc/http-transport-xray').middleware;

const segment = new AWSXRay.Segment('mySegment');

const client = HttpTransport.createClient();

client
  .use(xray(segment))
  .get(url)
  .asResponse();

Test

npm test