UNPKG

@grafana/faro-web-tracing

Version:
39 lines 1.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FaroSessionSpanProcessor = void 0; // False positive. Package can be resolved. // eslint-disable-next-line import/no-unresolved var incubating_1 = require("@opentelemetry/semantic-conventions/incubating"); /** * @deprecated * please use FaroMetaAttributesSpanProcessor instead */ var FaroSessionSpanProcessor = /** @class */ (function () { function FaroSessionSpanProcessor(processor, metas) { this.processor = processor; this.metas = metas; } FaroSessionSpanProcessor.prototype.forceFlush = function () { return this.processor.forceFlush(); }; FaroSessionSpanProcessor.prototype.onStart = function (span, parentContext) { var session = this.metas.value.session; if (session === null || session === void 0 ? void 0 : session.id) { span.attributes[incubating_1.ATTR_SESSION_ID] = session.id; /** * @deprecated will be removed in the future and has been replaced by ATTR_SESSION_ID (session.id) */ span.attributes['session_id'] = session.id; } this.processor.onStart(span, parentContext); }; FaroSessionSpanProcessor.prototype.onEnd = function (span) { this.processor.onEnd(span); }; FaroSessionSpanProcessor.prototype.shutdown = function () { return this.processor.shutdown(); }; return FaroSessionSpanProcessor; }()); exports.FaroSessionSpanProcessor = FaroSessionSpanProcessor; //# sourceMappingURL=sessionSpanProcessor.js.map