UNPKG

@embrace-io/web-sdk

Version:
33 lines (32 loc) 1.24 kB
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const require_constants_attributes = require("../../constants/attributes.cjs"); //#region src/processors/PageSpanProcessor/PageSpanProcessor.ts var PageSpanProcessor = class { _pageManager; constructor({ pageManager }) { this._pageManager = pageManager; } forceFlush() { return Promise.resolve(void 0); } onEnding(span) { if (!span.attributes["app.surface.name"] || !span.attributes["app.surface.id"]) { const currentRoute = this._pageManager.getCurrentRoute(); const currentPageId = this._pageManager.getCurrentPageId(); if (currentRoute && currentPageId) { span.attributes[require_constants_attributes.KEY_EMB_PAGE_PATH] = currentRoute.path; span.attributes[require_constants_attributes.KEY_EMB_PAGE_ID] = currentPageId; } } const appSurfaceLabel = this._pageManager.getPageLabel(); if (appSurfaceLabel && !span.attributes["app.surface.label"]) span.attributes[require_constants_attributes.KEY_APP_SURFACE_LABEL] = appSurfaceLabel; } onStart() {} onEnd() {} shutdown() { return Promise.resolve(void 0); } }; //#endregion exports.PageSpanProcessor = PageSpanProcessor; //# sourceMappingURL=PageSpanProcessor.cjs.map