elastic-apm-http-client
Advanced tools
Comparing version 9.8.1 to 9.9.0
# elastic-apm-http-client changelog | ||
## v9.9.0 | ||
- feat: Use uninstrumented HTTP(S) client request functions to avoid tracing | ||
requests made by the APM agent itself. | ||
([#161](https://github.com/elastic/apm-nodejs-http-client/pull/161)) | ||
## v9.8.1 | ||
@@ -4,0 +10,0 @@ |
17
index.js
@@ -37,2 +37,11 @@ 'use strict' | ||
// Get handles on uninstrumented functions for making HTTP(S) requests before | ||
// the APM agent has a chance to wrap them. This allows the Client to make | ||
// requests to APM server without interfering with the APM agent's tracing | ||
// of the user application. | ||
const httpGet = http.get | ||
const httpRequest = http.request | ||
const httpsGet = https.get | ||
const httpsRequest = https.request | ||
const containerInfo = getContainerInfo() | ||
@@ -209,5 +218,9 @@ | ||
this._transport = http | ||
this._transportRequest = httpRequest | ||
this._transportGet = httpGet | ||
break | ||
case 'https:': | ||
this._transport = https | ||
this._transportRequest = httpsRequest | ||
this._transportGet = httpsGet | ||
break | ||
@@ -287,3 +300,3 @@ default: | ||
const req = this._transport.get(opts, res => { | ||
const req = this._transportGet(opts, res => { | ||
res.on('error', err => { | ||
@@ -800,3 +813,3 @@ // Not sure this event can ever be emitted, but just in case | ||
// Start the request and set its timeout. | ||
const intakeReq = client._transport.request(client._conf.requestIntake) | ||
const intakeReq = client._transportRequest(client._conf.requestIntake) | ||
if (Number.isFinite(client._conf.serverTimeout)) { | ||
@@ -803,0 +816,0 @@ intakeReq.setTimeout(client._conf.serverTimeout) |
{ | ||
"name": "elastic-apm-http-client", | ||
"version": "9.8.1", | ||
"version": "9.9.0", | ||
"description": "A low-level HTTP client for communicating with the Elastic APM intake API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73831
1483