Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Commit 8aaa1f3

Browse files
authored
fix: change default APM server_url to 'http://127.0.0.1:8200' to avoid IPv6 ambiguity (#190)
v11.0.4. The APM agent won't *require* this change, because in the referenced change it will be adding the same default on its end. Refs: elastic/apm-agent-nodejs#3049
1 parent 6988a5c commit 8aaa1f3

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# elastic-apm-http-client changelog
22

3+
## v11.0.4
4+
5+
- Update the default `serverUrl` to "http://127.0.0.1:8200". We no longer use
6+
"localhost" to avoid ambiguity if localhost resolves to multiple addresses
7+
(e.g. IPv4 and IPv6). APM server only listens on IPv4 by default.
8+
(https://github.com/elastic/apm-agent-nodejs/pull/3049)
9+
310
## v11.0.3
411

512
- Prevent a possible tight loop in central config fetching.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ HTTP client configuration:
8282
identify itself as
8383
- `secretToken` - The Elastic APM intake API secret token
8484
- `apiKey` - Elastic APM API key
85-
- `serverUrl` - The APM Server URL (default: `http://localhost:8200`)
85+
- `serverUrl` - The APM Server URL (default: `http://127.0.0.1:8200`)
8686
- `headers` - An object containing extra HTTP headers that should be
8787
used when making HTTP requests to he APM Server
8888
- `rejectUnauthorized` - Set to `false` if the client shouldn't verify

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Client.prototype.config = function (opts) {
232232
if (!this._conf.size && this._conf.size !== 0) this._conf.size = 750 * 1024
233233
if (!this._conf.time && this._conf.time !== 0) this._conf.time = 10000
234234
if (!this._conf.serverTimeout && this._conf.serverTimeout !== 0) this._conf.serverTimeout = 15000
235-
if (!this._conf.serverUrl) this._conf.serverUrl = 'http://localhost:8200'
235+
if (!this._conf.serverUrl) this._conf.serverUrl = 'http://127.0.0.1:8200'
236236
if (!this._conf.hostname) this._conf.hostname = hostname
237237
if (!this._conf.environment) this._conf.environment = process.env.NODE_ENV || 'development'
238238
if (!this._conf.truncateKeywordsAt) this._conf.truncateKeywordsAt = 1024
@@ -987,7 +987,7 @@ function getChoppedStreamHandler (client, onerror) {
987987
//
988988
// The HTTP keep-alive agent will unref sockets when unused, and ref them
989989
// during a request. Given that the normal makeIntakeRequest behaviour
990-
// is to keep a request open for up to 10s (`apiRequestTimeout`), we must
990+
// is to keep a request open for up to 10s (`apiRequestTime`), we must
991991
// manually unref the socket.
992992
//
993993
// The exception is when in a Lambda environment, where we *do* want to

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "elastic-apm-http-client",
3-
"version": "11.0.3",
3+
"version": "11.0.4",
44
"description": "A low-level HTTP client for communicating with the Elastic APM intake API",
55
"main": "index.js",
66
"directories": {

0 commit comments

Comments
 (0)