@utk09/ui-observability 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +56 -36
- package/dist/batch-DEK4bv9N.js +31 -0
- package/dist/batch-DEK4bv9N.js.map +1 -0
- package/dist/batch-DEVFs28i.cjs +2 -0
- package/dist/batch-DEVFs28i.cjs.map +1 -0
- package/dist/{bus-CtJWf9QN.cjs → bus-DNFvTkif.cjs} +2 -2
- package/dist/{bus-CtJWf9QN.cjs.map → bus-DNFvTkif.cjs.map} +1 -1
- package/dist/{bus-D8kH58tb.js → bus-HVQ8E72V.js} +8 -8
- package/dist/{bus-D8kH58tb.js.map → bus-HVQ8E72V.js.map} +1 -1
- package/dist/{console-DjLbryED.js → console-C9Y639mn.js} +3 -3
- package/dist/{console-DjLbryED.js.map → console-C9Y639mn.js.map} +1 -1
- package/dist/{console-BpHfWstv.cjs → console-DssDxq1B.cjs} +2 -2
- package/dist/{console-BpHfWstv.cjs.map → console-DssDxq1B.cjs.map} +1 -1
- package/dist/constants-N99w84xy.js +117 -0
- package/dist/constants-N99w84xy.js.map +1 -0
- package/dist/constants-X86IDwkC.cjs +2 -0
- package/dist/constants-X86IDwkC.cjs.map +1 -0
- package/dist/constants.d.ts +18 -11
- package/dist/core/drops.d.ts +29 -0
- package/dist/core/hold-buffer.d.ts +27 -0
- package/dist/core/pipeline.d.ts +2 -7
- package/dist/core/runtime.d.ts +44 -8
- package/dist/core/sender.d.ts +4 -1
- package/dist/deadline-5_PecIl5.js +26 -0
- package/dist/deadline-5_PecIl5.js.map +1 -0
- package/dist/deadline-XSnm95pg.cjs +2 -0
- package/dist/deadline-XSnm95pg.cjs.map +1 -0
- package/dist/{errors-CpGRhhIf.cjs → errors-BTWuVnHZ.cjs} +2 -2
- package/dist/{errors-CpGRhhIf.cjs.map → errors-BTWuVnHZ.cjs.map} +1 -1
- package/dist/{errors-DH4QJS0u.js → errors-CQusIGWJ.js} +4 -4
- package/dist/{errors-DH4QJS0u.js.map → errors-CQusIGWJ.js.map} +1 -1
- package/dist/{deadline-Cbg2cbUw.cjs → identity-B1GDS1Tb.cjs} +2 -2
- package/dist/identity-B1GDS1Tb.cjs.map +1 -0
- package/dist/{deadline-B5DINjD5.js → identity-D4DPjTM9.js} +3 -26
- package/dist/identity-D4DPjTM9.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +467 -318
- package/dist/index.js.map +1 -1
- package/dist/{indexeddb-storage-n1qkFBGA.js → indexeddb-storage-B8SGUzSV.js} +79 -50
- package/dist/indexeddb-storage-B8SGUzSV.js.map +1 -0
- package/dist/indexeddb-storage-ukzC82dm.cjs +2 -0
- package/dist/indexeddb-storage-ukzC82dm.cjs.map +1 -0
- package/dist/{interactions-31eHGwEQ.cjs → interactions-CcxrVzpg.cjs} +2 -2
- package/dist/{interactions-31eHGwEQ.cjs.map → interactions-CcxrVzpg.cjs.map} +1 -1
- package/dist/{interactions-OU94MPXs.js → interactions-CnjfQgw3.js} +2 -2
- package/dist/{interactions-OU94MPXs.js.map → interactions-CnjfQgw3.js.map} +1 -1
- package/dist/{journey-CeJ1QoT2.js → journey-DjvDzHyp.js} +17 -16
- package/dist/{journey-CeJ1QoT2.js.map → journey-DjvDzHyp.js.map} +1 -1
- package/dist/journey-DxlfdFJV.cjs +2 -0
- package/dist/journey-DxlfdFJV.cjs.map +1 -0
- package/dist/{library-request-C9uJFlbq.cjs → library-request-BZ1ekVtl.cjs} +2 -2
- package/dist/{library-request-C9uJFlbq.cjs.map → library-request-BZ1ekVtl.cjs.map} +1 -1
- package/dist/{library-request-DvhuplAB.js → library-request-C8kc5YWv.js} +2 -2
- package/dist/{library-request-DvhuplAB.js.map → library-request-C8kc5YWv.js.map} +1 -1
- package/dist/{long-frames-B8VdA_ny.cjs → long-frames-BGik_Yhy.cjs} +2 -2
- package/dist/{long-frames-B8VdA_ny.cjs.map → long-frames-BGik_Yhy.cjs.map} +1 -1
- package/dist/{long-frames-C_7OutLs.js → long-frames-CZk3XOkH.js} +3 -3
- package/dist/{long-frames-C_7OutLs.js.map → long-frames-CZk3XOkH.js.map} +1 -1
- package/dist/models/batch.d.ts +14 -0
- package/dist/models/config.d.ts +146 -0
- package/dist/models/drop.d.ts +39 -0
- package/dist/models/storage.d.ts +15 -3
- package/dist/{network-D_lloS5t.js → network-51iicpLl.js} +19 -19
- package/dist/{network-D_lloS5t.js.map → network-51iicpLl.js.map} +1 -1
- package/dist/{network-BAV7ipyn.cjs → network-jBbjyAJP.cjs} +2 -2
- package/dist/{network-BAV7ipyn.cjs.map → network-jBbjyAJP.cjs.map} +1 -1
- package/dist/{platform-IHBZGqUe.js → platform-Cjts-8k8.js} +2 -2
- package/dist/{platform-IHBZGqUe.js.map → platform-Cjts-8k8.js.map} +1 -1
- package/dist/{platform-D4wu1eIF.cjs → platform-DW3GFIUE.cjs} +2 -2
- package/dist/{platform-D4wu1eIF.cjs.map → platform-DW3GFIUE.cjs.map} +1 -1
- package/dist/{remote-rules-kuDf5gbe.cjs → remote-rules-ByS34k4e.cjs} +2 -2
- package/dist/{remote-rules-kuDf5gbe.cjs.map → remote-rules-ByS34k4e.cjs.map} +1 -1
- package/dist/{remote-rules-Bt1XsdEQ.js → remote-rules-M-XZ1xbe.js} +2 -2
- package/dist/{remote-rules-Bt1XsdEQ.js.map → remote-rules-M-XZ1xbe.js.map} +1 -1
- package/dist/{sampling-o0VY1mqQ.js → sampling-BN3Oi6SV.js} +9 -9
- package/dist/{sampling-o0VY1mqQ.js.map → sampling-BN3Oi6SV.js.map} +1 -1
- package/dist/{sampling-BI15ds9D.cjs → sampling-b2ck5X98.cjs} +2 -2
- package/dist/{sampling-BI15ds9D.cjs.map → sampling-b2ck5X98.cjs.map} +1 -1
- package/dist/{sanitize-DSIP7amZ.cjs → sanitize-DKp5MRsa.cjs} +2 -2
- package/dist/{sanitize-DSIP7amZ.cjs.map → sanitize-DKp5MRsa.cjs.map} +1 -1
- package/dist/{sanitize-B9UheVKc.js → sanitize-Dwj9JCkI.js} +2 -2
- package/dist/{sanitize-B9UheVKc.js.map → sanitize-Dwj9JCkI.js.map} +1 -1
- package/dist/{sender-BnNj9bOX.js → sender-BBY0IcUo.js} +328 -269
- package/dist/sender-BBY0IcUo.js.map +1 -0
- package/dist/sender-BXoAZKum.cjs +3 -0
- package/dist/sender-BXoAZKum.cjs.map +1 -0
- package/dist/storage/emergency-queue.d.ts +4 -1
- package/dist/storage/eviction.d.ts +40 -0
- package/dist/storage/idb-driver.d.ts +6 -0
- package/dist/storage/indexeddb-storage.d.ts +13 -5
- package/dist/storage/local-storage.d.ts +24 -1
- package/dist/storage/memory-storage.d.ts +7 -0
- package/dist/{storm-Y-yuBhvv.cjs → storm-CKuaBp7i.cjs} +2 -2
- package/dist/{storm-Y-yuBhvv.cjs.map → storm-CKuaBp7i.cjs.map} +1 -1
- package/dist/{storm-BTw0J6eE.js → storm-DhtL2eVr.js} +2 -2
- package/dist/{storm-BTw0J6eE.js.map → storm-DhtL2eVr.js.map} +1 -1
- package/dist/transport/exit-flush.d.ts +6 -0
- package/dist/transport/retry-engine.d.ts +7 -3
- package/dist/transport/status-transport.d.ts +4 -1
- package/dist/utils/console.d.ts +4 -1
- package/package.json +1 -1
- package/dist/constants-Br3b89Wg.cjs +0 -2
- package/dist/constants-Br3b89Wg.cjs.map +0 -1
- package/dist/constants-DM94FjVX.js +0 -96
- package/dist/constants-DM94FjVX.js.map +0 -1
- package/dist/deadline-B5DINjD5.js.map +0 -1
- package/dist/deadline-Cbg2cbUw.cjs.map +0 -1
- package/dist/indexeddb-storage-DNdf1fmL.cjs +0 -2
- package/dist/indexeddb-storage-DNdf1fmL.cjs.map +0 -1
- package/dist/indexeddb-storage-n1qkFBGA.js.map +0 -1
- package/dist/journey-CE2EcwHW.cjs +0 -2
- package/dist/journey-CE2EcwHW.cjs.map +0 -1
- package/dist/sender-BnNj9bOX.js.map +0 -1
- package/dist/sender-D0OsyB1c.cjs +0 -3
- package/dist/sender-D0OsyB1c.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-N99w84xy.js","names":["LIBRARY_LOG_PREFIX","DIAGNOSTIC_THROTTLE_MS","SESSION_ID_KEY","TAB_ID_KEY","SESSION_IDLE_MS","SESSION_TOUCH_MS","OPENFIN_UA_PATTERN","ANDROID_WEBVIEW_UA_PATTERN","IOS_DEVICE_UA_PATTERN","MACINTOSH_UA_PATTERN","MOBILE_UA_PATTERN","WEBKIT_UA_TOKEN","SAFARI_UA_TOKEN","HIGH_SURROGATE_MIN","HIGH_SURROGATE_MAX","UTF8_TWO_BYTE_CEILING","SEVERITY_NUMBER","LEVEL_ORDER","ATTR_LOG_TYPE","ATTR_LOG_SEQ","ATTR_APP_NAMESPACE","ATTR_PAGE_URL","ATTR_URL_FULL","ATTR_JOURNEY_ID","ATTR_JOURNEY_NAME","ATTR_JOURNEY_PARENT_ID","ATTR_SANITIZE_FAILED","ATTR_ERROR_DATA","ATTR_BREADCRUMBS","ATTR_ATTRIBUTES_DROPPED","ATTR_ATTRIBUTES_BYTES","RESOURCE_SERVICE_NAME","RESOURCE_SERVICE_VERSION","RESOURCE_DEPLOYMENT_ENVIRONMENT","RESOURCE_TELEMETRY_SDK_NAME","RESOURCE_TELEMETRY_SDK_VERSION","RESOURCE_TELEMETRY_SDK_LANGUAGE","RESOURCE_HOST_PLATFORM","RESOURCE_SESSION_ID","RESOURCE_TAB_ID","RESOURCE_CONTEXT_ID","RESOURCE_BROWSER_USER_AGENT","RESOURCE_OPENFIN_UUID","RESOURCE_OPENFIN_NAME","TELEMETRY_SDK_NAME","TELEMETRY_SDK_VERSION","TELEMETRY_SDK_LANGUAGE","SERIALIZER_NAME_OTLP","ECS_LEVEL_NAMES","CONTENT_TYPE_JSON","CONTENT_TYPE_NDJSON","NANOS_PER_MILLI","NANOS_PATTERN","HEADER_CONTENT_TYPE","HEADER_CONTENT_ENCODING","HEADER_RETRY_AFTER","HEADER_BATCH_ID","HEADER_ATTEMPT","HEADER_SAMPLING","ENCODING_GZIP","MILLIS_PER_SECOND","BEACON_LIMIT_BYTES","CONTENT_TYPE_TEXT_PLAIN","QUERY_PARAM_BATCH_ID","QUERY_PARAM_EXIT_REASON","BATCH_STORAGE_KEY_PREFIX","EMERGENCY_STORAGE_KEY_PREFIX","STORAGE_PROBE_KEY","QUOTA_EXCEEDED_ERROR","INDEXEDDB_STORE_NAME","INDEXEDDB_CREATED_AT_INDEX","STORAGE_NAME_INDEXEDDB","STORAGE_NAME_LOCAL","STORAGE_NAME_MEMORY","STORAGE_NAME_NONE","DRAIN_LOCK_NAME","EMERGENCY_LOCK_NAME","JOURNEY_STORAGE_KEY","OPENFIN_OPTIONS_TIMEOUT_MS","OPENFIN_JOURNEY_CUSTOM_DATA_KEY","BASE64_PLUS_PATTERN","BASE64_SLASH_PATTERN","BASE64_PADDING_PATTERN","BASE64URL_DASH_PATTERN","BASE64URL_UNDERSCORE_PATTERN","TRACE_MAX_AGE_MS","TRACEPARENT_HEADER","FNV_OFFSET_BASIS","FNV_PRIME","UINT32_MAX","LEVEL_BYPASS_TYPES","LOG_TYPE_METRIC","LOG_TYPE_ACTION","BUS_PROTOCOL","RUNTIME_GLOBAL_KEY","RUNTIME_STOPPED_KEY","LIBRARY_REQUEST_KEY","LIBRARY_CONSOLE_KEY","ERROR_STORM_WINDOW_MS","CONSOLE_DEFAULT_STYLES","DURATION_PRECISION","GAP_REPORT_THROTTLE_MS","CAPTURE_NAMESPACE","STORAGE_NAMESPACE","DEFAULT_METRIC_UNIT","UNKNOWN_SERVICE_NAME","REMOTE_SAMPLING_MAX_CHARS","REMOTE_SAMPLING_MAX_TTL_MS","REMOTE_SAMPLING_POLL_MS","UNDEFAULTED_CONFIG_KEYS","CONFIG_SECTIONS","UNDEFAULTED_SECTION_KEYS","CONSOLE_DEFAULT_LEVEL","LOG_FLUSH_INTERVAL_MS","METRIC_FLUSH_INTERVAL_MS","REQUEST_TIMEOUT_MS","COMPRESSION_THRESHOLD_BYTES","STORAGE_DB_NAME","STORAGE_LIMITS","STORAGE_DEADLINE_MS","RETRY_BASE_DELAY_MS","RETRY_MAX_DELAY_MS","RETRY_IDLE_DELAY_MS","JOURNEY_MAX_AGE_MS","JOURNEY_URL_PARAM","BUS_CHANNEL_NAME","BUS_HANDSHAKE_TIMEOUT_MS","BUS_MAX_BOOT_BUFFER_ACTIONS","ERROR_DEDUPE_MS","RECORD_LIMITS","DEFAULT_CONFIG"],"sources":["../src/constants.ts"],"sourcesContent":["// src/constants.ts\n//\n// Defines all limits, thresholds, timing windows, storage keys, patterns, and\n// defaults that the library uses.\n\nimport type { ConsoleStyles, ResolvedConfig } from \"./models/config\";\nimport type { LogLevel, LogType } from \"./models/log-record\";\nimport type { StorageLimits } from \"./models/storage\";\n\n// ----------------------------------\n// Library-wide\n// ----------------------------------\n\n/** Prefix on console messages this library writes. */\nexport const LIBRARY_LOG_PREFIX = \"[ui-observability]\";\n\n// ----------------------------------\n// Diagnostics\n// ----------------------------------\n\n/**\n * Throttle window for each diagnostic code, in milliseconds. It limits how often an error\n * loop calls the handler.\n */\nexport const DIAGNOSTIC_THROTTLE_MS = 1000;\n\n// ----------------------------------\n// Identity\n// ----------------------------------\n\n/** `localStorage` key for the session id and its last-seen time. */\nexport const SESSION_ID_KEY = \"ui-observability.session\";\n\n/** `sessionStorage` key for the tab id. */\nexport const TAB_ID_KEY = \"ui-observability.tab\";\n\n/** Session idle timeout, in milliseconds. */\nexport const SESSION_IDLE_MS = 30 * 60 * 1000;\n\n/** Min gap between session last-seen writes, in milliseconds. */\nexport const SESSION_TOUCH_MS = 60_000;\n\n/** Random id length, in bytes, used when `crypto.randomUUID` is unavailable. */\nexport const ID_BYTE_LENGTH = 16;\n\n/** Distinct values in one byte (256). */\nexport const BYTE_VALUE_COUNT = 256;\n\n// ----------------------------------\n// Platform detection\n// ----------------------------------\n\n/** Matches OpenFin's user agent. */\nexport const OPENFIN_UA_PATTERN = /OpenFin/i;\n\n/** Matches Android's webview token (`wv`). */\nexport const ANDROID_WEBVIEW_UA_PATTERN = /\\bwv\\b/;\n\n/** Matches iOS hardware: iPhone, iPad, iPod. */\nexport const IOS_DEVICE_UA_PATTERN = /\\b(iPhone|iPad|iPod)\\b/;\n\n/** Matches desktop macOS in a user agent. */\nexport const MACINTOSH_UA_PATTERN = /\\bMacintosh\\b/;\n\n/** Matches the mobile token. */\nexport const MOBILE_UA_PATTERN = /\\bMobile\\b/;\n\n/** WebKit engine token, present in every WebKit browser including webviews. */\nexport const WEBKIT_UA_TOKEN = \"AppleWebKit\";\n\n/** Safari token sent by real iOS browsers, not in-app webviews. */\nexport const SAFARI_UA_TOKEN = \"Safari/\";\n\n// ----------------------------------\n// Sanitizing and size estimation\n// ----------------------------------\n\n/** First UTF-16 high surrogate code unit. */\nexport const HIGH_SURROGATE_MIN = 0xd800;\n\n/** Last UTF-16 high surrogate code unit. */\nexport const HIGH_SURROGATE_MAX = 0xdbff;\n\n/** Code units below this encode as one UTF-8 byte. */\nexport const UTF8_ONE_BYTE_CEILING = 0x80;\n\n/** Code units below this, and at or above the one-byte ceiling, encode as two UTF-8 bytes. */\nexport const UTF8_TWO_BYTE_CEILING = 0x800;\n\n/** Class names kept in a `describeNode` selector. */\nexport const MAX_NODE_CLASS_NAMES = 3;\n\n/** Byte cost of a null or undefined value. */\nexport const BYTES_PER_NULL = 4;\n\n/** Byte cost of a number (flat estimate). */\nexport const BYTES_PER_NUMBER = 8;\n\n/** Byte cost of a boolean. */\nexport const BYTES_PER_BOOLEAN = 5;\n\n/** Byte cost of an object or array's wrapping braces or brackets. */\nexport const BYTES_PER_CONTAINER = 2;\n\n/** Byte cost of a string's wrapping quotes. */\nexport const BYTES_PER_QUOTED_STRING = 2;\n\n/** Byte cost of one key's punctuation: quotes, colon, comma. */\nexport const BYTES_PER_KEY_OVERHEAD = 4;\n\n// ----------------------------------\n// Record model\n// ----------------------------------\n\n/**\n * Maps each log level to its OpenTelemetry severity number.\n * @see {@link LEVEL_ORDER}\n */\nexport const SEVERITY_NUMBER: Record<LogLevel, number> = {\n TRACE: 1,\n DEBUG: 5,\n INFO: 9,\n WARN: 13,\n ERROR: 17,\n FATAL: 21,\n};\n\n/**\n * Alias for `SEVERITY_NUMBER`, used by the level filter.\n * @see {@link SEVERITY_NUMBER}\n */\nexport const LEVEL_ORDER: Record<LogLevel, number> = SEVERITY_NUMBER;\n\n// ----------------------------------\n// Attribute and resource keys\n// ----------------------------------\n//\n// Attribute and resource key names that records carry in the payload. The names\n// follow OpenTelemetry conventions. The `uiobs.` prefix marks the fields of this library.\n\n/** Record kind attribute key. */\nexport const ATTR_LOG_TYPE = \"log.type\";\n\n/** Record sequence number in its context. It starts at 1. */\nexport const ATTR_LOG_SEQ = \"log.seq\";\n\n/** Logger namespace attribute key. */\nexport const ATTR_APP_NAMESPACE = \"app.namespace\";\n\n/** Document URL when the library built the record. */\nexport const ATTR_PAGE_URL = \"page.url\";\n\n/**\n * HTTP request URL attribute key. Network capture sets it. Do not reuse `ATTR_PAGE_URL`.\n * The page URL overwrites the request target under that key.\n * @see {@link ATTR_PAGE_URL}\n */\nexport const ATTR_URL_FULL = \"url.full\";\n\n/** Journey id attribute key. */\nexport const ATTR_JOURNEY_ID = \"journey.id\";\n\n/** Journey name attribute key. */\nexport const ATTR_JOURNEY_NAME = \"journey.name\";\n\n/** Parent journey id, present only on a child journey. */\nexport const ATTR_JOURNEY_PARENT_ID = \"journey.parent_id\";\n\n/** Marks a record whose attributes failed to sanitize. */\nexport const ATTR_SANITIZE_FAILED = \"uiobs.sanitize_failed\";\n\n/** Own fields of an Error reason, or the whole reason when it is not an Error. */\nexport const ATTR_ERROR_DATA = \"error.data\";\n\n/** Breadcrumb history of an error record. */\nexport const ATTR_BREADCRUMBS = \"breadcrumbs\";\n\n/**\n * Marks a record when the library drops its attributes because they exceed the byte budget.\n * @see {@link ATTR_ATTRIBUTES_BYTES}\n */\nexport const ATTR_ATTRIBUTES_DROPPED = \"uiobs.attributes_dropped\";\n\n/**\n * Byte size of the dropped attributes.\n * @see {@link ATTR_ATTRIBUTES_DROPPED}\n */\nexport const ATTR_ATTRIBUTES_BYTES = \"uiobs.attributes_bytes\";\n\n/** Application name resource key. */\nexport const RESOURCE_SERVICE_NAME = \"service.name\";\n\n/** Application build version resource key. */\nexport const RESOURCE_SERVICE_VERSION = \"service.version\";\n\n/** Deployment environment resource key. */\nexport const RESOURCE_DEPLOYMENT_ENVIRONMENT = \"deployment.environment\";\n\n/**\n * Producer library name resource key.\n * @see {@link TELEMETRY_SDK_NAME}\n */\nexport const RESOURCE_TELEMETRY_SDK_NAME = \"telemetry.sdk.name\";\n\n/**\n * Producer library version resource key.\n * @see {@link TELEMETRY_SDK_VERSION}\n */\nexport const RESOURCE_TELEMETRY_SDK_VERSION = \"telemetry.sdk.version\";\n\n/**\n * Producer SDK language resource key.\n * @see {@link TELEMETRY_SDK_LANGUAGE}\n */\nexport const RESOURCE_TELEMETRY_SDK_LANGUAGE = \"telemetry.sdk.language\";\n\n/** Host platform resource key: browser, webview, or OpenFin. */\nexport const RESOURCE_HOST_PLATFORM = \"host.platform\";\n\n/** Session id resource key. */\nexport const RESOURCE_SESSION_ID = \"session.id\";\n\n/** Tab id resource key. */\nexport const RESOURCE_TAB_ID = \"tab.id\";\n\n/** Context (realm) id resource key. */\nexport const RESOURCE_CONTEXT_ID = \"context.id\";\n\n/** Raw user agent resource key. */\nexport const RESOURCE_BROWSER_USER_AGENT = \"browser.user_agent\";\n\n/** OpenFin application uuid resource key. */\nexport const RESOURCE_OPENFIN_UUID = \"openfin.uuid\";\n\n/** OpenFin window or view name resource key. */\nexport const RESOURCE_OPENFIN_NAME = \"openfin.name\";\n\n/**\n * Value of `telemetry.sdk.name`.\n * @see {@link RESOURCE_TELEMETRY_SDK_NAME}\n */\nexport const TELEMETRY_SDK_NAME = \"@utk09/ui-observability\";\n\n/**\n * Value of `telemetry.sdk.version`. The code does not read it from package.json.\n * Change it by hand when you change the version in package.json.\n * @see {@link RESOURCE_TELEMETRY_SDK_VERSION}\n */\nexport const TELEMETRY_SDK_VERSION = \"0.9.1\";\n\n/**\n * Value of `telemetry.sdk.language`.\n * @see {@link RESOURCE_TELEMETRY_SDK_LANGUAGE}\n */\nexport const TELEMETRY_SDK_LANGUAGE = \"webjs\";\n\n// ----------------------------------\n// Serializers\n// ----------------------------------\n\n/** OTLP/JSON serializer name. */\nexport const SERIALIZER_NAME_OTLP = \"otlp\";\n\n/** ECS serializer name. */\nexport const SERIALIZER_NAME_ECS = \"ecs\";\n\n/**\n * ECS `log.level` names that differ from the lowercase severity text. ECS spells\n * the warning level in full. All other levels match in lowercase.\n * @see {@link SERIALIZER_NAME_ECS}\n */\nexport const ECS_LEVEL_NAMES: Partial<Record<LogLevel, string>> = { WARN: \"warning\" };\n\n/** Content type for an OTLP/JSON body. */\nexport const CONTENT_TYPE_JSON = \"application/json\";\n\n/** Content type for newline-delimited JSON. */\nexport const CONTENT_TYPE_NDJSON = \"application/x-ndjson\";\n\n/** Nanoseconds per millisecond. */\nexport const NANOS_PER_MILLI = 1000000n;\n\n/**\n * Matches a nanosecond epoch in decimal digits, for example \"1755543600123000000\".\n * @see {@link NANOS_PER_MILLI}\n */\nexport const NANOS_PATTERN = /^\\d+$/;\n\n// ----------------------------------\n// HTTP transport\n// ----------------------------------\n\n/** Content-Type header name. */\nexport const HEADER_CONTENT_TYPE = \"Content-Type\";\n\n/** Content-Encoding header name. */\nexport const HEADER_CONTENT_ENCODING = \"Content-Encoding\";\n\n/** Retry-After header name. */\nexport const HEADER_RETRY_AFTER = \"Retry-After\";\n\n/**\n * Batch deduplication key header name.\n * @see {@link QUERY_PARAM_BATCH_ID}\n */\nexport const HEADER_BATCH_ID = \"X-UiObs-Batch-Id\";\n\n/** Delivery attempt number header name. */\nexport const HEADER_ATTEMPT = \"X-UiObs-Attempt\";\n\n/** Response header that carries sampling rules from the ingest server. */\nexport const HEADER_SAMPLING = \"X-UiObs-Sampling\";\n\n/** Gzip encoding name. */\nexport const ENCODING_GZIP = \"gzip\";\n\n/** Lowest valid HTTP status code. */\nexport const HTTP_STATUS_MIN = 100;\n\n/** Highest valid HTTP status code. */\nexport const HTTP_STATUS_MAX = 599;\n\n/** Lowest HTTP status code that accepts a batch. */\nexport const HTTP_SUCCESS_MIN = 200;\n\n/** Lowest HTTP status code above the success range. */\nexport const HTTP_SUCCESS_END = 300;\n\n/** 401, credentials missing or rejected. */\nexport const HTTP_UNAUTHORIZED = 401;\n\n/** 403, valid credentials but access denied. */\nexport const HTTP_FORBIDDEN = 403;\n\n/** 408, the server closed the connection after a timeout. The transport can retry. */\nexport const HTTP_REQUEST_TIMEOUT = 408;\n\n/** 413, payload too large. The transport must split the batch. */\nexport const HTTP_PAYLOAD_TOO_LARGE = 413;\n\n/** 429, backpressure. */\nexport const HTTP_TOO_MANY_REQUESTS = 429;\n\n/** 500, floor for server-side errors. */\nexport const HTTP_SERVER_ERROR_MIN = 500;\n\n/** 503, temporary unavailability. */\nexport const HTTP_SERVICE_UNAVAILABLE = 503;\n\n/** Milliseconds per second. */\nexport const MILLIS_PER_SECOND = 1000;\n\n// ----------------------------------\n// Exit flush\n// ----------------------------------\n\n/** Max exit payload size, in bytes (`sendBeacon`/`fetch(keepalive)` shared budget). */\nexport const BEACON_LIMIT_BYTES = 60_000;\n\n/** Content type for an exit payload. It is CORS-safelisted and does not cause a preflight. */\nexport const CONTENT_TYPE_TEXT_PLAIN = \"text/plain;charset=UTF-8\";\n\n/**\n * Batch id query param name, for the exit path.\n * @see {@link HEADER_BATCH_ID}\n */\nexport const QUERY_PARAM_BATCH_ID = \"uiobs_batch_id\";\n\n/** Exit reason query param name, for logs only. */\nexport const QUERY_PARAM_EXIT_REASON = \"uiobs_exit\";\n\n// ----------------------------------\n// Storage\n// ----------------------------------\n\n/** localStorage key prefix for a stored batch. */\nexport const BATCH_STORAGE_KEY_PREFIX = \"ui-observability.batch.\";\n\n/** Zero-padded digit width for the creation time in a batch key. */\nexport const BATCH_KEY_TIME_WIDTH = 14;\n\n/** localStorage key prefix for a batch that exit flush stores. */\nexport const EMERGENCY_STORAGE_KEY_PREFIX = \"ui-observability.emergency.\";\n\n/** Maximum number of exit batches in the emergency queue. */\nexport const EMERGENCY_MAX_ENTRIES = 20;\n\n/** Key that the library writes to test if localStorage accepts writes. */\nexport const STORAGE_PROBE_KEY = \"ui-observability.probe\";\n\n/** Fraction of the store to evict on a quota error (1 in N). */\nexport const QUOTA_EVICTION_DIVISOR = 4;\n\n/** DOMException name for a full store. */\nexport const QUOTA_EXCEEDED_ERROR = \"QuotaExceededError\";\n\n/**\n * Native IndexedDB version. It starts at 11. Dexie, the previous adapter, opened the\n * same database at ten times its declared version. A version below 11 makes open()\n * fail with VersionError for an existing installation. Then no code can read the\n * batches in that database.\n */\nexport const INDEXEDDB_SCHEMA_VERSION = 11;\n\n/** IndexedDB object store that holds batches. Dexie set this name before the library removed it. */\nexport const INDEXEDDB_STORE_NAME = \"batches\";\n\n/** Index on the batch store that orders reads by creation time. */\nexport const INDEXEDDB_CREATED_AT_INDEX = \"createdAt\";\n\n/** IndexedDB adapter/strategy name. */\nexport const STORAGE_NAME_INDEXEDDB = \"indexeddb\";\n\n/** localStorage adapter/strategy name. */\nexport const STORAGE_NAME_LOCAL = \"localstorage\";\n\n/** In-memory adapter/strategy name. */\nexport const STORAGE_NAME_MEMORY = \"memory\";\n\n/** Name of the storage adapter that keeps nothing. */\nexport const STORAGE_NAME_NONE = \"none\";\n\n// ----------------------------------\n// Retry\n// ----------------------------------\n\n/**\n * Origin-wide lock name a drain runs under.\n * @see {@link EMERGENCY_LOCK_NAME}\n */\nexport const DRAIN_LOCK_NAME = \"ui-observability.drain\";\n\n/**\n * Lock name startup recovery runs under.\n * @see {@link DRAIN_LOCK_NAME}\n */\nexport const EMERGENCY_LOCK_NAME = \"ui-observability.emergency\";\n\n/** Batches sent per drain tick. */\nexport const BATCHES_PER_DRAIN = 20;\n\n// ----------------------------------\n// Journey\n// ----------------------------------\n\n/** `sessionStorage` key for the current journey. */\nexport const JOURNEY_STORAGE_KEY = \"ui-observability.journey\";\n\n/**\n * Max journey name length in a token, in characters.\n * @see {@link JOURNEY_TOKEN_MAX_CHARS}\n */\nexport const JOURNEY_TOKEN_NAME_MAX_CHARS = 64;\n\n/**\n * Max whole-token length, in characters. It rejects an oversized token. It does not\n * validate the token content.\n * @see {@link JOURNEY_TOKEN_NAME_MAX_CHARS}\n */\nexport const JOURNEY_TOKEN_MAX_CHARS = 256;\n\n/**\n * Time to wait for `fin.me.getOptions()`, in milliseconds. After this time, the\n * runtime continues without a seeded journey.\n * @see {@link OPENFIN_JOURNEY_CUSTOM_DATA_KEY}\n */\nexport const OPENFIN_OPTIONS_TIMEOUT_MS = 2000;\n\n/** Key under an OpenFin window's `customData` carrying a seeded journey token. */\nexport const OPENFIN_JOURNEY_CUSTOM_DATA_KEY = \"uiObsJourney\";\n\n/** Matches `+` in standard base64 (`-` in URL-safe). */\nexport const BASE64_PLUS_PATTERN = /\\+/g;\n\n/** Matches `/` in standard base64 (`_` in URL-safe). */\nexport const BASE64_SLASH_PATTERN = /\\//g;\n\n/** Matches trailing `=` padding. */\nexport const BASE64_PADDING_PATTERN = /=+$/;\n\n/** Matches `-` in URL-safe base64 (`+` in standard). */\nexport const BASE64URL_DASH_PATTERN = /-/g;\n\n/** Matches `_` in URL-safe base64 (`/` in standard). */\nexport const BASE64URL_UNDERSCORE_PATTERN = /_/g;\n\n/** Base64 characters per 3-byte group. */\nexport const BASE64_GROUP_CHARS = 4;\n\n// ----------------------------------\n// Tracing\n// ----------------------------------\n\n/** W3C trace id width, in bytes. */\nexport const TRACE_ID_BYTES = 16;\n\n/** W3C span id width, in bytes. */\nexport const SPAN_ID_BYTES = 8;\n\n/** Max ambient trace lifetime with no activity, in milliseconds. */\nexport const TRACE_MAX_AGE_MS = 5 * 60 * 1000;\n\n/** trace-flags value with the sampled bit set. */\nexport const TRACE_FLAGS_SAMPLED = 1;\n\n/** Mask for the one-byte trace-flags field. */\nexport const TRACE_FLAGS_MASK = 0xff;\n\n/**\n * W3C trace context header name\n * @see {@link TRACEPARENT_VERSION}\n */\nexport const TRACEPARENT_HEADER = \"traceparent\";\n\n/** traceparent header version prefix. */\nexport const TRACEPARENT_VERSION = \"00\";\n\n// ----------------------------------\n// Breadcrumbs\n// ----------------------------------\n\n/** Smallest valid breadcrumb buffer capacity. */\nexport const BREADCRUMB_MIN_CAPACITY = 1;\n\n// ----------------------------------\n// Sampling\n// ----------------------------------\n//\n// FNV-1a hash constants. The sampler uses them to change a sampling key into a\n// stable 0-1 fraction.\n\n/** FNV-1a 32-bit offset basis. */\nexport const FNV_OFFSET_BASIS = 0x811c9dc5;\n\n/** FNV-1a 32-bit prime. */\nexport const FNV_PRIME = 0x01000193;\n\n/** Largest 32-bit unsigned value. */\nexport const UINT32_MAX = 0xffffffff;\n\n/**\n * Types that minLevel does not drop. An action is an audit fact and a metric is a measurement.\n * The remote rate cap for records below minLevel does not apply to them.\n */\nexport const LEVEL_BYPASS_TYPES: readonly LogType[] = [\"action\", \"metric\"];\n\n// ----------------------------------\n// Pipeline\n// ----------------------------------\n\n/** Record kind routed to the metric stream. */\nexport const LOG_TYPE_METRIC: LogType = \"metric\";\n\n/** Record kind of an audit fact. Storage and the hold buffers drop it last. */\nexport const LOG_TYPE_ACTION: LogType = \"action\";\n\n// ----------------------------------\n// Bus\n// ----------------------------------\n\n/** Protocol identifier for bus envelopes. The bus drops an envelope with a different version. */\nexport const BUS_PROTOCOL = \"ui-observability/1\";\n\n/** Global window property key used to locate a same-origin runtime instance. */\nexport const RUNTIME_GLOBAL_KEY = \"ui-observability.runtime\";\n\n/** Global key of the runtime that shutdown() stopped. Calls go to it until the next configure(). */\nexport const RUNTIME_STOPPED_KEY = \"ui-observability.stopped\";\n\n/** Global symbol key of the library request scope count. All library copies on a page share it. */\nexport const LIBRARY_REQUEST_KEY = \"ui-observability.request-scope\";\n\n/** Global symbol key of the library console scope count. All library copies on a page share it. */\nexport const LIBRARY_CONSOLE_KEY = \"ui-observability.console-scope\";\n\n// ----------------------------------\n// Capture\n// ----------------------------------\n\n/** Maximum error records captured per throttling window before suppression. */\nexport const ERROR_STORM_MAX_PER_WINDOW = 20;\n\n/** Error rate-limiting window duration in milliseconds. */\nexport const ERROR_STORM_WINDOW_MS = 10_000;\n\n/**\n * Max ERROR and FATAL records that the pipeline admits in each storm window.\n * It is a safety limit for a render loop. It does not shape normal traffic.\n * ERROR and FATAL records skip sampling. A direct logger.error call has no other limit.\n */\nexport const ERROR_CEILING_MAX_PER_WINDOW = 500;\n\n/** Default minimum duration of a long frame that the library records, in milliseconds. */\nexport const LONG_FRAME_THRESHOLD_MS = 100;\n\n/** Maximum long frames recorded in each storm window. A frozen tab cannot flood the pipeline. */\nexport const LONG_FRAME_MAX_PER_WINDOW = 20;\n\n/** Maximum character length of a console breadcrumb message. */\nexport const CONSOLE_BREADCRUMB_MAX_CHARS = 200;\n\n/** Maximum distinct error signatures tracked for deduplication before LRU eviction. */\nexport const MAX_TRACKED_ERROR_SIGNATURES = 200;\n\n/** Maximum character length retained from clicked element text in breadcrumbs. */\nexport const CLICK_TEXT_MAX_CHARS = 50;\n\n/** Maximum character length retained from an aria-label attribute in generated selectors. */\nexport const ARIA_LABEL_MAX_CHARS = 40;\n\n/** Maximum class names included per element in generated CSS selectors. */\nexport const SELECTOR_MAX_CLASSES = 2;\n\n/** Default CSS of the console prefix. The colors are readable on light and dark devtools. */\nexport const CONSOLE_DEFAULT_STYLES: Readonly<Required<ConsoleStyles>> = {\n namespace: \"color:#888\",\n TRACE: \"color:#888;font-weight:bold\",\n DEBUG: \"color:#888;font-weight:bold\",\n INFO: \"color:#1e6fd9;font-weight:bold\",\n WARN: \"color:#c77700;font-weight:bold\",\n ERROR: \"color:#d32f2f;font-weight:bold\",\n FATAL: \"color:#d32f2f;font-weight:bold\",\n};\n\n/** Scaling factor for rounding duration measurements to three decimal places. */\nexport const DURATION_PRECISION = 1000;\n\n// ----------------------------------\n// Runtime\n// ----------------------------------\n\n/** Minimum duration in milliseconds between storage gap warning reports. */\nexport const GAP_REPORT_THROTTLE_MS = 60_000;\n\n/** Default namespace for telemetry records emitted by auto-capture modules. */\nexport const CAPTURE_NAMESPACE = \"uiobs.capture\";\n\n/** Default namespace for telemetry records emitted by storage subsystems. */\nexport const STORAGE_NAMESPACE = \"uiobs.storage\";\n\n/** Measurement unit that the library uses when the call gives no unit. */\nexport const DEFAULT_METRIC_UNIT = \"count\";\n\n// ----------------------------------\n// Configuration\n// ----------------------------------\n\n/** Default `service.name` when a consumer sets none. */\nexport const UNKNOWN_SERVICE_NAME = \"unknown-service\";\n\n/** Lowest sampling rate (drop everything). */\nexport const SAMPLING_RATE_MIN = 0;\n\n/** Highest sampling rate (keep everything). */\nexport const SAMPLING_RATE_MAX = 1;\n\n/**\n * Fallback for an invalid sampling rate (keep everything).\n * @see {@link SAMPLING_RATE_MAX}\n */\nexport const SAMPLING_RATE_FALLBACK = 1;\n\n/** Version of the remote sampling rules that the library accepts. */\nexport const REMOTE_SAMPLING_VERSION = 1;\n\n/** Maximum length of the sampling header, in characters. */\nexport const REMOTE_SAMPLING_MAX_CHARS = 4096;\n\n/** Maximum time that remote sampling rules stay in force, in milliseconds. */\nexport const REMOTE_SAMPLING_MAX_TTL_MS = 60 * 60 * 1000;\n\n/** Maximum namespace rates in one set of remote sampling rules. */\nexport const REMOTE_SAMPLING_MAX_RATES = 100;\n\n/** Time between two requests of a forwarder for the remote sampling rules, in milliseconds. */\nexport const REMOTE_SAMPLING_POLL_MS = 30_000;\n\n/**\n * Config keys with no default, excluded from `DEFAULT_CONFIG`.\n * @see {@link DEFAULT_CONFIG}\n */\nexport const UNDEFAULTED_CONFIG_KEYS = [\n \"redact\",\n \"onDiagnostic\",\n \"onDrop\",\n \"headers\",\n \"serializer\",\n \"otelLoader\",\n \"transport\",\n \"transportOnExit\",\n] as const;\n\n/**\n * Nested config section keys.\n * @see {@link ResolvedConfig}\n */\nexport const CONFIG_SECTIONS = [\n \"sampling\",\n \"bus\",\n \"journey\",\n \"batching\",\n \"retention\",\n \"limits\",\n \"capture\",\n] as const;\n\n/**\n * Section keys with no default, excluded from their section of `DEFAULT_CONFIG`.\n * @see {@link UNDEFAULTED_CONFIG_KEYS}\n */\nexport const UNDEFAULTED_SECTION_KEYS: Record<(typeof CONFIG_SECTIONS)[number], string[]> = {\n sampling: [],\n bus: [],\n journey: [],\n batching: [],\n retention: [],\n limits: [],\n capture: [\"webVitalsLoader\"],\n};\n\n/** Console mirroring level used when a consumer passes `console: true`. */\nexport const CONSOLE_DEFAULT_LEVEL: LogLevel = \"DEBUG\";\n\n// ----------------------------------\n// Batching\n// ----------------------------------\n\n/** Max time a partial log batch waits before the pipeline sends it, in milliseconds. */\nexport const LOG_FLUSH_INTERVAL_MS = 2000;\n\n/** Max records per log batch. At this count, the pipeline sends the batch early. */\nexport const LOG_BATCH_SIZE = 100;\n\n/**\n * Max time a partial metric batch waits before the pipeline sends it, in milliseconds.\n * Metric batches wait longer than log batches. Metrics have a higher volume, and no\n * caller waits for them.\n */\nexport const METRIC_FLUSH_INTERVAL_MS = 10_000;\n\n/** Max records per metric batch. At this count, the pipeline sends the batch early. */\nexport const METRIC_BATCH_SIZE = 500;\n\n/** Max concurrent ingest requests, across both streams. */\nexport const MAX_CONCURRENT_REQUESTS = 2;\n\n// ----------------------------------\n// HTTP transport\n// ----------------------------------\n\n/** Max time for one ingest request, in milliseconds. Then the transport aborts and retries it. */\nexport const REQUEST_TIMEOUT_MS = 15_000;\n\n/** Min payload size to compress, in bytes. */\nexport const COMPRESSION_THRESHOLD_BYTES = 1024;\n\n// ----------------------------------\n// Storage retention\n// ----------------------------------\n\n/** IndexedDB database name. */\nexport const STORAGE_DB_NAME = \"UiObservability\";\n\n/** Capacity and retention thresholds every storage adapter enforces. */\nexport const STORAGE_LIMITS: StorageLimits = {\n maxBatches: 500,\n maxAgeMs: 24 * 60 * 60 * 1000,\n maxAttempts: 5,\n};\n\n/**\n * Max time for one storage call, in milliseconds. Then the library treats the call as failed.\n * A call that does not settle keeps a dispatch slot or the drain flag.\n */\nexport const STORAGE_DEADLINE_MS = 10_000;\n\n// ----------------------------------\n// Retry backoff\n// ----------------------------------\n\n/** First backoff step, in milliseconds. Each attempt doubles it. */\nexport const RETRY_BASE_DELAY_MS = 2000;\n\n/** Backoff ceiling, in milliseconds. */\nexport const RETRY_MAX_DELAY_MS = 60_000;\n\n/** How often to check for stored work when nothing has failed recently, in milliseconds. */\nexport const RETRY_IDLE_DELAY_MS = 30_000;\n\n// ----------------------------------\n// Journey lifetime\n// ----------------------------------\n\n/** Max time a journey stays open, in milliseconds. Then the library treats it as abandoned. */\nexport const JOURNEY_MAX_AGE_MS = 30 * 60 * 1000;\n\n/** True if the journey ends for all contexts when the owning context closes. */\nexport const JOURNEY_END_ON_OWNER_CLOSE = false;\n\n/** Query parameter checked at boot for a seeded journey token. */\nexport const JOURNEY_URL_PARAM = \"__uiobs_journey\";\n\n// ----------------------------------\n// Bus handshake\n// ----------------------------------\n\n/** BroadcastChannel name for the control plane. */\nexport const BUS_CHANNEL_NAME = \"ui_observability_control\";\n\n/** Max time a forwarder waits for an owner to answer before it promotes itself, in milliseconds. */\nexport const BUS_HANDSHAKE_TIMEOUT_MS = 1500;\n\n/** Handshake attempts allowed before a cross-origin forwarder promotes itself to sender. */\nexport const BUS_MAX_HANDSHAKE_ATTEMPTS = 3;\n\n/** Max records that are not actions in one hold buffer. A full buffer drops the oldest. */\nexport const BUS_MAX_BOOT_BUFFER_RECORDS = 500;\n\n/** Max action records in one hold buffer. Actions have their own cap. A log storm cannot push one out. */\nexport const BUS_MAX_BOOT_BUFFER_ACTIONS = 2000;\n\n/** Max different values in each list of an onDrop summary. */\nexport const DROP_SUMMARY_MAX_ITEMS = 20;\n\n/** Max characters of an untrusted message type in a diagnostic detail. The sender sets the text. */\nexport const BUS_TYPE_DETAIL_MAX_CHARS = 32;\n\n// ----------------------------------\n// Capture\n// ----------------------------------\n\n/** Breadcrumbs kept as context for the next error. */\nexport const MAX_BREADCRUMBS = 50;\n\n/**\n * Time window in which the library counts identical errors but does not send them again,\n * in milliseconds.\n */\nexport const ERROR_DEDUPE_MS = 5000;\n\n// ----------------------------------\n// Per-record size caps\n// ----------------------------------\n\n/** Size caps for every record. The library applies them after sanitize and after redact. */\nexport const RECORD_LIMITS = {\n maxBodyChars: 4096,\n maxAttributeChars: 8192,\n maxAttributeCount: 128,\n maxStackChars: 8192,\n maxDepth: 6,\n maxArrayLength: 100,\n maxNodes: 10_000,\n maxRecordBytes: 32_768,\n};\n\n// ----------------------------------\n// Config defaults\n// ----------------------------------\n\n/**\n * Default runtime config before the consumer calls `configure()`. It excludes `serializer`.\n * `resolveConfig` supplies that default to prevent a circular import.\n * It comes after the constants that it reads. A const cannot be read before its line.\n * @see {@link ResolvedConfig}\n * @see {@link UNDEFAULTED_CONFIG_KEYS}\n */\nexport const DEFAULT_CONFIG: Omit<ResolvedConfig, \"serializer\"> = {\n endpoint: \"\",\n serviceName: \"\",\n serviceVersion: \"\",\n environment: \"\",\n enabled: true,\n minLevel: \"INFO\",\n compression: \"gzip\",\n credentials: \"omit\",\n storage: \"auto\",\n identity: \"storage\",\n sampling: {\n defaultRate: 1,\n rates: {},\n alwaysSampleTypes: [\"action\"],\n remote: false,\n remoteMaxRate: 1,\n },\n bus: { mode: \"auto\", trustedOrigins: [], openFinRole: \"auto\" },\n journey: { scope: \"auto\", maxAgeMs: JOURNEY_MAX_AGE_MS },\n batching: {\n logFlushIntervalMs: LOG_FLUSH_INTERVAL_MS,\n logBatchSize: LOG_BATCH_SIZE,\n metricFlushIntervalMs: METRIC_FLUSH_INTERVAL_MS,\n metricBatchSize: METRIC_BATCH_SIZE,\n },\n retention: { mode: \"limited\", ...STORAGE_LIMITS },\n limits: { ...RECORD_LIMITS },\n capture: {\n errors: true,\n rejections: true,\n resourceErrors: false,\n fetch: false,\n xhr: false,\n interactions: false,\n navigation: false,\n webVitals: false,\n longFrames: false,\n longFrameThresholdMs: LONG_FRAME_THRESHOLD_MS,\n console: false,\n fullUrls: false,\n ignoreUrls: [],\n propagateTraceHeaderTo: [],\n },\n console: { level: null, styles: CONSOLE_DEFAULT_STYLES },\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var ee=/OpenFin/i,te=/\bwv\b/,ne=/\b(iPhone|iPad|iPod)\b/,re=/\bMacintosh\b/,ie=/\bMobile\b/,e={TRACE:1,DEBUG:5,INFO:9,WARN:13,ERROR:17,FATAL:21},t=e,n=`log.type`,r=`log.seq`,i=`app.namespace`,a=`page.url`,o=`url.full`,s=`journey.id`,c=`journey.name`,l=`journey.parent_id`,u=`uiobs.sanitize_failed`,d=`error.data`,f=`breadcrumbs`,p=`uiobs.attributes_dropped`,m=`uiobs.attributes_bytes`,h=`service.name`,g=`service.version`,_=`deployment.environment`,v=`telemetry.sdk.name`,y=`telemetry.sdk.version`,b=`telemetry.sdk.language`,x=`host.platform`,S=`session.id`,C=`tab.id`,w=`context.id`,T=`browser.user_agent`,E=`openfin.uuid`,D=`openfin.name`,O=`@utk09/ui-observability`,k=`0.9.1`,A=`webjs`,j=`otlp`,M={WARN:`warning`},N=`application/json`,P=`application/x-ndjson`,F=1000000n,I=/^\d+$/,L=`Content-Type`,R=`Content-Encoding`,z=`Retry-After`,B=`X-UiObs-Batch-Id`,V=`X-UiObs-Attempt`,H=`X-UiObs-Sampling`,U=`gzip`,W=1e3,G=6e4,K=`text/plain;charset=UTF-8`,q=`uiobs_batch_id`,J=`uiobs_exit`,Y=`ui-observability.batch.`,ae=`ui-observability.emergency.`,oe=`ui-observability.probe`,se=`QuotaExceededError`,ce=`batches`,le=`createdAt`,ue=`indexeddb`,de=`localstorage`,fe=`memory`,pe=`none`,X=`ui-observability.drain`,me=`ui-observability.emergency`,he=`ui-observability.journey`,ge=2e3,_e=`uiObsJourney`,ve=/\+/g,ye=/\//g,be=/=+$/,xe=/-/g,Se=/_/g,Ce=3e5,we=`traceparent`,Te=2166136261,Ee=16777619,De=4294967295,Oe=[`action`,`metric`],ke=`metric`,Ae=`action`,je=`ui-observability/1`,Me=`ui-observability.runtime`,Ne=`ui-observability.stopped`,Pe=`ui-observability.request-scope`,Fe=`ui-observability.console-scope`,Ie=1e4,Z={namespace:`color:#888`,TRACE:`color:#888;font-weight:bold`,DEBUG:`color:#888;font-weight:bold`,INFO:`color:#1e6fd9;font-weight:bold`,WARN:`color:#c77700;font-weight:bold`,ERROR:`color:#d32f2f;font-weight:bold`,FATAL:`color:#d32f2f;font-weight:bold`},Le=1e3,Re=6e4,ze=`uiobs.capture`,Be=`uiobs.storage`,Ve=`count`,He=`unknown-service`,Ue=4096,We=36e5,Ge=3e4,Ke=[`redact`,`onDiagnostic`,`onDrop`,`headers`,`serializer`,`otelLoader`,`transport`,`transportOnExit`],qe=[`sampling`,`bus`,`journey`,`batching`,`retention`,`limits`,`capture`],Je={sampling:[],bus:[],journey:[],batching:[],retention:[],limits:[],capture:[`webVitalsLoader`]},Ye=`DEBUG`,Xe=2e3,Ze=1e4,Qe=15e3,$e=1024,et=`UiObservability`,tt={maxBatches:500,maxAgeMs:864e5,maxAttempts:5},nt=1e4,rt=2e3,it=6e4,at=3e4,Q=18e5,ot=`__uiobs_journey`,st=`ui_observability_control`,ct=1500,lt=2e3,ut=5e3,$={maxBodyChars:4096,maxAttributeChars:8192,maxAttributeCount:128,maxStackChars:8192,maxDepth:6,maxArrayLength:100,maxNodes:1e4,maxRecordBytes:32768},dt={endpoint:``,serviceName:``,serviceVersion:``,environment:``,enabled:!0,minLevel:`INFO`,compression:`gzip`,credentials:`omit`,storage:`auto`,identity:`storage`,sampling:{defaultRate:1,rates:{},alwaysSampleTypes:[`action`],remote:!1,remoteMaxRate:1},bus:{mode:`auto`,trustedOrigins:[],openFinRole:`auto`},journey:{scope:`auto`,maxAgeMs:Q},batching:{logFlushIntervalMs:Xe,logBatchSize:100,metricFlushIntervalMs:Ze,metricBatchSize:500},retention:{mode:`limited`,...tt},limits:{...$},capture:{errors:!0,rejections:!0,resourceErrors:!1,fetch:!1,xhr:!1,interactions:!1,navigation:!1,webVitals:!1,longFrames:!1,longFrameThresholdMs:100,console:!1,fullUrls:!1,ignoreUrls:[],propagateTraceHeaderTo:[]},console:{level:null,styles:Z}};Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"$t",{enumerable:!0,get:function(){return 6e4}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"At",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"Bt",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,"Ct",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"Dt",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"Et",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"Ft",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"Gt",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"Ht",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,"It",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"Jt",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"Kt",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"Lt",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"Mt",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"Nt",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"Ot",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"Pt",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"Qt",{enumerable:!0,get:function(){return`ui-observability.session`}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"Rt",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"St",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"Tt",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"Ut",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"Vt",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"Wt",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"Xt",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"Yt",{enumerable:!0,get:function(){return`Safari/`}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"Zt",{enumerable:!0,get:function(){return 18e5}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"_n",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"_t",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"an",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"bn",{enumerable:!0,get:function(){return`AppleWebKit`}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"cn",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"dn",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return`[ui-observability]`}}),Object.defineProperty(exports,"en",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return 56319}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"fn",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"gn",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"hn",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"in",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"jt",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"kt",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"ln",{enumerable:!0,get:function(){return`ui-observability.tab`}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"mn",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"nn",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"on",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"pn",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"qt",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"rn",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"sn",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"tn",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return 55296}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"un",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"vn",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"vt",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"wt",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"xt",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"yn",{enumerable:!0,get:function(){return 2048}}),Object.defineProperty(exports,"yt",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"zt",{enumerable:!0,get:function(){return S}});
|
|
2
|
+
//# sourceMappingURL=constants-X86IDwkC.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-X86IDwkC.cjs","names":["OPENFIN_UA_PATTERN","ANDROID_WEBVIEW_UA_PATTERN","IOS_DEVICE_UA_PATTERN","MACINTOSH_UA_PATTERN","MOBILE_UA_PATTERN","SEVERITY_NUMBER","LEVEL_ORDER","ATTR_LOG_TYPE","ATTR_LOG_SEQ","ATTR_APP_NAMESPACE","ATTR_PAGE_URL","ATTR_URL_FULL","ATTR_JOURNEY_ID","ATTR_JOURNEY_NAME","ATTR_JOURNEY_PARENT_ID","ATTR_SANITIZE_FAILED","ATTR_ERROR_DATA","ATTR_BREADCRUMBS","ATTR_ATTRIBUTES_DROPPED","ATTR_ATTRIBUTES_BYTES","RESOURCE_SERVICE_NAME","RESOURCE_SERVICE_VERSION","RESOURCE_DEPLOYMENT_ENVIRONMENT","RESOURCE_TELEMETRY_SDK_NAME","RESOURCE_TELEMETRY_SDK_VERSION","RESOURCE_TELEMETRY_SDK_LANGUAGE","RESOURCE_HOST_PLATFORM","RESOURCE_SESSION_ID","RESOURCE_TAB_ID","RESOURCE_CONTEXT_ID","RESOURCE_BROWSER_USER_AGENT","RESOURCE_OPENFIN_UUID","RESOURCE_OPENFIN_NAME","TELEMETRY_SDK_NAME","TELEMETRY_SDK_VERSION","TELEMETRY_SDK_LANGUAGE","SERIALIZER_NAME_OTLP","ECS_LEVEL_NAMES","CONTENT_TYPE_JSON","CONTENT_TYPE_NDJSON","NANOS_PER_MILLI","NANOS_PATTERN","HEADER_CONTENT_TYPE","HEADER_CONTENT_ENCODING","HEADER_RETRY_AFTER","HEADER_BATCH_ID","HEADER_ATTEMPT","HEADER_SAMPLING","ENCODING_GZIP","MILLIS_PER_SECOND","BEACON_LIMIT_BYTES","CONTENT_TYPE_TEXT_PLAIN","QUERY_PARAM_BATCH_ID","QUERY_PARAM_EXIT_REASON","BATCH_STORAGE_KEY_PREFIX","EMERGENCY_STORAGE_KEY_PREFIX","STORAGE_PROBE_KEY","QUOTA_EXCEEDED_ERROR","INDEXEDDB_STORE_NAME","INDEXEDDB_CREATED_AT_INDEX","STORAGE_NAME_INDEXEDDB","STORAGE_NAME_LOCAL","STORAGE_NAME_MEMORY","STORAGE_NAME_NONE","DRAIN_LOCK_NAME","EMERGENCY_LOCK_NAME","JOURNEY_STORAGE_KEY","OPENFIN_OPTIONS_TIMEOUT_MS","OPENFIN_JOURNEY_CUSTOM_DATA_KEY","BASE64_PLUS_PATTERN","BASE64_SLASH_PATTERN","BASE64_PADDING_PATTERN","BASE64URL_DASH_PATTERN","BASE64URL_UNDERSCORE_PATTERN","TRACE_MAX_AGE_MS","TRACEPARENT_HEADER","FNV_OFFSET_BASIS","FNV_PRIME","UINT32_MAX","LEVEL_BYPASS_TYPES","LOG_TYPE_METRIC","LOG_TYPE_ACTION","BUS_PROTOCOL","RUNTIME_GLOBAL_KEY","RUNTIME_STOPPED_KEY","LIBRARY_REQUEST_KEY","LIBRARY_CONSOLE_KEY","ERROR_STORM_WINDOW_MS","CONSOLE_DEFAULT_STYLES","DURATION_PRECISION","GAP_REPORT_THROTTLE_MS","CAPTURE_NAMESPACE","STORAGE_NAMESPACE","DEFAULT_METRIC_UNIT","UNKNOWN_SERVICE_NAME","REMOTE_SAMPLING_MAX_CHARS","REMOTE_SAMPLING_MAX_TTL_MS","REMOTE_SAMPLING_POLL_MS","UNDEFAULTED_CONFIG_KEYS","CONFIG_SECTIONS","UNDEFAULTED_SECTION_KEYS","CONSOLE_DEFAULT_LEVEL","LOG_FLUSH_INTERVAL_MS","METRIC_FLUSH_INTERVAL_MS","REQUEST_TIMEOUT_MS","COMPRESSION_THRESHOLD_BYTES","STORAGE_DB_NAME","STORAGE_LIMITS","STORAGE_DEADLINE_MS","RETRY_BASE_DELAY_MS","RETRY_MAX_DELAY_MS","RETRY_IDLE_DELAY_MS","JOURNEY_MAX_AGE_MS","JOURNEY_URL_PARAM","BUS_CHANNEL_NAME","BUS_HANDSHAKE_TIMEOUT_MS","BUS_MAX_BOOT_BUFFER_ACTIONS","ERROR_DEDUPE_MS","RECORD_LIMITS","DEFAULT_CONFIG"],"sources":["../src/constants.ts"],"sourcesContent":["// src/constants.ts\n//\n// Defines all limits, thresholds, timing windows, storage keys, patterns, and\n// defaults that the library uses.\n\nimport type { ConsoleStyles, ResolvedConfig } from \"./models/config\";\nimport type { LogLevel, LogType } from \"./models/log-record\";\nimport type { StorageLimits } from \"./models/storage\";\n\n// ----------------------------------\n// Library-wide\n// ----------------------------------\n\n/** Prefix on console messages this library writes. */\nexport const LIBRARY_LOG_PREFIX = \"[ui-observability]\";\n\n// ----------------------------------\n// Diagnostics\n// ----------------------------------\n\n/**\n * Throttle window for each diagnostic code, in milliseconds. It limits how often an error\n * loop calls the handler.\n */\nexport const DIAGNOSTIC_THROTTLE_MS = 1000;\n\n// ----------------------------------\n// Identity\n// ----------------------------------\n\n/** `localStorage` key for the session id and its last-seen time. */\nexport const SESSION_ID_KEY = \"ui-observability.session\";\n\n/** `sessionStorage` key for the tab id. */\nexport const TAB_ID_KEY = \"ui-observability.tab\";\n\n/** Session idle timeout, in milliseconds. */\nexport const SESSION_IDLE_MS = 30 * 60 * 1000;\n\n/** Min gap between session last-seen writes, in milliseconds. */\nexport const SESSION_TOUCH_MS = 60_000;\n\n/** Random id length, in bytes, used when `crypto.randomUUID` is unavailable. */\nexport const ID_BYTE_LENGTH = 16;\n\n/** Distinct values in one byte (256). */\nexport const BYTE_VALUE_COUNT = 256;\n\n// ----------------------------------\n// Platform detection\n// ----------------------------------\n\n/** Matches OpenFin's user agent. */\nexport const OPENFIN_UA_PATTERN = /OpenFin/i;\n\n/** Matches Android's webview token (`wv`). */\nexport const ANDROID_WEBVIEW_UA_PATTERN = /\\bwv\\b/;\n\n/** Matches iOS hardware: iPhone, iPad, iPod. */\nexport const IOS_DEVICE_UA_PATTERN = /\\b(iPhone|iPad|iPod)\\b/;\n\n/** Matches desktop macOS in a user agent. */\nexport const MACINTOSH_UA_PATTERN = /\\bMacintosh\\b/;\n\n/** Matches the mobile token. */\nexport const MOBILE_UA_PATTERN = /\\bMobile\\b/;\n\n/** WebKit engine token, present in every WebKit browser including webviews. */\nexport const WEBKIT_UA_TOKEN = \"AppleWebKit\";\n\n/** Safari token sent by real iOS browsers, not in-app webviews. */\nexport const SAFARI_UA_TOKEN = \"Safari/\";\n\n// ----------------------------------\n// Sanitizing and size estimation\n// ----------------------------------\n\n/** First UTF-16 high surrogate code unit. */\nexport const HIGH_SURROGATE_MIN = 0xd800;\n\n/** Last UTF-16 high surrogate code unit. */\nexport const HIGH_SURROGATE_MAX = 0xdbff;\n\n/** Code units below this encode as one UTF-8 byte. */\nexport const UTF8_ONE_BYTE_CEILING = 0x80;\n\n/** Code units below this, and at or above the one-byte ceiling, encode as two UTF-8 bytes. */\nexport const UTF8_TWO_BYTE_CEILING = 0x800;\n\n/** Class names kept in a `describeNode` selector. */\nexport const MAX_NODE_CLASS_NAMES = 3;\n\n/** Byte cost of a null or undefined value. */\nexport const BYTES_PER_NULL = 4;\n\n/** Byte cost of a number (flat estimate). */\nexport const BYTES_PER_NUMBER = 8;\n\n/** Byte cost of a boolean. */\nexport const BYTES_PER_BOOLEAN = 5;\n\n/** Byte cost of an object or array's wrapping braces or brackets. */\nexport const BYTES_PER_CONTAINER = 2;\n\n/** Byte cost of a string's wrapping quotes. */\nexport const BYTES_PER_QUOTED_STRING = 2;\n\n/** Byte cost of one key's punctuation: quotes, colon, comma. */\nexport const BYTES_PER_KEY_OVERHEAD = 4;\n\n// ----------------------------------\n// Record model\n// ----------------------------------\n\n/**\n * Maps each log level to its OpenTelemetry severity number.\n * @see {@link LEVEL_ORDER}\n */\nexport const SEVERITY_NUMBER: Record<LogLevel, number> = {\n TRACE: 1,\n DEBUG: 5,\n INFO: 9,\n WARN: 13,\n ERROR: 17,\n FATAL: 21,\n};\n\n/**\n * Alias for `SEVERITY_NUMBER`, used by the level filter.\n * @see {@link SEVERITY_NUMBER}\n */\nexport const LEVEL_ORDER: Record<LogLevel, number> = SEVERITY_NUMBER;\n\n// ----------------------------------\n// Attribute and resource keys\n// ----------------------------------\n//\n// Attribute and resource key names that records carry in the payload. The names\n// follow OpenTelemetry conventions. The `uiobs.` prefix marks the fields of this library.\n\n/** Record kind attribute key. */\nexport const ATTR_LOG_TYPE = \"log.type\";\n\n/** Record sequence number in its context. It starts at 1. */\nexport const ATTR_LOG_SEQ = \"log.seq\";\n\n/** Logger namespace attribute key. */\nexport const ATTR_APP_NAMESPACE = \"app.namespace\";\n\n/** Document URL when the library built the record. */\nexport const ATTR_PAGE_URL = \"page.url\";\n\n/**\n * HTTP request URL attribute key. Network capture sets it. Do not reuse `ATTR_PAGE_URL`.\n * The page URL overwrites the request target under that key.\n * @see {@link ATTR_PAGE_URL}\n */\nexport const ATTR_URL_FULL = \"url.full\";\n\n/** Journey id attribute key. */\nexport const ATTR_JOURNEY_ID = \"journey.id\";\n\n/** Journey name attribute key. */\nexport const ATTR_JOURNEY_NAME = \"journey.name\";\n\n/** Parent journey id, present only on a child journey. */\nexport const ATTR_JOURNEY_PARENT_ID = \"journey.parent_id\";\n\n/** Marks a record whose attributes failed to sanitize. */\nexport const ATTR_SANITIZE_FAILED = \"uiobs.sanitize_failed\";\n\n/** Own fields of an Error reason, or the whole reason when it is not an Error. */\nexport const ATTR_ERROR_DATA = \"error.data\";\n\n/** Breadcrumb history of an error record. */\nexport const ATTR_BREADCRUMBS = \"breadcrumbs\";\n\n/**\n * Marks a record when the library drops its attributes because they exceed the byte budget.\n * @see {@link ATTR_ATTRIBUTES_BYTES}\n */\nexport const ATTR_ATTRIBUTES_DROPPED = \"uiobs.attributes_dropped\";\n\n/**\n * Byte size of the dropped attributes.\n * @see {@link ATTR_ATTRIBUTES_DROPPED}\n */\nexport const ATTR_ATTRIBUTES_BYTES = \"uiobs.attributes_bytes\";\n\n/** Application name resource key. */\nexport const RESOURCE_SERVICE_NAME = \"service.name\";\n\n/** Application build version resource key. */\nexport const RESOURCE_SERVICE_VERSION = \"service.version\";\n\n/** Deployment environment resource key. */\nexport const RESOURCE_DEPLOYMENT_ENVIRONMENT = \"deployment.environment\";\n\n/**\n * Producer library name resource key.\n * @see {@link TELEMETRY_SDK_NAME}\n */\nexport const RESOURCE_TELEMETRY_SDK_NAME = \"telemetry.sdk.name\";\n\n/**\n * Producer library version resource key.\n * @see {@link TELEMETRY_SDK_VERSION}\n */\nexport const RESOURCE_TELEMETRY_SDK_VERSION = \"telemetry.sdk.version\";\n\n/**\n * Producer SDK language resource key.\n * @see {@link TELEMETRY_SDK_LANGUAGE}\n */\nexport const RESOURCE_TELEMETRY_SDK_LANGUAGE = \"telemetry.sdk.language\";\n\n/** Host platform resource key: browser, webview, or OpenFin. */\nexport const RESOURCE_HOST_PLATFORM = \"host.platform\";\n\n/** Session id resource key. */\nexport const RESOURCE_SESSION_ID = \"session.id\";\n\n/** Tab id resource key. */\nexport const RESOURCE_TAB_ID = \"tab.id\";\n\n/** Context (realm) id resource key. */\nexport const RESOURCE_CONTEXT_ID = \"context.id\";\n\n/** Raw user agent resource key. */\nexport const RESOURCE_BROWSER_USER_AGENT = \"browser.user_agent\";\n\n/** OpenFin application uuid resource key. */\nexport const RESOURCE_OPENFIN_UUID = \"openfin.uuid\";\n\n/** OpenFin window or view name resource key. */\nexport const RESOURCE_OPENFIN_NAME = \"openfin.name\";\n\n/**\n * Value of `telemetry.sdk.name`.\n * @see {@link RESOURCE_TELEMETRY_SDK_NAME}\n */\nexport const TELEMETRY_SDK_NAME = \"@utk09/ui-observability\";\n\n/**\n * Value of `telemetry.sdk.version`. The code does not read it from package.json.\n * Change it by hand when you change the version in package.json.\n * @see {@link RESOURCE_TELEMETRY_SDK_VERSION}\n */\nexport const TELEMETRY_SDK_VERSION = \"0.9.1\";\n\n/**\n * Value of `telemetry.sdk.language`.\n * @see {@link RESOURCE_TELEMETRY_SDK_LANGUAGE}\n */\nexport const TELEMETRY_SDK_LANGUAGE = \"webjs\";\n\n// ----------------------------------\n// Serializers\n// ----------------------------------\n\n/** OTLP/JSON serializer name. */\nexport const SERIALIZER_NAME_OTLP = \"otlp\";\n\n/** ECS serializer name. */\nexport const SERIALIZER_NAME_ECS = \"ecs\";\n\n/**\n * ECS `log.level` names that differ from the lowercase severity text. ECS spells\n * the warning level in full. All other levels match in lowercase.\n * @see {@link SERIALIZER_NAME_ECS}\n */\nexport const ECS_LEVEL_NAMES: Partial<Record<LogLevel, string>> = { WARN: \"warning\" };\n\n/** Content type for an OTLP/JSON body. */\nexport const CONTENT_TYPE_JSON = \"application/json\";\n\n/** Content type for newline-delimited JSON. */\nexport const CONTENT_TYPE_NDJSON = \"application/x-ndjson\";\n\n/** Nanoseconds per millisecond. */\nexport const NANOS_PER_MILLI = 1000000n;\n\n/**\n * Matches a nanosecond epoch in decimal digits, for example \"1755543600123000000\".\n * @see {@link NANOS_PER_MILLI}\n */\nexport const NANOS_PATTERN = /^\\d+$/;\n\n// ----------------------------------\n// HTTP transport\n// ----------------------------------\n\n/** Content-Type header name. */\nexport const HEADER_CONTENT_TYPE = \"Content-Type\";\n\n/** Content-Encoding header name. */\nexport const HEADER_CONTENT_ENCODING = \"Content-Encoding\";\n\n/** Retry-After header name. */\nexport const HEADER_RETRY_AFTER = \"Retry-After\";\n\n/**\n * Batch deduplication key header name.\n * @see {@link QUERY_PARAM_BATCH_ID}\n */\nexport const HEADER_BATCH_ID = \"X-UiObs-Batch-Id\";\n\n/** Delivery attempt number header name. */\nexport const HEADER_ATTEMPT = \"X-UiObs-Attempt\";\n\n/** Response header that carries sampling rules from the ingest server. */\nexport const HEADER_SAMPLING = \"X-UiObs-Sampling\";\n\n/** Gzip encoding name. */\nexport const ENCODING_GZIP = \"gzip\";\n\n/** Lowest valid HTTP status code. */\nexport const HTTP_STATUS_MIN = 100;\n\n/** Highest valid HTTP status code. */\nexport const HTTP_STATUS_MAX = 599;\n\n/** Lowest HTTP status code that accepts a batch. */\nexport const HTTP_SUCCESS_MIN = 200;\n\n/** Lowest HTTP status code above the success range. */\nexport const HTTP_SUCCESS_END = 300;\n\n/** 401, credentials missing or rejected. */\nexport const HTTP_UNAUTHORIZED = 401;\n\n/** 403, valid credentials but access denied. */\nexport const HTTP_FORBIDDEN = 403;\n\n/** 408, the server closed the connection after a timeout. The transport can retry. */\nexport const HTTP_REQUEST_TIMEOUT = 408;\n\n/** 413, payload too large. The transport must split the batch. */\nexport const HTTP_PAYLOAD_TOO_LARGE = 413;\n\n/** 429, backpressure. */\nexport const HTTP_TOO_MANY_REQUESTS = 429;\n\n/** 500, floor for server-side errors. */\nexport const HTTP_SERVER_ERROR_MIN = 500;\n\n/** 503, temporary unavailability. */\nexport const HTTP_SERVICE_UNAVAILABLE = 503;\n\n/** Milliseconds per second. */\nexport const MILLIS_PER_SECOND = 1000;\n\n// ----------------------------------\n// Exit flush\n// ----------------------------------\n\n/** Max exit payload size, in bytes (`sendBeacon`/`fetch(keepalive)` shared budget). */\nexport const BEACON_LIMIT_BYTES = 60_000;\n\n/** Content type for an exit payload. It is CORS-safelisted and does not cause a preflight. */\nexport const CONTENT_TYPE_TEXT_PLAIN = \"text/plain;charset=UTF-8\";\n\n/**\n * Batch id query param name, for the exit path.\n * @see {@link HEADER_BATCH_ID}\n */\nexport const QUERY_PARAM_BATCH_ID = \"uiobs_batch_id\";\n\n/** Exit reason query param name, for logs only. */\nexport const QUERY_PARAM_EXIT_REASON = \"uiobs_exit\";\n\n// ----------------------------------\n// Storage\n// ----------------------------------\n\n/** localStorage key prefix for a stored batch. */\nexport const BATCH_STORAGE_KEY_PREFIX = \"ui-observability.batch.\";\n\n/** Zero-padded digit width for the creation time in a batch key. */\nexport const BATCH_KEY_TIME_WIDTH = 14;\n\n/** localStorage key prefix for a batch that exit flush stores. */\nexport const EMERGENCY_STORAGE_KEY_PREFIX = \"ui-observability.emergency.\";\n\n/** Maximum number of exit batches in the emergency queue. */\nexport const EMERGENCY_MAX_ENTRIES = 20;\n\n/** Key that the library writes to test if localStorage accepts writes. */\nexport const STORAGE_PROBE_KEY = \"ui-observability.probe\";\n\n/** Fraction of the store to evict on a quota error (1 in N). */\nexport const QUOTA_EVICTION_DIVISOR = 4;\n\n/** DOMException name for a full store. */\nexport const QUOTA_EXCEEDED_ERROR = \"QuotaExceededError\";\n\n/**\n * Native IndexedDB version. It starts at 11. Dexie, the previous adapter, opened the\n * same database at ten times its declared version. A version below 11 makes open()\n * fail with VersionError for an existing installation. Then no code can read the\n * batches in that database.\n */\nexport const INDEXEDDB_SCHEMA_VERSION = 11;\n\n/** IndexedDB object store that holds batches. Dexie set this name before the library removed it. */\nexport const INDEXEDDB_STORE_NAME = \"batches\";\n\n/** Index on the batch store that orders reads by creation time. */\nexport const INDEXEDDB_CREATED_AT_INDEX = \"createdAt\";\n\n/** IndexedDB adapter/strategy name. */\nexport const STORAGE_NAME_INDEXEDDB = \"indexeddb\";\n\n/** localStorage adapter/strategy name. */\nexport const STORAGE_NAME_LOCAL = \"localstorage\";\n\n/** In-memory adapter/strategy name. */\nexport const STORAGE_NAME_MEMORY = \"memory\";\n\n/** Name of the storage adapter that keeps nothing. */\nexport const STORAGE_NAME_NONE = \"none\";\n\n// ----------------------------------\n// Retry\n// ----------------------------------\n\n/**\n * Origin-wide lock name a drain runs under.\n * @see {@link EMERGENCY_LOCK_NAME}\n */\nexport const DRAIN_LOCK_NAME = \"ui-observability.drain\";\n\n/**\n * Lock name startup recovery runs under.\n * @see {@link DRAIN_LOCK_NAME}\n */\nexport const EMERGENCY_LOCK_NAME = \"ui-observability.emergency\";\n\n/** Batches sent per drain tick. */\nexport const BATCHES_PER_DRAIN = 20;\n\n// ----------------------------------\n// Journey\n// ----------------------------------\n\n/** `sessionStorage` key for the current journey. */\nexport const JOURNEY_STORAGE_KEY = \"ui-observability.journey\";\n\n/**\n * Max journey name length in a token, in characters.\n * @see {@link JOURNEY_TOKEN_MAX_CHARS}\n */\nexport const JOURNEY_TOKEN_NAME_MAX_CHARS = 64;\n\n/**\n * Max whole-token length, in characters. It rejects an oversized token. It does not\n * validate the token content.\n * @see {@link JOURNEY_TOKEN_NAME_MAX_CHARS}\n */\nexport const JOURNEY_TOKEN_MAX_CHARS = 256;\n\n/**\n * Time to wait for `fin.me.getOptions()`, in milliseconds. After this time, the\n * runtime continues without a seeded journey.\n * @see {@link OPENFIN_JOURNEY_CUSTOM_DATA_KEY}\n */\nexport const OPENFIN_OPTIONS_TIMEOUT_MS = 2000;\n\n/** Key under an OpenFin window's `customData` carrying a seeded journey token. */\nexport const OPENFIN_JOURNEY_CUSTOM_DATA_KEY = \"uiObsJourney\";\n\n/** Matches `+` in standard base64 (`-` in URL-safe). */\nexport const BASE64_PLUS_PATTERN = /\\+/g;\n\n/** Matches `/` in standard base64 (`_` in URL-safe). */\nexport const BASE64_SLASH_PATTERN = /\\//g;\n\n/** Matches trailing `=` padding. */\nexport const BASE64_PADDING_PATTERN = /=+$/;\n\n/** Matches `-` in URL-safe base64 (`+` in standard). */\nexport const BASE64URL_DASH_PATTERN = /-/g;\n\n/** Matches `_` in URL-safe base64 (`/` in standard). */\nexport const BASE64URL_UNDERSCORE_PATTERN = /_/g;\n\n/** Base64 characters per 3-byte group. */\nexport const BASE64_GROUP_CHARS = 4;\n\n// ----------------------------------\n// Tracing\n// ----------------------------------\n\n/** W3C trace id width, in bytes. */\nexport const TRACE_ID_BYTES = 16;\n\n/** W3C span id width, in bytes. */\nexport const SPAN_ID_BYTES = 8;\n\n/** Max ambient trace lifetime with no activity, in milliseconds. */\nexport const TRACE_MAX_AGE_MS = 5 * 60 * 1000;\n\n/** trace-flags value with the sampled bit set. */\nexport const TRACE_FLAGS_SAMPLED = 1;\n\n/** Mask for the one-byte trace-flags field. */\nexport const TRACE_FLAGS_MASK = 0xff;\n\n/**\n * W3C trace context header name\n * @see {@link TRACEPARENT_VERSION}\n */\nexport const TRACEPARENT_HEADER = \"traceparent\";\n\n/** traceparent header version prefix. */\nexport const TRACEPARENT_VERSION = \"00\";\n\n// ----------------------------------\n// Breadcrumbs\n// ----------------------------------\n\n/** Smallest valid breadcrumb buffer capacity. */\nexport const BREADCRUMB_MIN_CAPACITY = 1;\n\n// ----------------------------------\n// Sampling\n// ----------------------------------\n//\n// FNV-1a hash constants. The sampler uses them to change a sampling key into a\n// stable 0-1 fraction.\n\n/** FNV-1a 32-bit offset basis. */\nexport const FNV_OFFSET_BASIS = 0x811c9dc5;\n\n/** FNV-1a 32-bit prime. */\nexport const FNV_PRIME = 0x01000193;\n\n/** Largest 32-bit unsigned value. */\nexport const UINT32_MAX = 0xffffffff;\n\n/**\n * Types that minLevel does not drop. An action is an audit fact and a metric is a measurement.\n * The remote rate cap for records below minLevel does not apply to them.\n */\nexport const LEVEL_BYPASS_TYPES: readonly LogType[] = [\"action\", \"metric\"];\n\n// ----------------------------------\n// Pipeline\n// ----------------------------------\n\n/** Record kind routed to the metric stream. */\nexport const LOG_TYPE_METRIC: LogType = \"metric\";\n\n/** Record kind of an audit fact. Storage and the hold buffers drop it last. */\nexport const LOG_TYPE_ACTION: LogType = \"action\";\n\n// ----------------------------------\n// Bus\n// ----------------------------------\n\n/** Protocol identifier for bus envelopes. The bus drops an envelope with a different version. */\nexport const BUS_PROTOCOL = \"ui-observability/1\";\n\n/** Global window property key used to locate a same-origin runtime instance. */\nexport const RUNTIME_GLOBAL_KEY = \"ui-observability.runtime\";\n\n/** Global key of the runtime that shutdown() stopped. Calls go to it until the next configure(). */\nexport const RUNTIME_STOPPED_KEY = \"ui-observability.stopped\";\n\n/** Global symbol key of the library request scope count. All library copies on a page share it. */\nexport const LIBRARY_REQUEST_KEY = \"ui-observability.request-scope\";\n\n/** Global symbol key of the library console scope count. All library copies on a page share it. */\nexport const LIBRARY_CONSOLE_KEY = \"ui-observability.console-scope\";\n\n// ----------------------------------\n// Capture\n// ----------------------------------\n\n/** Maximum error records captured per throttling window before suppression. */\nexport const ERROR_STORM_MAX_PER_WINDOW = 20;\n\n/** Error rate-limiting window duration in milliseconds. */\nexport const ERROR_STORM_WINDOW_MS = 10_000;\n\n/**\n * Max ERROR and FATAL records that the pipeline admits in each storm window.\n * It is a safety limit for a render loop. It does not shape normal traffic.\n * ERROR and FATAL records skip sampling. A direct logger.error call has no other limit.\n */\nexport const ERROR_CEILING_MAX_PER_WINDOW = 500;\n\n/** Default minimum duration of a long frame that the library records, in milliseconds. */\nexport const LONG_FRAME_THRESHOLD_MS = 100;\n\n/** Maximum long frames recorded in each storm window. A frozen tab cannot flood the pipeline. */\nexport const LONG_FRAME_MAX_PER_WINDOW = 20;\n\n/** Maximum character length of a console breadcrumb message. */\nexport const CONSOLE_BREADCRUMB_MAX_CHARS = 200;\n\n/** Maximum distinct error signatures tracked for deduplication before LRU eviction. */\nexport const MAX_TRACKED_ERROR_SIGNATURES = 200;\n\n/** Maximum character length retained from clicked element text in breadcrumbs. */\nexport const CLICK_TEXT_MAX_CHARS = 50;\n\n/** Maximum character length retained from an aria-label attribute in generated selectors. */\nexport const ARIA_LABEL_MAX_CHARS = 40;\n\n/** Maximum class names included per element in generated CSS selectors. */\nexport const SELECTOR_MAX_CLASSES = 2;\n\n/** Default CSS of the console prefix. The colors are readable on light and dark devtools. */\nexport const CONSOLE_DEFAULT_STYLES: Readonly<Required<ConsoleStyles>> = {\n namespace: \"color:#888\",\n TRACE: \"color:#888;font-weight:bold\",\n DEBUG: \"color:#888;font-weight:bold\",\n INFO: \"color:#1e6fd9;font-weight:bold\",\n WARN: \"color:#c77700;font-weight:bold\",\n ERROR: \"color:#d32f2f;font-weight:bold\",\n FATAL: \"color:#d32f2f;font-weight:bold\",\n};\n\n/** Scaling factor for rounding duration measurements to three decimal places. */\nexport const DURATION_PRECISION = 1000;\n\n// ----------------------------------\n// Runtime\n// ----------------------------------\n\n/** Minimum duration in milliseconds between storage gap warning reports. */\nexport const GAP_REPORT_THROTTLE_MS = 60_000;\n\n/** Default namespace for telemetry records emitted by auto-capture modules. */\nexport const CAPTURE_NAMESPACE = \"uiobs.capture\";\n\n/** Default namespace for telemetry records emitted by storage subsystems. */\nexport const STORAGE_NAMESPACE = \"uiobs.storage\";\n\n/** Measurement unit that the library uses when the call gives no unit. */\nexport const DEFAULT_METRIC_UNIT = \"count\";\n\n// ----------------------------------\n// Configuration\n// ----------------------------------\n\n/** Default `service.name` when a consumer sets none. */\nexport const UNKNOWN_SERVICE_NAME = \"unknown-service\";\n\n/** Lowest sampling rate (drop everything). */\nexport const SAMPLING_RATE_MIN = 0;\n\n/** Highest sampling rate (keep everything). */\nexport const SAMPLING_RATE_MAX = 1;\n\n/**\n * Fallback for an invalid sampling rate (keep everything).\n * @see {@link SAMPLING_RATE_MAX}\n */\nexport const SAMPLING_RATE_FALLBACK = 1;\n\n/** Version of the remote sampling rules that the library accepts. */\nexport const REMOTE_SAMPLING_VERSION = 1;\n\n/** Maximum length of the sampling header, in characters. */\nexport const REMOTE_SAMPLING_MAX_CHARS = 4096;\n\n/** Maximum time that remote sampling rules stay in force, in milliseconds. */\nexport const REMOTE_SAMPLING_MAX_TTL_MS = 60 * 60 * 1000;\n\n/** Maximum namespace rates in one set of remote sampling rules. */\nexport const REMOTE_SAMPLING_MAX_RATES = 100;\n\n/** Time between two requests of a forwarder for the remote sampling rules, in milliseconds. */\nexport const REMOTE_SAMPLING_POLL_MS = 30_000;\n\n/**\n * Config keys with no default, excluded from `DEFAULT_CONFIG`.\n * @see {@link DEFAULT_CONFIG}\n */\nexport const UNDEFAULTED_CONFIG_KEYS = [\n \"redact\",\n \"onDiagnostic\",\n \"onDrop\",\n \"headers\",\n \"serializer\",\n \"otelLoader\",\n \"transport\",\n \"transportOnExit\",\n] as const;\n\n/**\n * Nested config section keys.\n * @see {@link ResolvedConfig}\n */\nexport const CONFIG_SECTIONS = [\n \"sampling\",\n \"bus\",\n \"journey\",\n \"batching\",\n \"retention\",\n \"limits\",\n \"capture\",\n] as const;\n\n/**\n * Section keys with no default, excluded from their section of `DEFAULT_CONFIG`.\n * @see {@link UNDEFAULTED_CONFIG_KEYS}\n */\nexport const UNDEFAULTED_SECTION_KEYS: Record<(typeof CONFIG_SECTIONS)[number], string[]> = {\n sampling: [],\n bus: [],\n journey: [],\n batching: [],\n retention: [],\n limits: [],\n capture: [\"webVitalsLoader\"],\n};\n\n/** Console mirroring level used when a consumer passes `console: true`. */\nexport const CONSOLE_DEFAULT_LEVEL: LogLevel = \"DEBUG\";\n\n// ----------------------------------\n// Batching\n// ----------------------------------\n\n/** Max time a partial log batch waits before the pipeline sends it, in milliseconds. */\nexport const LOG_FLUSH_INTERVAL_MS = 2000;\n\n/** Max records per log batch. At this count, the pipeline sends the batch early. */\nexport const LOG_BATCH_SIZE = 100;\n\n/**\n * Max time a partial metric batch waits before the pipeline sends it, in milliseconds.\n * Metric batches wait longer than log batches. Metrics have a higher volume, and no\n * caller waits for them.\n */\nexport const METRIC_FLUSH_INTERVAL_MS = 10_000;\n\n/** Max records per metric batch. At this count, the pipeline sends the batch early. */\nexport const METRIC_BATCH_SIZE = 500;\n\n/** Max concurrent ingest requests, across both streams. */\nexport const MAX_CONCURRENT_REQUESTS = 2;\n\n// ----------------------------------\n// HTTP transport\n// ----------------------------------\n\n/** Max time for one ingest request, in milliseconds. Then the transport aborts and retries it. */\nexport const REQUEST_TIMEOUT_MS = 15_000;\n\n/** Min payload size to compress, in bytes. */\nexport const COMPRESSION_THRESHOLD_BYTES = 1024;\n\n// ----------------------------------\n// Storage retention\n// ----------------------------------\n\n/** IndexedDB database name. */\nexport const STORAGE_DB_NAME = \"UiObservability\";\n\n/** Capacity and retention thresholds every storage adapter enforces. */\nexport const STORAGE_LIMITS: StorageLimits = {\n maxBatches: 500,\n maxAgeMs: 24 * 60 * 60 * 1000,\n maxAttempts: 5,\n};\n\n/**\n * Max time for one storage call, in milliseconds. Then the library treats the call as failed.\n * A call that does not settle keeps a dispatch slot or the drain flag.\n */\nexport const STORAGE_DEADLINE_MS = 10_000;\n\n// ----------------------------------\n// Retry backoff\n// ----------------------------------\n\n/** First backoff step, in milliseconds. Each attempt doubles it. */\nexport const RETRY_BASE_DELAY_MS = 2000;\n\n/** Backoff ceiling, in milliseconds. */\nexport const RETRY_MAX_DELAY_MS = 60_000;\n\n/** How often to check for stored work when nothing has failed recently, in milliseconds. */\nexport const RETRY_IDLE_DELAY_MS = 30_000;\n\n// ----------------------------------\n// Journey lifetime\n// ----------------------------------\n\n/** Max time a journey stays open, in milliseconds. Then the library treats it as abandoned. */\nexport const JOURNEY_MAX_AGE_MS = 30 * 60 * 1000;\n\n/** True if the journey ends for all contexts when the owning context closes. */\nexport const JOURNEY_END_ON_OWNER_CLOSE = false;\n\n/** Query parameter checked at boot for a seeded journey token. */\nexport const JOURNEY_URL_PARAM = \"__uiobs_journey\";\n\n// ----------------------------------\n// Bus handshake\n// ----------------------------------\n\n/** BroadcastChannel name for the control plane. */\nexport const BUS_CHANNEL_NAME = \"ui_observability_control\";\n\n/** Max time a forwarder waits for an owner to answer before it promotes itself, in milliseconds. */\nexport const BUS_HANDSHAKE_TIMEOUT_MS = 1500;\n\n/** Handshake attempts allowed before a cross-origin forwarder promotes itself to sender. */\nexport const BUS_MAX_HANDSHAKE_ATTEMPTS = 3;\n\n/** Max records that are not actions in one hold buffer. A full buffer drops the oldest. */\nexport const BUS_MAX_BOOT_BUFFER_RECORDS = 500;\n\n/** Max action records in one hold buffer. Actions have their own cap. A log storm cannot push one out. */\nexport const BUS_MAX_BOOT_BUFFER_ACTIONS = 2000;\n\n/** Max different values in each list of an onDrop summary. */\nexport const DROP_SUMMARY_MAX_ITEMS = 20;\n\n/** Max characters of an untrusted message type in a diagnostic detail. The sender sets the text. */\nexport const BUS_TYPE_DETAIL_MAX_CHARS = 32;\n\n// ----------------------------------\n// Capture\n// ----------------------------------\n\n/** Breadcrumbs kept as context for the next error. */\nexport const MAX_BREADCRUMBS = 50;\n\n/**\n * Time window in which the library counts identical errors but does not send them again,\n * in milliseconds.\n */\nexport const ERROR_DEDUPE_MS = 5000;\n\n// ----------------------------------\n// Per-record size caps\n// ----------------------------------\n\n/** Size caps for every record. The library applies them after sanitize and after redact. */\nexport const RECORD_LIMITS = {\n maxBodyChars: 4096,\n maxAttributeChars: 8192,\n maxAttributeCount: 128,\n maxStackChars: 8192,\n maxDepth: 6,\n maxArrayLength: 100,\n maxNodes: 10_000,\n maxRecordBytes: 32_768,\n};\n\n// ----------------------------------\n// Config defaults\n// ----------------------------------\n\n/**\n * Default runtime config before the consumer calls `configure()`. It excludes `serializer`.\n * `resolveConfig` supplies that default to prevent a circular import.\n * It comes after the constants that it reads. A const cannot be read before its line.\n * @see {@link ResolvedConfig}\n * @see {@link UNDEFAULTED_CONFIG_KEYS}\n */\nexport const DEFAULT_CONFIG: Omit<ResolvedConfig, \"serializer\"> = {\n endpoint: \"\",\n serviceName: \"\",\n serviceVersion: \"\",\n environment: \"\",\n enabled: true,\n minLevel: \"INFO\",\n compression: \"gzip\",\n credentials: \"omit\",\n storage: \"auto\",\n identity: \"storage\",\n sampling: {\n defaultRate: 1,\n rates: {},\n alwaysSampleTypes: [\"action\"],\n remote: false,\n remoteMaxRate: 1,\n },\n bus: { mode: \"auto\", trustedOrigins: [], openFinRole: \"auto\" },\n journey: { scope: \"auto\", maxAgeMs: JOURNEY_MAX_AGE_MS },\n batching: {\n logFlushIntervalMs: LOG_FLUSH_INTERVAL_MS,\n logBatchSize: LOG_BATCH_SIZE,\n metricFlushIntervalMs: METRIC_FLUSH_INTERVAL_MS,\n metricBatchSize: METRIC_BATCH_SIZE,\n },\n retention: { mode: \"limited\", ...STORAGE_LIMITS },\n limits: { ...RECORD_LIMITS },\n capture: {\n errors: true,\n rejections: true,\n resourceErrors: false,\n fetch: false,\n xhr: false,\n interactions: false,\n navigation: false,\n webVitals: false,\n longFrames: false,\n longFrameThresholdMs: LONG_FRAME_THRESHOLD_MS,\n console: false,\n fullUrls: false,\n ignoreUrls: [],\n propagateTraceHeaderTo: [],\n },\n console: { level: null, styles: CONSOLE_DEFAULT_STYLES },\n};\n"],"mappings":"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"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -147,7 +147,7 @@ export declare const TELEMETRY_SDK_NAME = "@utk09/ui-observability";
|
|
|
147
147
|
* Change it by hand when you change the version in package.json.
|
|
148
148
|
* @see {@link RESOURCE_TELEMETRY_SDK_VERSION}
|
|
149
149
|
*/
|
|
150
|
-
export declare const TELEMETRY_SDK_VERSION = "0.9.
|
|
150
|
+
export declare const TELEMETRY_SDK_VERSION = "0.9.1";
|
|
151
151
|
/**
|
|
152
152
|
* Value of `telemetry.sdk.language`.
|
|
153
153
|
* @see {@link RESOURCE_TELEMETRY_SDK_LANGUAGE}
|
|
@@ -336,6 +336,8 @@ export declare const UINT32_MAX = 4294967295;
|
|
|
336
336
|
export declare const LEVEL_BYPASS_TYPES: readonly LogType[];
|
|
337
337
|
/** Record kind routed to the metric stream. */
|
|
338
338
|
export declare const LOG_TYPE_METRIC: LogType;
|
|
339
|
+
/** Record kind of an audit fact. Storage and the hold buffers drop it last. */
|
|
340
|
+
export declare const LOG_TYPE_ACTION: LogType;
|
|
339
341
|
/** Protocol identifier for bus envelopes. The bus drops an envelope with a different version. */
|
|
340
342
|
export declare const BUS_PROTOCOL = "ui-observability/1";
|
|
341
343
|
/** Global window property key used to locate a same-origin runtime instance. */
|
|
@@ -407,24 +409,17 @@ export declare const REMOTE_SAMPLING_POLL_MS = 30000;
|
|
|
407
409
|
* Config keys with no default, excluded from `DEFAULT_CONFIG`.
|
|
408
410
|
* @see {@link DEFAULT_CONFIG}
|
|
409
411
|
*/
|
|
410
|
-
export declare const UNDEFAULTED_CONFIG_KEYS: readonly ["redact", "onDiagnostic", "headers", "serializer", "otelLoader", "transport", "transportOnExit"];
|
|
412
|
+
export declare const UNDEFAULTED_CONFIG_KEYS: readonly ["redact", "onDiagnostic", "onDrop", "headers", "serializer", "otelLoader", "transport", "transportOnExit"];
|
|
411
413
|
/**
|
|
412
414
|
* Nested config section keys.
|
|
413
415
|
* @see {@link ResolvedConfig}
|
|
414
416
|
*/
|
|
415
|
-
export declare const CONFIG_SECTIONS: readonly ["sampling", "bus", "journey", "capture"];
|
|
417
|
+
export declare const CONFIG_SECTIONS: readonly ["sampling", "bus", "journey", "batching", "retention", "limits", "capture"];
|
|
416
418
|
/**
|
|
417
419
|
* Section keys with no default, excluded from their section of `DEFAULT_CONFIG`.
|
|
418
420
|
* @see {@link UNDEFAULTED_CONFIG_KEYS}
|
|
419
421
|
*/
|
|
420
422
|
export declare const UNDEFAULTED_SECTION_KEYS: Record<(typeof CONFIG_SECTIONS)[number], string[]>;
|
|
421
|
-
/**
|
|
422
|
-
* Default runtime config before the consumer calls `configure()`. It excludes `serializer`.
|
|
423
|
-
* `resolveConfig` supplies that default to prevent a circular import.
|
|
424
|
-
* @see {@link ResolvedConfig}
|
|
425
|
-
* @see {@link UNDEFAULTED_CONFIG_KEYS}
|
|
426
|
-
*/
|
|
427
|
-
export declare const DEFAULT_CONFIG: Omit<ResolvedConfig, "serializer">;
|
|
428
423
|
/** Console mirroring level used when a consumer passes `console: true`. */
|
|
429
424
|
export declare const CONSOLE_DEFAULT_LEVEL: LogLevel;
|
|
430
425
|
/** Max time a partial log batch waits before the pipeline sends it, in milliseconds. */
|
|
@@ -472,8 +467,12 @@ export declare const BUS_CHANNEL_NAME = "ui_observability_control";
|
|
|
472
467
|
export declare const BUS_HANDSHAKE_TIMEOUT_MS = 1500;
|
|
473
468
|
/** Handshake attempts allowed before a cross-origin forwarder promotes itself to sender. */
|
|
474
469
|
export declare const BUS_MAX_HANDSHAKE_ATTEMPTS = 3;
|
|
475
|
-
/** Max records
|
|
470
|
+
/** Max records that are not actions in one hold buffer. A full buffer drops the oldest. */
|
|
476
471
|
export declare const BUS_MAX_BOOT_BUFFER_RECORDS = 500;
|
|
472
|
+
/** Max action records in one hold buffer. Actions have their own cap. A log storm cannot push one out. */
|
|
473
|
+
export declare const BUS_MAX_BOOT_BUFFER_ACTIONS = 2000;
|
|
474
|
+
/** Max different values in each list of an onDrop summary. */
|
|
475
|
+
export declare const DROP_SUMMARY_MAX_ITEMS = 20;
|
|
477
476
|
/** Max characters of an untrusted message type in a diagnostic detail. The sender sets the text. */
|
|
478
477
|
export declare const BUS_TYPE_DETAIL_MAX_CHARS = 32;
|
|
479
478
|
/** Breadcrumbs kept as context for the next error. */
|
|
@@ -494,3 +493,11 @@ export declare const RECORD_LIMITS: {
|
|
|
494
493
|
maxNodes: number;
|
|
495
494
|
maxRecordBytes: number;
|
|
496
495
|
};
|
|
496
|
+
/**
|
|
497
|
+
* Default runtime config before the consumer calls `configure()`. It excludes `serializer`.
|
|
498
|
+
* `resolveConfig` supplies that default to prevent a circular import.
|
|
499
|
+
* It comes after the constants that it reads. A const cannot be read before its line.
|
|
500
|
+
* @see {@link ResolvedConfig}
|
|
501
|
+
* @see {@link UNDEFAULTED_CONFIG_KEYS}
|
|
502
|
+
*/
|
|
503
|
+
export declare const DEFAULT_CONFIG: Omit<ResolvedConfig, "serializer">;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ResolvedConfig } from "../models/config";
|
|
2
|
+
import type { LossReason } from "../models/drop";
|
|
3
|
+
import type { LogRecord } from "../models/log-record";
|
|
4
|
+
import type { Diagnostics } from "./diagnostics";
|
|
5
|
+
/** Collects lost records and gives one summary for each reason to the onDrop hook. */
|
|
6
|
+
export declare class DropReporter {
|
|
7
|
+
private readonly config;
|
|
8
|
+
private readonly diagnostics;
|
|
9
|
+
/** Summaries that wait for the end of the task, one for each reason. */
|
|
10
|
+
private readonly pending;
|
|
11
|
+
/** True while a microtask waits to send the summaries. */
|
|
12
|
+
private scheduled;
|
|
13
|
+
/** True while the hook runs. A loss that the hook causes is not reported again. */
|
|
14
|
+
private reporting;
|
|
15
|
+
/**
|
|
16
|
+
* @param config Active configuration. The reporter reads `onDrop` from it at each call.
|
|
17
|
+
* @param diagnostics Diagnostics reporter.
|
|
18
|
+
*/
|
|
19
|
+
constructor(config: ResolvedConfig, diagnostics: Diagnostics);
|
|
20
|
+
/**
|
|
21
|
+
* Adds lost records to the summary of their reason. Without an onDrop hook, it does nothing.
|
|
22
|
+
* @param reason Cause of the loss.
|
|
23
|
+
* @param records Lost records.
|
|
24
|
+
* @param batchIds Ids of the lost batches.
|
|
25
|
+
*/
|
|
26
|
+
add(reason: LossReason, records: readonly LogRecord[], batchIds?: readonly string[]): void;
|
|
27
|
+
/** Gives each waiting summary to the hook. A hook that throws does not stop the others. */
|
|
28
|
+
private flush;
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { LogRecord } from "../models/log-record";
|
|
2
|
+
/** Holds records in arrival order. A full buffer drops its oldest record of the same kind. */
|
|
3
|
+
export declare class HoldBuffer {
|
|
4
|
+
private readonly onDrop;
|
|
5
|
+
/** Held records in arrival order. */
|
|
6
|
+
private held;
|
|
7
|
+
/** Number of held actions. A count finds a full buffer without a scan at each push. */
|
|
8
|
+
private actions;
|
|
9
|
+
/**
|
|
10
|
+
* @param onDrop Receives the record that a full buffer drops.
|
|
11
|
+
*/
|
|
12
|
+
constructor(onDrop: (record: LogRecord) => void);
|
|
13
|
+
/** Held records in arrival order. */
|
|
14
|
+
get records(): readonly LogRecord[];
|
|
15
|
+
/** Number of held records. */
|
|
16
|
+
get length(): number;
|
|
17
|
+
/**
|
|
18
|
+
* Adds a record. A full buffer drops its oldest record of the same kind.
|
|
19
|
+
* @param record Record to hold.
|
|
20
|
+
*/
|
|
21
|
+
push(record: LogRecord): void;
|
|
22
|
+
/**
|
|
23
|
+
* Removes the held records.
|
|
24
|
+
* @returns The records in arrival order.
|
|
25
|
+
*/
|
|
26
|
+
take(): LogRecord[];
|
|
27
|
+
}
|
package/dist/core/pipeline.d.ts
CHANGED
|
@@ -13,11 +13,6 @@ export interface StreamOptions {
|
|
|
13
13
|
/** Maximum records in a batch. At this count, the pipeline sends the batch early. */
|
|
14
14
|
batchSize: number;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
17
|
-
* Batching policy per stream. Metrics use larger batches and a longer interval.
|
|
18
|
-
* Metrics have a higher volume, and no process waits for them.
|
|
19
|
-
*/
|
|
20
|
-
export declare const STREAM_OPTIONS: Record<StreamName, StreamOptions>;
|
|
21
16
|
/** Buffers the log and metric streams. It makes batches. It sends them over HTTP. */
|
|
22
17
|
export declare class LogPipeline {
|
|
23
18
|
private readonly transport;
|
|
@@ -45,9 +40,9 @@ export declare class LogPipeline {
|
|
|
45
40
|
* @param storage Storage adapter for offline batch persistence.
|
|
46
41
|
* @param retry Retry engine for redelivering persisted batches.
|
|
47
42
|
* @param diagnostics Diagnostics reporter.
|
|
48
|
-
* @param streamOptions Batching policy per stream.
|
|
43
|
+
* @param streamOptions Batching policy per stream, from the batching config.
|
|
49
44
|
*/
|
|
50
|
-
constructor(transport: BatchTransport, storage: StorageAdapter, retry: RetryEngine, diagnostics: Diagnostics, streamOptions
|
|
45
|
+
constructor(transport: BatchTransport, storage: StorageAdapter, retry: RetryEngine, diagnostics: Diagnostics, streamOptions: Record<StreamName, StreamOptions>);
|
|
51
46
|
/**
|
|
52
47
|
* Sets the observed timestamp and adds a record to the pipeline.
|
|
53
48
|
* @param record Record to push.
|
package/dist/core/runtime.d.ts
CHANGED
|
@@ -55,6 +55,8 @@ export declare class ObservabilityRuntime {
|
|
|
55
55
|
private readonly remote;
|
|
56
56
|
/** Console sink for local developer output. */
|
|
57
57
|
readonly console: ConsoleSink;
|
|
58
|
+
/** Collects lost records into onDrop summaries. */
|
|
59
|
+
private readonly drops;
|
|
58
60
|
/**
|
|
59
61
|
* Cross-realm communication bus. It is null until its chunk loads.
|
|
60
62
|
* In bus.mode "off", it loads only when a child frame or a worker needs it.
|
|
@@ -71,7 +73,7 @@ export declare class ObservabilityRuntime {
|
|
|
71
73
|
/** Load of the delivery stack. It is undefined when nothing loads. A record then has no destination. */
|
|
72
74
|
private senderLoad?;
|
|
73
75
|
/** Records that arrive while the delivery stack loads. */
|
|
74
|
-
private pendingRecords;
|
|
76
|
+
private readonly pendingRecords;
|
|
75
77
|
/** Active auto-capture instrumentation modules. */
|
|
76
78
|
private readonly captures;
|
|
77
79
|
/** Count of capture installs. An install that a later install replaced stops after its load. */
|
|
@@ -79,7 +81,7 @@ export declare class ObservabilityRuntime {
|
|
|
79
81
|
/** Capture work that a rebuild of the capture modules must not repeat. */
|
|
80
82
|
private readonly captureOnce;
|
|
81
83
|
/** Queue buffering records created before bus role resolution. */
|
|
82
|
-
private bootBuffer;
|
|
84
|
+
private readonly bootBuffer;
|
|
83
85
|
/** Batch buffer staging records for microtask forwarding. */
|
|
84
86
|
private forwardBuffer;
|
|
85
87
|
/** True if a microtask drain of the forward buffer is pending. */
|
|
@@ -94,6 +96,12 @@ export declare class ObservabilityRuntime {
|
|
|
94
96
|
private destroyed;
|
|
95
97
|
/** Timestamp of the last reported storage gap warning in epoch milliseconds. */
|
|
96
98
|
private lastGapAt;
|
|
99
|
+
/** Record limits of the builder and the console. The first configure() of the app sets them. */
|
|
100
|
+
private readonly limits;
|
|
101
|
+
/** Lifetime rules of the journey engine. The first configure() of the app sets the age. */
|
|
102
|
+
private readonly journeyOptions;
|
|
103
|
+
/** False in a runtime that an early log call started. The first configure() then sets limits. */
|
|
104
|
+
private tunablesLocked;
|
|
97
105
|
/**
|
|
98
106
|
* @param input Initial consumer configuration options.
|
|
99
107
|
* @param degraded True for a console-only runtime next to another version. It installs
|
|
@@ -131,9 +139,10 @@ export declare class ObservabilityRuntime {
|
|
|
131
139
|
/**
|
|
132
140
|
* Initializes a new runtime instance or updates the existing singleton.
|
|
133
141
|
* @param input Consumer configuration options.
|
|
142
|
+
* @param implicit True for the default runtime that an early log call starts.
|
|
134
143
|
* @returns Active runtime instance.
|
|
135
144
|
*/
|
|
136
|
-
static configure(input: Partial<ObservabilityConfig
|
|
145
|
+
static configure(input: Partial<ObservabilityConfig>, implicit?: boolean): ObservabilityRuntime;
|
|
137
146
|
/**
|
|
138
147
|
* Starts a console-only runtime next to the runtime of another version. It sends nothing,
|
|
139
148
|
* joins no bus and installs no capture. The other version keeps the page runtime.
|
|
@@ -147,6 +156,18 @@ export declare class ObservabilityRuntime {
|
|
|
147
156
|
* @param input Partial configuration to merge.
|
|
148
157
|
*/
|
|
149
158
|
private reconfigure;
|
|
159
|
+
/**
|
|
160
|
+
* Restores the startup tunables in the next config. A part of the runtime reads each tunable
|
|
161
|
+
* one time. A later change has no effect. The runtime then refuses it.
|
|
162
|
+
* @param next Resolved config of a later configure() call.
|
|
163
|
+
*/
|
|
164
|
+
private keepStartupTunables;
|
|
165
|
+
/**
|
|
166
|
+
* Refuses a change of config sections. It restores the values in force in the next config.
|
|
167
|
+
* @param next Resolved config of a later configure() call.
|
|
168
|
+
* @param sections Sections that cannot change.
|
|
169
|
+
*/
|
|
170
|
+
private keepSections;
|
|
150
171
|
/**
|
|
151
172
|
* Restores the storage strategy of the built adapter. The runtime reads all other keys
|
|
152
173
|
* live. It builds the adapter only one time. A new adapter strands the batches in the
|
|
@@ -196,6 +217,11 @@ export declare class ObservabilityRuntime {
|
|
|
196
217
|
* @returns Promise that resolves when the load completes, or immediately when nothing loads.
|
|
197
218
|
*/
|
|
198
219
|
private syncSender;
|
|
220
|
+
/**
|
|
221
|
+
* Tests if the config names a destination for the records.
|
|
222
|
+
* @returns True with an endpoint or a custom transport.
|
|
223
|
+
*/
|
|
224
|
+
private hasDestination;
|
|
199
225
|
/**
|
|
200
226
|
* Starts the load of the delivery stack one time.
|
|
201
227
|
* @returns Promise that resolves when the load completes or fails.
|
|
@@ -238,16 +264,17 @@ export declare class ObservabilityRuntime {
|
|
|
238
264
|
*/
|
|
239
265
|
private deliver;
|
|
240
266
|
/**
|
|
241
|
-
*
|
|
242
|
-
* @param
|
|
243
|
-
* @param record Record to hold.
|
|
267
|
+
* Counts a record that a full hold buffer drops. It gives the record to the onDrop report.
|
|
268
|
+
* @param record Dropped record.
|
|
244
269
|
*/
|
|
245
|
-
private
|
|
270
|
+
private dropHeld;
|
|
246
271
|
/**
|
|
247
272
|
* Batches records for asynchronous transmission to the upstream sender.
|
|
248
273
|
* @param record Log record to forward.
|
|
249
274
|
*/
|
|
250
275
|
private forward;
|
|
276
|
+
/** Gives the records of the forward buffer to the bus. */
|
|
277
|
+
private sendForwarded;
|
|
251
278
|
/**
|
|
252
279
|
* Validates, samples and queues records from child frames or workers.
|
|
253
280
|
* A forwarded record arrives built. This is the first point in this context where
|
|
@@ -258,8 +285,17 @@ export declare class ObservabilityRuntime {
|
|
|
258
285
|
/** Flushes the startup records. It adds the active journey to records without a journey. */
|
|
259
286
|
private releaseBootBuffer;
|
|
260
287
|
/**
|
|
261
|
-
*
|
|
288
|
+
* Gives lost records to the onDrop report.
|
|
289
|
+
* @param reason Cause of the loss.
|
|
290
|
+
* @param records Lost records.
|
|
291
|
+
* @param batchIds Ids of the lost batches.
|
|
292
|
+
*/
|
|
293
|
+
private readonly reportLoss;
|
|
294
|
+
/**
|
|
295
|
+
* Gives the evicted batches to the onDrop report. It also emits a warning record. A throttle
|
|
296
|
+
* limits the warning records.
|
|
262
297
|
* @param result Storage prune summary metrics.
|
|
298
|
+
* @param dropped The evicted batches.
|
|
263
299
|
*/
|
|
264
300
|
private readonly reportGap;
|
|
265
301
|
/** Makes and stores a new tab ID after a tab ID collision. */
|
package/dist/core/sender.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ResolvedConfig } from "../models/config";
|
|
2
|
+
import type { LossReporter } from "../models/drop";
|
|
2
3
|
import type { LogRecord } from "../models/log-record";
|
|
3
|
-
import type
|
|
4
|
+
import { type GapReporter } from "../models/storage";
|
|
4
5
|
import type { Diagnostics } from "./diagnostics";
|
|
5
6
|
import type { RemoteSlot } from "./remote-sampling";
|
|
6
7
|
/** Inputs to build the delivery stack. */
|
|
@@ -11,6 +12,8 @@ export interface SenderDeps {
|
|
|
11
12
|
diagnostics: Diagnostics;
|
|
12
13
|
/** Receives a report when storage drops batches before delivery. */
|
|
13
14
|
onGap: GapReporter;
|
|
15
|
+
/** Receives the records that the transport, the retry engine and the exit flush lose. */
|
|
16
|
+
onLoss: LossReporter;
|
|
14
17
|
/** Slot of the runtime for the sampling rules from the ingest server. */
|
|
15
18
|
remote: RemoteSlot;
|
|
16
19
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/utils/unref.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
typeof e != "number" && e.unref?.();
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/utils/deadline.ts
|
|
7
|
+
var t = class extends Error {
|
|
8
|
+
constructor(e) {
|
|
9
|
+
super(`The operation took longer than ${String(e)} ms.`), this.name = "DeadlineError";
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
function n(n, r) {
|
|
13
|
+
let i, a = new Promise((n, a) => {
|
|
14
|
+
let o = setTimeout(() => {
|
|
15
|
+
a(new t(r));
|
|
16
|
+
}, r);
|
|
17
|
+
i = o, e(o);
|
|
18
|
+
});
|
|
19
|
+
return Promise.race([n, a]).finally(() => {
|
|
20
|
+
clearTimeout(i);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { n, e as r, t };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=deadline-5_PecIl5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deadline-5_PecIl5.js","names":["unrefTimer","timer","DeadlineError","ms","withDeadline","expire","deadline","work"],"sources":["../src/utils/unref.ts","../src/utils/deadline.ts"],"sourcesContent":["// src/utils/unref.ts\n//\n// Unreferences timer handles in Node and browser environments. A pending timer\n// keeps a Node process alive under SSR and in tests.\n\n/** Timer handle. It is a number in a browser and a Timeout object in Node. */\nexport type TimerHandle = number | { unref?: () => void };\n\n/**\n * Unreferences a timer handle. A pending timer then does not keep a Node.js process alive.\n * @param timer Timer handle returned by setTimeout.\n */\nexport function unrefTimer(timer: TimerHandle): void {\n if (typeof timer !== \"number\") {\n timer.unref?.();\n }\n}\n","// src/utils/deadline.ts\n//\n// Sets a deadline for a promise that can stay pending. A pending promise raises no\n// diagnostics event. Without a deadline, its caller waits forever and keeps its slot.\n\nimport { unrefTimer } from \"./unref\";\n\n/** Error of a promise that did not settle before its deadline. */\nexport class DeadlineError extends Error {\n /**\n * @param ms Deadline in milliseconds.\n */\n constructor(ms: number) {\n super(`The operation took longer than ${String(ms)} ms.`);\n this.name = \"DeadlineError\";\n }\n}\n\n/**\n * Rejects when a promise does not settle within a deadline.\n * @param work Promise to bound.\n * @param ms Deadline in milliseconds.\n * @returns The value of the promise, or a rejection after the deadline.\n */\nexport function withDeadline<T>(work: Promise<T>, ms: number): Promise<T> {\n let expire: ReturnType<typeof setTimeout> | undefined;\n\n const deadline = new Promise<never>((_resolve, reject) => {\n const timer = setTimeout(() => {\n reject(new DeadlineError(ms));\n }, ms);\n\n expire = timer;\n unrefTimer(timer);\n });\n\n // Clear the timer on success and on failure. If not, each storage call leaves an armed timer.\n return Promise.race([work, deadline]).finally(() => {\n clearTimeout(expire);\n });\n}\n"],"mappings":";AAYA,SAAgBA,EAAW,GAA0B;CACnD,AAAI,OAAOC,KAAU,YACnBA,EAAM,QAAQ;AAElB;;;ACRA,IAAaC,IAAb,cAAmC,MAAM;CAIvC,YAAY,GAAY;EAEtB,AADA,MAAM,kCAAkC,OAAOC,CAAE,EAAE,KAAK,GACxD,KAAK,OAAO;CACd;AACF;AAQA,SAAgBC,EAAgB,GAAkB,GAAwB;CACxE,IAAIC,GAEEC,IAAW,IAAI,SAAgB,GAAU,MAAW;EACxD,IAAML,IAAQ,iBAAiB;GAC7B,EAAO,IAAIC,EAAcC,CAAE,CAAC;EAC9B,GAAGA,CAAE;EAGL,AADA,IAASF,GACTD,EAAWC,CAAK;CAClB,CAAC;CAGD,OAAO,QAAQ,KAAK,CAACM,GAAMD,CAAQ,CAAC,CAAC,CAAC,cAAc;EAClD,aAAaD,CAAM;CACrB,CAAC;AACH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e){typeof e!=`number`&&e.unref?.()}var t=class extends Error{constructor(e){super(`The operation took longer than ${String(e)} ms.`),this.name=`DeadlineError`}};function n(n,r){let i,a=new Promise((n,a)=>{let o=setTimeout(()=>{a(new t(r))},r);i=o,e(o)});return Promise.race([n,a]).finally(()=>{clearTimeout(i)})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|
|
2
|
+
//# sourceMappingURL=deadline-XSnm95pg.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deadline-XSnm95pg.cjs","names":["unrefTimer","timer","DeadlineError","ms","withDeadline","expire","deadline","reject","work"],"sources":["../src/utils/unref.ts","../src/utils/deadline.ts"],"sourcesContent":["// src/utils/unref.ts\n//\n// Unreferences timer handles in Node and browser environments. A pending timer\n// keeps a Node process alive under SSR and in tests.\n\n/** Timer handle. It is a number in a browser and a Timeout object in Node. */\nexport type TimerHandle = number | { unref?: () => void };\n\n/**\n * Unreferences a timer handle. A pending timer then does not keep a Node.js process alive.\n * @param timer Timer handle returned by setTimeout.\n */\nexport function unrefTimer(timer: TimerHandle): void {\n if (typeof timer !== \"number\") {\n timer.unref?.();\n }\n}\n","// src/utils/deadline.ts\n//\n// Sets a deadline for a promise that can stay pending. A pending promise raises no\n// diagnostics event. Without a deadline, its caller waits forever and keeps its slot.\n\nimport { unrefTimer } from \"./unref\";\n\n/** Error of a promise that did not settle before its deadline. */\nexport class DeadlineError extends Error {\n /**\n * @param ms Deadline in milliseconds.\n */\n constructor(ms: number) {\n super(`The operation took longer than ${String(ms)} ms.`);\n this.name = \"DeadlineError\";\n }\n}\n\n/**\n * Rejects when a promise does not settle within a deadline.\n * @param work Promise to bound.\n * @param ms Deadline in milliseconds.\n * @returns The value of the promise, or a rejection after the deadline.\n */\nexport function withDeadline<T>(work: Promise<T>, ms: number): Promise<T> {\n let expire: ReturnType<typeof setTimeout> | undefined;\n\n const deadline = new Promise<never>((_resolve, reject) => {\n const timer = setTimeout(() => {\n reject(new DeadlineError(ms));\n }, ms);\n\n expire = timer;\n unrefTimer(timer);\n });\n\n // Clear the timer on success and on failure. If not, each storage call leaves an armed timer.\n return Promise.race([work, deadline]).finally(() => {\n clearTimeout(expire);\n });\n}\n"],"mappings":"AAYA,SAAgBA,EAAW,EAA0B,CAC/C,OAAOC,GAAU,UACnBA,EAAM,QAAQ,CAElB,CCRA,IAAaC,EAAb,cAAmC,KAAM,CAIvC,YAAY,EAAY,CACtB,MAAM,kCAAkC,OAAOC,CAAE,EAAE,KAAK,EACxD,KAAK,KAAO,eACd,CACF,EAQA,SAAgBC,EAAgB,EAAkB,EAAwB,CACxE,IAAIC,EAEEC,EAAW,IAAI,SAAgB,EAAU,IAAW,CACxD,IAAML,EAAQ,eAAiB,CAC7BM,EAAO,IAAIL,EAAcC,CAAE,CAAC,CAC9B,EAAGA,CAAE,EAEL,EAASF,EACTD,EAAWC,CAAK,CAClB,CAAC,EAGD,OAAO,QAAQ,KAAK,CAACO,EAAMF,CAAQ,CAAC,CAAC,CAAC,YAAc,CAClD,aAAaD,CAAM,CACrB,CAAC,CACH"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
require("./constants-
|
|
1
|
+
require("./constants-X86IDwkC.cjs");const e=require("./error-like-gGRx2s36.cjs"),t=require("./platform-DW3GFIUE.cjs"),n=require("./storm-CKuaBp7i.cjs");function r(t){if(e.r(t)){let e=(t.stack??``).split(`
|
|
2
2
|
`)[1]??``;return{message:t.message,key:`${t.name}|${t.message}|${e}`}}let n=String(t);return{message:n,key:`${typeof t}|${n}|`}}var i=class{ctx;name=`errors`;installed=!1;seen=new Map;window={start:0,count:0};constructor(e){this.ctx=e}install(){this.installed||typeof addEventListener>`u`||(this.installed=!0,addEventListener(`error`,this.onError,!0),addEventListener(`unhandledrejection`,this.onRejection))}uninstall(){this.installed&&(this.installed=!1,removeEventListener(`error`,this.onError,!0),removeEventListener(`unhandledrejection`,this.onRejection),this.seen.clear())}onError=e=>{let n=e.target,r=n?.src??n?.href??``;if(n!==null&&n!==globalThis&&r!==``){if(!this.ctx.config.capture.resourceErrors)return;let e=this.ctx.config.capture.fullUrls?r:t.r(r);this.ctx.breadcrumbs.push({t:Date.now(),category:`http`,message:`resource failed: ${e}`}),this.ctx.logger.warn(`resource failed to load`,{"error.type":`resource`,"resource.url":e,"resource.tag":n.tagName.toLowerCase()});return}if(!this.ctx.config.capture.errors)return;let i=e,a=i.message===``?`unknown error`:i.message,o=i.error??Error(a);this.report(`window.onerror`,o,{"error.source":i.filename,"error.line":i.lineno,"error.column":i.colno})};onRejection=e=>{this.ctx.config.capture.rejections&&this.report(`unhandledrejection`,e.reason,{"error.type":`unhandledrejection`})};report(e,t,i){if(!n.t(this.window,20,this.ctx.diagnostics,`errors`))return;let a=Date.now(),{message:o,key:s}=this.ctx.diagnostics.guard(`capture.record_failed`,`The library could not read the error reason. It records the error without its message.`,()=>r(t))??{message:``,key:`${typeof t}||`},c=this.seen.get(s);if(c&&a-c.at<5e3){c.count++,c.at=a;return}let l=c?c.count-1:0;if(this.seen.delete(s),this.seen.set(s,{at:a,count:1}),this.seen.size>200){let[e]=this.seen.keys();this.seen.delete(e)}let u=t===void 0?Error(o):t;this.ctx.logger.error(o===``?e:o,u,{...i,"error.captured_by":e,"error.suppressed_count":l})}};exports.ErrorCapture=i;
|
|
3
|
-
//# sourceMappingURL=errors-
|
|
3
|
+
//# sourceMappingURL=errors-BTWuVnHZ.cjs.map
|