Skip to content

Commit

Permalink
Merge 0a1f723 into 9328558
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Apr 7, 2023
2 parents 9328558 + 0a1f723 commit 415e555
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"@types/mocha": "10.0.0",
"@types/node": "18.6.5",
"@types/request-promise-native": "1.0.18",
"@types/semver": "7.3.9",
"@types/sinon": "10.0.13",
"@types/superagent": "4.1.13",
"axios": "0.24.0",
Expand All @@ -75,8 +74,7 @@
"dependencies": {
"@opentelemetry/core": "1.11.0",
"@opentelemetry/instrumentation": "0.37.0",
"@opentelemetry/semantic-conventions": "1.11.0",
"semver": "^7.3.5"
"@opentelemetry/semantic-conventions": "1.11.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http",
"sideEffects": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import {
import type * as http from 'http';
import type * as https from 'https';
import { Socket } from 'net';
import * as semver from 'semver';
import * as url from 'url';
import {
Err,
Expand Down Expand Up @@ -580,18 +579,6 @@ export class HttpInstrumentation extends InstrumentationBase<Http> {
options,
extraOptions
);
/**
* Node 8's https module directly call the http one so to avoid creating
* 2 span for the same request we need to check that the protocol is correct
* See: https://github.com/nodejs/node/blob/v8.17.0/lib/https.js#L245
*/
if (
component === 'http' &&
semver.lt(process.version, '9.0.0') &&
optionsParsed.protocol === 'https:'
) {
return original.apply(this, [optionsParsed, ...args]);
}

if (
utils.isIgnored(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export function sendWithHttp<ExportItem, ServiceRequest>(
): void {
const exporterTimeout = collector.timeoutMillis;
const parsedUrl = new url.URL(collector.url);
const nodeVersion = Number(process.versions.node.split('.')[0]);
let retryTimer: ReturnType<typeof setTimeout>;
let req: http.ClientRequest;
let reqIsDestroyed = false;
Expand All @@ -63,8 +62,7 @@ export function sendWithHttp<ExportItem, ServiceRequest>(
const err = new OTLPExporterError('Request Timeout');
onError(err);
} else {
// req.abort() was deprecated since v14
nodeVersion >= 14 ? req.destroy() : req.abort();
req.destroy();
}
}, exporterTimeout);

Expand Down

0 comments on commit 415e555

Please sign in to comment.