You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using --loader newrelic/esm-loader.mjs in v11 leads to several issues that did not exist in v10:
Some packages are not properly instrumented. From my experiments, ioredis, winston, amqplib, aws-sdk, prisma are not properly instrumented (eg. no data posted), while fastify works (I'm getting Fastify//* transactions).
It may depends on the "style" of the import statement. For instance, as detailed below, winston is properly instrumented in v11 as long as it's imported like this import winston from "winston" and not like this import * as winston from "winston". v10 handles both cases properly.
Sorry you're having trouble @antmarot. I have confirmed the bug around import * as vs import name. I'll dig more into the import-in-the-middle code as it doesn't appear to be the interaction in our code. It's just not wrapping the right code when import * as
Description
Using
--loader newrelic/esm-loader.mjs
inv11
leads to several issues that did not exist inv10
:ioredis
,winston
,amqplib
,aws-sdk
,prisma
are not properly instrumented (eg. no data posted), whilefastify
works (I'm gettingFastify//*
transactions).import
statement. For instance, as detailed below,winston
is properly instrumented inv11
as long as it's imported like thisimport winston from "winston"
and not like thisimport * as winston from "winston"
.v10
handles both cases properly.v11
sometimes crashes silently. I experience this when importingpuppeteer
for instance. Potentially due to Loader fails when circular dependencies exist within an application nodejs/import-in-the-middle#32Expected Behavior
No regression in ESM loader in
v11
wrtv10
.Steps to Reproduce
This only illustrates the import style issue as this is the only one I could pinpoint.
Results in dashboard:
![newrelic-import-v11](https://private-user-images.githubusercontent.com/2891618/275810682-c04c031f-5c9b-4b53-a3a8-3175c86910b7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODU3MDksIm5iZiI6MTczOTE4NTQwOSwicGF0aCI6Ii8yODkxNjE4LzI3NTgxMDY4Mi1jMDRjMDMxZi01YzliLTRiNTMtYTNhOC0zMTc1Yzg2OTEwYjcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMTEwMzI5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Y2Y1MjlkMzc5ZDNiNTFlMTIwMGNlYjBlMDA5NDMzNTA5OTAwZGViNjM0ODQ5NjI4ZGQwN2MzZTIyMDFjYTY5NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.wQbNzYol9lY-RYlWsKImQ0-iqD7l_H4L5GAWjuOW5Vk)
No
V11: import * as
log entry.Your Environment
The text was updated successfully, but these errors were encountered: