@opentelemetry/web
Advanced tools
Comparing version 0.8.3 to 0.9.0
@@ -1,16 +0,1 @@ | ||
/*! | ||
* Copyright 2019, OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export declare enum PerformanceTimingNames { | ||
@@ -17,0 +2,0 @@ CONNECT_END = "connectEnd", |
"use strict"; | ||
/*! | ||
* Copyright 2019, OpenTelemetry Authors | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
@@ -18,2 +18,3 @@ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PerformanceTimingNames = void 0; | ||
var PerformanceTimingNames; | ||
@@ -20,0 +21,0 @@ (function (PerformanceTimingNames) { |
@@ -1,16 +0,1 @@ | ||
/*! | ||
* Copyright 2019, OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export * from './WebTracerProvider'; | ||
@@ -17,0 +2,0 @@ export * from './StackContextManager'; |
"use strict"; | ||
/*! | ||
* Copyright 2019, OpenTelemetry Authors | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
@@ -17,10 +17,18 @@ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
*/ | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./WebTracerProvider")); | ||
__export(require("./StackContextManager")); | ||
__export(require("./enums/PerformanceTimingNames")); | ||
__export(require("./utils")); | ||
__exportStar(require("./WebTracerProvider"), exports); | ||
__exportStar(require("./StackContextManager"), exports); | ||
__exportStar(require("./enums/PerformanceTimingNames"), exports); | ||
__exportStar(require("./types"), exports); | ||
__exportStar(require("./utils"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -1,16 +0,1 @@ | ||
/*! | ||
* Copyright 2019, OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { Context } from '@opentelemetry/api'; | ||
@@ -17,0 +2,0 @@ import { ContextManager } from '@opentelemetry/context-base'; |
"use strict"; | ||
/*! | ||
* Copyright 2019, OpenTelemetry Authors | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
@@ -18,2 +18,3 @@ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.StackContextManager = void 0; | ||
const api_1 = require("@opentelemetry/api"); | ||
@@ -20,0 +21,0 @@ /** |
@@ -1,19 +0,1 @@ | ||
/*! | ||
* Copyright 2019, OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** | ||
* Performance metrics | ||
*/ | ||
import { PerformanceTimingNames } from './enums/PerformanceTimingNames'; | ||
@@ -56,2 +38,8 @@ export declare type PerformanceEntries = { | ||
} | ||
declare type PropagateTraceHeaderCorsUrl = string | RegExp; | ||
/** | ||
* urls which should include trace headers when origin doesn't match | ||
*/ | ||
export declare type PropagateTraceHeaderCorsUrls = PropagateTraceHeaderCorsUrl | PropagateTraceHeaderCorsUrl[]; | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
"use strict"; | ||
/*! | ||
* Copyright 2019, OpenTelemetry Authors | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
@@ -17,7 +18,3 @@ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Performance metrics | ||
*/ | ||
const PerformanceTimingNames_1 = require("./enums/PerformanceTimingNames"); | ||
//# sourceMappingURL=types.js.map |
@@ -1,17 +0,2 @@ | ||
/*! | ||
* Copyright 2019, OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { PerformanceEntries, PerformanceResourceTimingInfo } from './types'; | ||
import { PerformanceEntries, PerformanceResourceTimingInfo, PropagateTraceHeaderCorsUrls } from './types'; | ||
import * as api from '@opentelemetry/api'; | ||
@@ -32,2 +17,8 @@ /** | ||
/** | ||
* Helper function for adding network events | ||
* @param span | ||
* @param resource | ||
*/ | ||
export declare function addSpanNetworkEvents(span: api.Span, resource: PerformanceEntries): void; | ||
/** | ||
* sort resources by startTime | ||
@@ -45,4 +36,5 @@ * @param filteredResources | ||
* @param ignoredResources | ||
* @param initiatorType | ||
*/ | ||
export declare function getResource(spanUrl: string, startTimeHR: api.HrTime, endTimeHR: api.HrTime, resources: PerformanceResourceTiming[], ignoredResources?: WeakSet<PerformanceResourceTiming>): PerformanceResourceTimingInfo; | ||
export declare function getResource(spanUrl: string, startTimeHR: api.HrTime, endTimeHR: api.HrTime, resources: PerformanceResourceTiming[], ignoredResources?: WeakSet<PerformanceResourceTiming>, initiatorType?: string): PerformanceResourceTimingInfo; | ||
/** | ||
@@ -60,2 +52,8 @@ * Parses url using anchor element | ||
export declare function getElementXPath(target: any, optimised?: boolean): string; | ||
/** | ||
* Checks if trace headers should be propagated | ||
* @param spanUrl | ||
* @private | ||
*/ | ||
export declare function shouldPropagateTraceHeaders(spanUrl: string, propagateTraceHeaderCorsUrls?: PropagateTraceHeaderCorsUrls): boolean; | ||
//# sourceMappingURL=utils.d.ts.map |
"use strict"; | ||
/*! | ||
* Copyright 2019, OpenTelemetry Authors | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
@@ -18,2 +18,3 @@ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.shouldPropagateTraceHeaders = exports.getElementXPath = exports.parseUrl = exports.getResource = exports.sortResources = exports.addSpanNetworkEvents = exports.addSpanNetworkEvent = exports.hasKey = void 0; | ||
const PerformanceTimingNames_1 = require("./enums/PerformanceTimingNames"); | ||
@@ -26,2 +27,3 @@ const core_1 = require("@opentelemetry/core"); | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function hasKey(obj, key) { | ||
@@ -52,2 +54,19 @@ return key in obj; | ||
/** | ||
* Helper function for adding network events | ||
* @param span | ||
* @param resource | ||
*/ | ||
function addSpanNetworkEvents(span, resource) { | ||
addSpanNetworkEvent(span, PerformanceTimingNames_1.PerformanceTimingNames.FETCH_START, resource); | ||
addSpanNetworkEvent(span, PerformanceTimingNames_1.PerformanceTimingNames.DOMAIN_LOOKUP_START, resource); | ||
addSpanNetworkEvent(span, PerformanceTimingNames_1.PerformanceTimingNames.DOMAIN_LOOKUP_END, resource); | ||
addSpanNetworkEvent(span, PerformanceTimingNames_1.PerformanceTimingNames.CONNECT_START, resource); | ||
addSpanNetworkEvent(span, PerformanceTimingNames_1.PerformanceTimingNames.SECURE_CONNECTION_START, resource); | ||
addSpanNetworkEvent(span, PerformanceTimingNames_1.PerformanceTimingNames.CONNECT_END, resource); | ||
addSpanNetworkEvent(span, PerformanceTimingNames_1.PerformanceTimingNames.REQUEST_START, resource); | ||
addSpanNetworkEvent(span, PerformanceTimingNames_1.PerformanceTimingNames.RESPONSE_START, resource); | ||
addSpanNetworkEvent(span, PerformanceTimingNames_1.PerformanceTimingNames.RESPONSE_END, resource); | ||
} | ||
exports.addSpanNetworkEvents = addSpanNetworkEvents; | ||
/** | ||
* sort resources by startTime | ||
@@ -78,5 +97,6 @@ * @param filteredResources | ||
* @param ignoredResources | ||
* @param initiatorType | ||
*/ | ||
function getResource(spanUrl, startTimeHR, endTimeHR, resources, ignoredResources = new WeakSet()) { | ||
const filteredResources = filterResourcesForSpan(spanUrl, startTimeHR, endTimeHR, resources, ignoredResources); | ||
function getResource(spanUrl, startTimeHR, endTimeHR, resources, ignoredResources = new WeakSet(), initiatorType) { | ||
const filteredResources = filterResourcesForSpan(spanUrl, startTimeHR, endTimeHR, resources, ignoredResources, initiatorType); | ||
if (filteredResources.length === 0) { | ||
@@ -149,3 +169,3 @@ return { | ||
*/ | ||
function filterResourcesForSpan(spanUrl, startTimeHR, endTimeHR, resources, ignoredResources) { | ||
function filterResourcesForSpan(spanUrl, startTimeHR, endTimeHR, resources, ignoredResources, initiatorType) { | ||
const startTime = core_1.hrTimeToNanoseconds(startTimeHR); | ||
@@ -156,3 +176,4 @@ const endTime = core_1.hrTimeToNanoseconds(endTimeHR); | ||
const resourceEndTime = core_1.hrTimeToNanoseconds(core_1.timeInputToHrTime(resource[PerformanceTimingNames_1.PerformanceTimingNames.RESPONSE_END])); | ||
return (resource.initiatorType.toLowerCase() === 'xmlhttprequest' && | ||
return (resource.initiatorType.toLowerCase() === | ||
(initiatorType || 'xmlhttprequest') && | ||
resource.name === spanUrl && | ||
@@ -185,2 +206,3 @@ resourceStartTime >= startTime && | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function getElementXPath(target, optimised) { | ||
@@ -258,2 +280,22 @@ if (target.nodeType === Node.DOCUMENT_NODE) { | ||
} | ||
/** | ||
* Checks if trace headers should be propagated | ||
* @param spanUrl | ||
* @private | ||
*/ | ||
function shouldPropagateTraceHeaders(spanUrl, propagateTraceHeaderCorsUrls) { | ||
let propagateTraceHeaderUrls = propagateTraceHeaderCorsUrls || []; | ||
if (typeof propagateTraceHeaderUrls === 'string' || | ||
propagateTraceHeaderUrls instanceof RegExp) { | ||
propagateTraceHeaderUrls = [propagateTraceHeaderUrls]; | ||
} | ||
const parsedSpanUrl = parseUrl(spanUrl); | ||
if (parsedSpanUrl.origin === window.location.origin) { | ||
return true; | ||
} | ||
else { | ||
return propagateTraceHeaderUrls.some(propagateTraceHeaderUrl => core_1.urlMatches(spanUrl, propagateTraceHeaderUrl)); | ||
} | ||
} | ||
exports.shouldPropagateTraceHeaders = shouldPropagateTraceHeaders; | ||
//# sourceMappingURL=utils.js.map |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.8.3"; | ||
export declare const VERSION = "0.9.0"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
/* | ||
* Copyright 2020, OpenTelemetry Authors | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
@@ -18,4 +18,5 @@ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VERSION = void 0; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.8.3'; | ||
exports.VERSION = '0.9.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -1,16 +0,1 @@ | ||
/*! | ||
* Copyright 2019, OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { BasePlugin } from '@opentelemetry/core'; | ||
@@ -17,0 +2,0 @@ import { BasicTracerProvider, SDKRegistrationConfig, TracerConfig } from '@opentelemetry/tracing'; |
"use strict"; | ||
/*! | ||
* Copyright 2019, OpenTelemetry Authors | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
@@ -18,2 +18,3 @@ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WebTracerProvider = void 0; | ||
const tracing_1 = require("@opentelemetry/tracing"); | ||
@@ -20,0 +21,0 @@ const StackContextManager_1 = require("./StackContextManager"); |
{ | ||
"name": "@opentelemetry/web", | ||
"version": "0.8.3", | ||
"version": "0.9.0", | ||
"description": "OpenTelemetry Web Tracer", | ||
@@ -45,39 +45,39 @@ "main": "build/src/index.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.6.0", | ||
"@opentelemetry/context-zone": "^0.8.3", | ||
"@opentelemetry/resources": "^0.8.3", | ||
"@types/jquery": "^3.3.31", | ||
"@types/mocha": "^7.0.0", | ||
"@types/node": "^14.0.5", | ||
"@types/sinon": "^7.0.13", | ||
"@babel/core": "7.10.2", | ||
"@opentelemetry/context-zone": "^0.9.0", | ||
"@opentelemetry/resources": "^0.9.0", | ||
"@types/jquery": "3.3.38", | ||
"@types/mocha": "7.0.2", | ||
"@types/node": "14.0.13", | ||
"@types/sinon": "9.0.4", | ||
"@types/webpack-env": "1.15.2", | ||
"babel-loader": "^8.0.6", | ||
"codecov": "^3.6.1", | ||
"gts": "^2.0.0", | ||
"istanbul-instrumenter-loader": "^3.0.1", | ||
"karma": "^5.0.5", | ||
"karma-chrome-launcher": "^3.1.0", | ||
"karma-coverage-istanbul-reporter": "^3.0.2", | ||
"karma-jquery": "^0.2.4", | ||
"karma-mocha": "^2.0.1", | ||
"karma-spec-reporter": "^0.0.32", | ||
"karma-webpack": "^4.0.2", | ||
"mocha": "^7.1.2", | ||
"nyc": "^15.0.0", | ||
"rimraf": "^3.0.0", | ||
"sinon": "^7.5.0", | ||
"ts-loader": "^6.0.4", | ||
"ts-mocha": "^7.0.0", | ||
"ts-node": "^8.6.2", | ||
"typescript": "3.7.2", | ||
"webpack": "^4.35.2", | ||
"webpack-cli": "^3.3.9", | ||
"webpack-merge": "^4.2.2" | ||
"babel-loader": "8.1.0", | ||
"codecov": "3.7.0", | ||
"gts": "2.0.2", | ||
"istanbul-instrumenter-loader": "3.0.1", | ||
"karma": "5.1.0", | ||
"karma-chrome-launcher": "3.1.0", | ||
"karma-coverage-istanbul-reporter": "3.0.3", | ||
"karma-jquery": "0.2.4", | ||
"karma-mocha": "2.0.1", | ||
"karma-spec-reporter": "0.0.32", | ||
"karma-webpack": "4.0.2", | ||
"mocha": "7.2.0", | ||
"nyc": "15.1.0", | ||
"rimraf": "3.0.2", | ||
"sinon": "9.0.2", | ||
"ts-loader": "7.0.5", | ||
"ts-mocha": "7.0.0", | ||
"ts-node": "8.10.2", | ||
"typescript": "3.9.5", | ||
"webpack": "4.43.0", | ||
"webpack-cli": "3.3.11", | ||
"webpack-merge": "4.2.2" | ||
}, | ||
"dependencies": { | ||
"@opentelemetry/api": "^0.8.3", | ||
"@opentelemetry/context-base": "^0.8.3", | ||
"@opentelemetry/core": "^0.8.3", | ||
"@opentelemetry/tracing": "^0.8.3" | ||
"@opentelemetry/api": "^0.9.0", | ||
"@opentelemetry/context-base": "^0.9.0", | ||
"@opentelemetry/core": "^0.9.0", | ||
"@opentelemetry/tracing": "^0.9.0" | ||
} | ||
} |
# OpenTelemetry Web SDK | ||
[![Gitter chat][gitter-image]][gitter-url] | ||
@@ -13,3 +14,4 @@ [![NPM Published Version][npm-img]][npm-url] | ||
## How does automatic tracing work? | ||
## How does automatic tracing work | ||
This package exposes a class `WebTracerProvider` that will be able to automatically trace things in Browser only. | ||
@@ -66,2 +68,3 @@ | ||
## Useful links | ||
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/> | ||
@@ -68,0 +71,0 @@ - For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-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
86
47473
775
+ Added@opentelemetry/api@0.9.0(transitive)
+ Added@opentelemetry/context-base@0.9.0(transitive)
+ Added@opentelemetry/core@0.9.0(transitive)
+ Added@opentelemetry/resources@0.9.0(transitive)
+ Added@opentelemetry/tracing@0.9.0(transitive)
- Removed@opentelemetry/api@0.8.3(transitive)
- Removed@opentelemetry/context-base@0.8.3(transitive)
- Removed@opentelemetry/core@0.8.3(transitive)
- Removed@opentelemetry/resources@0.8.3(transitive)
- Removed@opentelemetry/tracing@0.8.3(transitive)
Updated@opentelemetry/api@^0.9.0
Updated@opentelemetry/core@^0.9.0