Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Commit

Permalink
fix outgoing http request (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eli Golderg authored and sjanuary committed Aug 13, 2018
1 parent c24bbde commit c92a557
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions probes/http-outbound-probe-zipkin.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,16 @@ HttpOutboundProbeZipkin.prototype.attach = function(name, target) {
if (parsedOptions.method) {
requestMethod = parsedOptions.method;
}

// This converts the outgoing request's options to an object
// so that we can add headers onto it
methodArgs[0] = Object.assign({}, parsedOptions);
}
// Must assign new options back to methodArgs[0]
methodArgs[0] = Request.addZipkinHeaders(options, tracer.createChildId());

if (!methodArgs[0].headers) methodArgs[0].headers = {};
let { headers } = Request.addZipkinHeaders(methodArgs[0], tracer.createChildId());
Object.assign(methodArgs[0].headers, { headers });

tracer.recordServiceName(serviceName);
tracer.recordRpc(requestMethod);
tracer.recordBinary('http.url', urlRequested);
Expand Down

0 comments on commit c92a557

Please sign in to comment.