@opentelemetry/instrumentation-xml-http-request
Advanced tools
Comparing version 0.28.0 to 0.29.0
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.28.0"; | ||
export declare const VERSION = "0.29.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -17,3 +17,3 @@ /* | ||
// this is autogenerated file, see scripts/version-update.js | ||
export var VERSION = '0.28.0'; | ||
export var VERSION = '0.29.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -35,11 +35,6 @@ /* | ||
import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; | ||
import { addSpanNetworkEvents, getResource, PerformanceTimingNames as PTN, shouldPropagateTraceHeaders } from '@opentelemetry/sdk-trace-web'; | ||
import { addSpanNetworkEvents, getResource, PerformanceTimingNames as PTN, shouldPropagateTraceHeaders, parseUrl, } from '@opentelemetry/sdk-trace-web'; | ||
import { EventNames } from './enums/EventNames'; | ||
import { VERSION } from './version'; | ||
import { AttributeNames } from './enums/AttributeNames'; | ||
function parseUrl(url) { | ||
var element = document.createElement('a'); | ||
element.href = url; | ||
return element; | ||
} | ||
// how long to wait for observer to collect information about resources | ||
@@ -153,4 +148,4 @@ // this is needed as event "load" is called before observer | ||
if (!xhrMem || | ||
PerformanceObserver == null || | ||
PerformanceResourceTiming == null) { | ||
typeof PerformanceObserver !== 'function' || | ||
typeof PerformanceResourceTiming !== 'function') { | ||
return; | ||
@@ -157,0 +152,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.28.0"; | ||
export declare const VERSION = "0.29.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -17,3 +17,3 @@ /* | ||
// this is autogenerated file, see scripts/version-update.js | ||
export const VERSION = '0.28.0'; | ||
export const VERSION = '0.29.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -20,11 +20,6 @@ /* | ||
import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; | ||
import { addSpanNetworkEvents, getResource, PerformanceTimingNames as PTN, shouldPropagateTraceHeaders } from '@opentelemetry/sdk-trace-web'; | ||
import { addSpanNetworkEvents, getResource, PerformanceTimingNames as PTN, shouldPropagateTraceHeaders, parseUrl, } from '@opentelemetry/sdk-trace-web'; | ||
import { EventNames } from './enums/EventNames'; | ||
import { VERSION } from './version'; | ||
import { AttributeNames } from './enums/AttributeNames'; | ||
function parseUrl(url) { | ||
const element = document.createElement('a'); | ||
element.href = url; | ||
return element; | ||
} | ||
// how long to wait for observer to collect information about resources | ||
@@ -134,4 +129,4 @@ // this is needed as event "load" is called before observer | ||
if (!xhrMem || | ||
PerformanceObserver == null || | ||
PerformanceResourceTiming == null) { | ||
typeof PerformanceObserver !== 'function' || | ||
typeof PerformanceResourceTiming !== 'function') { | ||
return; | ||
@@ -138,0 +133,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.28.0"; | ||
export declare const VERSION = "0.29.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.28.0'; | ||
exports.VERSION = '0.29.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -27,7 +27,2 @@ "use strict"; | ||
const AttributeNames_1 = require("./enums/AttributeNames"); | ||
function parseUrl(url) { | ||
const element = document.createElement('a'); | ||
element.href = url; | ||
return element; | ||
} | ||
// how long to wait for observer to collect information about resources | ||
@@ -62,3 +57,3 @@ // this is needed as event "load" is called before observer | ||
_addHeaders(xhr, spanUrl) { | ||
const url = parseUrl(spanUrl).href; | ||
const url = (0, sdk_trace_web_1.parseUrl)(spanUrl).href; | ||
if (!(0, sdk_trace_web_1.shouldPropagateTraceHeaders)(url, this._getConfig().propagateTraceHeaderCorsUrls)) { | ||
@@ -102,3 +97,3 @@ const headers = {}; | ||
if (typeof spanUrl === 'string') { | ||
const parsedUrl = parseUrl(spanUrl); | ||
const parsedUrl = (0, sdk_trace_web_1.parseUrl)(spanUrl); | ||
if (xhrMem.status !== undefined) { | ||
@@ -139,4 +134,4 @@ span.setAttribute(semantic_conventions_1.SemanticAttributes.HTTP_STATUS_CODE, xhrMem.status); | ||
if (!xhrMem || | ||
PerformanceObserver == null || | ||
PerformanceResourceTiming == null) { | ||
typeof PerformanceObserver !== 'function' || | ||
typeof PerformanceResourceTiming !== 'function') { | ||
return; | ||
@@ -147,3 +142,3 @@ } | ||
const entries = list.getEntries(); | ||
const parsedUrl = parseUrl(spanUrl); | ||
const parsedUrl = (0, sdk_trace_web_1.parseUrl)(spanUrl); | ||
entries.forEach(entry => { | ||
@@ -193,3 +188,3 @@ if (entry.initiatorType === 'xmlhttprequest' && | ||
} | ||
const resource = (0, sdk_trace_web_1.getResource)(parseUrl(spanUrl).href, startTime, endTime, resources, this._usedResources); | ||
const resource = (0, sdk_trace_web_1.getResource)((0, sdk_trace_web_1.parseUrl)(spanUrl).href, startTime, endTime, resources, this._usedResources); | ||
if (resource.mainRequest) { | ||
@@ -196,0 +191,0 @@ const mainRequest = resource.mainRequest; |
{ | ||
"name": "@opentelemetry/instrumentation-xml-http-request", | ||
"version": "0.28.0", | ||
"version": "0.29.0", | ||
"description": "OpenTelemetry XMLHttpRequest automatic instrumentation package.", | ||
@@ -59,5 +59,5 @@ "main": "build/src/index.js", | ||
"@opentelemetry/api": "^1.0.0", | ||
"@opentelemetry/context-zone": "1.2.0", | ||
"@opentelemetry/propagator-b3": "1.2.0", | ||
"@opentelemetry/sdk-trace-base": "1.2.0", | ||
"@opentelemetry/context-zone": "1.3.0", | ||
"@opentelemetry/propagator-b3": "1.3.0", | ||
"@opentelemetry/sdk-trace-base": "1.3.0", | ||
"@types/mocha": "8.2.3", | ||
@@ -81,3 +81,3 @@ "@types/node": "14.17.33", | ||
"ts-loader": "8.3.0", | ||
"ts-mocha": "8.0.0", | ||
"ts-mocha": "9.0.2", | ||
"typescript": "4.4.4", | ||
@@ -92,8 +92,8 @@ "webpack": "4.46.0", | ||
"dependencies": { | ||
"@opentelemetry/core": "1.2.0", | ||
"@opentelemetry/instrumentation": "0.28.0", | ||
"@opentelemetry/sdk-trace-web": "1.2.0", | ||
"@opentelemetry/semantic-conventions": "1.2.0" | ||
"@opentelemetry/core": "1.3.0", | ||
"@opentelemetry/instrumentation": "0.29.0", | ||
"@opentelemetry/sdk-trace-web": "1.3.0", | ||
"@opentelemetry/semantic-conventions": "1.3.0" | ||
}, | ||
"gitHead": "a0a670a03fd35b0799bee8cc466f79e93b5b6dd2" | ||
"gitHead": "eda0b092db484855ded8b4837ba7fc19a377c5a7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
197819
2008
+ Added@opentelemetry/api-metrics@0.29.0(transitive)
+ Added@opentelemetry/core@1.3.0(transitive)
+ Added@opentelemetry/instrumentation@0.29.0(transitive)
+ Added@opentelemetry/resources@1.3.0(transitive)
+ Added@opentelemetry/sdk-trace-base@1.3.0(transitive)
+ Added@opentelemetry/sdk-trace-web@1.3.0(transitive)
+ Added@opentelemetry/semantic-conventions@1.3.0(transitive)
- Removed@opentelemetry/api-metrics@0.28.0(transitive)
- Removed@opentelemetry/core@1.2.0(transitive)
- Removed@opentelemetry/instrumentation@0.28.0(transitive)
- Removed@opentelemetry/resources@1.2.0(transitive)
- Removed@opentelemetry/sdk-trace-base@1.2.0(transitive)
- Removed@opentelemetry/sdk-trace-web@1.2.0(transitive)
- Removed@opentelemetry/semantic-conventions@1.2.0(transitive)
Updated@opentelemetry/core@1.3.0