Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #70 from newrelic/add-server-path
Browse files Browse the repository at this point in the history
Adds an additional path to register next-server instrumentation
  • Loading branch information
bizob2828 authored Jul 5, 2022
2 parents 0567b92 + a561f7d commit ed8c636
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
*/
const newrelic = require('newrelic')

// TODO: Remove once we update agent instrumentation to not rely on full required path within Node.js
// When running Next.js app as a standalone server this is how the next-server is getting loaded
// See: https://github.com/vercel/next.js/blob/canary/packages/next/build/utils.ts#L1217
newrelic.instrumentWebframework('next/dist/server/next-server', require('./lib/next-server'))
newrelic.instrumentWebframework('./next-server', require('./lib/next-server'))
newrelic.instrumentWebframework('./render', require('./lib/render'))
newrelic.instrumentWebframework('./context', require('./lib/context'))

0 comments on commit ed8c636

Please sign in to comment.