Loading

Elastic APM Node.Js Agent release notes

Review the changes, fixes, and more in each version of Elastic Node.Js Java Agent.

To check for security updates, go to Security announcements for the Elastic stack.

Release date: January 20, 2025

  • Fix instrumentation of @aws-sdk/client-s3, @aws-sdk/client-sqs, and @aws-sdk/client-sns for versions 3.723.0 and later. Internally the AWS SDK clients updated to @smithy/smithy-client@4. (#4398)

Release date: December 24, 2024

  • Improve trace-level logging to better support debugging central config and transaction sampling issues. (#4291)

Release date: December 9, 2024

  • Add support for undici v7. (#4336)
  • Fix to support a internal refactor in mysql2 v3.11.5. (#4334)
  • Guard against a possible encoding error of tracing data in the APM client, before it is sent. It is possible this could wedge the APM client, resulting in the APM agent no longer sending tracing data. (#4359)

Release date: November 4, 2024

  • Fix AWS Lambda instrumentation to work with a "handler" string that includes a period (.) in the module path. E.g. the leading . in Handler: ./src/functions/myfunc/handler.main. (#4293).

Release date: October 8, 2024

  • Minor improvement to container ID parsing from /etc/cgroup v1 files in AWS ECS Fargate, where the pattern has been observed to sometimes differ from the documented pattern. (APM spec issue #888)
  • Add support for tedious v19. (#4218)
  • Add support for koa-router v13. (#4236)
  • Update cookie to version v0.7.2 to fix security issue CVE-2024-47764

Release date: August 9, 2024

  • Update import-in-the-middle to 1.11.0, which fixes an issue that can crash users using Nuxt and ESM. (#4175)

Release date: August 1, 2024

  • Fix for instrumentation for @aws-sdk/sns-client that will prevent a crash if the client is used when there is no parent transaction present. (#4168)
  • Fix for config resolution process. Before this change falsy config options coming from the elastic-apm-node.js file were ignored. (#4119)
  • Fix publishing of AWS Lambda layer to all AWS regions. This was broken in the 4.7.1 release. (#4171)

Release date: July 24, 2024

  • Update import-in-the-middle internally-used library to v1.9.1. This can fix usage with ESM code (see ECMAScript module support) in some cases, e.g. usage with Nuxt 3.

Release date: June 13, 2024

  • Update OpenTelemetry bridge support to @opentelemetry/api version 1.9.0. (#4078)

    Support for the new addLink and addLinks methods on Span have been added. However, support for the new synchronous gauge have not yet been added.

Release date: June 5, 2024

  • Make published docker.elastic.co/observability/apm-agent-nodejs Docker images multi-platform, with support for linux/amd64,linux/arm64 for now. This is necessary for users of the Elastic APM Attacher for Kubernetes, when deploying to k8s nodes that are ARM64 (e.g. Gravitron on AWS). (#4038)
  • Fix instrumentation for recent @aws-sdk/client-* releases that use @smithy/smithy-client v3. (For example @aws-sdk/client-s3@3.575.0 released 2024-05-13 updated to smithy-client v3.) Before this change the APM agent had been limiting patching of @smithy/smithy-client to >=1 <3. (#4036)

  • Mark the published AWS Lambda layers as supporting the "nodejs20.x" Lambda Runtime (--compatible-runtimes). The "nodejs20.x" runtime was released by AWS on 2023-11-15. (#4033)

    Note that this Node.js APM agent supports Node.js 20.x, so the new AWS Lambda runtime was supported when it was released. However, the metadata stating compatible runtimes (which is advisory) was not updated until now.

Release date: May 13, 2024

  • Change how the "cookie" HTTP request header is represented in APM transaction data to avoid a rare, but possible, intake bug where the transaction could be rejected due to a mapping conflict.

    Before this change a Cookie: foo=bar; sessionid=42 HTTP request header would be represented in the transaction document in Elasticsearch with these document fields (the example assumes sanitizeFieldNames matches "sessionid", as it does by default):

    http.request.headers.cookie: "[REDACTED]"
    ...
    http.request.cookies.foo: "bar"
    http.request.cookies.sessionid: "[REDACTED]"
    

    After this change it is represented as:

    http.request.headers.cookie: "foo=bar; sessionid=REDACTED"
    

    In other words, http.request.cookies are no longer separated out. (#4006)

Release date: April 23, 2024

  • Fix message handling for tombstone messages in kafkajs instrumentation. (#3985)

Release date: April 12, 2024

  • Fix path resolution for requests that contain invalid characters in its host header. (#3923)
  • Fix span names for getMore command of mongodb. (#3919)
  • Fix undici instrumentation to cope with a bug in undici@6.11.0 where request.addHeader() was accidentally removed. (It was re-added in undici@6.11.1.) (#3963)
  • Update undici instrumentation to avoid possibly adding a second traceparent header to outgoing HTTP requests, because this can break Elasticsearch requests. (#3964)

Release date: March 13, 2024

  • Update OpenTelemetry bridge support to @opentelemetry/api version 1.8.0.
  • Update tedious instrumentation to support versions 17 and 18. (#3901, #3911)
  • Add new kafkajs instrumentation. (#2905)
  • Fix instrumentation of mongodb to not break mongodb@6.4.0. Mongodb v6.4.0 included changes that resulted in the APM agent’s instrumentation breaking it. (#3897)
  • Fix hostname detection on Windows in some cases (where a powershell profile could break collection). (#3899)
  • Fix a path normalization issue that broke (or partially broke) instrumentation of some modules on Windows: Next.js, redis v4+, mongodb. (#3905)

Release date: February 6, 2024

  • Add support for instrumentation of ES module-using (ESM) code with Node.js versions matching ^18.19.0 || >=20.2.0. Before this version of the APM agent, ESM instrumentation was only supported for some earlier Node.js versions. Changes in Node.js’s ESM loader in v18.19.0 and v20 broke earlier ESM support. (#3784, #3844)

Release date: January 12, 2024

  • Support ELASTIC_APM_ACTIVATION_METHOD=K8S_ATTACH (in addition to the current K8S value) to indicate the agent is being started by apm-k8s-attacher. Newer releases of apm-k8s-attacher will be using this value (to have a common value used between APM agents).
  • Fix bug where NODE_ENV environment value was not used as a default for the environment config setting. The bug was introduced in v4.2.0. (#3807)
  • Improve Fastify instrumentation to no longer cause the FSTDEP017 and FSTDEP018 deprecation warnings. (#3814)

Release date: December 5, 2023

  • Add the apmClientHeaders config option, to allow adding custom headers to HTTP requests made to APM server by the APM agent. (#3759)
  • Skip undici tests for undici >=5.28.0 and NodeJS <14.18.0. (#3755)
  • Change the log level of Sending error to Elastic APM: ... from info to debug. There is no need to clutter the log output with this message. (#3748)
  • Explicitly mark this package as being of type="commonjs". The experimental node --experimental-default-type=module ... option added in Node.js v20.10.0 means that a default to "commonjs" isn’t guaranteed.
  • Fix the dependency version range for @elastic/ecs-pino-format. (#3774)

Release date: November 23, 2023

  • Fix mongodb instrumentation to avoid loosing context when multiple cursors are running concurrently. (#3161)
  • Set mongodb span’s outcome according to the result of the command being traced. (#3695)
  • Fix @aws-sdk/client-sqs instrumentation which was failing for SendMessageBatch command when any of the entities does not contain MessageAttributes. (#3746)

Release date: October 9, 2023

  • Update OpenTelemetry bridge support to @opentelemetry/api version 1.6.0. #3622
  • Add support for @aws-sdk/client-dynamodb, one of the AWS SDK v3 clients. (#2958)
  • Add support for @aws-sdk/client-sns, one of the AWS SDK v3 clients. (#2956)
  • Add support for @aws-sdk/client-sqs, one of the AWS SDK v3 clients. (#2957)
  • Fixes for some values of the disableInstrumentations config setting. "redis" will now properly disable instrumentation for redis@4. "next" will propertly disable all Next.js instrumentation. (#3658)

Release date: September 7, 2023

  • The apm.destroy() method is now async. Almost no users should need to use this method. However, if used, to be sure to wait for APM agent shutdown to be complete, one can now await apm.destroy(). (#3222)
  • Support instrumenting mongodb v6. (#3596)
  • Add a warning message when a duration or size config option is provided without units. (#2121)
  • Change default value of useElasticTraceparentHeader config option to false. This means that for outgoing HTTP requests, the APM agent will no longer add the elastic-apm-traceparent header. This vendor-specific header was used in the past while the W3C trace-context spec was still in development. Now that it is in wide use, the elastic-apm-traceparent header is only useful for interaction with very old Elastic APM agents.
  • Add default ports into context.service.target.name for HTTP spans conforming to the spec update done in https://github.com/elastic/apm/pull/700 (#3590)
  • Fix instrumentation of mongodb to avoid multiple command handler registrations when client is created via MongoClient.connect static method. (#3586)