@embrace-io/web-sdk
Version:
70 lines (69 loc) • 7.95 kB
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_instrumentations_EmbraceInstrumentationBase_EmbraceInstrumentationBase = require("../instrumentations/EmbraceInstrumentationBase/EmbraceInstrumentationBase.cjs");
const require_instrumentations_document_load_DocumentLoadInstrumentation_DocumentLoadInstrumentation = require("../instrumentations/document-load/DocumentLoadInstrumentation/DocumentLoadInstrumentation.cjs");
const require_instrumentations_empty_root_EmptyRootInstrumentation_EmptyRootInstrumentation = require("../instrumentations/empty-root/EmptyRootInstrumentation/EmptyRootInstrumentation.cjs");
const require_instrumentations_clicks_ClicksInstrumentation_ClicksInstrumentation = require("../instrumentations/clicks/ClicksInstrumentation/ClicksInstrumentation.cjs");
const require_instrumentations_element_timing_ElementTimingInstrumentation_ElementTimingInstrumentation = require("../instrumentations/element-timing/ElementTimingInstrumentation/ElementTimingInstrumentation.cjs");
const require_instrumentations_exceptions_GlobalExceptionInstrumentation_GlobalExceptionInstrumentation = require("../instrumentations/exceptions/GlobalExceptionInstrumentation/GlobalExceptionInstrumentation.cjs");
const require_instrumentations_first_interaction_FirstInteractionInstrumentation_FirstInteractionInstrumentation = require("../instrumentations/first-interaction/FirstInteractionInstrumentation/FirstInteractionInstrumentation.cjs");
const require_instrumentations_loaf_LoafInstrumentation_LoafInstrumentation = require("../instrumentations/loaf/LoafInstrumentation/LoafInstrumentation.cjs");
const require_instrumentations_max_scroll_depth_MaxScrollDepthInstrumentation_MaxScrollDepthInstrumentation = require("../instrumentations/max-scroll-depth/MaxScrollDepthInstrumentation/MaxScrollDepthInstrumentation.cjs");
const require_instrumentations_navigation_NavigationInstrumentation_NavigationInstrumentation = require("../instrumentations/navigation/NavigationInstrumentation/NavigationInstrumentation.cjs");
const require_instrumentations_rage_click_RageClickInstrumentation_RageClickInstrumentation = require("../instrumentations/rage-click/RageClickInstrumentation/RageClickInstrumentation.cjs");
const require_instrumentations_server_timing_ServerTimingInstrumentation_ServerTimingInstrumentation = require("../instrumentations/server-timing/ServerTimingInstrumentation/ServerTimingInstrumentation.cjs");
const require_instrumentations_soft_navigation_performance_SoftNavigationPerformanceInstrumentation_SoftNavigationPerformanceInstrumentation = require("../instrumentations/soft-navigation-performance/SoftNavigationPerformanceInstrumentation/SoftNavigationPerformanceInstrumentation.cjs");
const require_instrumentations_user_timing_UserTimingInstrumentation_UserTimingInstrumentation = require("../instrumentations/user-timing/UserTimingInstrumentation/UserTimingInstrumentation.cjs");
const require_instrumentations_web_vitals_WebVitalsInstrumentation_WebVitalsInstrumentation = require("../instrumentations/web-vitals/WebVitalsInstrumentation/WebVitalsInstrumentation.cjs");
let _opentelemetry_instrumentation_fetch = require("@opentelemetry/instrumentation-fetch");
let _opentelemetry_instrumentation_xml_http_request = require("@opentelemetry/instrumentation-xml-http-request");
//#region src/sdk/setupDefaultInstrumentations.ts
const setupDefaultInstrumentations = (config = {}, { logManager, userSessionManager, pageManager, limitManager, signalBuffer }) => {
const instrumentations = [];
if (!config.omit?.has("exception")) instrumentations.push(new require_instrumentations_exceptions_GlobalExceptionInstrumentation_GlobalExceptionInstrumentation.GlobalExceptionInstrumentation(config["exception"]));
if (!config.omit?.has("click")) instrumentations.push(new require_instrumentations_clicks_ClicksInstrumentation_ClicksInstrumentation.ClicksInstrumentation(config["click"]));
if (!config.omit?.has("rage-click")) instrumentations.push(new require_instrumentations_rage_click_RageClickInstrumentation_RageClickInstrumentation.RageClickInstrumentation(config["rage-click"]));
if (!config.omit?.has("max-scroll-depth")) instrumentations.push(new require_instrumentations_max_scroll_depth_MaxScrollDepthInstrumentation_MaxScrollDepthInstrumentation.MaxScrollDepthInstrumentation(config["max-scroll-depth"]));
if (!config.omit?.has("first-interaction")) instrumentations.push(new require_instrumentations_first_interaction_FirstInteractionInstrumentation_FirstInteractionInstrumentation.FirstInteractionInstrumentation(config["first-interaction"]));
if (!config.omit?.has("web-vital")) instrumentations.push(new require_instrumentations_web_vitals_WebVitalsInstrumentation_WebVitalsInstrumentation.WebVitalsInstrumentation({
...config["web-vital"],
pageManager
}));
if (!config.omit?.has("loaf")) instrumentations.push(new require_instrumentations_loaf_LoafInstrumentation_LoafInstrumentation.LoafInstrumentation({ ...config["loaf"] }));
if (!config.omit?.has("user-timing")) instrumentations.push(new require_instrumentations_user_timing_UserTimingInstrumentation_UserTimingInstrumentation.UserTimingInstrumentation(config["user-timing"]));
if (!config.omit?.has("element-timing")) instrumentations.push(new require_instrumentations_element_timing_ElementTimingInstrumentation_ElementTimingInstrumentation.ElementTimingInstrumentation({
limitManager,
...config["element-timing"]
}));
if (!config.omit?.has("soft-navigation-performance")) instrumentations.push(new require_instrumentations_soft_navigation_performance_SoftNavigationPerformanceInstrumentation_SoftNavigationPerformanceInstrumentation.SoftNavigationPerformanceInstrumentation({
limitManager,
signalBuffer,
...config["soft-navigation-performance"]
}));
if (!config.omit?.has("document-load")) instrumentations.push(new require_instrumentations_document_load_DocumentLoadInstrumentation_DocumentLoadInstrumentation.DocumentLoadInstrumentation(config["document-load"]));
instrumentations.push(new require_instrumentations_navigation_NavigationInstrumentation_NavigationInstrumentation.NavigationInstrumentation({
pageManager,
...config["navigation"]
}));
if (!config.omit?.has("server-timing")) instrumentations.push(new require_instrumentations_server_timing_ServerTimingInstrumentation_ServerTimingInstrumentation.ServerTimingInstrumentation({
limitManager,
...config["server-timing"]
}));
if (!config.omit?.has("@opentelemetry/instrumentation-fetch")) instrumentations.push(new _opentelemetry_instrumentation_fetch.FetchInstrumentation({
...config["@opentelemetry/instrumentation-fetch"],
ignoreUrls: [...config["network"]?.ignoreUrls ?? [], ...config["@opentelemetry/instrumentation-fetch"]?.ignoreUrls ?? []]
}));
if (!config.omit?.has("@opentelemetry/instrumentation-xml-http-request")) instrumentations.push(new _opentelemetry_instrumentation_xml_http_request.XMLHttpRequestInstrumentation({
...config["@opentelemetry/instrumentation-xml-http-request"],
ignoreUrls: [...config["network"]?.ignoreUrls ?? [], ...config["@opentelemetry/instrumentation-xml-http-request"]?.ignoreUrls ?? []]
}));
if (config["empty-root"]) instrumentations.push(new require_instrumentations_empty_root_EmptyRootInstrumentation_EmptyRootInstrumentation.EmptyRootInstrumentation({ ...config["empty-root"] }));
for (const instrumentation of instrumentations) if (instrumentation instanceof require_instrumentations_EmbraceInstrumentationBase_EmbraceInstrumentationBase.EmbraceInstrumentationBase) {
if (userSessionManager) instrumentation.setUserSessionManager(userSessionManager);
if (logManager) instrumentation.setLogManager(logManager);
if (limitManager) instrumentation.setLimitManager(limitManager);
}
return instrumentations;
};
//#endregion
exports.setupDefaultInstrumentations = setupDefaultInstrumentations;
//# sourceMappingURL=setupDefaultInstrumentations.cjs.map