Skip to content

Commit

Permalink
Use the non-deprecated request.raw attribute (#288)
Browse files Browse the repository at this point in the history
* looks like request.req has been aliased to raw for a while: fastify/fastify@4cb0a4b
* this should continue to work for older versions of fastify, and no longer show a deprecation warning
* verified that fields are populated in Honeycomb with latest 3.x and a 2.0.0 fastify
  • Loading branch information
vreynolds authored Jan 21, 2021
1 parent 2a60646 commit 4edd634
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/instrumentation/fastify.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ const instrumentFastify = function (fastify, opts = {}) {
"request.host": request.hostname,
"request.original_url": request.raw.url,
"request.remote_addr": request.ip,
"request.method": request.req.method,
"request.method": request.raw.method,
"request.route": request.route ? request.route.path : undefined,
"request.query": request.query,
"request.http_version": `HTTP/${request.req.httpVersion}`,
"request.http_version": `HTTP/${request.raw.httpVersion}`,
};

for (let [key, value] of Object.entries(traceUtil.getInstrumentedRequestHeaders())) {
Expand Down

0 comments on commit 4edd634

Please sign in to comment.