apm-agent-nodejs icon indicating copy to clipboard operation
apm-agent-nodejs copied to clipboard

ESM support, stage 2

Open trentm opened this issue 2 years ago • 2 comments

https://github.com/elastic/apm-agent-nodejs/issues/1952 will add initial experimental ESM support. This issue lists a number of follow tasks for ESM support:

  • [ ] node v20 support (there is an IITM update with support): https://github.com/elastic/apm-agent-nodejs/pull/3469
  • [ ] work through remaining modules:
    • [ ] lambda functions
    • [ ] azure functions
    • [ ] @apollo/server
    • [ ] @elastic/elasticsearch
    • [ ] @opentelemetry/api
    • [ ] @opentelemetry/sdk-metrics
    • [ ] apollo-server-core
    • [ ] aws-sdk
    • [ ] bluebird
    • [ ] cassandra-driver
    • [ ] elasticsearch
    • [ ] express-graphql
    • [ ] express-queue
    • [ ] finalhandler
    • [ ] generic-pool
    • [ ] graphql
    • [ ] handlebars
    • [ ] hapi, @hapi/hapi
    • [ ] http2
    • [ ] jade
    • [ ] koa
    • [ ] koa-router, @koa/router
    • [ ] memcached
    • [ ] mimic-response
    • [ ] mongodb-core
    • [ ] mongodb
    • [ ] mysql
    • [ ] mysql2
    • [ ] next
    • [ ] pug
    • [ ] redis
    • [ ] restify
    • [ ] tedious
    • [ ] undici
    • [ ] ws
  • [ ] https://github.com/elastic/apm-agent-nodejs/issues/1612
  • [ ] revisit the "starting the agent" docs now that there is some ESM support. Might want to start preferring the option of using the node CLI options rather than starting in code.
  • [ ] Lambda support for .mjs files (see getFilePath in "lib/lambda.js")

trentm avatar Jun 26 '23 19:06 trentm

Good morning, is there an ETA for this? I have a whole software platform using Hapi & Node 20, and I have been waiting since last year for APM to support it :) at the moment I had to to totally disable APM for the current year. Is it actively being worked on?

Zorinik avatar Sep 25 '24 13:09 Zorinik

@trentm id happily instrument lambda manually if it meant I could move to ESM.

Even a function like this https://github.com/newrelic/newrelic-lambda-layers?tab=readme-ov-file#manual-instrumentation-for-es-modules would be very helpful until a more auto shim could be found

Honestly manual shims should be a thing in APM and would give us more better control as a developer and allow you guys to be less constrained to the major downsides of auto shimming. Especially in the context of bundling, etc.

curtdept avatar Oct 18 '24 17:10 curtdept