Next.js instrumentation doesn't honour usePathAsTransactionName
config var
#3072
Labels
usePathAsTransactionName
config var
#3072
As discussed at https://discuss.elastic.co/t/next-js-and-dynamic-routes/321302 the current Next.js instrumentation that sets the
transaction.name
for a Dynamic Route does not honour theusePathAsTransactionName: true
config var. That means that a requestGET /a-dynamic-route/42
to this dynamic route https://github.com/elastic/apm-agent-nodejs/blob/main/test/instrumentation/modules/next/a-nextjs-app/pages/a-dynamic-page/%5Bnum%5D.js results intransaction.name = 'GET /a-dynamic-route/[num]
even ifusePathAsTransactionName: true
.Note that there is also naming of the
Next.js _data/route ...
transactions for possibly dynamic routes -- e.g. "Next.js _next/data route /a-dynamic-page/[num]". However, I don't think those should honourusePathAsTransactionName
. At least not without user feedback.The text was updated successfully, but these errors were encountered: