@utk09/ui-observability 0.9.4 → 0.9.5
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 +45 -0
- package/README.md +122 -94
- package/dist/batch-BQFtb3i5.cjs +2 -0
- package/dist/batch-BQFtb3i5.cjs.map +1 -0
- package/dist/{batch-D-4xl7op.js → batch-BUJh-1jZ.js} +7 -5
- package/dist/batch-BUJh-1jZ.js.map +1 -0
- package/dist/bus/bus.d.ts +76 -2
- package/dist/bus/links.d.ts +9 -2
- package/dist/bus/validation.d.ts +7 -0
- package/dist/bus-BW6N-pY8.cjs +2 -0
- package/dist/bus-BW6N-pY8.cjs.map +1 -0
- package/dist/bus-DeOPHWaD.js +647 -0
- package/dist/bus-DeOPHWaD.js.map +1 -0
- package/dist/capture/storm.d.ts +2 -1
- package/dist/capture/types.d.ts +2 -0
- package/dist/{console-Boqa7new.cjs → console-Ce6heqZZ.cjs} +2 -2
- package/dist/console-Ce6heqZZ.cjs.map +1 -0
- package/dist/{console-BT7mcgU6.js → console-DbAZYJuy.js} +4 -4
- package/dist/console-DbAZYJuy.js.map +1 -0
- package/dist/constants-CN7GE1Lt.js +246 -0
- package/dist/constants-CN7GE1Lt.js.map +1 -0
- package/dist/constants-CW-MlHdY.cjs +2 -0
- package/dist/constants-CW-MlHdY.cjs.map +1 -0
- package/dist/constants.d.ts +29 -9
- package/dist/context-storage-BjzeBSxH.cjs +2 -0
- package/dist/context-storage-BjzeBSxH.cjs.map +1 -0
- package/dist/context-storage-DxZf4Gfh.js +52 -0
- package/dist/context-storage-DxZf4Gfh.js.map +1 -0
- package/dist/core/breadcrumbs.d.ts +7 -2
- package/dist/core/context.d.ts +2 -0
- package/dist/core/diagnostics.d.ts +11 -3
- package/dist/core/meter.d.ts +6 -1
- package/dist/core/pipeline.d.ts +29 -2
- package/dist/core/record.d.ts +2 -1
- package/dist/core/runtime.d.ts +91 -3
- package/dist/core/sampling.d.ts +3 -1
- package/dist/core/sender.d.ts +35 -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/emergency-queue-BYUyDHGD.js +69 -0
- package/dist/emergency-queue-BYUyDHGD.js.map +1 -0
- package/dist/emergency-queue-Cs1hrjsC.cjs +2 -0
- package/dist/emergency-queue-Cs1hrjsC.cjs.map +1 -0
- package/dist/{errors-BDI96zKc.js → errors-BhC7HTSt.js} +8 -9
- package/dist/errors-BhC7HTSt.js.map +1 -0
- package/dist/errors-CgY633cG.cjs +3 -0
- package/dist/errors-CgY633cG.cjs.map +1 -0
- package/dist/factory-C5TujXlU.js +280 -0
- package/dist/factory-C5TujXlU.js.map +1 -0
- package/dist/factory-CNj4DH3n.cjs +2 -0
- package/dist/factory-CNj4DH3n.cjs.map +1 -0
- package/dist/fixed-window-CtaFHanJ.js +12 -0
- package/dist/fixed-window-CtaFHanJ.js.map +1 -0
- package/dist/fixed-window-CvESpFYV.cjs +2 -0
- package/dist/fixed-window-CvESpFYV.cjs.map +1 -0
- package/dist/identity-8vKkyAWm.js +103 -0
- package/dist/identity-8vKkyAWm.js.map +1 -0
- package/dist/identity-Da9TkuKd.cjs +2 -0
- package/dist/identity-Da9TkuKd.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +45 -7
- package/dist/index.js +908 -529
- package/dist/index.js.map +1 -1
- package/dist/indexeddb-storage-BTfIFRHF.cjs +2 -0
- package/dist/indexeddb-storage-BTfIFRHF.cjs.map +1 -0
- package/dist/{indexeddb-storage-HgkQUTyS.js → indexeddb-storage-CCA1LvtO.js} +33 -18
- package/dist/indexeddb-storage-CCA1LvtO.js.map +1 -0
- package/dist/{interactions-Ck01cEij.js → interactions-BUDLxbv1.js} +16 -12
- package/dist/interactions-BUDLxbv1.js.map +1 -0
- package/dist/interactions-NHbLKrqe.cjs +2 -0
- package/dist/interactions-NHbLKrqe.cjs.map +1 -0
- package/dist/{journey-DRK0A8u_.js → journey-BUJ4WJxP.js} +12 -12
- package/dist/{journey-DRK0A8u_.js.map → journey-BUJ4WJxP.js.map} +1 -1
- package/dist/{journey-Co9OlzrW.cjs → journey-B_tTnvac.cjs} +2 -2
- package/dist/{journey-Co9OlzrW.cjs.map → journey-B_tTnvac.cjs.map} +1 -1
- package/dist/keys-BHhw_0Wh.cjs +2 -0
- package/dist/keys-BHhw_0Wh.cjs.map +1 -0
- package/dist/keys-D5r_GH9q.js +17 -0
- package/dist/keys-D5r_GH9q.js.map +1 -0
- package/dist/{library-request-ChCar5F8.js → library-request-BKOcaKtQ.js} +2 -2
- package/dist/{library-request-ChCar5F8.js.map → library-request-BKOcaKtQ.js.map} +1 -1
- package/dist/{library-request-gMFOCNcn.cjs → library-request-BaZOi4eg.cjs} +2 -2
- package/dist/{library-request-gMFOCNcn.cjs.map → library-request-BaZOi4eg.cjs.map} +1 -1
- package/dist/{long-frames-Bky6nZDF.cjs → long-frames-CF3qiSAX.cjs} +2 -2
- package/dist/long-frames-CF3qiSAX.cjs.map +1 -0
- package/dist/{long-frames-DDumopji.js → long-frames-DI5ypfAF.js} +5 -5
- package/dist/long-frames-DI5ypfAF.js.map +1 -0
- package/dist/models/batch.d.ts +4 -0
- package/dist/models/bus.d.ts +32 -9
- package/dist/models/config.d.ts +347 -9
- package/dist/models/drop.d.ts +1 -1
- package/dist/models/health.d.ts +27 -0
- package/dist/models/storage.d.ts +13 -0
- package/dist/network-CF8UO5PK.cjs +2 -0
- package/dist/network-CF8UO5PK.cjs.map +1 -0
- package/dist/{network-BsBZ6_-Q.js → network-DdzXDI3J.js} +18 -16
- package/dist/network-DdzXDI3J.js.map +1 -0
- package/dist/openfin-BwEN0uj4.js.map +1 -1
- package/dist/openfin-DtH2f7zX.cjs.map +1 -1
- package/dist/{platform-4yYjMD-B.js → platform-Bw1btWCT.js} +16 -10
- package/dist/platform-Bw1btWCT.js.map +1 -0
- package/dist/platform-DBSKTvFn.cjs +2 -0
- package/dist/platform-DBSKTvFn.cjs.map +1 -0
- package/dist/{remote-rules-1KqfVBIu.js → remote-rules-DIcC5vVC.js} +3 -3
- package/dist/{remote-rules-1KqfVBIu.js.map → remote-rules-DIcC5vVC.js.map} +1 -1
- package/dist/{remote-rules-BHgEGlYi.cjs → remote-rules-DpFmOef2.cjs} +2 -2
- package/dist/{remote-rules-BHgEGlYi.cjs.map → remote-rules-DpFmOef2.cjs.map} +1 -1
- package/dist/sampling-BVjspJWu.cjs +2 -0
- package/dist/sampling-BVjspJWu.cjs.map +1 -0
- package/dist/{sampling-nYIWP_vP.js → sampling-Cm3WhI0a.js} +26 -36
- package/dist/sampling-Cm3WhI0a.js.map +1 -0
- package/dist/{sanitize-BiUKCUG6.js → sanitize-C-ahCFsG.js} +2 -2
- package/dist/{sanitize-BiUKCUG6.js.map → sanitize-C-ahCFsG.js.map} +1 -1
- package/dist/{sanitize-BxuPSXOk.cjs → sanitize-DHucKGdi.cjs} +2 -2
- package/dist/{sanitize-BxuPSXOk.cjs.map → sanitize-DHucKGdi.cjs.map} +1 -1
- package/dist/sender-D3fRCR8d.cjs +3 -0
- package/dist/sender-D3fRCR8d.cjs.map +1 -0
- package/dist/sender-DUUmSglb.js +1163 -0
- package/dist/sender-DUUmSglb.js.map +1 -0
- package/dist/storage/context-storage.d.ts +89 -0
- package/dist/storage/emergency-queue.d.ts +9 -1
- package/dist/storage/factory.d.ts +7 -1
- package/dist/storage/idb-driver.d.ts +13 -0
- package/dist/storage/indexeddb-storage.d.ts +13 -0
- package/dist/storage/local-storage.d.ts +21 -1
- package/dist/storage/memory-storage.d.ts +13 -0
- package/dist/storage-BA9RqRO-.cjs +2 -0
- package/dist/storage-BA9RqRO-.cjs.map +1 -0
- package/dist/storage-w7Tslvlq.js +17 -0
- package/dist/storage-w7Tslvlq.js.map +1 -0
- package/dist/storm-CNZjsw4T.cjs +2 -0
- package/dist/storm-CNZjsw4T.cjs.map +1 -0
- package/dist/storm-Daq2jGHU.js +10 -0
- package/dist/storm-Daq2jGHU.js.map +1 -0
- package/dist/transport/retry-engine.d.ts +7 -2
- package/dist/transport/status-transport.d.ts +17 -0
- package/dist/types-BR9t_w28.js.map +1 -1
- package/dist/types-C7WNpnG1.cjs.map +1 -1
- package/dist/utils/fixed-window.d.ts +9 -0
- package/dist/utils/identity.d.ts +9 -2
- package/dist/utils/lock.d.ts +8 -0
- package/dist/utils/openfin.d.ts +1 -1
- package/dist/utils/platform.d.ts +3 -1
- package/dist/web-socket-BacvKOvD.cjs +2 -0
- package/dist/web-socket-BacvKOvD.cjs.map +1 -0
- package/dist/web-socket-CpsD8WAa.js +105 -0
- package/dist/web-socket-CpsD8WAa.js.map +1 -0
- package/package.json +1 -1
- package/dist/batch-C4oF6XZT.cjs +0 -2
- package/dist/batch-C4oF6XZT.cjs.map +0 -1
- package/dist/batch-D-4xl7op.js.map +0 -1
- package/dist/bus-Cyvq-Ngx.js +0 -478
- package/dist/bus-Cyvq-Ngx.js.map +0 -1
- package/dist/bus-rOhVuRee.cjs +0 -2
- package/dist/bus-rOhVuRee.cjs.map +0 -1
- package/dist/console-BT7mcgU6.js.map +0 -1
- package/dist/console-Boqa7new.cjs.map +0 -1
- package/dist/constants-BgRS6MB0.cjs +0 -2
- package/dist/constants-BgRS6MB0.cjs.map +0 -1
- package/dist/constants-L_d5YvvQ.js +0 -160
- package/dist/constants-L_d5YvvQ.js.map +0 -1
- package/dist/errors-BDI96zKc.js.map +0 -1
- package/dist/errors-_xEsCVXn.cjs +0 -3
- package/dist/errors-_xEsCVXn.cjs.map +0 -1
- package/dist/fixed-window-BR0bu32Y.cjs +0 -2
- package/dist/fixed-window-BR0bu32Y.cjs.map +0 -1
- package/dist/fixed-window-Re7jIRJH.js +0 -9
- package/dist/fixed-window-Re7jIRJH.js.map +0 -1
- package/dist/identity-Bwku7zzN.cjs +0 -2
- package/dist/identity-Bwku7zzN.cjs.map +0 -1
- package/dist/identity-Dtv917nz.js +0 -98
- package/dist/identity-Dtv917nz.js.map +0 -1
- package/dist/indexeddb-storage-Cvavrf-y.cjs +0 -2
- package/dist/indexeddb-storage-Cvavrf-y.cjs.map +0 -1
- package/dist/indexeddb-storage-HgkQUTyS.js.map +0 -1
- package/dist/interactions-Bhe1ft8P.cjs +0 -2
- package/dist/interactions-Bhe1ft8P.cjs.map +0 -1
- package/dist/interactions-Ck01cEij.js.map +0 -1
- package/dist/log-record-cwFiLyPY.js +0 -17
- package/dist/log-record-cwFiLyPY.js.map +0 -1
- package/dist/log-record-jX9eWUP8.cjs +0 -2
- package/dist/log-record-jX9eWUP8.cjs.map +0 -1
- package/dist/long-frames-Bky6nZDF.cjs.map +0 -1
- package/dist/long-frames-DDumopji.js.map +0 -1
- package/dist/network-BsBZ6_-Q.js.map +0 -1
- package/dist/network-_4csBGBM.cjs +0 -2
- package/dist/network-_4csBGBM.cjs.map +0 -1
- package/dist/platform-4yYjMD-B.js.map +0 -1
- package/dist/platform-o7r1ocOu.cjs +0 -2
- package/dist/platform-o7r1ocOu.cjs.map +0 -1
- package/dist/sampling-C4my-ma0.cjs +0 -2
- package/dist/sampling-C4my-ma0.cjs.map +0 -1
- package/dist/sampling-nYIWP_vP.js.map +0 -1
- package/dist/sender-6vrT9fFL.cjs +0 -3
- package/dist/sender-6vrT9fFL.cjs.map +0 -1
- package/dist/sender-DFQMF39P.js +0 -1351
- package/dist/sender-DFQMF39P.js.map +0 -1
- package/dist/storm-6YYbXzT_.cjs +0 -2
- package/dist/storm-6YYbXzT_.cjs.map +0 -1
- package/dist/storm-CfO0Sam2.js +0 -10
- package/dist/storm-CfO0Sam2.js.map +0 -1
- package/dist/web-socket-Ar4cZxmd.js +0 -102
- package/dist/web-socket-Ar4cZxmd.js.map +0 -1
- package/dist/web-socket-BwJdwSHl.cjs +0 -2
- package/dist/web-socket-BwJdwSHl.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-CN7GE1Lt.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","ECS_VERSION","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","JOURNEY_ID_PATTERN","JOURNEY_CLOCK_SKEW_MS","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","LOG_TYPE_SPAN","BUS_PROTOCOL","BUS_TYPE","RUNTIME_GLOBAL_KEY","RUNTIME_STOPPED_KEY","LIBRARY_REQUEST_KEY","LIBRARY_CONSOLE_KEY","TRANSPORT_CALL_KEY","ERROR_STORM_WINDOW_MS","ACTION_ATTRIBUTE_DEFAULT","CONSOLE_DEFAULT_STYLES","DURATION_PRECISION","GAP_REPORT_THROTTLE_MS","CAPTURE_NAMESPACE","STORAGE_NAMESPACE","DEFAULT_METRIC_UNIT","METRIC_NAMESPACE","ATTR_METRIC_OVERFLOW","METRIC_DEFAULT_BOUNDARIES","METRIC_KEYS","TRACE_NAMESPACE","SPAN_KEYS","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 build writes the version of package.json here.\n * @see {@link RESOURCE_TELEMETRY_SDK_VERSION}\n */\nexport const TELEMETRY_SDK_VERSION = __UIOBS_VERSION__;\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/** ECS version of the documents. The Elastic ECS logging libraries write this version. */\nexport const ECS_VERSION = \"8.10.0\";\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. Version 11 replaced Dexie. Version 12 adds the context index.\n * Dexie opened this database at ten times its declared version. A version below 11 makes\n * open() fail with VersionError for an existing installation. Then no code can read its batches.\n */\nexport const INDEXEDDB_SCHEMA_VERSION = 12;\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 length of a journey id from startJourney(), in characters. The token of a journey with this\n * id and a full name stays below the token limit.\n * @see {@link JOURNEY_TOKEN_MAX_CHARS}\n */\nexport const JOURNEY_ID_MAX_CHARS = 64;\n\n/**\n * Accepted journey id from startJourney(): letters, digits, \"_\", \".\", \":\" and \"-\". Each character\n * is one byte in UTF-8. A multibyte id makes the token larger than its limit.\n */\nexport const JOURNEY_ID_PATTERN = new RegExp(`^[\\\\w.:-]{1,${String(JOURNEY_ID_MAX_CHARS)}}$`);\n\n/**\n * Time that the start of a journey token can be ahead of this clock, in milliseconds. Two machines\n * can disagree on the time. A token further ahead never expires.\n */\nexport const JOURNEY_CLOCK_SKEW_MS = 5 * 60 * 1000;\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. A metric and a span are measurements.\n * The remote rate cap for records below minLevel does not apply to them.\n */\nexport const LEVEL_BYPASS_TYPES: readonly LogType[] = [\"action\", \"metric\", \"span\"];\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/** Record kind routed to the trace stream. */\nexport const LOG_TYPE_SPAN: LogType = \"span\";\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/2\";\n\n/**\n * Type tag of each bus message. Every frame must use the same values. The prefix makes a message\n * easy to identify in a postMessage log. The envelope tag BUS_PROTOCOL still separates the bus\n * from other traffic.\n */\nexport const BUS_TYPE = {\n hello: \"ui-observability.message.hello\",\n welcome: \"ui-observability.message.welcome\",\n records: \"ui-observability.message.records\",\n securityContext: \"ui-observability.message.security-context\",\n journey: \"ui-observability.message.journey\",\n journeyRequest: \"ui-observability.message.journey-request\",\n sampling: \"ui-observability.message.sampling\",\n samplingRequest: \"ui-observability.message.sampling-request\",\n tab: \"ui-observability.message.tab\",\n} as const;\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/** Global symbol key of the count of custom transport calls that wait for an answer. */\nexport const TRANSPORT_CALL_KEY = \"ui-observability.transport-calls\";\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 WebSocket events recorded in each storm window. A reconnect loop cannot flood the pipeline. */\nexport const WEBSOCKET_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/** Attribute that names a click action when the app sets no other attribute. */\nexport const ACTION_ATTRIBUTE_DEFAULT = \"data-observability-action\";\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/** Namespace of the points that the counter and histogram instruments give. */\nexport const METRIC_NAMESPACE = \"uiobs.metrics\";\n\n/** Maximum attribute sets of one instrument in one interval. More sets go to one overflow set. */\nexport const METRIC_MAX_SERIES = 100;\n\n/** Maximum bucket boundaries of one histogram. More boundaries make a large point. */\nexport const METRIC_MAX_BOUNDARIES = 50;\n\n/** Attribute of the overflow set. OpenTelemetry uses the same key. */\nexport const ATTR_METRIC_OVERFLOW = \"otel.metric.overflow\";\n\n/** Default histogram boundaries. They are the OpenTelemetry default boundaries. */\nexport const METRIC_DEFAULT_BOUNDARIES: readonly number[] = [\n 0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000,\n];\n\n/**\n * Attribute keys of an aggregated metric point. The OTLP metrics serializer reads them.\n * Sampling keeps each record with a start time. A sample of a sum gives a false sum.\n */\nexport const METRIC_KEYS = {\n start: \"metric.start_time_unix_nano\",\n attributeKeys: \"metric.attribute_keys\",\n count: \"metric.count\",\n sum: \"metric.sum\",\n min: \"metric.min\",\n max: \"metric.max\",\n bounds: \"metric.bounds\",\n buckets: \"metric.bucket_counts\",\n} as const;\n\n/** Namespace of the span records. */\nexport const TRACE_NAMESPACE = \"uiobs.traces\";\n\n/** Attribute keys of the span fields of a span record. The traces serializer reads them. */\nexport const SPAN_KEYS = {\n kind: \"span.kind\",\n parentId: \"span.parent_id\",\n start: \"span.start_time_unix_nano\",\n end: \"span.end_time_unix_nano\",\n status: \"span.status\",\n} as const;\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 \"contextProvider\",\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 \"capturePolicy\",\n \"metadata\",\n \"persistence\",\n \"diagnostics\",\n \"correlation\",\n \"metrics\",\n \"buffering\",\n \"delivery\",\n \"loggerCache\",\n \"securityContext\",\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 capturePolicy: [],\n metadata: [],\n persistence: [],\n diagnostics: [],\n correlation: [],\n metrics: [],\n buffering: [],\n delivery: [],\n loggerCache: [],\n securityContext: [],\n sampling: [],\n bus: [],\n journey: [],\n batching: [],\n retention: [],\n limits: [],\n capture: [\"webVitalsLoader\", \"urlTransform\"],\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/**\n * Max characters of an untrusted message type in a diagnostic detail. The sender sets the text.\n * The longest BUS_TYPE value has 41 characters. Each valid type then fits.\n */\nexport const BUS_TYPE_DETAIL_MAX_CHARS = 48;\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 capturePolicy: {\n breadcrumbs: MAX_BREADCRUMBS,\n errorDedupeMs: ERROR_DEDUPE_MS,\n maxErrorSignatures: MAX_TRACKED_ERROR_SIGNATURES,\n errorsPerWindow: 20,\n consolePerWindow: 20,\n longFramesPerWindow: 20,\n webSocketPerWindow: 20,\n windowMs: 10000,\n errorCeiling: ERROR_CEILING_MAX_PER_WINDOW,\n },\n metadata: { pageUrl: true, userAgent: true, openfin: true },\n persistence: { namespace: \"\" },\n diagnostics: { throttleMs: 1000, consoleFallback: false },\n correlation: {\n sessionIdleMs: SESSION_IDLE_MS,\n sessionTouchMs: SESSION_TOUCH_MS,\n traceMaxAgeMs: TRACE_MAX_AGE_MS,\n },\n metrics: {\n maxSeries: METRIC_MAX_SERIES,\n maxInstruments: 1000,\n maxHistogramBoundaries: METRIC_MAX_BOUNDARIES,\n },\n buffering: { maxPendingRecords: 10000, maxPendingBytes: 16777216, overflow: \"drop-oldest\" },\n delivery: {\n requestTimeoutMs: REQUEST_TIMEOUT_MS,\n maxConcurrentRequests: MAX_CONCURRENT_REQUESTS,\n retryBaseDelayMs: RETRY_BASE_DELAY_MS,\n retryMaxDelayMs: RETRY_MAX_DELAY_MS,\n retryIdleDelayMs: RETRY_IDLE_DELAY_MS,\n batchesPerDrain: BATCHES_PER_DRAIN,\n },\n lockConfiguration: false,\n loggerCache: { maxEntries: 256 },\n securityContext: { id: \"\", isolation: true },\n endpoint: \"\",\n metricsEndpoint: \"\",\n tracesEndpoint: \"\",\n serviceName: \"\",\n serviceVersion: \"\",\n environment: \"\",\n enabled: true,\n minLevel: \"INFO\",\n minLevels: {},\n processors: [],\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: {\n mode: \"auto\",\n trustedOrigins: [],\n openFinRole: \"auto\",\n sourcePolicy: \"registered\",\n validation: \"strict\",\n maxMessageBytes: 262144,\n maxRecordsPerMessage: 100,\n maxMessagesPerSecond: 100,\n maxTrackedSources: 256,\n },\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 httpMetrics: true,\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: [],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BAAA;EACA,SAAS;EACT,UAAU;EACV,YAAY,CAAC;EACb,wBAAwB,CAAC;EACzB,WAAW;EACX,SAAS,CAAC;CACZ;CACA,SAAS;EAAE,OAAO;EAAM,QAAQpC;CAAuB;AACzD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=18e5,t=6e4,ee=/OpenFin/i,te=/\bwv\b/,ne=/\b(iPhone|iPad|iPod)\b/,re=/\bMacintosh\b/,ie=/\bMobile\b/,n={TRACE:1,DEBUG:5,INFO:9,WARN:13,ERROR:17,FATAL:21},ae=n,r=`log.type`,i=`log.seq`,a=`app.namespace`,o=`page.url`,s=`url.full`,c=`journey.id`,l=`journey.name`,u=`journey.parent_id`,d=`uiobs.sanitize_failed`,f=`error.data`,p=`breadcrumbs`,m=`uiobs.attributes_dropped`,h=`uiobs.attributes_bytes`,g=`service.name`,_=`service.version`,v=`deployment.environment`,y=`telemetry.sdk.name`,b=`telemetry.sdk.version`,x=`telemetry.sdk.language`,S=`host.platform`,C=`session.id`,w=`tab.id`,T=`context.id`,E=`browser.user_agent`,D=`openfin.uuid`,O=`openfin.name`,k=`@utk09/ui-observability`,A=`0.9.5`,j=`webjs`,M=`otlp`,N={WARN:`warning`},P=`8.10.0`,F=`application/json`,I=`application/x-ndjson`,L=1000000n,R=/^\d+$/,z=`Content-Type`,B=`Content-Encoding`,V=`Retry-After`,H=`X-UiObs-Batch-Id`,U=`X-UiObs-Attempt`,W=`X-UiObs-Sampling`,G=`gzip`,K=1e3,q=6e4,J=`text/plain;charset=UTF-8`,oe=`uiobs_batch_id`,se=`uiobs_exit`,ce=`ui-observability.batch.`,le=`ui-observability.emergency.`,ue=`ui-observability.probe`,de=`QuotaExceededError`,fe=`batches`,pe=`createdAt`,me=`indexeddb`,he=`localstorage`,ge=`memory`,_e=`none`,ve=`ui-observability.drain`,ye=`ui-observability.emergency`,be=`ui-observability.journey`,xe=RegExp(`^[\\w.:-]{1,64}$`),Se=3e5,Y=2e3,Ce=`uiObsJourney`,we=/\+/g,Te=/\//g,Ee=/=+$/,De=/-/g,Oe=/_/g,X=3e5,ke=`traceparent`,Ae=2166136261,je=16777619,Me=4294967295,Ne=[`action`,`metric`,`span`],Pe=`metric`,Fe=`action`,Ie=`span`,Le=`ui-observability/2`,Re={hello:`ui-observability.message.hello`,welcome:`ui-observability.message.welcome`,records:`ui-observability.message.records`,securityContext:`ui-observability.message.security-context`,journey:`ui-observability.message.journey`,journeyRequest:`ui-observability.message.journey-request`,sampling:`ui-observability.message.sampling`,samplingRequest:`ui-observability.message.sampling-request`,tab:`ui-observability.message.tab`},ze=`ui-observability.runtime`,Be=`ui-observability.stopped`,Ve=`ui-observability.request-scope`,He=`ui-observability.console-scope`,Ue=`ui-observability.transport-calls`,We=1e4,Ge=`data-observability-action`,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`},Ke=1e3,qe=6e4,Je=`uiobs.capture`,Ye=`uiobs.storage`,Xe=`count`,Ze=`uiobs.metrics`,Qe=`otel.metric.overflow`,$e=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],et={start:`metric.start_time_unix_nano`,attributeKeys:`metric.attribute_keys`,count:`metric.count`,sum:`metric.sum`,min:`metric.min`,max:`metric.max`,bounds:`metric.bounds`,buckets:`metric.bucket_counts`},tt=`uiobs.traces`,nt={kind:`span.kind`,parentId:`span.parent_id`,start:`span.start_time_unix_nano`,end:`span.end_time_unix_nano`,status:`span.status`},rt=`unknown-service`,it=4096,at=36e5,ot=3e4,st=[`contextProvider`,`redact`,`onDiagnostic`,`onDrop`,`headers`,`serializer`,`otelLoader`,`transport`,`transportOnExit`],ct=[`capturePolicy`,`metadata`,`persistence`,`diagnostics`,`correlation`,`metrics`,`buffering`,`delivery`,`loggerCache`,`securityContext`,`sampling`,`bus`,`journey`,`batching`,`retention`,`limits`,`capture`],lt={capturePolicy:[],metadata:[],persistence:[],diagnostics:[],correlation:[],metrics:[],buffering:[],delivery:[],loggerCache:[],securityContext:[],sampling:[],bus:[],journey:[],batching:[],retention:[],limits:[],capture:[`webVitalsLoader`,`urlTransform`]},ut=`DEBUG`,dt=2e3,ft=1e4,pt=15e3,mt=1024,ht=`UiObservability`,gt={maxBatches:500,maxAgeMs:864e5,maxAttempts:5},_t=1e4,vt=2e3,yt=6e4,bt=3e4,Q=18e5,xt=`__uiobs_journey`,St=`ui_observability_control`,Ct=1500,wt=2e3,Tt=5e3,$={maxBodyChars:4096,maxAttributeChars:8192,maxAttributeCount:128,maxStackChars:8192,maxDepth:6,maxArrayLength:100,maxNodes:1e4,maxRecordBytes:32768},Et={capturePolicy:{breadcrumbs:50,errorDedupeMs:Tt,maxErrorSignatures:200,errorsPerWindow:20,consolePerWindow:20,longFramesPerWindow:20,webSocketPerWindow:20,windowMs:1e4,errorCeiling:500},metadata:{pageUrl:!0,userAgent:!0,openfin:!0},persistence:{namespace:``},diagnostics:{throttleMs:1e3,consoleFallback:!1},correlation:{sessionIdleMs:e,sessionTouchMs:t,traceMaxAgeMs:X},metrics:{maxSeries:100,maxInstruments:1e3,maxHistogramBoundaries:50},buffering:{maxPendingRecords:1e4,maxPendingBytes:16777216,overflow:`drop-oldest`},delivery:{requestTimeoutMs:pt,maxConcurrentRequests:2,retryBaseDelayMs:vt,retryMaxDelayMs:yt,retryIdleDelayMs:bt,batchesPerDrain:20},lockConfiguration:!1,loggerCache:{maxEntries:256},securityContext:{id:``,isolation:!0},endpoint:``,metricsEndpoint:``,tracesEndpoint:``,serviceName:``,serviceVersion:``,environment:``,enabled:!0,minLevel:`INFO`,minLevels:{},processors:[],compression:`gzip`,credentials:`omit`,storage:`auto`,identity:`storage`,sampling:{defaultRate:1,rates:{},alwaysSampleTypes:[`action`],remote:!1,remoteMaxRate:1},bus:{mode:`auto`,trustedOrigins:[],openFinRole:`auto`,sourcePolicy:`registered`,validation:`strict`,maxMessageBytes:262144,maxRecordsPerMessage:100,maxMessagesPerSecond:100,maxTrackedSources:256},journey:{scope:`auto`,maxAgeMs:Q},batching:{logFlushIntervalMs:dt,logBatchSize:100,metricFlushIntervalMs:ft,metricBatchSize:500},retention:{mode:`limited`,...gt},limits:{...$},capture:{errors:!0,rejections:!0,resourceErrors:!1,fetch:!1,xhr:!1,httpMetrics:!0,interactions:!1,navigation:!1,webVitals:!1,longFrames:!1,longFrameThresholdMs:100,console:!1,fullUrls:!1,ignoreUrls:[],propagateTraceHeaderTo:[],webSocket:!1,plugins:[]},console:{level:null,styles:Z}};Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"$t",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(exports,"At",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"Bt",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"Cn",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"Ct",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"Dn",{enumerable:!0,get:function(){return 2048}}),Object.defineProperty(exports,"Dt",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(exports,"En",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,"Et",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"Ft",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"Gt",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"Ht",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"It",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"Jt",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"Kt",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(exports,"Lt",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"Mt",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"Nt",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"On",{enumerable:!0,get:function(){return`AppleWebKit`}}),Object.defineProperty(exports,"Ot",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"Pt",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"Qt",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"Rt",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"Sn",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"St",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(exports,"Tn",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"Tt",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"Ut",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"Vt",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"Wt",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"Xt",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"Yt",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"Zt",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"_n",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"_t",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"an",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"bn",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"cn",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"dn",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"en",{enumerable:!0,get:function(){return`Safari/`}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"fn",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"gn",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return`[ui-observability]`}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"hn",{enumerable:!0,get:function(){return`ui-observability.tab`}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"in",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return 55296}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,"jt",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"kt",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"ln",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"mn",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"nn",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"on",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"pn",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"qt",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"rn",{enumerable:!0,get:function(){return`ui-observability.session`}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return 56319}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"sn",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"tn",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"un",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"vn",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"vt",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,"wn",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"wt",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"xn",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"xt",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"yn",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"yt",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,"zt",{enumerable:!0,get:function(){return E}});
|
|
2
|
+
//# sourceMappingURL=constants-CW-MlHdY.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-CW-MlHdY.cjs","names":["SESSION_IDLE_MS","SESSION_TOUCH_MS","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","ECS_VERSION","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","JOURNEY_ID_PATTERN","JOURNEY_CLOCK_SKEW_MS","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","LOG_TYPE_SPAN","BUS_PROTOCOL","BUS_TYPE","RUNTIME_GLOBAL_KEY","RUNTIME_STOPPED_KEY","LIBRARY_REQUEST_KEY","LIBRARY_CONSOLE_KEY","TRANSPORT_CALL_KEY","ERROR_STORM_WINDOW_MS","ACTION_ATTRIBUTE_DEFAULT","CONSOLE_DEFAULT_STYLES","DURATION_PRECISION","GAP_REPORT_THROTTLE_MS","CAPTURE_NAMESPACE","STORAGE_NAMESPACE","DEFAULT_METRIC_UNIT","METRIC_NAMESPACE","ATTR_METRIC_OVERFLOW","METRIC_DEFAULT_BOUNDARIES","METRIC_KEYS","TRACE_NAMESPACE","SPAN_KEYS","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 build writes the version of package.json here.\n * @see {@link RESOURCE_TELEMETRY_SDK_VERSION}\n */\nexport const TELEMETRY_SDK_VERSION = __UIOBS_VERSION__;\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/** ECS version of the documents. The Elastic ECS logging libraries write this version. */\nexport const ECS_VERSION = \"8.10.0\";\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. Version 11 replaced Dexie. Version 12 adds the context index.\n * Dexie opened this database at ten times its declared version. A version below 11 makes\n * open() fail with VersionError for an existing installation. Then no code can read its batches.\n */\nexport const INDEXEDDB_SCHEMA_VERSION = 12;\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 length of a journey id from startJourney(), in characters. The token of a journey with this\n * id and a full name stays below the token limit.\n * @see {@link JOURNEY_TOKEN_MAX_CHARS}\n */\nexport const JOURNEY_ID_MAX_CHARS = 64;\n\n/**\n * Accepted journey id from startJourney(): letters, digits, \"_\", \".\", \":\" and \"-\". Each character\n * is one byte in UTF-8. A multibyte id makes the token larger than its limit.\n */\nexport const JOURNEY_ID_PATTERN = new RegExp(`^[\\\\w.:-]{1,${String(JOURNEY_ID_MAX_CHARS)}}$`);\n\n/**\n * Time that the start of a journey token can be ahead of this clock, in milliseconds. Two machines\n * can disagree on the time. A token further ahead never expires.\n */\nexport const JOURNEY_CLOCK_SKEW_MS = 5 * 60 * 1000;\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. A metric and a span are measurements.\n * The remote rate cap for records below minLevel does not apply to them.\n */\nexport const LEVEL_BYPASS_TYPES: readonly LogType[] = [\"action\", \"metric\", \"span\"];\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/** Record kind routed to the trace stream. */\nexport const LOG_TYPE_SPAN: LogType = \"span\";\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/2\";\n\n/**\n * Type tag of each bus message. Every frame must use the same values. The prefix makes a message\n * easy to identify in a postMessage log. The envelope tag BUS_PROTOCOL still separates the bus\n * from other traffic.\n */\nexport const BUS_TYPE = {\n hello: \"ui-observability.message.hello\",\n welcome: \"ui-observability.message.welcome\",\n records: \"ui-observability.message.records\",\n securityContext: \"ui-observability.message.security-context\",\n journey: \"ui-observability.message.journey\",\n journeyRequest: \"ui-observability.message.journey-request\",\n sampling: \"ui-observability.message.sampling\",\n samplingRequest: \"ui-observability.message.sampling-request\",\n tab: \"ui-observability.message.tab\",\n} as const;\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/** Global symbol key of the count of custom transport calls that wait for an answer. */\nexport const TRANSPORT_CALL_KEY = \"ui-observability.transport-calls\";\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 WebSocket events recorded in each storm window. A reconnect loop cannot flood the pipeline. */\nexport const WEBSOCKET_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/** Attribute that names a click action when the app sets no other attribute. */\nexport const ACTION_ATTRIBUTE_DEFAULT = \"data-observability-action\";\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/** Namespace of the points that the counter and histogram instruments give. */\nexport const METRIC_NAMESPACE = \"uiobs.metrics\";\n\n/** Maximum attribute sets of one instrument in one interval. More sets go to one overflow set. */\nexport const METRIC_MAX_SERIES = 100;\n\n/** Maximum bucket boundaries of one histogram. More boundaries make a large point. */\nexport const METRIC_MAX_BOUNDARIES = 50;\n\n/** Attribute of the overflow set. OpenTelemetry uses the same key. */\nexport const ATTR_METRIC_OVERFLOW = \"otel.metric.overflow\";\n\n/** Default histogram boundaries. They are the OpenTelemetry default boundaries. */\nexport const METRIC_DEFAULT_BOUNDARIES: readonly number[] = [\n 0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000,\n];\n\n/**\n * Attribute keys of an aggregated metric point. The OTLP metrics serializer reads them.\n * Sampling keeps each record with a start time. A sample of a sum gives a false sum.\n */\nexport const METRIC_KEYS = {\n start: \"metric.start_time_unix_nano\",\n attributeKeys: \"metric.attribute_keys\",\n count: \"metric.count\",\n sum: \"metric.sum\",\n min: \"metric.min\",\n max: \"metric.max\",\n bounds: \"metric.bounds\",\n buckets: \"metric.bucket_counts\",\n} as const;\n\n/** Namespace of the span records. */\nexport const TRACE_NAMESPACE = \"uiobs.traces\";\n\n/** Attribute keys of the span fields of a span record. The traces serializer reads them. */\nexport const SPAN_KEYS = {\n kind: \"span.kind\",\n parentId: \"span.parent_id\",\n start: \"span.start_time_unix_nano\",\n end: \"span.end_time_unix_nano\",\n status: \"span.status\",\n} as const;\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 \"contextProvider\",\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 \"capturePolicy\",\n \"metadata\",\n \"persistence\",\n \"diagnostics\",\n \"correlation\",\n \"metrics\",\n \"buffering\",\n \"delivery\",\n \"loggerCache\",\n \"securityContext\",\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 capturePolicy: [],\n metadata: [],\n persistence: [],\n diagnostics: [],\n correlation: [],\n metrics: [],\n buffering: [],\n delivery: [],\n loggerCache: [],\n securityContext: [],\n sampling: [],\n bus: [],\n journey: [],\n batching: [],\n retention: [],\n limits: [],\n capture: [\"webVitalsLoader\", \"urlTransform\"],\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/**\n * Max characters of an untrusted message type in a diagnostic detail. The sender sets the text.\n * The longest BUS_TYPE value has 41 characters. Each valid type then fits.\n */\nexport const BUS_TYPE_DETAIL_MAX_CHARS = 48;\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 capturePolicy: {\n breadcrumbs: MAX_BREADCRUMBS,\n errorDedupeMs: ERROR_DEDUPE_MS,\n maxErrorSignatures: MAX_TRACKED_ERROR_SIGNATURES,\n errorsPerWindow: 20,\n consolePerWindow: 20,\n longFramesPerWindow: 20,\n webSocketPerWindow: 20,\n windowMs: 10000,\n errorCeiling: ERROR_CEILING_MAX_PER_WINDOW,\n },\n metadata: { pageUrl: true, userAgent: true, openfin: true },\n persistence: { namespace: \"\" },\n diagnostics: { throttleMs: 1000, consoleFallback: false },\n correlation: {\n sessionIdleMs: SESSION_IDLE_MS,\n sessionTouchMs: SESSION_TOUCH_MS,\n traceMaxAgeMs: TRACE_MAX_AGE_MS,\n },\n metrics: {\n maxSeries: METRIC_MAX_SERIES,\n maxInstruments: 1000,\n maxHistogramBoundaries: METRIC_MAX_BOUNDARIES,\n },\n buffering: { maxPendingRecords: 10000, maxPendingBytes: 16777216, overflow: \"drop-oldest\" },\n delivery: {\n requestTimeoutMs: REQUEST_TIMEOUT_MS,\n maxConcurrentRequests: MAX_CONCURRENT_REQUESTS,\n retryBaseDelayMs: RETRY_BASE_DELAY_MS,\n retryMaxDelayMs: RETRY_MAX_DELAY_MS,\n retryIdleDelayMs: RETRY_IDLE_DELAY_MS,\n batchesPerDrain: BATCHES_PER_DRAIN,\n },\n lockConfiguration: false,\n loggerCache: { maxEntries: 256 },\n securityContext: { id: \"\", isolation: true },\n endpoint: \"\",\n metricsEndpoint: \"\",\n tracesEndpoint: \"\",\n serviceName: \"\",\n serviceVersion: \"\",\n environment: \"\",\n enabled: true,\n minLevel: \"INFO\",\n minLevels: {},\n processors: [],\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: {\n mode: \"auto\",\n trustedOrigins: [],\n openFinRole: \"auto\",\n sourcePolicy: \"registered\",\n validation: \"strict\",\n maxMessageBytes: 262144,\n maxRecordsPerMessage: 100,\n maxMessagesPerSecond: 100,\n maxTrackedSources: 256,\n },\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 httpMetrics: true,\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 webSoc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,CACzD"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -242,12 +242,11 @@ export declare const QUOTA_EVICTION_DIVISOR = 4;
|
|
|
242
242
|
/** DOMException name for a full store. */
|
|
243
243
|
export declare const QUOTA_EXCEEDED_ERROR = "QuotaExceededError";
|
|
244
244
|
/**
|
|
245
|
-
* Native IndexedDB version.
|
|
246
|
-
*
|
|
247
|
-
* fail with VersionError for an existing installation. Then no code can read
|
|
248
|
-
* batches in that database.
|
|
245
|
+
* Native IndexedDB version. Version 11 replaced Dexie. Version 12 adds the context index.
|
|
246
|
+
* Dexie opened this database at ten times its declared version. A version below 11 makes
|
|
247
|
+
* open() fail with VersionError for an existing installation. Then no code can read its batches.
|
|
249
248
|
*/
|
|
250
|
-
export declare const INDEXEDDB_SCHEMA_VERSION =
|
|
249
|
+
export declare const INDEXEDDB_SCHEMA_VERSION = 12;
|
|
251
250
|
/** IndexedDB object store that holds batches. Dexie set this name before the library removed it. */
|
|
252
251
|
export declare const INDEXEDDB_STORE_NAME = "batches";
|
|
253
252
|
/** Index on the batch store that orders reads by creation time. */
|
|
@@ -358,7 +357,23 @@ export declare const LOG_TYPE_ACTION: LogType;
|
|
|
358
357
|
/** Record kind routed to the trace stream. */
|
|
359
358
|
export declare const LOG_TYPE_SPAN: LogType;
|
|
360
359
|
/** Protocol identifier for bus envelopes. The bus drops an envelope with a different version. */
|
|
361
|
-
export declare const BUS_PROTOCOL = "ui-observability/
|
|
360
|
+
export declare const BUS_PROTOCOL = "ui-observability/2";
|
|
361
|
+
/**
|
|
362
|
+
* Type tag of each bus message. Every frame must use the same values. The prefix makes a message
|
|
363
|
+
* easy to identify in a postMessage log. The envelope tag BUS_PROTOCOL still separates the bus
|
|
364
|
+
* from other traffic.
|
|
365
|
+
*/
|
|
366
|
+
export declare const BUS_TYPE: {
|
|
367
|
+
readonly hello: "ui-observability.message.hello";
|
|
368
|
+
readonly welcome: "ui-observability.message.welcome";
|
|
369
|
+
readonly records: "ui-observability.message.records";
|
|
370
|
+
readonly securityContext: "ui-observability.message.security-context";
|
|
371
|
+
readonly journey: "ui-observability.message.journey";
|
|
372
|
+
readonly journeyRequest: "ui-observability.message.journey-request";
|
|
373
|
+
readonly sampling: "ui-observability.message.sampling";
|
|
374
|
+
readonly samplingRequest: "ui-observability.message.sampling-request";
|
|
375
|
+
readonly tab: "ui-observability.message.tab";
|
|
376
|
+
};
|
|
362
377
|
/** Global window property key used to locate a same-origin runtime instance. */
|
|
363
378
|
export declare const RUNTIME_GLOBAL_KEY = "ui-observability.runtime";
|
|
364
379
|
/** Global key of the runtime that shutdown() stopped. Calls go to it until the next configure(). */
|
|
@@ -391,6 +406,8 @@ export declare const CONSOLE_BREADCRUMB_MAX_CHARS = 200;
|
|
|
391
406
|
export declare const MAX_TRACKED_ERROR_SIGNATURES = 200;
|
|
392
407
|
/** Maximum character length retained from clicked element text in breadcrumbs. */
|
|
393
408
|
export declare const CLICK_TEXT_MAX_CHARS = 50;
|
|
409
|
+
/** Attribute that names a click action when the app sets no other attribute. */
|
|
410
|
+
export declare const ACTION_ATTRIBUTE_DEFAULT = "data-observability-action";
|
|
394
411
|
/** Maximum character length retained from an aria-label attribute in generated selectors. */
|
|
395
412
|
export declare const ARIA_LABEL_MAX_CHARS = 40;
|
|
396
413
|
/** Maximum class names included per element in generated CSS selectors. */
|
|
@@ -471,7 +488,7 @@ export declare const UNDEFAULTED_CONFIG_KEYS: readonly ["contextProvider", "reda
|
|
|
471
488
|
* Nested config section keys.
|
|
472
489
|
* @see {@link ResolvedConfig}
|
|
473
490
|
*/
|
|
474
|
-
export declare const CONFIG_SECTIONS: readonly ["sampling", "bus", "journey", "batching", "retention", "limits", "capture"];
|
|
491
|
+
export declare const CONFIG_SECTIONS: readonly ["capturePolicy", "metadata", "persistence", "diagnostics", "correlation", "metrics", "buffering", "delivery", "loggerCache", "securityContext", "sampling", "bus", "journey", "batching", "retention", "limits", "capture"];
|
|
475
492
|
/**
|
|
476
493
|
* Section keys with no default, excluded from their section of `DEFAULT_CONFIG`.
|
|
477
494
|
* @see {@link UNDEFAULTED_CONFIG_KEYS}
|
|
@@ -530,8 +547,11 @@ export declare const BUS_MAX_BOOT_BUFFER_RECORDS = 500;
|
|
|
530
547
|
export declare const BUS_MAX_BOOT_BUFFER_ACTIONS = 2000;
|
|
531
548
|
/** Max different values in each list of an onDrop summary. */
|
|
532
549
|
export declare const DROP_SUMMARY_MAX_ITEMS = 20;
|
|
533
|
-
/**
|
|
534
|
-
|
|
550
|
+
/**
|
|
551
|
+
* Max characters of an untrusted message type in a diagnostic detail. The sender sets the text.
|
|
552
|
+
* The longest BUS_TYPE value has 41 characters. Each valid type then fits.
|
|
553
|
+
*/
|
|
554
|
+
export declare const BUS_TYPE_DETAIL_MAX_CHARS = 48;
|
|
535
555
|
/** Breadcrumbs kept as context for the next error. */
|
|
536
556
|
export declare const MAX_BREADCRUMBS = 50;
|
|
537
557
|
/**
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=class{store;policy;namespace;name;active=!0;discard=!1;constructor(e,t,n=``){this.store=e,this.policy=t,this.namespace=n,this.name=e.name}accepts(e){return(e.persistenceNamespace??``)===this.namespace&&(!this.policy.isolation||!this.policy.id||e.routingContextId===this.policy.id)}async save(e){this.active&&this.accepts(e)&&(await this.store.save(e),this.discard&&await this.store.remove(e.id))}async take(e){return this.isolated()?this.store.takeContext?this.store.takeContext(this.policy.id,e):(await this.store.take(4294967295)).filter(e=>this.accepts(e)).slice(0,e):(await this.store.take(e)).filter(e=>this.accepts(e))}isolated(){return this.policy.isolation&&this.policy.id!==``}remove(e){return this.store.remove(e)}bumpAttempts(e,t){return this.store.bumpAttempts(e,t)}prune(){return this.store.prune()}async count(){return this.isolated()?this.store.countContext?this.store.countContext(this.policy.id):(await this.take(2**53-1)).length:this.store.count()}async clear(){for(let e of await this.take(2**53-1))await this.store.remove(e.id)}async retire(e){this.active=!1,this.discard=e,e&&await this.clear(),this.name!==`memory`&&await this.close()}clearNamespace(){return this.store.clear()}close(){return this.store.close()}};exports.ContextStorage=e;
|
|
2
|
+
//# sourceMappingURL=context-storage-BjzeBSxH.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-storage-BjzeBSxH.cjs","names":["ContextStorage","store","policy","namespace","batch","limit","id","attempts","discard"],"sources":["../src/storage/context-storage.ts"],"sourcesContent":["// src/storage/context-storage.ts\n//\n// Gives access to stored batches of one delivery context and one application namespace.\n\nimport type { SecurityContextOptions } from \"../models/config\";\nimport type { LogBatch } from \"../models/batch\";\nimport type { StorageAdapter } from \"../models/storage\";\n\n/** Gives access to one part of the shared store. Records of other contexts stay stored. */\nexport class ContextStorage implements StorageAdapter {\n /** Adapter name of the underlying store. */\n readonly name: string;\n /** False after this context store stops accepting writes. */\n private active = true;\n /** True if a late save must remove its batch after it completes. */\n private discard = false;\n\n /**\n * Builds access to one application namespace and delivery context.\n * @param store Underlying batch store.\n * @param policy Active context id and isolation rule.\n * @param namespace Application storage namespace.\n */\n constructor(\n private readonly store: StorageAdapter,\n private readonly policy: SecurityContextOptions,\n readonly namespace = \"\",\n ) {\n this.name = store.name;\n }\n\n /**\n * Checks if a batch belongs to the permitted namespace and context.\n * @param batch Batch to check.\n * @returns True if this adapter can accept the batch.\n */\n accepts(batch: LogBatch): boolean {\n return (\n (batch.persistenceNamespace ?? \"\") === this.namespace &&\n (!this.policy.isolation || !this.policy.id || batch.routingContextId === this.policy.id)\n );\n }\n\n /**\n * Stores a batch of this context. A late save removes its batch after a discard.\n * @param batch Batch to store.\n * @returns Promise that resolves when the save and any removal complete.\n */\n async save(batch: LogBatch): Promise<void> {\n if (!this.active || !this.accepts(batch)) return;\n await this.store.save(batch);\n // A slow save can complete after the context change cleared these records.\n if (this.discard) await this.store.remove(batch.id);\n }\n\n /**\n * Reads stored batches of this context, oldest first.\n * @param limit Maximum batches to return.\n * @returns Batches in creation order. The method does not remove them.\n */\n async take(limit: number): Promise<LogBatch[]> {\n // Read only this part of the store. A full read on each retry pass parses all contexts.\n if (!this.isolated()) {\n return (await this.store.take(limit)).filter((batch) => this.accepts(batch));\n }\n\n if (this.store.takeContext) {\n return this.store.takeContext(this.policy.id, limit);\n }\n\n const all = await this.store.take(0xffffffff);\n return all.filter((batch) => this.accepts(batch)).slice(0, limit);\n }\n\n /**\n * Checks if reads are limited to the active context.\n * @returns True if isolation is on and the context has an id.\n */\n private isolated(): boolean {\n return this.policy.isolation && this.policy.id !== \"\";\n }\n\n /**\n * Removes one stored batch.\n * @param id Batch id.\n * @returns Promise that resolves when removal completes.\n */\n remove(id: string): Promise<void> {\n return this.store.remove(id);\n }\n\n /**\n * Changes the attempt count of a stored batch.\n * @param id Batch id.\n * @param attempts Total attempt count to store.\n * @returns Promise that resolves when the change completes.\n */\n bumpAttempts(id: string, attempts: number): Promise<void> {\n return this.store.bumpAttempts(id, attempts);\n }\n\n /**\n * Applies the retention and capacity limits of the underlying store.\n * @returns Summary of the batches and records removed.\n */\n prune(): ReturnType<StorageAdapter[\"prune\"]> {\n return this.store.prune();\n }\n\n /**\n * Counts stored batches of this context.\n * @returns Number of batches in this context.\n */\n async count(): Promise<number> {\n if (!this.isolated()) {\n return this.store.count();\n }\n\n if (this.store.countContext) {\n return this.store.countContext(this.policy.id);\n }\n\n return (await this.take(Number.MAX_SAFE_INTEGER)).length;\n }\n\n /**\n * Removes stored batches of this context.\n * @returns Promise that resolves when removal completes.\n */\n async clear(): Promise<void> {\n for (const batch of await this.take(Number.MAX_SAFE_INTEGER)) await this.store.remove(batch.id);\n }\n\n /**\n * Stops new writes and clears this context if required. Other contexts can keep the memory store.\n * @param discard True to remove this context before closing the store.\n * @returns Promise that resolves when removal and closure complete.\n */\n async retire(discard: boolean): Promise<void> {\n this.active = false;\n this.discard = discard;\n if (discard) await this.clear();\n // Keep the memory store for later context changes. It can hold records of other contexts.\n if (this.name !== \"memory\") await this.close();\n }\n\n /**\n * Removes all batches in the application namespace.\n * @returns Promise that resolves when removal completes.\n */\n clearNamespace(): Promise<void> {\n return this.store.clear();\n }\n\n /**\n * Closes the underlying store.\n * @returns Promise that resolves when closure completes.\n */\n close(): Promise<void> {\n return this.store.close();\n }\n}\n"],"mappings":"AASA,IAAaA,EAAb,KAAsD,CAejC,MACA,OACR,UAfX,KAEA,OAAiB,GAEjB,QAAkB,GAQlB,YACE,EACA,EACA,EAAqB,GACrB,CAHiB,KAAA,MAAAC,EACA,KAAA,OAAAC,EACR,KAAA,UAAAC,EAET,KAAK,KAAOF,EAAM,IACpB,CAOA,QAAQ,EAA0B,CAChC,OACGG,EAAM,sBAAwB,MAAQ,KAAK,YAC3C,CAAC,KAAK,OAAO,WAAa,CAAC,KAAK,OAAO,IAAMA,EAAM,mBAAqB,KAAK,OAAO,GAEzF,CAOA,MAAM,KAAK,EAAgC,CACpC,KAAK,QAAW,KAAK,QAAQA,CAAK,IACvC,MAAM,KAAK,MAAM,KAAKA,CAAK,EAEvB,KAAK,SAAS,MAAM,KAAK,MAAM,OAAOA,EAAM,EAAE,EACpD,CAOA,MAAM,KAAK,EAAoC,CAW7C,OATK,KAAK,SAAS,EAIf,KAAK,MAAM,YACN,KAAK,MAAM,YAAY,KAAK,OAAO,GAAIC,CAAK,GAI9C,MADW,KAAK,MAAM,KAAK,UAAU,EAAA,CACjC,OAAQ,GAAU,KAAK,QAAQD,CAAK,CAAC,CAAC,CAAC,MAAM,EAAGC,CAAK,GARtD,MAAM,KAAK,MAAM,KAAKA,CAAK,EAAA,CAAG,OAAQ,GAAU,KAAK,QAAQD,CAAK,CAAC,CAS/E,CAMA,UAA4B,CAC1B,OAAO,KAAK,OAAO,WAAa,KAAK,OAAO,KAAO,EACrD,CAOA,OAAO,EAA2B,CAChC,OAAO,KAAK,MAAM,OAAOE,CAAE,CAC7B,CAQA,aAAa,EAAY,EAAiC,CACxD,OAAO,KAAK,MAAM,aAAaA,EAAIC,CAAQ,CAC7C,CAMA,OAA6C,CAC3C,OAAO,KAAK,MAAM,MAAM,CAC1B,CAMA,MAAM,OAAyB,CAS7B,OARK,KAAK,SAAS,EAIf,KAAK,MAAM,aACN,KAAK,MAAM,aAAa,KAAK,OAAO,EAAE,GAGvC,MAAM,KAAK,YAA4B,EAAA,CAAG,OAPzC,KAAK,MAAM,MAAM,CAQ5B,CAMA,MAAM,OAAuB,CAC3B,IAAK,IAAMH,KAAS,MAAM,KAAK,YAA4B,EAAG,MAAM,KAAK,MAAM,OAAOA,EAAM,EAAE,CAChG,CAOA,MAAM,OAAO,EAAiC,CAC5C,KAAK,OAAS,GACd,KAAK,QAAUI,EACXA,GAAS,MAAM,KAAK,MAAM,EAE1B,KAAK,OAAS,UAAU,MAAM,KAAK,MAAM,CAC/C,CAMA,gBAAgC,CAC9B,OAAO,KAAK,MAAM,MAAM,CAC1B,CAMA,OAAuB,CACrB,OAAO,KAAK,MAAM,MAAM,CAC1B,CACF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//#region src/storage/context-storage.ts
|
|
2
|
+
var e = class {
|
|
3
|
+
store;
|
|
4
|
+
policy;
|
|
5
|
+
namespace;
|
|
6
|
+
name;
|
|
7
|
+
active = !0;
|
|
8
|
+
discard = !1;
|
|
9
|
+
constructor(e, t, n = "") {
|
|
10
|
+
this.store = e, this.policy = t, this.namespace = n, this.name = e.name;
|
|
11
|
+
}
|
|
12
|
+
accepts(e) {
|
|
13
|
+
return (e.persistenceNamespace ?? "") === this.namespace && (!this.policy.isolation || !this.policy.id || e.routingContextId === this.policy.id);
|
|
14
|
+
}
|
|
15
|
+
async save(e) {
|
|
16
|
+
this.active && this.accepts(e) && (await this.store.save(e), this.discard && await this.store.remove(e.id));
|
|
17
|
+
}
|
|
18
|
+
async take(e) {
|
|
19
|
+
return this.isolated() ? this.store.takeContext ? this.store.takeContext(this.policy.id, e) : (await this.store.take(4294967295)).filter((e) => this.accepts(e)).slice(0, e) : (await this.store.take(e)).filter((e) => this.accepts(e));
|
|
20
|
+
}
|
|
21
|
+
isolated() {
|
|
22
|
+
return this.policy.isolation && this.policy.id !== "";
|
|
23
|
+
}
|
|
24
|
+
remove(e) {
|
|
25
|
+
return this.store.remove(e);
|
|
26
|
+
}
|
|
27
|
+
bumpAttempts(e, t) {
|
|
28
|
+
return this.store.bumpAttempts(e, t);
|
|
29
|
+
}
|
|
30
|
+
prune() {
|
|
31
|
+
return this.store.prune();
|
|
32
|
+
}
|
|
33
|
+
async count() {
|
|
34
|
+
return this.isolated() ? this.store.countContext ? this.store.countContext(this.policy.id) : (await this.take(2 ** 53 - 1)).length : this.store.count();
|
|
35
|
+
}
|
|
36
|
+
async clear() {
|
|
37
|
+
for (let e of await this.take(2 ** 53 - 1)) await this.store.remove(e.id);
|
|
38
|
+
}
|
|
39
|
+
async retire(e) {
|
|
40
|
+
this.active = !1, this.discard = e, e && await this.clear(), this.name !== "memory" && await this.close();
|
|
41
|
+
}
|
|
42
|
+
clearNamespace() {
|
|
43
|
+
return this.store.clear();
|
|
44
|
+
}
|
|
45
|
+
close() {
|
|
46
|
+
return this.store.close();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { e as ContextStorage };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=context-storage-DxZf4Gfh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-storage-DxZf4Gfh.js","names":["ContextStorage","store","policy","namespace","batch","limit","id","attempts","discard"],"sources":["../src/storage/context-storage.ts"],"sourcesContent":["// src/storage/context-storage.ts\n//\n// Gives access to stored batches of one delivery context and one application namespace.\n\nimport type { SecurityContextOptions } from \"../models/config\";\nimport type { LogBatch } from \"../models/batch\";\nimport type { StorageAdapter } from \"../models/storage\";\n\n/** Gives access to one part of the shared store. Records of other contexts stay stored. */\nexport class ContextStorage implements StorageAdapter {\n /** Adapter name of the underlying store. */\n readonly name: string;\n /** False after this context store stops accepting writes. */\n private active = true;\n /** True if a late save must remove its batch after it completes. */\n private discard = false;\n\n /**\n * Builds access to one application namespace and delivery context.\n * @param store Underlying batch store.\n * @param policy Active context id and isolation rule.\n * @param namespace Application storage namespace.\n */\n constructor(\n private readonly store: StorageAdapter,\n private readonly policy: SecurityContextOptions,\n readonly namespace = \"\",\n ) {\n this.name = store.name;\n }\n\n /**\n * Checks if a batch belongs to the permitted namespace and context.\n * @param batch Batch to check.\n * @returns True if this adapter can accept the batch.\n */\n accepts(batch: LogBatch): boolean {\n return (\n (batch.persistenceNamespace ?? \"\") === this.namespace &&\n (!this.policy.isolation || !this.policy.id || batch.routingContextId === this.policy.id)\n );\n }\n\n /**\n * Stores a batch of this context. A late save removes its batch after a discard.\n * @param batch Batch to store.\n * @returns Promise that resolves when the save and any removal complete.\n */\n async save(batch: LogBatch): Promise<void> {\n if (!this.active || !this.accepts(batch)) return;\n await this.store.save(batch);\n // A slow save can complete after the context change cleared these records.\n if (this.discard) await this.store.remove(batch.id);\n }\n\n /**\n * Reads stored batches of this context, oldest first.\n * @param limit Maximum batches to return.\n * @returns Batches in creation order. The method does not remove them.\n */\n async take(limit: number): Promise<LogBatch[]> {\n // Read only this part of the store. A full read on each retry pass parses all contexts.\n if (!this.isolated()) {\n return (await this.store.take(limit)).filter((batch) => this.accepts(batch));\n }\n\n if (this.store.takeContext) {\n return this.store.takeContext(this.policy.id, limit);\n }\n\n const all = await this.store.take(0xffffffff);\n return all.filter((batch) => this.accepts(batch)).slice(0, limit);\n }\n\n /**\n * Checks if reads are limited to the active context.\n * @returns True if isolation is on and the context has an id.\n */\n private isolated(): boolean {\n return this.policy.isolation && this.policy.id !== \"\";\n }\n\n /**\n * Removes one stored batch.\n * @param id Batch id.\n * @returns Promise that resolves when removal completes.\n */\n remove(id: string): Promise<void> {\n return this.store.remove(id);\n }\n\n /**\n * Changes the attempt count of a stored batch.\n * @param id Batch id.\n * @param attempts Total attempt count to store.\n * @returns Promise that resolves when the change completes.\n */\n bumpAttempts(id: string, attempts: number): Promise<void> {\n return this.store.bumpAttempts(id, attempts);\n }\n\n /**\n * Applies the retention and capacity limits of the underlying store.\n * @returns Summary of the batches and records removed.\n */\n prune(): ReturnType<StorageAdapter[\"prune\"]> {\n return this.store.prune();\n }\n\n /**\n * Counts stored batches of this context.\n * @returns Number of batches in this context.\n */\n async count(): Promise<number> {\n if (!this.isolated()) {\n return this.store.count();\n }\n\n if (this.store.countContext) {\n return this.store.countContext(this.policy.id);\n }\n\n return (await this.take(Number.MAX_SAFE_INTEGER)).length;\n }\n\n /**\n * Removes stored batches of this context.\n * @returns Promise that resolves when removal completes.\n */\n async clear(): Promise<void> {\n for (const batch of await this.take(Number.MAX_SAFE_INTEGER)) await this.store.remove(batch.id);\n }\n\n /**\n * Stops new writes and clears this context if required. Other contexts can keep the memory store.\n * @param discard True to remove this context before closing the store.\n * @returns Promise that resolves when removal and closure complete.\n */\n async retire(discard: boolean): Promise<void> {\n this.active = false;\n this.discard = discard;\n if (discard) await this.clear();\n // Keep the memory store for later context changes. It can hold records of other contexts.\n if (this.name !== \"memory\") await this.close();\n }\n\n /**\n * Removes all batches in the application namespace.\n * @returns Promise that resolves when removal completes.\n */\n clearNamespace(): Promise<void> {\n return this.store.clear();\n }\n\n /**\n * Closes the underlying store.\n * @returns Promise that resolves when closure completes.\n */\n close(): Promise<void> {\n return this.store.close();\n }\n}\n"],"mappings":";AASA,IAAaA,IAAb,MAAsD;CAejC;CACA;CACR;CAfX;CAEA,SAAiB;CAEjB,UAAkB;CAQlB,YACE,GACA,GACA,IAAqB,IACrB;EACA,AAJiB,KAAA,QAAAC,GACA,KAAA,SAAAC,GACR,KAAA,YAAAC,GAET,KAAK,OAAOF,EAAM;CACpB;CAOA,QAAQ,GAA0B;EAChC,QACGG,EAAM,wBAAwB,QAAQ,KAAK,cAC3C,CAAC,KAAK,OAAO,aAAa,CAAC,KAAK,OAAO,MAAMA,EAAM,qBAAqB,KAAK,OAAO;CAEzF;CAOA,MAAM,KAAK,GAAgC;EACzC,AAAK,KAAK,UAAW,KAAK,QAAQA,CAAK,MACvC,MAAM,KAAK,MAAM,KAAKA,CAAK,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Breadcrumb {
|
|
|
14
14
|
/** Ring buffer of fixed size. It keeps recent breadcrumbs in time order. */
|
|
15
15
|
export declare class BreadcrumbBuffer {
|
|
16
16
|
/** Storage array of the ring buffer. */
|
|
17
|
-
private
|
|
17
|
+
private buffer;
|
|
18
18
|
/** Next write index in the circular buffer. */
|
|
19
19
|
private pointer;
|
|
20
20
|
/**
|
|
@@ -23,11 +23,16 @@ export declare class BreadcrumbBuffer {
|
|
|
23
23
|
*/
|
|
24
24
|
private filled;
|
|
25
25
|
/** Maximum number of breadcrumbs that the buffer keeps. */
|
|
26
|
-
private
|
|
26
|
+
private capacity;
|
|
27
27
|
/**
|
|
28
28
|
* @param capacity Maximum number of breadcrumbs. A smaller value changes to the minimum size.
|
|
29
29
|
*/
|
|
30
30
|
constructor(capacity: number);
|
|
31
|
+
/**
|
|
32
|
+
* Changes the capacity and keeps the most recent breadcrumbs that fit.
|
|
33
|
+
* @param capacity New capacity. Set 0 to remove and disable stored breadcrumbs.
|
|
34
|
+
*/
|
|
35
|
+
resize(capacity: number): void;
|
|
31
36
|
/**
|
|
32
37
|
* Adds a breadcrumb. When the buffer is full, the new breadcrumb replaces the oldest one.
|
|
33
38
|
* @param crumb Breadcrumb to add.
|
package/dist/core/context.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export declare class ContextStore {
|
|
|
18
18
|
* @param key Attribute key to remove.
|
|
19
19
|
*/
|
|
20
20
|
remove(key: string): void;
|
|
21
|
+
/** Removes all ambient context attributes. */
|
|
22
|
+
clear(): void;
|
|
21
23
|
/**
|
|
22
24
|
* Returns a copy of all ambient context attributes. The copy prevents a merge
|
|
23
25
|
* target or a sanitizer from changing the store.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Closed set of diagnostic event codes emitted by library subsystems. */
|
|
2
|
-
export type DiagnosticCode = "config.invalid" | "config.reconfigured" | "record.sanitize_failed" | "record.truncated" | "record.dropped_by_level" | "record.dropped_by_sampling" | "record.dropped_by_ceiling" | "record.dropped_by_processor" | "record.dropped_by_redact" | "record.dropped_boot_buffer_full" | "record.dropped_malformed" | "record.dropped_no_destination" | "runtime.version_mismatch" | "journey.expired" | "journey.adopted" | "journey.token_too_large" | "trace.otel_failed" | "bus.role_resolved" | "bus.no_owner" | "bus.handshake_timeout" | "bus.untrusted_origin" | "bus.send_failed" | "transport.http_error" | "transport.timeout" | "transport.batch_split" | "transport.throttled" | "transport.dropped_permanent" | "transport.rejected_credentials" | "transport.serialize_failed" | "storage.unavailable" | "storage.degraded" | "storage.quota_exceeded" | "storage.evicted" | "storage.dead_lettered" | "pipeline.crashed" | "capture.install_failed" | "capture.rate_limited" | "capture.header_failed" | "capture.record_failed" | "capture.transport_request" | "openfin.unavailable" | "platform.api_blocked" | "handler.threw";
|
|
2
|
+
export type DiagnosticCode = "config.locked" | "security.rotated" | "security.context_mismatch" | "record.dropped_during_rotation" | "bus.rejected_message" | "config.invalid" | "config.reconfigured" | "record.sanitize_failed" | "record.truncated" | "record.dropped_by_level" | "record.dropped_by_sampling" | "record.dropped_by_ceiling" | "record.dropped_by_processor" | "record.dropped_by_redact" | "record.dropped_boot_buffer_full" | "record.dropped_malformed" | "record.dropped_no_destination" | "runtime.version_mismatch" | "journey.expired" | "journey.adopted" | "journey.token_too_large" | "trace.otel_failed" | "bus.role_resolved" | "bus.no_owner" | "bus.handshake_timeout" | "bus.untrusted_origin" | "bus.send_failed" | "transport.http_error" | "transport.timeout" | "transport.batch_split" | "transport.throttled" | "transport.dropped_permanent" | "transport.rejected_credentials" | "transport.serialize_failed" | "storage.unavailable" | "storage.degraded" | "storage.quota_exceeded" | "storage.evicted" | "storage.dead_lettered" | "pipeline.crashed" | "capture.install_failed" | "capture.rate_limited" | "capture.header_failed" | "capture.record_failed" | "capture.transport_request" | "openfin.unavailable" | "platform.api_blocked" | "handler.threw";
|
|
3
3
|
/** Diagnostic event payload dispatched to consumer handlers. */
|
|
4
4
|
export interface DiagnosticEvent {
|
|
5
5
|
/** Diagnostic fault code. */
|
|
@@ -20,7 +20,8 @@ export type DiagnosticHandler = (event: DiagnosticEvent) => void;
|
|
|
20
20
|
/** Reports internal errors. It limits the dispatch rate but counts every event. */
|
|
21
21
|
export declare class Diagnostics {
|
|
22
22
|
private handler?;
|
|
23
|
-
private
|
|
23
|
+
private throttleMs;
|
|
24
|
+
private consoleFallback;
|
|
24
25
|
/** Running occurrence counts per diagnostic code. */
|
|
25
26
|
private readonly counters;
|
|
26
27
|
/** Timestamp of last emitted event per code in epoch milliseconds. */
|
|
@@ -28,8 +29,15 @@ export declare class Diagnostics {
|
|
|
28
29
|
/**
|
|
29
30
|
* @param handler Optional diagnostic event listener callback.
|
|
30
31
|
* @param throttleMs Minimum duration in milliseconds between emitted events for a single code.
|
|
32
|
+
* @param consoleFallback True to print a fixed warning if the diagnostic handler throws.
|
|
31
33
|
*/
|
|
32
|
-
constructor(handler?: DiagnosticHandler | undefined, throttleMs?: number);
|
|
34
|
+
constructor(handler?: DiagnosticHandler | undefined, throttleMs?: number, consoleFallback?: boolean);
|
|
35
|
+
/**
|
|
36
|
+
* Changes the report interval and the console fallback rule.
|
|
37
|
+
* @param throttleMs Minimum wait between reports of one code, in milliseconds.
|
|
38
|
+
* @param consoleFallback True to print a fixed warning if the handler throws.
|
|
39
|
+
*/
|
|
40
|
+
setPolicy(throttleMs: number, consoleFallback: boolean): void;
|
|
33
41
|
/**
|
|
34
42
|
* Updates or removes the active diagnostic event handler.
|
|
35
43
|
* @param handler New diagnostic event handler.
|
package/dist/core/meter.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare class Meter {
|
|
|
23
23
|
private readonly intervalMs;
|
|
24
24
|
private readonly emit;
|
|
25
25
|
private readonly diagnostics;
|
|
26
|
+
private readonly policy;
|
|
26
27
|
/** Instruments with a value in the current interval. */
|
|
27
28
|
private readonly instruments;
|
|
28
29
|
/** Timer of the current interval. It runs only while a value waits. */
|
|
@@ -35,7 +36,11 @@ export declare class Meter {
|
|
|
35
36
|
* metric fields.
|
|
36
37
|
* @param diagnostics Diagnostics reporter.
|
|
37
38
|
*/
|
|
38
|
-
constructor(intervalMs: () => number, emit: (name: string, attributes: MetricAttributes, fields: Record<string, unknown>) => void, diagnostics: Diagnostics
|
|
39
|
+
constructor(intervalMs: () => number, emit: (name: string, attributes: MetricAttributes, fields: Record<string, unknown>) => void, diagnostics: Diagnostics, policy?: {
|
|
40
|
+
maxSeries: number;
|
|
41
|
+
maxInstruments: number;
|
|
42
|
+
maxHistogramBoundaries: number;
|
|
43
|
+
});
|
|
39
44
|
/**
|
|
40
45
|
* Adds a value to the series of its attribute set. It never throws into the call of the app.
|
|
41
46
|
* @param def Definition of the instrument.
|
package/dist/core/pipeline.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ResolvedConfig } from "../models/config";
|
|
2
|
+
import type { LossReporter } from "../models/drop";
|
|
1
3
|
import type { LogBatch } from "../models/batch";
|
|
2
4
|
import { type LogRecord } from "../models/log-record";
|
|
3
5
|
import type { StorageAdapter } from "../models/storage";
|
|
@@ -19,6 +21,9 @@ export declare class LogPipeline {
|
|
|
19
21
|
private readonly storage;
|
|
20
22
|
private readonly retry;
|
|
21
23
|
private readonly diagnostics;
|
|
24
|
+
private readonly routingContextId?;
|
|
25
|
+
private readonly policy?;
|
|
26
|
+
private readonly onLoss;
|
|
22
27
|
/** Buffer instances for logs and metrics streams. */
|
|
23
28
|
private readonly streams;
|
|
24
29
|
/** In-flight batches without delivery confirmation. The exit flush sends them again. */
|
|
@@ -29,12 +34,34 @@ export declare class LogPipeline {
|
|
|
29
34
|
private readonly open;
|
|
30
35
|
/** Ceiling on the ERROR and FATAL records that bypass sampling. */
|
|
31
36
|
private readonly ceiling;
|
|
32
|
-
/**
|
|
37
|
+
/** Requests that have not completed. delivery.maxConcurrentRequests sets their limit. */
|
|
33
38
|
private inFlight;
|
|
34
39
|
/** It is true when a pump is in the queue. One microtask then drains a burst. */
|
|
35
40
|
private pumpScheduled;
|
|
36
41
|
/** True after destroy() stops the pipeline. */
|
|
37
42
|
private stopped;
|
|
43
|
+
/** Encoded byte count of each record in the buffers or requests. */
|
|
44
|
+
private readonly held;
|
|
45
|
+
/** Total encoded bytes of the held records. */
|
|
46
|
+
private heldBytes;
|
|
47
|
+
/** True while the overflow storage operation has not completed. */
|
|
48
|
+
private persisting;
|
|
49
|
+
/**
|
|
50
|
+
* Removes completed or dropped records from the buffer counts.
|
|
51
|
+
* @param records Records to remove from the counts.
|
|
52
|
+
*/
|
|
53
|
+
private release;
|
|
54
|
+
/**
|
|
55
|
+
* Removes records that have not reached the transport. A request already sent cannot be removed.
|
|
56
|
+
* @returns True if the method removed a batch or a buffered group.
|
|
57
|
+
*/
|
|
58
|
+
private evict;
|
|
59
|
+
/**
|
|
60
|
+
* Checks the buffer limits and applies the overflow rule.
|
|
61
|
+
* @param record New record to add.
|
|
62
|
+
* @returns True if the record can enter the live buffer.
|
|
63
|
+
*/
|
|
64
|
+
private admit;
|
|
38
65
|
/**
|
|
39
66
|
* @param transport HTTP transport for live batch delivery.
|
|
40
67
|
* @param storage Storage adapter for offline batch persistence.
|
|
@@ -42,7 +69,7 @@ export declare class LogPipeline {
|
|
|
42
69
|
* @param diagnostics Diagnostics reporter.
|
|
43
70
|
* @param streamOptions Batching policy per stream, from the batching config.
|
|
44
71
|
*/
|
|
45
|
-
constructor(transport: BatchTransport, storage: StorageAdapter, retry: RetryEngine, diagnostics: Diagnostics, streamOptions: Record<StreamName, StreamOptions
|
|
72
|
+
constructor(transport: BatchTransport, storage: StorageAdapter, retry: RetryEngine, diagnostics: Diagnostics, streamOptions: Record<StreamName, StreamOptions>, routingContextId?: (() => string | undefined) | undefined, policy?: ResolvedConfig | undefined, onLoss?: LossReporter);
|
|
46
73
|
/**
|
|
47
74
|
* Sets the observed timestamp and adds a record to the pipeline.
|
|
48
75
|
* @param record Record to push.
|