elastic-apm-http-client
Advanced tools
Changelog
v11.0.0
Add support for coordinating data flushing in an AWS Lambda environment. The following two API additions are used to ensure that (a) the Elastic Lambda extension is signaled at invocation end per spec and (b) a new intake request is not started when a Lambda function invocation is not active.
Client#lambdaStart()
should be used to indicate when a Lambda function
invocation begins.Client#flush([opts,] cb)
now supports an optional opts.lambdaEnd
boolean. Set it to true to indicate this is a flush at the end of a Lambda
function invocation.This is a BREAKING CHANGE, because current versions of elastic-apm-node
depend on ^10.4.0
. If this were released as another 10.x, then usage of
current elastic-apm-node with this version of the client would break
behavior in a Lambda environment.
Add the freeSocketTimeout
option, with a default of 4000 (ms), and switch
from Node.js's core http.Agent
to the agentkeepalive package
to fix ECONNRESET issues with HTTP Keep-Alive usage talking to APM Server
(https://github.com/elastic/apm-agent-nodejs/issues/2594).
Changelog
v10.4.0
Add APM Server version checking to the client. On creation the client will call the APM Server Information API to get the server version and save that.
The new Client#supportsKeepingUnsampledTransaction()
boolean method returns
true
if APM Server is a version that requires unsampled transactions to
be sent. This will be used by the APM Agent to drop unsampled transactions
for newer APM Servers.
There is a new apmServerVersion: <string>
config option to tell the Client
to skip fetching the APM Server version and use the given value. This config
option is intended mainly for internal test suite usage.
Changelog
v10.3.0
Add the expectExtraMetadata: true
configuration option and
Client#setExtraMetadata(metadata)
method to provide a mechanism for the
Node.js APM Agent to pass in metadata asynchronously and be sure that the
client will not begin an intake request until that metadata is provided.
This is to support passing in AWS Lambda metadata that cannot be gathered
until the first Lambda function
invocation.
(Note: The expectExtraMetadata
option cannot be used in combination with
cloudMetadataFetcher
.)
Use Z_BEST_SPEED
for gzip compression per
https://github.com/elastic/apm/blob/main/specs/agents/transport.md#compression
Changelog
v10.2.0
userAgent
string.
Before this it would append " elastic-apm-http-client/$ver node/$ver". This
is to support the APM agents spec for
User-Agent.Changelog
v10.1.0
client.flush()
will initiate a quicker completion of the current intake
request.Changelog
v10.0.0
truncate*At
config options) have
changed from truncating at a number of unicode chars, rather than a number
of bytes. This is both faster and matches the json-schema spec
for apm-server intake fields
that specify maxLength
.truncateQueriesAt
config option has been removed.truncateLongFieldsAt
config option has been added to cover
span.context.db.statement
and a number of other possibly-long fields (per
spec).
This does mean that in rare cases of long field values longer than the
default 10000 chars, this change will result in those values being truncated.truncateErrorMessagesAt
config option has been deprecated, in favor
of truncateLongFieldsAt
. Note, however, that truncateLongFieldsAt
does
not support the special case -1
value to disable truncation. If
truncateErrorMessagesAt
is not specified, the value for
truncateLongFieldsAt
is used. This means the effective default is now 10000,
no longer 2048.