@embrace-io/web-sdk
Version:
20 lines (19 loc) • 1.41 kB
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_constants_attributes = require("../constants/attributes.cjs");
const require_instrumentations_soft_navigation_performance_SoftNavigationPerformanceInstrumentation_constants = require("../instrumentations/soft-navigation-performance/SoftNavigationPerformanceInstrumentation/constants.cjs");
let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
//#region src/utils/spanPredicates.ts
const isNetworkSpan = (span) => {
if (span.attributes[_opentelemetry_semantic_conventions.ATTR_HTTP_REQUEST_METHOD] && typeof span.attributes[_opentelemetry_semantic_conventions.ATTR_HTTP_RESPONSE_STATUS_CODE] === "number") {
const url = span.attributes[_opentelemetry_semantic_conventions.ATTR_URL_FULL];
return typeof url === "string" && url.includes("://");
}
return false;
};
const isSessionPartSpan = (span) => span.attributes[require_constants_attributes.KEY_EMB_TYPE] === "ux.session_part";
const isSoftNavigationSpan = (span) => span.attributes[require_instrumentations_soft_navigation_performance_SoftNavigationPerformanceInstrumentation_constants.KEY_EMB_SOFT_NAVIGATION_SOURCE] !== void 0;
//#endregion
exports.isNetworkSpan = isNetworkSpan;
exports.isSessionPartSpan = isSessionPartSpan;
exports.isSoftNavigationSpan = isSoftNavigationSpan;
//# sourceMappingURL=spanPredicates.cjs.map