Node.js Agent version 4.x
editNode.js Agent version 4.x
editSee the Upgrade to v4.x guide.
4.8.1 - 2024/11/04
editBug fixes
edit-
Fix AWS Lambda instrumentation to work with a "handler" string that includes
a period (
.
) in the module path. E.g. the leading.
inHandler: ./src/functions/myfunc/handler.main
. (#4293).
4.8.0 - 2024/10/08
editFeatures
edit- 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)
Bug fixes
edit-
Update
cookie
to versionv0.7.2
to fix security issue [CVE-2024-47764](https://github.com/advisories/GHSA-pxg6-pf52-xh8x)
4.7.2 - 2024/08/01
editFeatures
edit-
Support hooking built-in Node.js modules loaded via
process.getBuiltinModule
, added in v22.3.0. (#4160)
Bug fixes
edit-
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)
4.7.1 - 2024/07/24
editBug fixes
edit- 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.
4.7.0 - 2024/06/13
editFeatures
edit-
Update OpenTelemetry bridge support to
@opentelemetry/api
version 1.9.0. (#4078)Support for the new
addLink
andaddLinks
methods on Span have been added. However, support for the new synchronous gauge have not yet been added.
4.6.0 - 2024/06/05
editFeatures
edit-
Make published
docker.elastic.co/observability/apm-agent-nodejs
Docker images multi-platform, with support forlinux/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)
Bug fixes
edit-
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.
4.5.4 - 2024/05/13
editBug fixes
edit-
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 assumessanitizeFieldNames
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)
4.5.3 - 2024/04/23
editBug fixes
edit-
Fix message handling for tombstone messages in
kafkajs
instrumentation. (#3985)
4.5.2 - 2024/04/12
editBug fixes
edit- 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)
4.5.0 - 2024/03/13
editFeatures
edit-
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)
Bug fixes
edit- 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)
4.4.1 - 2024/02/06
editBug fixes
edit-
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)
4.4.0 - 2024/01/12
editKnown issue: Using the APM agent’s ECMAScript module support with Node.js v18.19.0 is not supported in this version. Upgrade to APM agent version v4.5.0 or later, or use Node.js v18.18.1 or earlier. See https://github.com/elastic/apm-agent-nodejs/issues/3784 for details.
Features
edit-
Support
ELASTIC_APM_ACTIVATION_METHOD=K8S_ATTACH
(in addition to the currentK8S
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).
Bug fixes
edit-
Fix bug where
NODE_ENV
environment value was not used as a default for theenvironment
config setting. The bug was introduced in v4.2.0. (#3807) -
Improve Fastify instrumentation to no longer cause the
FSTDEP017
andFSTDEP018
deprecation warnings. (#3814)
4.3.0 - 2023/12/05
editKnown issue: Using the APM agent’s ECMAScript module support with Node.js v18.19.0 is not supported in this version. Upgrade to APM agent version v4.5.0 or later, or use Node.js v18.18.1 or earlier. See https://github.com/elastic/apm-agent-nodejs/issues/3784 for details.
Features
edit-
Add the
apmClientHeaders
config option, to allow adding custom headers to HTTP requests made to APM server by the APM agent. (#3759)
Bug fixes
edit-
Fix the dependency version range for
@elastic/ecs-pino-format
. (#3774)
Chores
edit-
Skip undici tests for
undici
>=5.28.0
and NodeJS<14.18.0
. (#3755) -
Change the log level of
Sending error to Elastic APM: ...
frominfo
todebug
. 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.
4.2.0 - 2023/11/23
editBreaking changes
edit- Drop support for next@11. Next.js instrumentation support is currently in technical preview, so it is not considered a semver-major change to drop support for this old version of next. (#3664)
Features
edit-
Add
apm.getServiceVersion()
,apm.getServiceEnvironment()
, andapm.getServiceNodeName()
. These are intended for use by ecs-logging-nodejs formatting packages. See https://github.com/elastic/ecs-logging-nodejs/pull/152. (#3195) - Add knex@3 instrumentation. (#3659)
-
Update OpenTelemetry bridge support to
@opentelemetry/api
version 1.7.0.
Bug fixes
edit-
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 forSendMessageBatch
command when any of the entities does not containMessageAttributes
. (#3746)
4.1.0 - 2023/10/09
editFeatures
edit-
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)
Bug fixes
edit-
Changes to cloud metadata collection for Google Cloud (GCP). Most notably
the
cloud.project.id
field is now theproject-id
from https://cloud.google.com/compute/docs/metadata/default-metadata-values#project_metadata rather than thenumeric-project-id
. This matches the value produced by Elastic Beats (like filebeat). #3614
4.0.0 - 2023/09/07
editSee the Upgrade to v4.x guide.
Breaking changes
edit- Set the new minimum supported Node.js to version 14.17.0. Users of earlier Node.js versions can use elastic-apm-node v3.x, which supports back to Node.js v8.6.
-
Ignore a
timer
option passed tostartTransaction()
andstartSpan()
APIs. This option was never documented. It would be surprising if any user is impacted by this. -
Remove long deprecated support for the
ELASTIC_APM_
-prefixed environment variables for the Kubernetes config options. For example, one must useKUBERNETES_POD_NAME
and notELASTIC_APM_KUBERNETES_POD_NAME
. (#2661) -
The config option
filterHttpHeaders
is now removed. (#3539) -
Remove the deprecated
span.toString()
andtransaction.toString()
APIs. See the upgrading doc for details. (#2348) - Remove instrumentation support for the old hapi package — the current @hapi/hapi package is still instrumented. (#2691)
-
Change
apm.startTransaction()
api to return a noop transaction instead of null, if the agent is not yet started. (#2429) -
Drop support for the obsolete "patch" context manager, i.e. the
contextManager: "patch"
config option. This was a limited async context management that predated the preferredAsyncLocalStorage
core Node.js mechanism for context tracking. It was deprecated in v3.37.0. As well, the related and deprecatedasyncHooks
config option has been removed. (#3529) -
Remove the
logUncaughtExceptions
config option. See Upgrading to v4 for details. (#2412) -
Remove
transaction.subtype
andtransaction.action
properties from API. This also impactsapm.startTransaction([name][, type][, options])
andtransaction.setType(...)
, both of which now no longer acceptsubtype
andaction
parameters. These two properties were deprecated in v3.25.0. (#3557) -
Remove support for the erroneous
ELASTIC_SANITIZE_FIELD_NAMES
andELASTIC_IGNORE_MESSAGE_QUEUES
config environment variables. The correct env vars areELASTIC_APM_SANITIZE_FIELD_NAMES
andELASTIC_APM_IGNORE_MESSAGE_QUEUES
, respectively, and were supported starting in v3.36.0.
Features
editBug fixes
edit-
Fix instrumentation of
mongodb
to avoid multiple command handler registrations when client is created viaMongoClient.connect
static method. (#3586)
Chores
edit- Add a warning message when a duration or size config option is provided without units. (#2121)
-
Change default value of
useElasticTraceparentHeader
config option tofalse
. This means that for outgoing HTTP requests, the APM agent will no longer add theelastic-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, theelastic-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)