Skip to content

Commit

Permalink
Remove comment about server.decorate (#486)
Browse files Browse the repository at this point in the history
server.decorate seems to only allow adding methods to the server, request, or toolkit, not wrapping. So this comment is probably not correct.
  • Loading branch information
anuraaga authored Feb 15, 2020
1 parent 6abcd04 commit 7039caf
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions packages/zipkin-instrumentation-hapi/src/hapiMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ exports.register = (server, {tracer, serviceName, port = 0}) => {
return h.continue;
});

// server.decorate seems a better choice for scoping the handler with the current trace ID
// However, it seems only one decorator is permitted, and we don't want to break if the user
// supplied one. Hence, we use handlers instead.
server.ext('onPreHandler', (request, h) => {
const traceId = request._trace_id;
if (traceId) tracer.setId(traceId); // manually start scope
Expand Down

0 comments on commit 7039caf

Please sign in to comment.