Socket
Socket
Sign inDemoInstall

@opentelemetry/instrumentation-document-load

Package Overview
Dependencies
Maintainers
3
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/instrumentation-document-load - npm Package Compare versions

Comparing version 0.38.0 to 0.39.0

36

build/esm/instrumentation.js

@@ -36,3 +36,3 @@ /*

import { AttributeNames } from './enums/AttributeNames';
import { VERSION } from './version';
import { PACKAGE_NAME, PACKAGE_VERSION } from './version';
import { SEMATTRS_HTTP_URL, SEMATTRS_HTTP_USER_AGENT, } from '@opentelemetry/semantic-conventions';

@@ -51,3 +51,3 @@ import { addSpanPerformancePaintEvents, getPerformanceNavigationEntries, } from './utils';

if (config === void 0) { config = {}; }
var _this = _super.call(this, '@opentelemetry/instrumentation-document-load', VERSION, config) || this;
var _this = _super.call(this, PACKAGE_NAME, PACKAGE_VERSION, config) || this;
_this.component = 'document-load';

@@ -104,3 +104,5 @@ _this.version = '1';

var _a;
addSpanNetworkEvents(fetchSpan, entries);
if (!_this._getConfig().ignoreNetworkEvents) {
addSpanNetworkEvents(fetchSpan, entries);
}
_this._addCustomAttributesOnSpan(fetchSpan, (_a = _this._getConfig().applyCustomAttributesOnSpan) === null || _a === void 0 ? void 0 : _a.documentFetch);

@@ -114,12 +116,16 @@ _this._endSpan(fetchSpan, PTN.RESPONSE_END, entries);

_this._addResourcesSpans(rootSpan);
addSpanNetworkEvent(rootSpan, PTN.FETCH_START, entries);
addSpanNetworkEvent(rootSpan, PTN.UNLOAD_EVENT_START, entries);
addSpanNetworkEvent(rootSpan, PTN.UNLOAD_EVENT_END, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_INTERACTIVE, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_CONTENT_LOADED_EVENT_START, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_CONTENT_LOADED_EVENT_END, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_COMPLETE, entries);
addSpanNetworkEvent(rootSpan, PTN.LOAD_EVENT_START, entries);
addSpanNetworkEvent(rootSpan, PTN.LOAD_EVENT_END, entries);
addSpanPerformancePaintEvents(rootSpan);
if (!_this._getConfig().ignoreNetworkEvents) {
addSpanNetworkEvent(rootSpan, PTN.FETCH_START, entries);
addSpanNetworkEvent(rootSpan, PTN.UNLOAD_EVENT_START, entries);
addSpanNetworkEvent(rootSpan, PTN.UNLOAD_EVENT_END, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_INTERACTIVE, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_CONTENT_LOADED_EVENT_START, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_CONTENT_LOADED_EVENT_END, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_COMPLETE, entries);
addSpanNetworkEvent(rootSpan, PTN.LOAD_EVENT_START, entries);
addSpanNetworkEvent(rootSpan, PTN.LOAD_EVENT_END, entries);
}
if (!_this._getConfig().ignorePerformancePaintEvents) {
addSpanPerformancePaintEvents(rootSpan);
}
_this._addCustomAttributesOnSpan(rootSpan, (_a = _this._getConfig().applyCustomAttributesOnSpan) === null || _a === void 0 ? void 0 : _a.documentLoad);

@@ -157,3 +163,5 @@ _this._endSpan(rootSpan, PTN.LOAD_EVENT_END, entries);

span.setAttribute(SEMATTRS_HTTP_URL, resource.name);
addSpanNetworkEvents(span, resource);
if (!this._getConfig().ignoreNetworkEvents) {
addSpanNetworkEvents(span, resource);
}
this._addCustomAttributesOnResourceSpan(span, resource, (_a = this._getConfig().applyCustomAttributesOnSpan) === null || _a === void 0 ? void 0 : _a.resourceFetch);

@@ -160,0 +168,0 @@ this._endSpan(span, PTN.RESPONSE_END, resource);

@@ -19,3 +19,35 @@ import { Span } from '@opentelemetry/api';

};
/** Ignore adding network events as span events for document fetch and resource fetch spans.
* This instrumentation will send the following span events by default:
* connectEnd
* connectStart
* decodedBodySize
* domComplete
* domContentLoadedEventEnd
* domContentLoadedEventStart
* domInteractive
* domainLookupEnd
* domainLookupStart
* encodedBodySize
* fetchStart
* loadEventEnd
* loadEventStart
* navigationStart
* redirectEnd
* redirectStart
* requestStart
* responseEnd
* responseStart
* secureConnectionStart
* unloadEventEnd
* unloadEventStart
*/
ignoreNetworkEvents?: boolean;
/** Ignore adding performance paint span events on document load spans
* This instrumentation will send the following span events by default:
* firstContentfulPaint
* firstPaint
*/
ignorePerformancePaintEvents?: boolean;
}
//# sourceMappingURL=types.d.ts.map

@@ -1,2 +0,3 @@

export declare const VERSION = "0.38.0";
export declare const PACKAGE_VERSION = "0.39.0";
export declare const PACKAGE_NAME = "@opentelemetry/instrumentation-document-load";
//# sourceMappingURL=version.d.ts.map

@@ -17,3 +17,4 @@ /*

// this is autogenerated file, see scripts/version-update.js
export var VERSION = '0.38.0';
export var PACKAGE_VERSION = '0.39.0';
export var PACKAGE_NAME = '@opentelemetry/instrumentation-document-load';
//# sourceMappingURL=version.js.map

@@ -21,3 +21,3 @@ /*

import { AttributeNames } from './enums/AttributeNames';
import { VERSION } from './version';
import { PACKAGE_NAME, PACKAGE_VERSION } from './version';
import { SEMATTRS_HTTP_URL, SEMATTRS_HTTP_USER_AGENT, } from '@opentelemetry/semantic-conventions';

@@ -34,3 +34,3 @@ import { addSpanPerformancePaintEvents, getPerformanceNavigationEntries, } from './utils';

constructor(config = {}) {
super('@opentelemetry/instrumentation-document-load', VERSION, config);
super(PACKAGE_NAME, PACKAGE_VERSION, config);
this.component = 'document-load';

@@ -83,3 +83,5 @@ this.version = '1';

var _a;
addSpanNetworkEvents(fetchSpan, entries);
if (!this._getConfig().ignoreNetworkEvents) {
addSpanNetworkEvents(fetchSpan, entries);
}
this._addCustomAttributesOnSpan(fetchSpan, (_a = this._getConfig().applyCustomAttributesOnSpan) === null || _a === void 0 ? void 0 : _a.documentFetch);

@@ -93,12 +95,16 @@ this._endSpan(fetchSpan, PTN.RESPONSE_END, entries);

this._addResourcesSpans(rootSpan);
addSpanNetworkEvent(rootSpan, PTN.FETCH_START, entries);
addSpanNetworkEvent(rootSpan, PTN.UNLOAD_EVENT_START, entries);
addSpanNetworkEvent(rootSpan, PTN.UNLOAD_EVENT_END, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_INTERACTIVE, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_CONTENT_LOADED_EVENT_START, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_CONTENT_LOADED_EVENT_END, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_COMPLETE, entries);
addSpanNetworkEvent(rootSpan, PTN.LOAD_EVENT_START, entries);
addSpanNetworkEvent(rootSpan, PTN.LOAD_EVENT_END, entries);
addSpanPerformancePaintEvents(rootSpan);
if (!this._getConfig().ignoreNetworkEvents) {
addSpanNetworkEvent(rootSpan, PTN.FETCH_START, entries);
addSpanNetworkEvent(rootSpan, PTN.UNLOAD_EVENT_START, entries);
addSpanNetworkEvent(rootSpan, PTN.UNLOAD_EVENT_END, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_INTERACTIVE, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_CONTENT_LOADED_EVENT_START, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_CONTENT_LOADED_EVENT_END, entries);
addSpanNetworkEvent(rootSpan, PTN.DOM_COMPLETE, entries);
addSpanNetworkEvent(rootSpan, PTN.LOAD_EVENT_START, entries);
addSpanNetworkEvent(rootSpan, PTN.LOAD_EVENT_END, entries);
}
if (!this._getConfig().ignorePerformancePaintEvents) {
addSpanPerformancePaintEvents(rootSpan);
}
this._addCustomAttributesOnSpan(rootSpan, (_a = this._getConfig().applyCustomAttributesOnSpan) === null || _a === void 0 ? void 0 : _a.documentLoad);

@@ -136,3 +142,5 @@ this._endSpan(rootSpan, PTN.LOAD_EVENT_END, entries);

span.setAttribute(SEMATTRS_HTTP_URL, resource.name);
addSpanNetworkEvents(span, resource);
if (!this._getConfig().ignoreNetworkEvents) {
addSpanNetworkEvents(span, resource);
}
this._addCustomAttributesOnResourceSpan(span, resource, (_a = this._getConfig().applyCustomAttributesOnSpan) === null || _a === void 0 ? void 0 : _a.resourceFetch);

@@ -139,0 +147,0 @@ this._endSpan(span, PTN.RESPONSE_END, resource);

@@ -19,3 +19,35 @@ import { Span } from '@opentelemetry/api';

};
/** Ignore adding network events as span events for document fetch and resource fetch spans.
* This instrumentation will send the following span events by default:
* connectEnd
* connectStart
* decodedBodySize
* domComplete
* domContentLoadedEventEnd
* domContentLoadedEventStart
* domInteractive
* domainLookupEnd
* domainLookupStart
* encodedBodySize
* fetchStart
* loadEventEnd
* loadEventStart
* navigationStart
* redirectEnd
* redirectStart
* requestStart
* responseEnd
* responseStart
* secureConnectionStart
* unloadEventEnd
* unloadEventStart
*/
ignoreNetworkEvents?: boolean;
/** Ignore adding performance paint span events on document load spans
* This instrumentation will send the following span events by default:
* firstContentfulPaint
* firstPaint
*/
ignorePerformancePaintEvents?: boolean;
}
//# sourceMappingURL=types.d.ts.map

@@ -1,2 +0,3 @@

export declare const VERSION = "0.38.0";
export declare const PACKAGE_VERSION = "0.39.0";
export declare const PACKAGE_NAME = "@opentelemetry/instrumentation-document-load";
//# sourceMappingURL=version.d.ts.map

@@ -17,3 +17,4 @@ /*

// this is autogenerated file, see scripts/version-update.js
export const VERSION = '0.38.0';
export const PACKAGE_VERSION = '0.39.0';
export const PACKAGE_NAME = '@opentelemetry/instrumentation-document-load';
//# sourceMappingURL=version.js.map

@@ -36,3 +36,3 @@ "use strict";

constructor(config = {}) {
super('@opentelemetry/instrumentation-document-load', version_1.VERSION, config);
super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config);
this.component = 'document-load';

@@ -85,3 +85,5 @@ this.version = '1';

var _a;
(0, sdk_trace_web_1.addSpanNetworkEvents)(fetchSpan, entries);
if (!this._getConfig().ignoreNetworkEvents) {
(0, sdk_trace_web_1.addSpanNetworkEvents)(fetchSpan, entries);
}
this._addCustomAttributesOnSpan(fetchSpan, (_a = this._getConfig().applyCustomAttributesOnSpan) === null || _a === void 0 ? void 0 : _a.documentFetch);

@@ -95,12 +97,16 @@ this._endSpan(fetchSpan, sdk_trace_web_1.PerformanceTimingNames.RESPONSE_END, entries);

this._addResourcesSpans(rootSpan);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.FETCH_START, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.UNLOAD_EVENT_START, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.UNLOAD_EVENT_END, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.DOM_INTERACTIVE, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.DOM_CONTENT_LOADED_EVENT_START, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.DOM_CONTENT_LOADED_EVENT_END, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.DOM_COMPLETE, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.LOAD_EVENT_START, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.LOAD_EVENT_END, entries);
(0, utils_1.addSpanPerformancePaintEvents)(rootSpan);
if (!this._getConfig().ignoreNetworkEvents) {
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.FETCH_START, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.UNLOAD_EVENT_START, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.UNLOAD_EVENT_END, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.DOM_INTERACTIVE, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.DOM_CONTENT_LOADED_EVENT_START, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.DOM_CONTENT_LOADED_EVENT_END, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.DOM_COMPLETE, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.LOAD_EVENT_START, entries);
(0, sdk_trace_web_1.addSpanNetworkEvent)(rootSpan, sdk_trace_web_1.PerformanceTimingNames.LOAD_EVENT_END, entries);
}
if (!this._getConfig().ignorePerformancePaintEvents) {
(0, utils_1.addSpanPerformancePaintEvents)(rootSpan);
}
this._addCustomAttributesOnSpan(rootSpan, (_a = this._getConfig().applyCustomAttributesOnSpan) === null || _a === void 0 ? void 0 : _a.documentLoad);

@@ -138,3 +144,5 @@ this._endSpan(rootSpan, sdk_trace_web_1.PerformanceTimingNames.LOAD_EVENT_END, entries);

span.setAttribute(semantic_conventions_1.SEMATTRS_HTTP_URL, resource.name);
(0, sdk_trace_web_1.addSpanNetworkEvents)(span, resource);
if (!this._getConfig().ignoreNetworkEvents) {
(0, sdk_trace_web_1.addSpanNetworkEvents)(span, resource);
}
this._addCustomAttributesOnResourceSpan(span, resource, (_a = this._getConfig().applyCustomAttributesOnSpan) === null || _a === void 0 ? void 0 : _a.resourceFetch);

@@ -141,0 +149,0 @@ this._endSpan(span, sdk_trace_web_1.PerformanceTimingNames.RESPONSE_END, resource);

@@ -19,3 +19,35 @@ import { Span } from '@opentelemetry/api';

};
/** Ignore adding network events as span events for document fetch and resource fetch spans.
* This instrumentation will send the following span events by default:
* connectEnd
* connectStart
* decodedBodySize
* domComplete
* domContentLoadedEventEnd
* domContentLoadedEventStart
* domInteractive
* domainLookupEnd
* domainLookupStart
* encodedBodySize
* fetchStart
* loadEventEnd
* loadEventStart
* navigationStart
* redirectEnd
* redirectStart
* requestStart
* responseEnd
* responseStart
* secureConnectionStart
* unloadEventEnd
* unloadEventStart
*/
ignoreNetworkEvents?: boolean;
/** Ignore adding performance paint span events on document load spans
* This instrumentation will send the following span events by default:
* firstContentfulPaint
* firstPaint
*/
ignorePerformancePaintEvents?: boolean;
}
//# sourceMappingURL=types.d.ts.map

@@ -1,2 +0,3 @@

export declare const VERSION = "0.38.0";
export declare const PACKAGE_VERSION = "0.39.0";
export declare const PACKAGE_NAME = "@opentelemetry/instrumentation-document-load";
//# sourceMappingURL=version.d.ts.map

@@ -18,5 +18,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0;
// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.38.0';
exports.PACKAGE_VERSION = '0.39.0';
exports.PACKAGE_NAME = '@opentelemetry/instrumentation-document-load';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/instrumentation-document-load",
"version": "0.38.0",
"description": "OpenTelemetry document-load automatic instrumentation package.",
"version": "0.39.0",
"description": "OpenTelemetry instrumentation for document load operations in browser applications",
"main": "build/src/index.js",

@@ -17,3 +17,3 @@ "module": "build/esm/index.js",

"version:update": "node ../../../scripts/version-update.js",
"compile": "npm run version:update && tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
"compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
"prepublishOnly": "npm run compile",

@@ -73,3 +73,3 @@ "tdd": "wtr --watch",

"@opentelemetry/core": "^1.8.0",
"@opentelemetry/instrumentation": "^0.51.0",
"@opentelemetry/instrumentation": "^0.52.0",
"@opentelemetry/sdk-trace-base": "^1.0.0",

@@ -80,3 +80,3 @@ "@opentelemetry/sdk-trace-web": "^1.15.0",

"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/web/opentelemetry-instrumentation-document-load#readme",
"gitHead": "96a87b48934f0afcf1fe637eed6704f35bd8e973"
"gitHead": "0af1b70f7c3c9763c85ac51fa5e334c1e1512020"
}

@@ -114,2 +114,14 @@ # OpenTelemetry Instrumentation Document Load

## Document Load Instrumentation Options
The document load instrumentation plugin has few options available to choose from. You can set the following:
| Options | Type | Description |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|-----------------------------------------------------------------------------------------|
| `applyCustomAttributesOnSpan.documentLoad`| `DocumentLoadCustomAttributeFunction` | Function for adding custom attributes to `documentLoad` spans. |
| `applyCustomAttributesOnSpan.documentFetch` | `DocumentLoadCustomAttributeFunction` | Function for adding custom attributes to `documentFetch` spans. |
| `applyCustomAttributesOnSpan.resourceFetch` | `ResourceFetchCustomAttributeFunction` | Function for adding custom attributes to `resourceFetch` spans |
| `ignoreNetworkEvents` | `boolean` | Ignore adding [network events as span events](https://github.com/open-telemetry/opentelemetry-js/blob/e49c4c7f42c6c444da3f802687cfa4f2d6983f46/packages/opentelemetry-sdk-trace-web/src/enums/PerformanceTimingNames.ts#L17) for document fetch and resource fetch spans. |
| `ignorePerformancePaintEvents` | `boolean` | Ignore adding performance resource paint span events to document load spans. |
## Semantic Conventions

@@ -116,0 +128,0 @@

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc