@utk09/ui-observability 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -0
- package/README.md +75 -48
- package/dist/batch-DEK4bv9N.js +31 -0
- package/dist/batch-DEK4bv9N.js.map +1 -0
- package/dist/batch-DEVFs28i.cjs +2 -0
- package/dist/batch-DEVFs28i.cjs.map +1 -0
- package/dist/bus/bus.d.ts +46 -12
- package/dist/bus/links.d.ts +6 -3
- package/dist/bus-DNFvTkif.cjs +2 -0
- package/dist/bus-DNFvTkif.cjs.map +1 -0
- package/dist/{bus-DPDrlUBY.js → bus-HVQ8E72V.js} +128 -71
- package/dist/bus-HVQ8E72V.js.map +1 -0
- package/dist/capture/interactions.d.ts +7 -6
- package/dist/capture/network.d.ts +23 -9
- package/dist/capture/types.d.ts +3 -3
- package/dist/console-C9Y639mn.js +82 -0
- package/dist/console-C9Y639mn.js.map +1 -0
- package/dist/console-DssDxq1B.cjs +2 -0
- package/dist/console-DssDxq1B.cjs.map +1 -0
- package/dist/constants-N99w84xy.js +117 -0
- package/dist/constants-N99w84xy.js.map +1 -0
- package/dist/constants-X86IDwkC.cjs +2 -0
- package/dist/constants-X86IDwkC.cjs.map +1 -0
- package/dist/constants.d.ts +36 -18
- package/dist/core/diagnostics.d.ts +2 -2
- package/dist/core/drops.d.ts +29 -0
- package/dist/core/hold-buffer.d.ts +27 -0
- package/dist/core/journey.d.ts +16 -4
- package/dist/core/logger.d.ts +6 -2
- package/dist/core/pipeline.d.ts +20 -16
- package/dist/core/record.d.ts +11 -6
- package/dist/core/remote-sampling.d.ts +1 -1
- package/dist/core/runtime.d.ts +87 -23
- package/dist/core/sender.d.ts +19 -11
- 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/error-like-Ywo5uRHo.js +19 -0
- package/dist/error-like-Ywo5uRHo.js.map +1 -0
- package/dist/error-like-gGRx2s36.cjs +2 -0
- package/dist/error-like-gGRx2s36.cjs.map +1 -0
- package/dist/errors-BTWuVnHZ.cjs +3 -0
- package/dist/errors-BTWuVnHZ.cjs.map +1 -0
- package/dist/{errors-Dnc-X4Ec.js → errors-CQusIGWJ.js} +39 -20
- package/dist/errors-CQusIGWJ.js.map +1 -0
- package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
- package/dist/global-scope-dp2jADRl.js.map +1 -1
- package/dist/identity-B1GDS1Tb.cjs +2 -0
- package/dist/identity-B1GDS1Tb.cjs.map +1 -0
- package/dist/identity-D4DPjTM9.js +88 -0
- package/dist/identity-D4DPjTM9.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.js +720 -446
- package/dist/index.js.map +1 -1
- package/dist/{indexeddb-storage-uD4oaRMc.js → indexeddb-storage-B8SGUzSV.js} +88 -59
- package/dist/indexeddb-storage-B8SGUzSV.js.map +1 -0
- package/dist/indexeddb-storage-ukzC82dm.cjs +2 -0
- package/dist/indexeddb-storage-ukzC82dm.cjs.map +1 -0
- package/dist/interactions-CcxrVzpg.cjs +2 -0
- package/dist/interactions-CcxrVzpg.cjs.map +1 -0
- package/dist/{interactions-igKTAJvj.js → interactions-CnjfQgw3.js} +22 -19
- package/dist/interactions-CnjfQgw3.js.map +1 -0
- package/dist/journey-DjvDzHyp.js +163 -0
- package/dist/journey-DjvDzHyp.js.map +1 -0
- package/dist/journey-DxlfdFJV.cjs +2 -0
- package/dist/journey-DxlfdFJV.cjs.map +1 -0
- package/dist/{library-request-Br_T09Bn.cjs → library-request-BZ1ekVtl.cjs} +2 -2
- package/dist/{library-request-Br_T09Bn.cjs.map → library-request-BZ1ekVtl.cjs.map} +1 -1
- package/dist/{library-request-Dt0fXhcn.js → library-request-C8kc5YWv.js} +2 -2
- package/dist/{library-request-Dt0fXhcn.js.map → library-request-C8kc5YWv.js.map} +1 -1
- package/dist/{long-frames-DahhqM6u.cjs → long-frames-BGik_Yhy.cjs} +2 -2
- package/dist/{long-frames-DahhqM6u.cjs.map → long-frames-BGik_Yhy.cjs.map} +1 -1
- package/dist/{long-frames-6pnjWSSR.js → long-frames-CZk3XOkH.js} +3 -3
- package/dist/{long-frames-6pnjWSSR.js.map → long-frames-CZk3XOkH.js.map} +1 -1
- package/dist/models/batch.d.ts +15 -1
- package/dist/models/bus.d.ts +7 -4
- package/dist/models/config.d.ts +189 -12
- package/dist/models/drop.d.ts +39 -0
- package/dist/models/log-record.d.ts +12 -6
- package/dist/models/storage.d.ts +15 -3
- package/dist/network-51iicpLl.js +174 -0
- package/dist/network-51iicpLl.js.map +1 -0
- package/dist/network-jBbjyAJP.cjs +2 -0
- package/dist/network-jBbjyAJP.cjs.map +1 -0
- package/dist/patch-BX8KrPCT.cjs +2 -0
- package/dist/patch-BX8KrPCT.cjs.map +1 -0
- package/dist/patch-CCWfuEY7.js +9 -0
- package/dist/patch-CCWfuEY7.js.map +1 -0
- package/dist/platform-Cjts-8k8.js +48 -0
- package/dist/platform-Cjts-8k8.js.map +1 -0
- package/dist/{platform-D_XkVIF6.cjs → platform-DW3GFIUE.cjs} +2 -2
- package/dist/platform-DW3GFIUE.cjs.map +1 -0
- package/dist/{remote-rules-rJJZKVG8.cjs → remote-rules-ByS34k4e.cjs} +2 -2
- package/dist/remote-rules-ByS34k4e.cjs.map +1 -0
- package/dist/{remote-rules-5UA23alm.js → remote-rules-M-XZ1xbe.js} +14 -14
- package/dist/remote-rules-M-XZ1xbe.js.map +1 -0
- package/dist/sampling-BN3Oi6SV.js +63 -0
- package/dist/sampling-BN3Oi6SV.js.map +1 -0
- package/dist/sampling-b2ck5X98.cjs +2 -0
- package/dist/sampling-b2ck5X98.cjs.map +1 -0
- package/dist/sanitize-DKp5MRsa.cjs +2 -0
- package/dist/sanitize-DKp5MRsa.cjs.map +1 -0
- package/dist/sanitize-Dwj9JCkI.js +123 -0
- package/dist/sanitize-Dwj9JCkI.js.map +1 -0
- package/dist/{sender-G6v4Uqi4.js → sender-BBY0IcUo.js} +439 -322
- package/dist/sender-BBY0IcUo.js.map +1 -0
- package/dist/sender-BXoAZKum.cjs +3 -0
- package/dist/sender-BXoAZKum.cjs.map +1 -0
- package/dist/storage/emergency-queue.d.ts +5 -2
- package/dist/storage/eviction.d.ts +40 -0
- package/dist/storage/factory.d.ts +1 -1
- package/dist/storage/idb-driver.d.ts +7 -1
- package/dist/storage/indexeddb-storage.d.ts +13 -5
- package/dist/storage/local-storage.d.ts +27 -4
- package/dist/storage/memory-storage.d.ts +10 -3
- package/dist/{storm-BtzgLOCX.cjs → storm-CKuaBp7i.cjs} +2 -2
- package/dist/{storm-BtzgLOCX.cjs.map → storm-CKuaBp7i.cjs.map} +1 -1
- package/dist/{storm-DJkEZP_8.js → storm-DhtL2eVr.js} +2 -2
- package/dist/{storm-DJkEZP_8.js.map → storm-DhtL2eVr.js.map} +1 -1
- package/dist/transport/compression.d.ts +1 -1
- package/dist/transport/exit-flush.d.ts +27 -17
- package/dist/transport/http-transport.d.ts +61 -7
- package/dist/transport/retry-engine.d.ts +12 -8
- package/dist/transport/status-transport.d.ts +8 -3
- package/dist/utils/console.d.ts +5 -2
- package/dist/utils/error-like.d.ts +25 -0
- package/dist/utils/global-scope.d.ts +1 -1
- package/dist/utils/identity.d.ts +1 -1
- package/dist/utils/library-console.d.ts +1 -1
- package/dist/utils/library-request.d.ts +1 -1
- package/dist/utils/patch.d.ts +9 -0
- package/dist/utils/platform.d.ts +3 -3
- package/dist/utils/sequence.d.ts +0 -5
- package/dist/utils/timer.d.ts +1 -1
- package/dist/utils/tracing.d.ts +3 -3
- package/dist/utils/unref.d.ts +2 -2
- package/dist/{web-vitals-DHZ0yA_H.js → web-vitals-Bflr5jSA.js} +4 -2
- package/dist/web-vitals-Bflr5jSA.js.map +1 -0
- package/dist/web-vitals-DFuoTQbZ.cjs +2 -0
- package/dist/web-vitals-DFuoTQbZ.cjs.map +1 -0
- package/package.json +2 -2
- package/dist/bus-CUXRY0JR.cjs +0 -2
- package/dist/bus-CUXRY0JR.cjs.map +0 -1
- package/dist/bus-DPDrlUBY.js.map +0 -1
- package/dist/console-CNljJict.js +0 -81
- package/dist/console-CNljJict.js.map +0 -1
- package/dist/console-PKzc-FmR.cjs +0 -2
- package/dist/console-PKzc-FmR.cjs.map +0 -1
- package/dist/constants-B28fDv2F.cjs +0 -2
- package/dist/constants-B28fDv2F.cjs.map +0 -1
- package/dist/constants-Bu49bm39.js +0 -93
- package/dist/constants-Bu49bm39.js.map +0 -1
- package/dist/errors-C78ZTjet.cjs +0 -3
- package/dist/errors-C78ZTjet.cjs.map +0 -1
- package/dist/errors-Dnc-X4Ec.js.map +0 -1
- package/dist/indexeddb-storage-D0p3iMD0.cjs +0 -2
- package/dist/indexeddb-storage-D0p3iMD0.cjs.map +0 -1
- package/dist/indexeddb-storage-uD4oaRMc.js.map +0 -1
- package/dist/interactions-CsE2y_fQ.cjs +0 -2
- package/dist/interactions-CsE2y_fQ.cjs.map +0 -1
- package/dist/interactions-igKTAJvj.js.map +0 -1
- package/dist/network-CZ0aFUsy.cjs +0 -2
- package/dist/network-CZ0aFUsy.cjs.map +0 -1
- package/dist/network-aSNbwpue.js +0 -112
- package/dist/network-aSNbwpue.js.map +0 -1
- package/dist/platform-BwbMRwHm.js +0 -48
- package/dist/platform-BwbMRwHm.js.map +0 -1
- package/dist/platform-D_XkVIF6.cjs.map +0 -1
- package/dist/remote-rules-5UA23alm.js.map +0 -1
- package/dist/remote-rules-rJJZKVG8.cjs.map +0 -1
- package/dist/sampling-E4x92Nn2.cjs +0 -2
- package/dist/sampling-E4x92Nn2.cjs.map +0 -1
- package/dist/sampling-J1eahbfT.js +0 -160
- package/dist/sampling-J1eahbfT.js.map +0 -1
- package/dist/sanitize-BMhh8ghJ.cjs +0 -2
- package/dist/sanitize-BMhh8ghJ.cjs.map +0 -1
- package/dist/sanitize-UJ-4Lb0n.js +0 -114
- package/dist/sanitize-UJ-4Lb0n.js.map +0 -1
- package/dist/sender-B6ufz26f.cjs +0 -3
- package/dist/sender-B6ufz26f.cjs.map +0 -1
- package/dist/sender-G6v4Uqi4.js.map +0 -1
- package/dist/unref-16maCyKA.js +0 -8
- package/dist/unref-16maCyKA.js.map +0 -1
- package/dist/unref-CU9Nyz_9.cjs +0 -2
- package/dist/unref-CU9Nyz_9.cjs.map +0 -1
- package/dist/web-vitals-B2FYsEAU.cjs +0 -2
- package/dist/web-vitals-B2FYsEAU.cjs.map +0 -1
- package/dist/web-vitals-DHZ0yA_H.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var ee=/OpenFin/i,te=/\bwv\b/,ne=/\b(iPhone|iPad|iPod)\b/,re=/\bMacintosh\b/,ie=/\bMobile\b/,e={TRACE:1,DEBUG:5,INFO:9,WARN:13,ERROR:17,FATAL:21},t=e,n=`log.type`,r=`log.seq`,i=`app.namespace`,a=`page.url`,o=`url.full`,s=`journey.id`,c=`journey.name`,l=`journey.parent_id`,u=`uiobs.sanitize_failed`,d=`error.data`,f=`breadcrumbs`,p=`uiobs.attributes_dropped`,m=`uiobs.attributes_bytes`,h=`service.name`,g=`service.version`,_=`deployment.environment`,v=`telemetry.sdk.name`,y=`telemetry.sdk.version`,b=`telemetry.sdk.language`,x=`host.platform`,S=`session.id`,C=`tab.id`,w=`context.id`,T=`browser.user_agent`,E=`openfin.uuid`,D=`openfin.name`,O=`@utk09/ui-observability`,k=`0.9.1`,A=`webjs`,j=`otlp`,M={WARN:`warning`},N=`application/json`,P=`application/x-ndjson`,F=1000000n,I=/^\d+$/,L=`Content-Type`,R=`Content-Encoding`,z=`Retry-After`,B=`X-UiObs-Batch-Id`,V=`X-UiObs-Attempt`,H=`X-UiObs-Sampling`,U=`gzip`,W=1e3,G=6e4,K=`text/plain;charset=UTF-8`,q=`uiobs_batch_id`,J=`uiobs_exit`,Y=`ui-observability.batch.`,ae=`ui-observability.emergency.`,oe=`ui-observability.probe`,se=`QuotaExceededError`,ce=`batches`,le=`createdAt`,ue=`indexeddb`,de=`localstorage`,fe=`memory`,pe=`none`,X=`ui-observability.drain`,me=`ui-observability.emergency`,he=`ui-observability.journey`,ge=2e3,_e=`uiObsJourney`,ve=/\+/g,ye=/\//g,be=/=+$/,xe=/-/g,Se=/_/g,Ce=3e5,we=`traceparent`,Te=2166136261,Ee=16777619,De=4294967295,Oe=[`action`,`metric`],ke=`metric`,Ae=`action`,je=`ui-observability/1`,Me=`ui-observability.runtime`,Ne=`ui-observability.stopped`,Pe=`ui-observability.request-scope`,Fe=`ui-observability.console-scope`,Ie=1e4,Z={namespace:`color:#888`,TRACE:`color:#888;font-weight:bold`,DEBUG:`color:#888;font-weight:bold`,INFO:`color:#1e6fd9;font-weight:bold`,WARN:`color:#c77700;font-weight:bold`,ERROR:`color:#d32f2f;font-weight:bold`,FATAL:`color:#d32f2f;font-weight:bold`},Le=1e3,Re=6e4,ze=`uiobs.capture`,Be=`uiobs.storage`,Ve=`count`,He=`unknown-service`,Ue=4096,We=36e5,Ge=3e4,Ke=[`redact`,`onDiagnostic`,`onDrop`,`headers`,`serializer`,`otelLoader`,`transport`,`transportOnExit`],qe=[`sampling`,`bus`,`journey`,`batching`,`retention`,`limits`,`capture`],Je={sampling:[],bus:[],journey:[],batching:[],retention:[],limits:[],capture:[`webVitalsLoader`]},Ye=`DEBUG`,Xe=2e3,Ze=1e4,Qe=15e3,$e=1024,et=`UiObservability`,tt={maxBatches:500,maxAgeMs:864e5,maxAttempts:5},nt=1e4,rt=2e3,it=6e4,at=3e4,Q=18e5,ot=`__uiobs_journey`,st=`ui_observability_control`,ct=1500,lt=2e3,ut=5e3,$={maxBodyChars:4096,maxAttributeChars:8192,maxAttributeCount:128,maxStackChars:8192,maxDepth:6,maxArrayLength:100,maxNodes:1e4,maxRecordBytes:32768},dt={endpoint:``,serviceName:``,serviceVersion:``,environment:``,enabled:!0,minLevel:`INFO`,compression:`gzip`,credentials:`omit`,storage:`auto`,identity:`storage`,sampling:{defaultRate:1,rates:{},alwaysSampleTypes:[`action`],remote:!1,remoteMaxRate:1},bus:{mode:`auto`,trustedOrigins:[],openFinRole:`auto`},journey:{scope:`auto`,maxAgeMs:Q},batching:{logFlushIntervalMs:Xe,logBatchSize:100,metricFlushIntervalMs:Ze,metricBatchSize:500},retention:{mode:`limited`,...tt},limits:{...$},capture:{errors:!0,rejections:!0,resourceErrors:!1,fetch:!1,xhr:!1,interactions:!1,navigation:!1,webVitals:!1,longFrames:!1,longFrameThresholdMs:100,console:!1,fullUrls:!1,ignoreUrls:[],propagateTraceHeaderTo:[]},console:{level:null,styles:Z}};Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"$t",{enumerable:!0,get:function(){return 6e4}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"At",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"Bt",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,"Ct",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"Dt",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"Et",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"Ft",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(exports,"Gt",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"Ht",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,"It",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"Jt",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,"Kt",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"Lt",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"Mt",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"Nt",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"Ot",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"Pt",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"Qt",{enumerable:!0,get:function(){return`ui-observability.session`}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"Rt",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"St",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"Tt",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"Ut",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"Vt",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"Wt",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"Xt",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"Yt",{enumerable:!0,get:function(){return`Safari/`}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"Zt",{enumerable:!0,get:function(){return 18e5}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"_n",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"_t",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"an",{enumerable:!0,get:function(){return de}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"bn",{enumerable:!0,get:function(){return`AppleWebKit`}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return _e}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"cn",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"dn",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return`[ui-observability]`}}),Object.defineProperty(exports,"en",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return 56319}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"fn",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"gn",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"hn",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"in",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"jt",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"kt",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"ln",{enumerable:!0,get:function(){return`ui-observability.tab`}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"mn",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"nn",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"on",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"pn",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"qt",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"rn",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"sn",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"tn",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return 55296}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"un",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(exports,"vn",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"vt",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"wt",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"xt",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(exports,"yn",{enumerable:!0,get:function(){return 2048}}),Object.defineProperty(exports,"yt",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"zt",{enumerable:!0,get:function(){return S}});
|
|
2
|
+
//# sourceMappingURL=constants-X86IDwkC.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-X86IDwkC.cjs","names":["OPENFIN_UA_PATTERN","ANDROID_WEBVIEW_UA_PATTERN","IOS_DEVICE_UA_PATTERN","MACINTOSH_UA_PATTERN","MOBILE_UA_PATTERN","SEVERITY_NUMBER","LEVEL_ORDER","ATTR_LOG_TYPE","ATTR_LOG_SEQ","ATTR_APP_NAMESPACE","ATTR_PAGE_URL","ATTR_URL_FULL","ATTR_JOURNEY_ID","ATTR_JOURNEY_NAME","ATTR_JOURNEY_PARENT_ID","ATTR_SANITIZE_FAILED","ATTR_ERROR_DATA","ATTR_BREADCRUMBS","ATTR_ATTRIBUTES_DROPPED","ATTR_ATTRIBUTES_BYTES","RESOURCE_SERVICE_NAME","RESOURCE_SERVICE_VERSION","RESOURCE_DEPLOYMENT_ENVIRONMENT","RESOURCE_TELEMETRY_SDK_NAME","RESOURCE_TELEMETRY_SDK_VERSION","RESOURCE_TELEMETRY_SDK_LANGUAGE","RESOURCE_HOST_PLATFORM","RESOURCE_SESSION_ID","RESOURCE_TAB_ID","RESOURCE_CONTEXT_ID","RESOURCE_BROWSER_USER_AGENT","RESOURCE_OPENFIN_UUID","RESOURCE_OPENFIN_NAME","TELEMETRY_SDK_NAME","TELEMETRY_SDK_VERSION","TELEMETRY_SDK_LANGUAGE","SERIALIZER_NAME_OTLP","ECS_LEVEL_NAMES","CONTENT_TYPE_JSON","CONTENT_TYPE_NDJSON","NANOS_PER_MILLI","NANOS_PATTERN","HEADER_CONTENT_TYPE","HEADER_CONTENT_ENCODING","HEADER_RETRY_AFTER","HEADER_BATCH_ID","HEADER_ATTEMPT","HEADER_SAMPLING","ENCODING_GZIP","MILLIS_PER_SECOND","BEACON_LIMIT_BYTES","CONTENT_TYPE_TEXT_PLAIN","QUERY_PARAM_BATCH_ID","QUERY_PARAM_EXIT_REASON","BATCH_STORAGE_KEY_PREFIX","EMERGENCY_STORAGE_KEY_PREFIX","STORAGE_PROBE_KEY","QUOTA_EXCEEDED_ERROR","INDEXEDDB_STORE_NAME","INDEXEDDB_CREATED_AT_INDEX","STORAGE_NAME_INDEXEDDB","STORAGE_NAME_LOCAL","STORAGE_NAME_MEMORY","STORAGE_NAME_NONE","DRAIN_LOCK_NAME","EMERGENCY_LOCK_NAME","JOURNEY_STORAGE_KEY","OPENFIN_OPTIONS_TIMEOUT_MS","OPENFIN_JOURNEY_CUSTOM_DATA_KEY","BASE64_PLUS_PATTERN","BASE64_SLASH_PATTERN","BASE64_PADDING_PATTERN","BASE64URL_DASH_PATTERN","BASE64URL_UNDERSCORE_PATTERN","TRACE_MAX_AGE_MS","TRACEPARENT_HEADER","FNV_OFFSET_BASIS","FNV_PRIME","UINT32_MAX","LEVEL_BYPASS_TYPES","LOG_TYPE_METRIC","LOG_TYPE_ACTION","BUS_PROTOCOL","RUNTIME_GLOBAL_KEY","RUNTIME_STOPPED_KEY","LIBRARY_REQUEST_KEY","LIBRARY_CONSOLE_KEY","ERROR_STORM_WINDOW_MS","CONSOLE_DEFAULT_STYLES","DURATION_PRECISION","GAP_REPORT_THROTTLE_MS","CAPTURE_NAMESPACE","STORAGE_NAMESPACE","DEFAULT_METRIC_UNIT","UNKNOWN_SERVICE_NAME","REMOTE_SAMPLING_MAX_CHARS","REMOTE_SAMPLING_MAX_TTL_MS","REMOTE_SAMPLING_POLL_MS","UNDEFAULTED_CONFIG_KEYS","CONFIG_SECTIONS","UNDEFAULTED_SECTION_KEYS","CONSOLE_DEFAULT_LEVEL","LOG_FLUSH_INTERVAL_MS","METRIC_FLUSH_INTERVAL_MS","REQUEST_TIMEOUT_MS","COMPRESSION_THRESHOLD_BYTES","STORAGE_DB_NAME","STORAGE_LIMITS","STORAGE_DEADLINE_MS","RETRY_BASE_DELAY_MS","RETRY_MAX_DELAY_MS","RETRY_IDLE_DELAY_MS","JOURNEY_MAX_AGE_MS","JOURNEY_URL_PARAM","BUS_CHANNEL_NAME","BUS_HANDSHAKE_TIMEOUT_MS","BUS_MAX_BOOT_BUFFER_ACTIONS","ERROR_DEDUPE_MS","RECORD_LIMITS","DEFAULT_CONFIG"],"sources":["../src/constants.ts"],"sourcesContent":["// src/constants.ts\n//\n// Defines all limits, thresholds, timing windows, storage keys, patterns, and\n// defaults that the library uses.\n\nimport type { ConsoleStyles, ResolvedConfig } from \"./models/config\";\nimport type { LogLevel, LogType } from \"./models/log-record\";\nimport type { StorageLimits } from \"./models/storage\";\n\n// ----------------------------------\n// Library-wide\n// ----------------------------------\n\n/** Prefix on console messages this library writes. */\nexport const LIBRARY_LOG_PREFIX = \"[ui-observability]\";\n\n// ----------------------------------\n// Diagnostics\n// ----------------------------------\n\n/**\n * Throttle window for each diagnostic code, in milliseconds. It limits how often an error\n * loop calls the handler.\n */\nexport const DIAGNOSTIC_THROTTLE_MS = 1000;\n\n// ----------------------------------\n// Identity\n// ----------------------------------\n\n/** `localStorage` key for the session id and its last-seen time. */\nexport const SESSION_ID_KEY = \"ui-observability.session\";\n\n/** `sessionStorage` key for the tab id. */\nexport const TAB_ID_KEY = \"ui-observability.tab\";\n\n/** Session idle timeout, in milliseconds. */\nexport const SESSION_IDLE_MS = 30 * 60 * 1000;\n\n/** Min gap between session last-seen writes, in milliseconds. */\nexport const SESSION_TOUCH_MS = 60_000;\n\n/** Random id length, in bytes, used when `crypto.randomUUID` is unavailable. */\nexport const ID_BYTE_LENGTH = 16;\n\n/** Distinct values in one byte (256). */\nexport const BYTE_VALUE_COUNT = 256;\n\n// ----------------------------------\n// Platform detection\n// ----------------------------------\n\n/** Matches OpenFin's user agent. */\nexport const OPENFIN_UA_PATTERN = /OpenFin/i;\n\n/** Matches Android's webview token (`wv`). */\nexport const ANDROID_WEBVIEW_UA_PATTERN = /\\bwv\\b/;\n\n/** Matches iOS hardware: iPhone, iPad, iPod. */\nexport const IOS_DEVICE_UA_PATTERN = /\\b(iPhone|iPad|iPod)\\b/;\n\n/** Matches desktop macOS in a user agent. */\nexport const MACINTOSH_UA_PATTERN = /\\bMacintosh\\b/;\n\n/** Matches the mobile token. */\nexport const MOBILE_UA_PATTERN = /\\bMobile\\b/;\n\n/** WebKit engine token, present in every WebKit browser including webviews. */\nexport const WEBKIT_UA_TOKEN = \"AppleWebKit\";\n\n/** Safari token sent by real iOS browsers, not in-app webviews. */\nexport const SAFARI_UA_TOKEN = \"Safari/\";\n\n// ----------------------------------\n// Sanitizing and size estimation\n// ----------------------------------\n\n/** First UTF-16 high surrogate code unit. */\nexport const HIGH_SURROGATE_MIN = 0xd800;\n\n/** Last UTF-16 high surrogate code unit. */\nexport const HIGH_SURROGATE_MAX = 0xdbff;\n\n/** Code units below this encode as one UTF-8 byte. */\nexport const UTF8_ONE_BYTE_CEILING = 0x80;\n\n/** Code units below this, and at or above the one-byte ceiling, encode as two UTF-8 bytes. */\nexport const UTF8_TWO_BYTE_CEILING = 0x800;\n\n/** Class names kept in a `describeNode` selector. */\nexport const MAX_NODE_CLASS_NAMES = 3;\n\n/** Byte cost of a null or undefined value. */\nexport const BYTES_PER_NULL = 4;\n\n/** Byte cost of a number (flat estimate). */\nexport const BYTES_PER_NUMBER = 8;\n\n/** Byte cost of a boolean. */\nexport const BYTES_PER_BOOLEAN = 5;\n\n/** Byte cost of an object or array's wrapping braces or brackets. */\nexport const BYTES_PER_CONTAINER = 2;\n\n/** Byte cost of a string's wrapping quotes. */\nexport const BYTES_PER_QUOTED_STRING = 2;\n\n/** Byte cost of one key's punctuation: quotes, colon, comma. */\nexport const BYTES_PER_KEY_OVERHEAD = 4;\n\n// ----------------------------------\n// Record model\n// ----------------------------------\n\n/**\n * Maps each log level to its OpenTelemetry severity number.\n * @see {@link LEVEL_ORDER}\n */\nexport const SEVERITY_NUMBER: Record<LogLevel, number> = {\n TRACE: 1,\n DEBUG: 5,\n INFO: 9,\n WARN: 13,\n ERROR: 17,\n FATAL: 21,\n};\n\n/**\n * Alias for `SEVERITY_NUMBER`, used by the level filter.\n * @see {@link SEVERITY_NUMBER}\n */\nexport const LEVEL_ORDER: Record<LogLevel, number> = SEVERITY_NUMBER;\n\n// ----------------------------------\n// Attribute and resource keys\n// ----------------------------------\n//\n// Attribute and resource key names that records carry in the payload. The names\n// follow OpenTelemetry conventions. The `uiobs.` prefix marks the fields of this library.\n\n/** Record kind attribute key. */\nexport const ATTR_LOG_TYPE = \"log.type\";\n\n/** Record sequence number in its context. It starts at 1. */\nexport const ATTR_LOG_SEQ = \"log.seq\";\n\n/** Logger namespace attribute key. */\nexport const ATTR_APP_NAMESPACE = \"app.namespace\";\n\n/** Document URL when the library built the record. */\nexport const ATTR_PAGE_URL = \"page.url\";\n\n/**\n * HTTP request URL attribute key. Network capture sets it. Do not reuse `ATTR_PAGE_URL`.\n * The page URL overwrites the request target under that key.\n * @see {@link ATTR_PAGE_URL}\n */\nexport const ATTR_URL_FULL = \"url.full\";\n\n/** Journey id attribute key. */\nexport const ATTR_JOURNEY_ID = \"journey.id\";\n\n/** Journey name attribute key. */\nexport const ATTR_JOURNEY_NAME = \"journey.name\";\n\n/** Parent journey id, present only on a child journey. */\nexport const ATTR_JOURNEY_PARENT_ID = \"journey.parent_id\";\n\n/** Marks a record whose attributes failed to sanitize. */\nexport const ATTR_SANITIZE_FAILED = \"uiobs.sanitize_failed\";\n\n/** Own fields of an Error reason, or the whole reason when it is not an Error. */\nexport const ATTR_ERROR_DATA = \"error.data\";\n\n/** Breadcrumb history of an error record. */\nexport const ATTR_BREADCRUMBS = \"breadcrumbs\";\n\n/**\n * Marks a record when the library drops its attributes because they exceed the byte budget.\n * @see {@link ATTR_ATTRIBUTES_BYTES}\n */\nexport const ATTR_ATTRIBUTES_DROPPED = \"uiobs.attributes_dropped\";\n\n/**\n * Byte size of the dropped attributes.\n * @see {@link ATTR_ATTRIBUTES_DROPPED}\n */\nexport const ATTR_ATTRIBUTES_BYTES = \"uiobs.attributes_bytes\";\n\n/** Application name resource key. */\nexport const RESOURCE_SERVICE_NAME = \"service.name\";\n\n/** Application build version resource key. */\nexport const RESOURCE_SERVICE_VERSION = \"service.version\";\n\n/** Deployment environment resource key. */\nexport const RESOURCE_DEPLOYMENT_ENVIRONMENT = \"deployment.environment\";\n\n/**\n * Producer library name resource key.\n * @see {@link TELEMETRY_SDK_NAME}\n */\nexport const RESOURCE_TELEMETRY_SDK_NAME = \"telemetry.sdk.name\";\n\n/**\n * Producer library version resource key.\n * @see {@link TELEMETRY_SDK_VERSION}\n */\nexport const RESOURCE_TELEMETRY_SDK_VERSION = \"telemetry.sdk.version\";\n\n/**\n * Producer SDK language resource key.\n * @see {@link TELEMETRY_SDK_LANGUAGE}\n */\nexport const RESOURCE_TELEMETRY_SDK_LANGUAGE = \"telemetry.sdk.language\";\n\n/** Host platform resource key: browser, webview, or OpenFin. */\nexport const RESOURCE_HOST_PLATFORM = \"host.platform\";\n\n/** Session id resource key. */\nexport const RESOURCE_SESSION_ID = \"session.id\";\n\n/** Tab id resource key. */\nexport const RESOURCE_TAB_ID = \"tab.id\";\n\n/** Context (realm) id resource key. */\nexport const RESOURCE_CONTEXT_ID = \"context.id\";\n\n/** Raw user agent resource key. */\nexport const RESOURCE_BROWSER_USER_AGENT = \"browser.user_agent\";\n\n/** OpenFin application uuid resource key. */\nexport const RESOURCE_OPENFIN_UUID = \"openfin.uuid\";\n\n/** OpenFin window or view name resource key. */\nexport const RESOURCE_OPENFIN_NAME = \"openfin.name\";\n\n/**\n * Value of `telemetry.sdk.name`.\n * @see {@link RESOURCE_TELEMETRY_SDK_NAME}\n */\nexport const TELEMETRY_SDK_NAME = \"@utk09/ui-observability\";\n\n/**\n * Value of `telemetry.sdk.version`. The code does not read it from package.json.\n * Change it by hand when you change the version in package.json.\n * @see {@link RESOURCE_TELEMETRY_SDK_VERSION}\n */\nexport const TELEMETRY_SDK_VERSION = \"0.9.1\";\n\n/**\n * Value of `telemetry.sdk.language`.\n * @see {@link RESOURCE_TELEMETRY_SDK_LANGUAGE}\n */\nexport const TELEMETRY_SDK_LANGUAGE = \"webjs\";\n\n// ----------------------------------\n// Serializers\n// ----------------------------------\n\n/** OTLP/JSON serializer name. */\nexport const SERIALIZER_NAME_OTLP = \"otlp\";\n\n/** ECS serializer name. */\nexport const SERIALIZER_NAME_ECS = \"ecs\";\n\n/**\n * ECS `log.level` names that differ from the lowercase severity text. ECS spells\n * the warning level in full. All other levels match in lowercase.\n * @see {@link SERIALIZER_NAME_ECS}\n */\nexport const ECS_LEVEL_NAMES: Partial<Record<LogLevel, string>> = { WARN: \"warning\" };\n\n/** Content type for an OTLP/JSON body. */\nexport const CONTENT_TYPE_JSON = \"application/json\";\n\n/** Content type for newline-delimited JSON. */\nexport const CONTENT_TYPE_NDJSON = \"application/x-ndjson\";\n\n/** Nanoseconds per millisecond. */\nexport const NANOS_PER_MILLI = 1000000n;\n\n/**\n * Matches a nanosecond epoch in decimal digits, for example \"1755543600123000000\".\n * @see {@link NANOS_PER_MILLI}\n */\nexport const NANOS_PATTERN = /^\\d+$/;\n\n// ----------------------------------\n// HTTP transport\n// ----------------------------------\n\n/** Content-Type header name. */\nexport const HEADER_CONTENT_TYPE = \"Content-Type\";\n\n/** Content-Encoding header name. */\nexport const HEADER_CONTENT_ENCODING = \"Content-Encoding\";\n\n/** Retry-After header name. */\nexport const HEADER_RETRY_AFTER = \"Retry-After\";\n\n/**\n * Batch deduplication key header name.\n * @see {@link QUERY_PARAM_BATCH_ID}\n */\nexport const HEADER_BATCH_ID = \"X-UiObs-Batch-Id\";\n\n/** Delivery attempt number header name. */\nexport const HEADER_ATTEMPT = \"X-UiObs-Attempt\";\n\n/** Response header that carries sampling rules from the ingest server. */\nexport const HEADER_SAMPLING = \"X-UiObs-Sampling\";\n\n/** Gzip encoding name. */\nexport const ENCODING_GZIP = \"gzip\";\n\n/** Lowest valid HTTP status code. */\nexport const HTTP_STATUS_MIN = 100;\n\n/** Highest valid HTTP status code. */\nexport const HTTP_STATUS_MAX = 599;\n\n/** Lowest HTTP status code that accepts a batch. */\nexport const HTTP_SUCCESS_MIN = 200;\n\n/** Lowest HTTP status code above the success range. */\nexport const HTTP_SUCCESS_END = 300;\n\n/** 401, credentials missing or rejected. */\nexport const HTTP_UNAUTHORIZED = 401;\n\n/** 403, valid credentials but access denied. */\nexport const HTTP_FORBIDDEN = 403;\n\n/** 408, the server closed the connection after a timeout. The transport can retry. */\nexport const HTTP_REQUEST_TIMEOUT = 408;\n\n/** 413, payload too large. The transport must split the batch. */\nexport const HTTP_PAYLOAD_TOO_LARGE = 413;\n\n/** 429, backpressure. */\nexport const HTTP_TOO_MANY_REQUESTS = 429;\n\n/** 500, floor for server-side errors. */\nexport const HTTP_SERVER_ERROR_MIN = 500;\n\n/** 503, temporary unavailability. */\nexport const HTTP_SERVICE_UNAVAILABLE = 503;\n\n/** Milliseconds per second. */\nexport const MILLIS_PER_SECOND = 1000;\n\n// ----------------------------------\n// Exit flush\n// ----------------------------------\n\n/** Max exit payload size, in bytes (`sendBeacon`/`fetch(keepalive)` shared budget). */\nexport const BEACON_LIMIT_BYTES = 60_000;\n\n/** Content type for an exit payload. It is CORS-safelisted and does not cause a preflight. */\nexport const CONTENT_TYPE_TEXT_PLAIN = \"text/plain;charset=UTF-8\";\n\n/**\n * Batch id query param name, for the exit path.\n * @see {@link HEADER_BATCH_ID}\n */\nexport const QUERY_PARAM_BATCH_ID = \"uiobs_batch_id\";\n\n/** Exit reason query param name, for logs only. */\nexport const QUERY_PARAM_EXIT_REASON = \"uiobs_exit\";\n\n// ----------------------------------\n// Storage\n// ----------------------------------\n\n/** localStorage key prefix for a stored batch. */\nexport const BATCH_STORAGE_KEY_PREFIX = \"ui-observability.batch.\";\n\n/** Zero-padded digit width for the creation time in a batch key. */\nexport const BATCH_KEY_TIME_WIDTH = 14;\n\n/** localStorage key prefix for a batch that exit flush stores. */\nexport const EMERGENCY_STORAGE_KEY_PREFIX = \"ui-observability.emergency.\";\n\n/** Maximum number of exit batches in the emergency queue. */\nexport const EMERGENCY_MAX_ENTRIES = 20;\n\n/** Key that the library writes to test if localStorage accepts writes. */\nexport const STORAGE_PROBE_KEY = \"ui-observability.probe\";\n\n/** Fraction of the store to evict on a quota error (1 in N). */\nexport const QUOTA_EVICTION_DIVISOR = 4;\n\n/** DOMException name for a full store. */\nexport const QUOTA_EXCEEDED_ERROR = \"QuotaExceededError\";\n\n/**\n * Native IndexedDB version. It starts at 11. Dexie, the previous adapter, opened the\n * same database at ten times its declared version. A version below 11 makes open()\n * fail with VersionError for an existing installation. Then no code can read the\n * batches in that database.\n */\nexport const INDEXEDDB_SCHEMA_VERSION = 11;\n\n/** IndexedDB object store that holds batches. Dexie set this name before the library removed it. */\nexport const INDEXEDDB_STORE_NAME = \"batches\";\n\n/** Index on the batch store that orders reads by creation time. */\nexport const INDEXEDDB_CREATED_AT_INDEX = \"createdAt\";\n\n/** IndexedDB adapter/strategy name. */\nexport const STORAGE_NAME_INDEXEDDB = \"indexeddb\";\n\n/** localStorage adapter/strategy name. */\nexport const STORAGE_NAME_LOCAL = \"localstorage\";\n\n/** In-memory adapter/strategy name. */\nexport const STORAGE_NAME_MEMORY = \"memory\";\n\n/** Name of the storage adapter that keeps nothing. */\nexport const STORAGE_NAME_NONE = \"none\";\n\n// ----------------------------------\n// Retry\n// ----------------------------------\n\n/**\n * Origin-wide lock name a drain runs under.\n * @see {@link EMERGENCY_LOCK_NAME}\n */\nexport const DRAIN_LOCK_NAME = \"ui-observability.drain\";\n\n/**\n * Lock name startup recovery runs under.\n * @see {@link DRAIN_LOCK_NAME}\n */\nexport const EMERGENCY_LOCK_NAME = \"ui-observability.emergency\";\n\n/** Batches sent per drain tick. */\nexport const BATCHES_PER_DRAIN = 20;\n\n// ----------------------------------\n// Journey\n// ----------------------------------\n\n/** `sessionStorage` key for the current journey. */\nexport const JOURNEY_STORAGE_KEY = \"ui-observability.journey\";\n\n/**\n * Max journey name length in a token, in characters.\n * @see {@link JOURNEY_TOKEN_MAX_CHARS}\n */\nexport const JOURNEY_TOKEN_NAME_MAX_CHARS = 64;\n\n/**\n * Max whole-token length, in characters. It rejects an oversized token. It does not\n * validate the token content.\n * @see {@link JOURNEY_TOKEN_NAME_MAX_CHARS}\n */\nexport const JOURNEY_TOKEN_MAX_CHARS = 256;\n\n/**\n * Time to wait for `fin.me.getOptions()`, in milliseconds. After this time, the\n * runtime continues without a seeded journey.\n * @see {@link OPENFIN_JOURNEY_CUSTOM_DATA_KEY}\n */\nexport const OPENFIN_OPTIONS_TIMEOUT_MS = 2000;\n\n/** Key under an OpenFin window's `customData` carrying a seeded journey token. */\nexport const OPENFIN_JOURNEY_CUSTOM_DATA_KEY = \"uiObsJourney\";\n\n/** Matches `+` in standard base64 (`-` in URL-safe). */\nexport const BASE64_PLUS_PATTERN = /\\+/g;\n\n/** Matches `/` in standard base64 (`_` in URL-safe). */\nexport const BASE64_SLASH_PATTERN = /\\//g;\n\n/** Matches trailing `=` padding. */\nexport const BASE64_PADDING_PATTERN = /=+$/;\n\n/** Matches `-` in URL-safe base64 (`+` in standard). */\nexport const BASE64URL_DASH_PATTERN = /-/g;\n\n/** Matches `_` in URL-safe base64 (`/` in standard). */\nexport const BASE64URL_UNDERSCORE_PATTERN = /_/g;\n\n/** Base64 characters per 3-byte group. */\nexport const BASE64_GROUP_CHARS = 4;\n\n// ----------------------------------\n// Tracing\n// ----------------------------------\n\n/** W3C trace id width, in bytes. */\nexport const TRACE_ID_BYTES = 16;\n\n/** W3C span id width, in bytes. */\nexport const SPAN_ID_BYTES = 8;\n\n/** Max ambient trace lifetime with no activity, in milliseconds. */\nexport const TRACE_MAX_AGE_MS = 5 * 60 * 1000;\n\n/** trace-flags value with the sampled bit set. */\nexport const TRACE_FLAGS_SAMPLED = 1;\n\n/** Mask for the one-byte trace-flags field. */\nexport const TRACE_FLAGS_MASK = 0xff;\n\n/**\n * W3C trace context header name\n * @see {@link TRACEPARENT_VERSION}\n */\nexport const TRACEPARENT_HEADER = \"traceparent\";\n\n/** traceparent header version prefix. */\nexport const TRACEPARENT_VERSION = \"00\";\n\n// ----------------------------------\n// Breadcrumbs\n// ----------------------------------\n\n/** Smallest valid breadcrumb buffer capacity. */\nexport const BREADCRUMB_MIN_CAPACITY = 1;\n\n// ----------------------------------\n// Sampling\n// ----------------------------------\n//\n// FNV-1a hash constants. The sampler uses them to change a sampling key into a\n// stable 0-1 fraction.\n\n/** FNV-1a 32-bit offset basis. */\nexport const FNV_OFFSET_BASIS = 0x811c9dc5;\n\n/** FNV-1a 32-bit prime. */\nexport const FNV_PRIME = 0x01000193;\n\n/** Largest 32-bit unsigned value. */\nexport const UINT32_MAX = 0xffffffff;\n\n/**\n * Types that minLevel does not drop. An action is an audit fact and a metric is a measurement.\n * The remote rate cap for records below minLevel does not apply to them.\n */\nexport const LEVEL_BYPASS_TYPES: readonly LogType[] = [\"action\", \"metric\"];\n\n// ----------------------------------\n// Pipeline\n// ----------------------------------\n\n/** Record kind routed to the metric stream. */\nexport const LOG_TYPE_METRIC: LogType = \"metric\";\n\n/** Record kind of an audit fact. Storage and the hold buffers drop it last. */\nexport const LOG_TYPE_ACTION: LogType = \"action\";\n\n// ----------------------------------\n// Bus\n// ----------------------------------\n\n/** Protocol identifier for bus envelopes. The bus drops an envelope with a different version. */\nexport const BUS_PROTOCOL = \"ui-observability/1\";\n\n/** Global window property key used to locate a same-origin runtime instance. */\nexport const RUNTIME_GLOBAL_KEY = \"ui-observability.runtime\";\n\n/** Global key of the runtime that shutdown() stopped. Calls go to it until the next configure(). */\nexport const RUNTIME_STOPPED_KEY = \"ui-observability.stopped\";\n\n/** Global symbol key of the library request scope count. All library copies on a page share it. */\nexport const LIBRARY_REQUEST_KEY = \"ui-observability.request-scope\";\n\n/** Global symbol key of the library console scope count. All library copies on a page share it. */\nexport const LIBRARY_CONSOLE_KEY = \"ui-observability.console-scope\";\n\n// ----------------------------------\n// Capture\n// ----------------------------------\n\n/** Maximum error records captured per throttling window before suppression. */\nexport const ERROR_STORM_MAX_PER_WINDOW = 20;\n\n/** Error rate-limiting window duration in milliseconds. */\nexport const ERROR_STORM_WINDOW_MS = 10_000;\n\n/**\n * Max ERROR and FATAL records that the pipeline admits in each storm window.\n * It is a safety limit for a render loop. It does not shape normal traffic.\n * ERROR and FATAL records skip sampling. A direct logger.error call has no other limit.\n */\nexport const ERROR_CEILING_MAX_PER_WINDOW = 500;\n\n/** Default minimum duration of a long frame that the library records, in milliseconds. */\nexport const LONG_FRAME_THRESHOLD_MS = 100;\n\n/** Maximum long frames recorded in each storm window. A frozen tab cannot flood the pipeline. */\nexport const LONG_FRAME_MAX_PER_WINDOW = 20;\n\n/** Maximum character length of a console breadcrumb message. */\nexport const CONSOLE_BREADCRUMB_MAX_CHARS = 200;\n\n/** Maximum distinct error signatures tracked for deduplication before LRU eviction. */\nexport const MAX_TRACKED_ERROR_SIGNATURES = 200;\n\n/** Maximum character length retained from clicked element text in breadcrumbs. */\nexport const CLICK_TEXT_MAX_CHARS = 50;\n\n/** Maximum character length retained from an aria-label attribute in generated selectors. */\nexport const ARIA_LABEL_MAX_CHARS = 40;\n\n/** Maximum class names included per element in generated CSS selectors. */\nexport const SELECTOR_MAX_CLASSES = 2;\n\n/** Default CSS of the console prefix. The colors are readable on light and dark devtools. */\nexport const CONSOLE_DEFAULT_STYLES: Readonly<Required<ConsoleStyles>> = {\n namespace: \"color:#888\",\n TRACE: \"color:#888;font-weight:bold\",\n DEBUG: \"color:#888;font-weight:bold\",\n INFO: \"color:#1e6fd9;font-weight:bold\",\n WARN: \"color:#c77700;font-weight:bold\",\n ERROR: \"color:#d32f2f;font-weight:bold\",\n FATAL: \"color:#d32f2f;font-weight:bold\",\n};\n\n/** Scaling factor for rounding duration measurements to three decimal places. */\nexport const DURATION_PRECISION = 1000;\n\n// ----------------------------------\n// Runtime\n// ----------------------------------\n\n/** Minimum duration in milliseconds between storage gap warning reports. */\nexport const GAP_REPORT_THROTTLE_MS = 60_000;\n\n/** Default namespace for telemetry records emitted by auto-capture modules. */\nexport const CAPTURE_NAMESPACE = \"uiobs.capture\";\n\n/** Default namespace for telemetry records emitted by storage subsystems. */\nexport const STORAGE_NAMESPACE = \"uiobs.storage\";\n\n/** Measurement unit that the library uses when the call gives no unit. */\nexport const DEFAULT_METRIC_UNIT = \"count\";\n\n// ----------------------------------\n// Configuration\n// ----------------------------------\n\n/** Default `service.name` when a consumer sets none. */\nexport const UNKNOWN_SERVICE_NAME = \"unknown-service\";\n\n/** Lowest sampling rate (drop everything). */\nexport const SAMPLING_RATE_MIN = 0;\n\n/** Highest sampling rate (keep everything). */\nexport const SAMPLING_RATE_MAX = 1;\n\n/**\n * Fallback for an invalid sampling rate (keep everything).\n * @see {@link SAMPLING_RATE_MAX}\n */\nexport const SAMPLING_RATE_FALLBACK = 1;\n\n/** Version of the remote sampling rules that the library accepts. */\nexport const REMOTE_SAMPLING_VERSION = 1;\n\n/** Maximum length of the sampling header, in characters. */\nexport const REMOTE_SAMPLING_MAX_CHARS = 4096;\n\n/** Maximum time that remote sampling rules stay in force, in milliseconds. */\nexport const REMOTE_SAMPLING_MAX_TTL_MS = 60 * 60 * 1000;\n\n/** Maximum namespace rates in one set of remote sampling rules. */\nexport const REMOTE_SAMPLING_MAX_RATES = 100;\n\n/** Time between two requests of a forwarder for the remote sampling rules, in milliseconds. */\nexport const REMOTE_SAMPLING_POLL_MS = 30_000;\n\n/**\n * Config keys with no default, excluded from `DEFAULT_CONFIG`.\n * @see {@link DEFAULT_CONFIG}\n */\nexport const UNDEFAULTED_CONFIG_KEYS = [\n \"redact\",\n \"onDiagnostic\",\n \"onDrop\",\n \"headers\",\n \"serializer\",\n \"otelLoader\",\n \"transport\",\n \"transportOnExit\",\n] as const;\n\n/**\n * Nested config section keys.\n * @see {@link ResolvedConfig}\n */\nexport const CONFIG_SECTIONS = [\n \"sampling\",\n \"bus\",\n \"journey\",\n \"batching\",\n \"retention\",\n \"limits\",\n \"capture\",\n] as const;\n\n/**\n * Section keys with no default, excluded from their section of `DEFAULT_CONFIG`.\n * @see {@link UNDEFAULTED_CONFIG_KEYS}\n */\nexport const UNDEFAULTED_SECTION_KEYS: Record<(typeof CONFIG_SECTIONS)[number], string[]> = {\n sampling: [],\n bus: [],\n journey: [],\n batching: [],\n retention: [],\n limits: [],\n capture: [\"webVitalsLoader\"],\n};\n\n/** Console mirroring level used when a consumer passes `console: true`. */\nexport const CONSOLE_DEFAULT_LEVEL: LogLevel = \"DEBUG\";\n\n// ----------------------------------\n// Batching\n// ----------------------------------\n\n/** Max time a partial log batch waits before the pipeline sends it, in milliseconds. */\nexport const LOG_FLUSH_INTERVAL_MS = 2000;\n\n/** Max records per log batch. At this count, the pipeline sends the batch early. */\nexport const LOG_BATCH_SIZE = 100;\n\n/**\n * Max time a partial metric batch waits before the pipeline sends it, in milliseconds.\n * Metric batches wait longer than log batches. Metrics have a higher volume, and no\n * caller waits for them.\n */\nexport const METRIC_FLUSH_INTERVAL_MS = 10_000;\n\n/** Max records per metric batch. At this count, the pipeline sends the batch early. */\nexport const METRIC_BATCH_SIZE = 500;\n\n/** Max concurrent ingest requests, across both streams. */\nexport const MAX_CONCURRENT_REQUESTS = 2;\n\n// ----------------------------------\n// HTTP transport\n// ----------------------------------\n\n/** Max time for one ingest request, in milliseconds. Then the transport aborts and retries it. */\nexport const REQUEST_TIMEOUT_MS = 15_000;\n\n/** Min payload size to compress, in bytes. */\nexport const COMPRESSION_THRESHOLD_BYTES = 1024;\n\n// ----------------------------------\n// Storage retention\n// ----------------------------------\n\n/** IndexedDB database name. */\nexport const STORAGE_DB_NAME = \"UiObservability\";\n\n/** Capacity and retention thresholds every storage adapter enforces. */\nexport const STORAGE_LIMITS: StorageLimits = {\n maxBatches: 500,\n maxAgeMs: 24 * 60 * 60 * 1000,\n maxAttempts: 5,\n};\n\n/**\n * Max time for one storage call, in milliseconds. Then the library treats the call as failed.\n * A call that does not settle keeps a dispatch slot or the drain flag.\n */\nexport const STORAGE_DEADLINE_MS = 10_000;\n\n// ----------------------------------\n// Retry backoff\n// ----------------------------------\n\n/** First backoff step, in milliseconds. Each attempt doubles it. */\nexport const RETRY_BASE_DELAY_MS = 2000;\n\n/** Backoff ceiling, in milliseconds. */\nexport const RETRY_MAX_DELAY_MS = 60_000;\n\n/** How often to check for stored work when nothing has failed recently, in milliseconds. */\nexport const RETRY_IDLE_DELAY_MS = 30_000;\n\n// ----------------------------------\n// Journey lifetime\n// ----------------------------------\n\n/** Max time a journey stays open, in milliseconds. Then the library treats it as abandoned. */\nexport const JOURNEY_MAX_AGE_MS = 30 * 60 * 1000;\n\n/** True if the journey ends for all contexts when the owning context closes. */\nexport const JOURNEY_END_ON_OWNER_CLOSE = false;\n\n/** Query parameter checked at boot for a seeded journey token. */\nexport const JOURNEY_URL_PARAM = \"__uiobs_journey\";\n\n// ----------------------------------\n// Bus handshake\n// ----------------------------------\n\n/** BroadcastChannel name for the control plane. */\nexport const BUS_CHANNEL_NAME = \"ui_observability_control\";\n\n/** Max time a forwarder waits for an owner to answer before it promotes itself, in milliseconds. */\nexport const BUS_HANDSHAKE_TIMEOUT_MS = 1500;\n\n/** Handshake attempts allowed before a cross-origin forwarder promotes itself to sender. */\nexport const BUS_MAX_HANDSHAKE_ATTEMPTS = 3;\n\n/** Max records that are not actions in one hold buffer. A full buffer drops the oldest. */\nexport const BUS_MAX_BOOT_BUFFER_RECORDS = 500;\n\n/** Max action records in one hold buffer. Actions have their own cap. A log storm cannot push one out. */\nexport const BUS_MAX_BOOT_BUFFER_ACTIONS = 2000;\n\n/** Max different values in each list of an onDrop summary. */\nexport const DROP_SUMMARY_MAX_ITEMS = 20;\n\n/** Max characters of an untrusted message type in a diagnostic detail. The sender sets the text. */\nexport const BUS_TYPE_DETAIL_MAX_CHARS = 32;\n\n// ----------------------------------\n// Capture\n// ----------------------------------\n\n/** Breadcrumbs kept as context for the next error. */\nexport const MAX_BREADCRUMBS = 50;\n\n/**\n * Time window in which the library counts identical errors but does not send them again,\n * in milliseconds.\n */\nexport const ERROR_DEDUPE_MS = 5000;\n\n// ----------------------------------\n// Per-record size caps\n// ----------------------------------\n\n/** Size caps for every record. The library applies them after sanitize and after redact. */\nexport const RECORD_LIMITS = {\n maxBodyChars: 4096,\n maxAttributeChars: 8192,\n maxAttributeCount: 128,\n maxStackChars: 8192,\n maxDepth: 6,\n maxArrayLength: 100,\n maxNodes: 10_000,\n maxRecordBytes: 32_768,\n};\n\n// ----------------------------------\n// Config defaults\n// ----------------------------------\n\n/**\n * Default runtime config before the consumer calls `configure()`. It excludes `serializer`.\n * `resolveConfig` supplies that default to prevent a circular import.\n * It comes after the constants that it reads. A const cannot be read before its line.\n * @see {@link ResolvedConfig}\n * @see {@link UNDEFAULTED_CONFIG_KEYS}\n */\nexport const DEFAULT_CONFIG: Omit<ResolvedConfig, \"serializer\"> = {\n endpoint: \"\",\n serviceName: \"\",\n serviceVersion: \"\",\n environment: \"\",\n enabled: true,\n minLevel: \"INFO\",\n compression: \"gzip\",\n credentials: \"omit\",\n storage: \"auto\",\n identity: \"storage\",\n sampling: {\n defaultRate: 1,\n rates: {},\n alwaysSampleTypes: [\"action\"],\n remote: false,\n remoteMaxRate: 1,\n },\n bus: { mode: \"auto\", trustedOrigins: [], openFinRole: \"auto\" },\n journey: { scope: \"auto\", maxAgeMs: JOURNEY_MAX_AGE_MS },\n batching: {\n logFlushIntervalMs: LOG_FLUSH_INTERVAL_MS,\n logBatchSize: LOG_BATCH_SIZE,\n metricFlushIntervalMs: METRIC_FLUSH_INTERVAL_MS,\n metricBatchSize: METRIC_BATCH_SIZE,\n },\n retention: { mode: \"limited\", ...STORAGE_LIMITS },\n limits: { ...RECORD_LIMITS },\n capture: {\n errors: true,\n rejections: true,\n resourceErrors: false,\n fetch: false,\n xhr: false,\n interactions: false,\n navigation: false,\n webVitals: false,\n longFrames: false,\n longFrameThresholdMs: LONG_FRAME_THRESHOLD_MS,\n console: false,\n fullUrls: false,\n ignoreUrls: [],\n propagateTraceHeaderTo: [],\n },\n console: { level: null, styles: CONSOLE_DEFAULT_STYLES },\n};\n"],"mappings":"AAcA,IAuCaA,GAAqB,WAGrBC,GAA6B,SAG7BC,GAAwB,yBAGxBC,GAAuB,gBAGvBC,GAAoB,aAqDpBC,EAA4C,CACvD,MAAO,EACP,MAAO,EACP,KAAM,EACN,KAAM,GACN,MAAO,GACP,MAAO,EACT,EAMaC,EAAwCD,EAUxCE,EAAgB,WAGhBC,EAAe,UAGfC,EAAqB,gBAGrBC,EAAgB,WAOhBC,EAAgB,WAGhBC,EAAkB,aAGlBC,EAAoB,eAGpBC,EAAyB,oBAGzBC,EAAuB,wBAGvBC,EAAkB,aAGlBC,EAAmB,cAMnBC,EAA0B,2BAM1BC,EAAwB,yBAGxBC,EAAwB,eAGxBC,EAA2B,kBAG3BC,EAAkC,yBAMlCC,EAA8B,qBAM9BC,EAAiC,wBAMjCC,EAAkC,yBAGlCC,EAAyB,gBAGzBC,EAAsB,aAGtBC,EAAkB,SAGlBC,EAAsB,aAGtBC,EAA8B,qBAG9BC,EAAwB,eAGxBC,EAAwB,eAMxBC,EAAqB,0BAOrBC,EAAwB,QAMxBC,EAAyB,QAOzBC,EAAuB,OAUvBC,EAAqD,CAAE,KAAM,SAAU,EAGvEC,EAAoB,mBAGpBC,EAAsB,uBAGtBC,EAAkB,SAMlBC,EAAgB,QAOhBC,EAAsB,eAGtBC,EAA0B,mBAG1BC,EAAqB,cAMrBC,EAAkB,mBAGlBC,EAAiB,kBAGjBC,EAAkB,mBAGlBC,EAAgB,OAoChBC,EAAoB,IAOpBC,EAAqB,IAGrBC,EAA0B,2BAM1BC,EAAuB,iBAGvBC,EAA0B,aAO1BC,EAA2B,0BAM3BC,GAA+B,8BAM/BC,GAAoB,yBAMpBC,GAAuB,qBAWvBC,GAAuB,UAGvBC,GAA6B,YAG7BC,GAAyB,YAGzBC,GAAqB,eAGrBC,GAAsB,SAGtBC,GAAoB,OAUpBC,EAAkB,yBAMlBC,GAAsB,6BAUtBC,GAAsB,2BAoBtBC,GAA6B,IAG7BC,GAAkC,eAGlCC,GAAsB,MAGtBC,GAAuB,MAGvBC,GAAyB,MAGzBC,GAAyB,KAGzBC,GAA+B,KAgB/BC,GAAmB,IAYnBC,GAAqB,cAoBrBC,GAAmB,WAGnBC,GAAY,SAGZC,GAAa,WAMbC,GAAyC,CAAC,SAAU,QAAQ,EAO5DC,GAA2B,SAG3BC,GAA2B,SAO3BC,GAAe,qBAGfC,GAAqB,2BAGrBC,GAAsB,2BAGtBC,GAAsB,iCAGtBC,GAAsB,iCAUtBC,GAAwB,IA+BxBC,EAA4D,CACvE,UAAW,aACX,MAAO,8BACP,MAAO,8BACP,KAAM,iCACN,KAAM,iCACN,MAAO,iCACP,MAAO,gCACT,EAGaC,GAAqB,IAOrBC,GAAyB,IAGzBC,GAAoB,gBAGpBC,GAAoB,gBAGpBC,GAAsB,QAOtBC,GAAuB,kBAkBvBC,GAA4B,KAG5BC,GAA6B,KAM7BC,GAA0B,IAM1BC,GAA0B,CACrC,SACA,eACA,SACA,UACA,aACA,aACA,YACA,iBACF,EAMaC,GAAkB,CAC7B,WACA,MACA,UACA,WACA,YACA,SACA,SACF,EAMaC,GAA+E,CAC1F,SAAU,CAAC,EACX,IAAK,CAAC,EACN,QAAS,CAAC,EACV,SAAU,CAAC,EACX,UAAW,CAAC,EACZ,OAAQ,CAAC,EACT,QAAS,CAAC,iBAAiB,CAC7B,EAGaC,GAAkC,QAOlCC,GAAwB,IAUxBC,GAA2B,IAa3BC,GAAqB,KAGrBC,GAA8B,KAO9BC,GAAkB,kBAGlBC,GAAgC,CAC3C,WAAY,IACZ,SAAU,MACV,YAAa,CACf,EAMaC,GAAsB,IAOtBC,GAAsB,IAGtBC,GAAqB,IAGrBC,GAAsB,IAOtBC,EAAqB,KAMrBC,GAAoB,kBAOpBC,GAAmB,2BAGnBC,GAA2B,KAS3BC,GAA8B,IAmB9BC,GAAkB,IAOlBC,EAAgB,CAC3B,aAAc,KACd,kBAAmB,KACnB,kBAAmB,IACnB,cAAe,KACf,SAAU,EACV,eAAgB,IAChB,SAAU,IACV,eAAgB,KAClB,EAaaC,GAAqD,CAChE,SAAU,GACV,YAAa,GACb,eAAgB,GAChB,YAAa,GACb,QAAS,GACT,SAAU,OACV,YAAa,OACb,YAAa,OACb,QAAS,OACT,SAAU,UACV,SAAU,CACR,YAAa,EACb,MAAO,CAAC,EACR,kBAAmB,CAAC,QAAQ,EAC5B,OAAQ,GACR,cAAe,CACjB,EACA,IAAK,CAAE,KAAM,OAAQ,eAAgB,CAAC,EAAG,YAAa,MAAO,EAC7D,QAAS,CAAE,MAAO,OAAQ,SAAUP,CAAmB,EACvD,SAAU,CACR,mBAAoBV,GACpB,aAAA,IACA,sBAAuBC,GACvB,gBAAA,GACF,EACA,UAAW,CAAE,KAAM,UAAW,GAAGI,EAAe,EAChD,OAAQ,CAAE,GAAGW,CAAc,EAC3B,QAAS,CACP,OAAQ,GACR,WAAY,GACZ,eAAgB,GAChB,MAAO,GACP,IAAK,GACL,aAAc,GACd,WAAY,GACZ,UAAW,GACX,WAAY,GACZ,qBAAA,IACA,QAAS,GACT,SAAU,GACV,WAAY,CAAC,EACb,uBAAwB,CAAC,CAC3B,EACA,QAAS,CAAE,MAAO,KAAM,OAAQ9B,CAAuB,CACzD"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare const ATTR_LOG_TYPE = "log.type";
|
|
|
72
72
|
export declare const ATTR_LOG_SEQ = "log.seq";
|
|
73
73
|
/** Logger namespace attribute key. */
|
|
74
74
|
export declare const ATTR_APP_NAMESPACE = "app.namespace";
|
|
75
|
-
/** Document URL when the
|
|
75
|
+
/** Document URL when the library built the record. */
|
|
76
76
|
export declare const ATTR_PAGE_URL = "page.url";
|
|
77
77
|
/**
|
|
78
78
|
* HTTP request URL attribute key. Network capture sets it. Do not reuse `ATTR_PAGE_URL`.
|
|
@@ -88,6 +88,10 @@ export declare const ATTR_JOURNEY_NAME = "journey.name";
|
|
|
88
88
|
export declare const ATTR_JOURNEY_PARENT_ID = "journey.parent_id";
|
|
89
89
|
/** Marks a record whose attributes failed to sanitize. */
|
|
90
90
|
export declare const ATTR_SANITIZE_FAILED = "uiobs.sanitize_failed";
|
|
91
|
+
/** Own fields of an Error reason, or the whole reason when it is not an Error. */
|
|
92
|
+
export declare const ATTR_ERROR_DATA = "error.data";
|
|
93
|
+
/** Breadcrumb history of an error record. */
|
|
94
|
+
export declare const ATTR_BREADCRUMBS = "breadcrumbs";
|
|
91
95
|
/**
|
|
92
96
|
* Marks a record when the library drops its attributes because they exceed the byte budget.
|
|
93
97
|
* @see {@link ATTR_ATTRIBUTES_BYTES}
|
|
@@ -143,7 +147,7 @@ export declare const TELEMETRY_SDK_NAME = "@utk09/ui-observability";
|
|
|
143
147
|
* Change it by hand when you change the version in package.json.
|
|
144
148
|
* @see {@link RESOURCE_TELEMETRY_SDK_VERSION}
|
|
145
149
|
*/
|
|
146
|
-
export declare const TELEMETRY_SDK_VERSION = "0.
|
|
150
|
+
export declare const TELEMETRY_SDK_VERSION = "0.9.1";
|
|
147
151
|
/**
|
|
148
152
|
* Value of `telemetry.sdk.language`.
|
|
149
153
|
* @see {@link RESOURCE_TELEMETRY_SDK_LANGUAGE}
|
|
@@ -166,7 +170,7 @@ export declare const CONTENT_TYPE_NDJSON = "application/x-ndjson";
|
|
|
166
170
|
/** Nanoseconds per millisecond. */
|
|
167
171
|
export declare const NANOS_PER_MILLI = 1000000n;
|
|
168
172
|
/**
|
|
169
|
-
* Matches a nanosecond epoch
|
|
173
|
+
* Matches a nanosecond epoch in decimal digits, for example "1755543600123000000".
|
|
170
174
|
* @see {@link NANOS_PER_MILLI}
|
|
171
175
|
*/
|
|
172
176
|
export declare const NANOS_PATTERN: RegExp;
|
|
@@ -228,9 +232,9 @@ export declare const BATCH_STORAGE_KEY_PREFIX = "ui-observability.batch.";
|
|
|
228
232
|
export declare const BATCH_KEY_TIME_WIDTH = 14;
|
|
229
233
|
/** localStorage key prefix for a batch that exit flush stores. */
|
|
230
234
|
export declare const EMERGENCY_STORAGE_KEY_PREFIX = "ui-observability.emergency.";
|
|
231
|
-
/**
|
|
235
|
+
/** Maximum number of exit batches in the emergency queue. */
|
|
232
236
|
export declare const EMERGENCY_MAX_ENTRIES = 20;
|
|
233
|
-
/** Key
|
|
237
|
+
/** Key that the library writes to test if localStorage accepts writes. */
|
|
234
238
|
export declare const STORAGE_PROBE_KEY = "ui-observability.probe";
|
|
235
239
|
/** Fraction of the store to evict on a quota error (1 in N). */
|
|
236
240
|
export declare const QUOTA_EVICTION_DIVISOR = 4;
|
|
@@ -253,7 +257,7 @@ export declare const STORAGE_NAME_INDEXEDDB = "indexeddb";
|
|
|
253
257
|
export declare const STORAGE_NAME_LOCAL = "localstorage";
|
|
254
258
|
/** In-memory adapter/strategy name. */
|
|
255
259
|
export declare const STORAGE_NAME_MEMORY = "memory";
|
|
256
|
-
/**
|
|
260
|
+
/** Name of the storage adapter that keeps nothing. */
|
|
257
261
|
export declare const STORAGE_NAME_NONE = "none";
|
|
258
262
|
/**
|
|
259
263
|
* Origin-wide lock name a drain runs under.
|
|
@@ -325,8 +329,15 @@ export declare const FNV_OFFSET_BASIS = 2166136261;
|
|
|
325
329
|
export declare const FNV_PRIME = 16777619;
|
|
326
330
|
/** Largest 32-bit unsigned value. */
|
|
327
331
|
export declare const UINT32_MAX = 4294967295;
|
|
332
|
+
/**
|
|
333
|
+
* Types that minLevel does not drop. An action is an audit fact and a metric is a measurement.
|
|
334
|
+
* The remote rate cap for records below minLevel does not apply to them.
|
|
335
|
+
*/
|
|
336
|
+
export declare const LEVEL_BYPASS_TYPES: readonly LogType[];
|
|
328
337
|
/** Record kind routed to the metric stream. */
|
|
329
338
|
export declare const LOG_TYPE_METRIC: LogType;
|
|
339
|
+
/** Record kind of an audit fact. Storage and the hold buffers drop it last. */
|
|
340
|
+
export declare const LOG_TYPE_ACTION: LogType;
|
|
330
341
|
/** Protocol identifier for bus envelopes. The bus drops an envelope with a different version. */
|
|
331
342
|
export declare const BUS_PROTOCOL = "ui-observability/1";
|
|
332
343
|
/** Global window property key used to locate a same-origin runtime instance. */
|
|
@@ -371,7 +382,7 @@ export declare const GAP_REPORT_THROTTLE_MS = 60000;
|
|
|
371
382
|
export declare const CAPTURE_NAMESPACE = "uiobs.capture";
|
|
372
383
|
/** Default namespace for telemetry records emitted by storage subsystems. */
|
|
373
384
|
export declare const STORAGE_NAMESPACE = "uiobs.storage";
|
|
374
|
-
/**
|
|
385
|
+
/** Measurement unit that the library uses when the call gives no unit. */
|
|
375
386
|
export declare const DEFAULT_METRIC_UNIT = "count";
|
|
376
387
|
/** Default `service.name` when a consumer sets none. */
|
|
377
388
|
export declare const UNKNOWN_SERVICE_NAME = "unknown-service";
|
|
@@ -398,24 +409,17 @@ export declare const REMOTE_SAMPLING_POLL_MS = 30000;
|
|
|
398
409
|
* Config keys with no default, excluded from `DEFAULT_CONFIG`.
|
|
399
410
|
* @see {@link DEFAULT_CONFIG}
|
|
400
411
|
*/
|
|
401
|
-
export declare const UNDEFAULTED_CONFIG_KEYS: readonly ["redact", "onDiagnostic", "headers", "serializer", "otelLoader", "transport", "transportOnExit"];
|
|
412
|
+
export declare const UNDEFAULTED_CONFIG_KEYS: readonly ["redact", "onDiagnostic", "onDrop", "headers", "serializer", "otelLoader", "transport", "transportOnExit"];
|
|
402
413
|
/**
|
|
403
414
|
* Nested config section keys.
|
|
404
415
|
* @see {@link ResolvedConfig}
|
|
405
416
|
*/
|
|
406
|
-
export declare const CONFIG_SECTIONS: readonly ["sampling", "bus", "capture"];
|
|
417
|
+
export declare const CONFIG_SECTIONS: readonly ["sampling", "bus", "journey", "batching", "retention", "limits", "capture"];
|
|
407
418
|
/**
|
|
408
419
|
* Section keys with no default, excluded from their section of `DEFAULT_CONFIG`.
|
|
409
420
|
* @see {@link UNDEFAULTED_CONFIG_KEYS}
|
|
410
421
|
*/
|
|
411
422
|
export declare const UNDEFAULTED_SECTION_KEYS: Record<(typeof CONFIG_SECTIONS)[number], string[]>;
|
|
412
|
-
/**
|
|
413
|
-
* Default runtime config before the consumer calls `configure()`. It excludes `serializer`.
|
|
414
|
-
* `resolveConfig` supplies that default to prevent a circular import.
|
|
415
|
-
* @see {@link ResolvedConfig}
|
|
416
|
-
* @see {@link UNDEFAULTED_CONFIG_KEYS}
|
|
417
|
-
*/
|
|
418
|
-
export declare const DEFAULT_CONFIG: Omit<ResolvedConfig, "serializer">;
|
|
419
423
|
/** Console mirroring level used when a consumer passes `console: true`. */
|
|
420
424
|
export declare const CONSOLE_DEFAULT_LEVEL: LogLevel;
|
|
421
425
|
/** Max time a partial log batch waits before the pipeline sends it, in milliseconds. */
|
|
@@ -453,7 +457,7 @@ export declare const RETRY_MAX_DELAY_MS = 60000;
|
|
|
453
457
|
export declare const RETRY_IDLE_DELAY_MS = 30000;
|
|
454
458
|
/** Max time a journey stays open, in milliseconds. Then the library treats it as abandoned. */
|
|
455
459
|
export declare const JOURNEY_MAX_AGE_MS: number;
|
|
456
|
-
/**
|
|
460
|
+
/** True if the journey ends for all contexts when the owning context closes. */
|
|
457
461
|
export declare const JOURNEY_END_ON_OWNER_CLOSE = false;
|
|
458
462
|
/** Query parameter checked at boot for a seeded journey token. */
|
|
459
463
|
export declare const JOURNEY_URL_PARAM = "__uiobs_journey";
|
|
@@ -463,8 +467,14 @@ export declare const BUS_CHANNEL_NAME = "ui_observability_control";
|
|
|
463
467
|
export declare const BUS_HANDSHAKE_TIMEOUT_MS = 1500;
|
|
464
468
|
/** Handshake attempts allowed before a cross-origin forwarder promotes itself to sender. */
|
|
465
469
|
export declare const BUS_MAX_HANDSHAKE_ATTEMPTS = 3;
|
|
466
|
-
/** Max records
|
|
470
|
+
/** Max records that are not actions in one hold buffer. A full buffer drops the oldest. */
|
|
467
471
|
export declare const BUS_MAX_BOOT_BUFFER_RECORDS = 500;
|
|
472
|
+
/** Max action records in one hold buffer. Actions have their own cap. A log storm cannot push one out. */
|
|
473
|
+
export declare const BUS_MAX_BOOT_BUFFER_ACTIONS = 2000;
|
|
474
|
+
/** Max different values in each list of an onDrop summary. */
|
|
475
|
+
export declare const DROP_SUMMARY_MAX_ITEMS = 20;
|
|
476
|
+
/** Max characters of an untrusted message type in a diagnostic detail. The sender sets the text. */
|
|
477
|
+
export declare const BUS_TYPE_DETAIL_MAX_CHARS = 32;
|
|
468
478
|
/** Breadcrumbs kept as context for the next error. */
|
|
469
479
|
export declare const MAX_BREADCRUMBS = 50;
|
|
470
480
|
/**
|
|
@@ -483,3 +493,11 @@ export declare const RECORD_LIMITS: {
|
|
|
483
493
|
maxNodes: number;
|
|
484
494
|
maxRecordBytes: number;
|
|
485
495
|
};
|
|
496
|
+
/**
|
|
497
|
+
* Default runtime config before the consumer calls `configure()`. It excludes `serializer`.
|
|
498
|
+
* `resolveConfig` supplies that default to prevent a circular import.
|
|
499
|
+
* It comes after the constants that it reads. A const cannot be read before its line.
|
|
500
|
+
* @see {@link ResolvedConfig}
|
|
501
|
+
* @see {@link UNDEFAULTED_CONFIG_KEYS}
|
|
502
|
+
*/
|
|
503
|
+
export declare const DEFAULT_CONFIG: Omit<ResolvedConfig, "serializer">;
|
|
@@ -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_redact" | "record.dropped_boot_buffer_full" | "record.dropped_malformed" | "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" | "openfin.unavailable" | "platform.api_blocked" | "handler.threw";
|
|
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_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" | "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. */
|
|
@@ -64,7 +64,7 @@ export declare class Diagnostics {
|
|
|
64
64
|
* @param code Diagnostic code to report on rejection.
|
|
65
65
|
* @param message ASD-STE100 sentence that states the failure. The handler gets it as the event message.
|
|
66
66
|
* @param fn Async function to execute.
|
|
67
|
-
* @returns Promise
|
|
67
|
+
* @returns Promise that resolves to the return value, or undefined on rejection.
|
|
68
68
|
*/
|
|
69
69
|
guardAsync<T>(code: DiagnosticCode, message: string, fn: () => Promise<T>): Promise<T | undefined>;
|
|
70
70
|
/**
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ResolvedConfig } from "../models/config";
|
|
2
|
+
import type { LossReason } from "../models/drop";
|
|
3
|
+
import type { LogRecord } from "../models/log-record";
|
|
4
|
+
import type { Diagnostics } from "./diagnostics";
|
|
5
|
+
/** Collects lost records and gives one summary for each reason to the onDrop hook. */
|
|
6
|
+
export declare class DropReporter {
|
|
7
|
+
private readonly config;
|
|
8
|
+
private readonly diagnostics;
|
|
9
|
+
/** Summaries that wait for the end of the task, one for each reason. */
|
|
10
|
+
private readonly pending;
|
|
11
|
+
/** True while a microtask waits to send the summaries. */
|
|
12
|
+
private scheduled;
|
|
13
|
+
/** True while the hook runs. A loss that the hook causes is not reported again. */
|
|
14
|
+
private reporting;
|
|
15
|
+
/**
|
|
16
|
+
* @param config Active configuration. The reporter reads `onDrop` from it at each call.
|
|
17
|
+
* @param diagnostics Diagnostics reporter.
|
|
18
|
+
*/
|
|
19
|
+
constructor(config: ResolvedConfig, diagnostics: Diagnostics);
|
|
20
|
+
/**
|
|
21
|
+
* Adds lost records to the summary of their reason. Without an onDrop hook, it does nothing.
|
|
22
|
+
* @param reason Cause of the loss.
|
|
23
|
+
* @param records Lost records.
|
|
24
|
+
* @param batchIds Ids of the lost batches.
|
|
25
|
+
*/
|
|
26
|
+
add(reason: LossReason, records: readonly LogRecord[], batchIds?: readonly string[]): void;
|
|
27
|
+
/** Gives each waiting summary to the hook. A hook that throws does not stop the others. */
|
|
28
|
+
private flush;
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { LogRecord } from "../models/log-record";
|
|
2
|
+
/** Holds records in arrival order. A full buffer drops its oldest record of the same kind. */
|
|
3
|
+
export declare class HoldBuffer {
|
|
4
|
+
private readonly onDrop;
|
|
5
|
+
/** Held records in arrival order. */
|
|
6
|
+
private held;
|
|
7
|
+
/** Number of held actions. A count finds a full buffer without a scan at each push. */
|
|
8
|
+
private actions;
|
|
9
|
+
/**
|
|
10
|
+
* @param onDrop Receives the record that a full buffer drops.
|
|
11
|
+
*/
|
|
12
|
+
constructor(onDrop: (record: LogRecord) => void);
|
|
13
|
+
/** Held records in arrival order. */
|
|
14
|
+
get records(): readonly LogRecord[];
|
|
15
|
+
/** Number of held records. */
|
|
16
|
+
get length(): number;
|
|
17
|
+
/**
|
|
18
|
+
* Adds a record. A full buffer drops its oldest record of the same kind.
|
|
19
|
+
* @param record Record to hold.
|
|
20
|
+
*/
|
|
21
|
+
push(record: LogRecord): void;
|
|
22
|
+
/**
|
|
23
|
+
* Removes the held records.
|
|
24
|
+
* @returns The records in arrival order.
|
|
25
|
+
*/
|
|
26
|
+
take(): LogRecord[];
|
|
27
|
+
}
|
package/dist/core/journey.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Diagnostics } from "./diagnostics";
|
|
|
4
4
|
export interface JourneyOptions {
|
|
5
5
|
/** Maximum open time of a journey, in milliseconds. After this time, the engine ends it. */
|
|
6
6
|
maxAgeMs: number;
|
|
7
|
-
/**
|
|
7
|
+
/** True if the journey ends for all contexts when the owning context closes. */
|
|
8
8
|
endOnOwnerClose: boolean;
|
|
9
9
|
/** Query parameter checked at boot for a seeded journey token. */
|
|
10
10
|
urlParam: string;
|
|
@@ -24,6 +24,13 @@ export interface Journey {
|
|
|
24
24
|
/** Context identifier of the document that started the journey. */
|
|
25
25
|
ownerContextId: string;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Parses and validates an unknown value into a Journey object. The value comes from
|
|
29
|
+
* sessionStorage or from a bus message of another realm.
|
|
30
|
+
* @param value Unverified parsed JSON value.
|
|
31
|
+
* @returns Validated Journey instance or null.
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseJourney(value: unknown): Journey | null;
|
|
27
34
|
/** Manages journey lifecycle, cross-window adoption, storage synchronization, and expiration. */
|
|
28
35
|
export declare class JourneyEngine {
|
|
29
36
|
private readonly options;
|
|
@@ -48,7 +55,7 @@ export declare class JourneyEngine {
|
|
|
48
55
|
/**
|
|
49
56
|
* Finds and adopts the initial journey. It checks the URL query, then sessionStorage,
|
|
50
57
|
* then OpenFin customData.
|
|
51
|
-
* @returns Promise
|
|
58
|
+
* @returns Promise that resolves when journey initialization completes.
|
|
52
59
|
*/
|
|
53
60
|
bootstrap(): Promise<void>;
|
|
54
61
|
/**
|
|
@@ -81,7 +88,7 @@ export declare class JourneyEngine {
|
|
|
81
88
|
* Validates and adopts a serialized journey token.
|
|
82
89
|
* @param token Base64url journey token.
|
|
83
90
|
* @param source Originating source description for diagnostics.
|
|
84
|
-
* @param broadcast
|
|
91
|
+
* @param broadcast True to send the adoption to the connected bus peers.
|
|
85
92
|
* @returns True if the token was valid, unexpired, and adopted.
|
|
86
93
|
*/
|
|
87
94
|
adopt(token: string, source: string, broadcast?: boolean): boolean;
|
|
@@ -120,11 +127,16 @@ export declare class JourneyEngine {
|
|
|
120
127
|
* @returns Token string or null.
|
|
121
128
|
*/
|
|
122
129
|
private readUrlToken;
|
|
130
|
+
/**
|
|
131
|
+
* Removes the journey token from the address bar after the engine adopts it.
|
|
132
|
+
* If not, a copy or a bookmark of the link starts the same journey in another session.
|
|
133
|
+
*/
|
|
134
|
+
private removeUrlToken;
|
|
123
135
|
/**
|
|
124
136
|
* Reads the journey token from the customData of the OpenFin window options.
|
|
125
137
|
* OPENFIN_OPTIONS_TIMEOUT_MS limits the wait. At the deadline, it reports
|
|
126
138
|
* openfin.unavailable and returns no token. A window without a token gives the same result.
|
|
127
|
-
* @returns Promise
|
|
139
|
+
* @returns Promise that resolves to token string or null.
|
|
128
140
|
*/
|
|
129
141
|
private readOpenFinToken;
|
|
130
142
|
}
|
package/dist/core/logger.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export declare class OneLogger {
|
|
|
10
10
|
private readonly bind;
|
|
11
11
|
readonly namespace: string;
|
|
12
12
|
private readonly options;
|
|
13
|
+
/** log.type of the level methods. It is "system" only for the namespaces of the library. */
|
|
14
|
+
private readonly levelType;
|
|
13
15
|
/**
|
|
14
16
|
* @param bind Returns the runtime for each write.
|
|
15
17
|
* A logger that exists before configure() writes to the configured runtime.
|
|
@@ -98,7 +100,7 @@ export declare class OneLogger {
|
|
|
98
100
|
* @param label Metric name prefix.
|
|
99
101
|
* @param fn Asynchronous function to time.
|
|
100
102
|
* @param attributes Optional contextual attributes.
|
|
101
|
-
* @returns Promise
|
|
103
|
+
* @returns Promise that resolves to the result of the timed function.
|
|
102
104
|
*/
|
|
103
105
|
timeAsync: <T>(label: string, fn: () => Promise<T>, attributes?: Record<string, unknown>) => Promise<T>;
|
|
104
106
|
/**
|
|
@@ -107,6 +109,7 @@ export declare class OneLogger {
|
|
|
107
109
|
* @param type Record classification.
|
|
108
110
|
* @param body Primary message.
|
|
109
111
|
* @param payload Optional contextual attributes.
|
|
112
|
+
* @param copied True when the payload is a copy that the library made. write() does not copy it.
|
|
110
113
|
*/
|
|
111
114
|
private write;
|
|
112
115
|
/**
|
|
@@ -126,10 +129,11 @@ export declare class OneLogger {
|
|
|
126
129
|
* @param payload Caller payload.
|
|
127
130
|
* @param error Error of an error call.
|
|
128
131
|
* @param record Built record, or null if the library did not build it or redact dropped it.
|
|
132
|
+
* @param dropped Reason of the drop when the builder dropped the record.
|
|
129
133
|
*/
|
|
130
134
|
private print;
|
|
131
135
|
/**
|
|
132
|
-
* Tests
|
|
136
|
+
* Tests if the console prints a level that the library does not send.
|
|
133
137
|
* @param runtime Runtime of this write.
|
|
134
138
|
* @param level Severity level.
|
|
135
139
|
* @returns True if logging is on and the console accepts the level.
|
package/dist/core/pipeline.d.ts
CHANGED
|
@@ -13,12 +13,7 @@ export interface StreamOptions {
|
|
|
13
13
|
/** Maximum records in a batch. At this count, the pipeline sends the batch early. */
|
|
14
14
|
batchSize: number;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
17
|
-
* Batching policy per stream. Metrics use larger batches and a longer interval.
|
|
18
|
-
* Metrics have a higher volume, and no process waits for them.
|
|
19
|
-
*/
|
|
20
|
-
export declare const STREAM_OPTIONS: Record<StreamName, StreamOptions>;
|
|
21
|
-
/** Buffers log and metric streams, makes batches and sends them over HTTP. */
|
|
16
|
+
/** Buffers the log and metric streams. It makes batches. It sends them over HTTP. */
|
|
22
17
|
export declare class LogPipeline {
|
|
23
18
|
private readonly transport;
|
|
24
19
|
private readonly storage;
|
|
@@ -30,22 +25,24 @@ export declare class LogPipeline {
|
|
|
30
25
|
private readonly unconfirmed;
|
|
31
26
|
/** Closed batches waiting for a free dispatch slot. */
|
|
32
27
|
private readonly queue;
|
|
28
|
+
/** Each batch in the queue or in flight. flushPending waits for them. destroy() resolves them. */
|
|
29
|
+
private readonly open;
|
|
33
30
|
/** Ceiling on the ERROR and FATAL records that bypass sampling. */
|
|
34
31
|
private readonly ceiling;
|
|
35
|
-
/**
|
|
32
|
+
/** Number of dispatches in flight. MAX_CONCURRENT_REQUESTS is the limit. */
|
|
36
33
|
private inFlight;
|
|
37
34
|
/** It is true when a pump is in the queue. One microtask then drains a burst. */
|
|
38
35
|
private pumpScheduled;
|
|
39
|
-
/**
|
|
36
|
+
/** True after destroy() stops the pipeline. */
|
|
40
37
|
private stopped;
|
|
41
38
|
/**
|
|
42
39
|
* @param transport HTTP transport for live batch delivery.
|
|
43
40
|
* @param storage Storage adapter for offline batch persistence.
|
|
44
41
|
* @param retry Retry engine for redelivering persisted batches.
|
|
45
42
|
* @param diagnostics Diagnostics reporter.
|
|
46
|
-
* @param streamOptions Batching policy per stream.
|
|
43
|
+
* @param streamOptions Batching policy per stream, from the batching config.
|
|
47
44
|
*/
|
|
48
|
-
constructor(transport: BatchTransport, storage: StorageAdapter, retry: RetryEngine, diagnostics: Diagnostics, streamOptions
|
|
45
|
+
constructor(transport: BatchTransport, storage: StorageAdapter, retry: RetryEngine, diagnostics: Diagnostics, streamOptions: Record<StreamName, StreamOptions>);
|
|
49
46
|
/**
|
|
50
47
|
* Sets the observed timestamp and adds a record to the pipeline.
|
|
51
48
|
* @param record Record to push.
|
|
@@ -56,7 +53,7 @@ export declare class LogPipeline {
|
|
|
56
53
|
* An in-flight batch has its own ID and its send is not complete. If this method
|
|
57
54
|
* takes it, the pipeline sends each record again under a new ID. The server cannot
|
|
58
55
|
* deduplicate that ID.
|
|
59
|
-
* @returns Combined LogBatch or null if no records
|
|
56
|
+
* @returns Combined LogBatch, or null if the buffers hold no records.
|
|
60
57
|
*/
|
|
61
58
|
drainPending(): LogBatch | null;
|
|
62
59
|
/**
|
|
@@ -67,12 +64,19 @@ export declare class LogPipeline {
|
|
|
67
64
|
* @returns Combined LogBatch or null if no records are pending.
|
|
68
65
|
*/
|
|
69
66
|
drainForExit(): LogBatch | null;
|
|
67
|
+
/**
|
|
68
|
+
* Sends the buffered records through the normal dispatch path. Then it waits for each
|
|
69
|
+
* batch in the queue and in flight. The throttle check and the concurrency limit apply.
|
|
70
|
+
* A direct send goes around both.
|
|
71
|
+
* @returns Promise that resolves when the pipeline sends or stores each batch, or on destroy.
|
|
72
|
+
*/
|
|
73
|
+
flushPending(): Promise<void>;
|
|
70
74
|
/** Stops the flush timers and refuses further records. */
|
|
71
75
|
destroy(): void;
|
|
72
76
|
/**
|
|
73
77
|
* Wraps drained records in a batch.
|
|
74
78
|
* @param records Records taken from the buffers, in delivery order.
|
|
75
|
-
* @returns New LogBatch, or null when
|
|
79
|
+
* @returns New LogBatch, or null when the drain takes nothing.
|
|
76
80
|
*/
|
|
77
81
|
private toBatch;
|
|
78
82
|
/**
|
|
@@ -93,14 +97,14 @@ export declare class LogPipeline {
|
|
|
93
97
|
/**
|
|
94
98
|
* Queues a batch and schedules the pump on a microtask. An inline dispatch starts
|
|
95
99
|
* a fetch inside the log call of the application.
|
|
96
|
-
* @param batch Batch ready for delivery.
|
|
100
|
+
* @param batch Batch ready for delivery, or null when the drain found no records.
|
|
97
101
|
*/
|
|
98
102
|
private enqueue;
|
|
99
103
|
/** Starts queued dispatches up to the concurrency limit. */
|
|
100
104
|
private pump;
|
|
101
105
|
/**
|
|
102
|
-
* Delivers one batch
|
|
103
|
-
* @param
|
|
106
|
+
* Delivers one batch. It then frees the concurrency slot. It resolves the promise of the batch.
|
|
107
|
+
* @param pending Batch to deliver.
|
|
104
108
|
*/
|
|
105
109
|
private run;
|
|
106
110
|
/**
|
|
@@ -117,7 +121,7 @@ export declare class LogPipeline {
|
|
|
117
121
|
*/
|
|
118
122
|
private storeFailed;
|
|
119
123
|
/**
|
|
120
|
-
* Stores an undelivered batch
|
|
124
|
+
* Stores an undelivered batch. Then it starts the retry engine. A deadline limits the
|
|
121
125
|
* wait. A storage call that does not settle holds this dispatch slot. Two such calls
|
|
122
126
|
* stop the pipeline.
|
|
123
127
|
* @param batch Batch to persist.
|
package/dist/core/record.d.ts
CHANGED
|
@@ -39,11 +39,14 @@ export interface RecordLimits extends SanitizeLimits {
|
|
|
39
39
|
/** Max total attribute bytes per record. */
|
|
40
40
|
maxRecordBytes: number;
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
43
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Reason a record was not built. "malformed" means the redact hook broke the record shape
|
|
44
|
+
* or set an unknown severityText.
|
|
45
|
+
*/
|
|
46
|
+
export type DropReason = "level" | "sampling" | "redact" | "malformed";
|
|
44
47
|
/** Outcome of one build call. */
|
|
45
48
|
export interface BuildResult {
|
|
46
|
-
/** Completed record, or null when
|
|
49
|
+
/** Completed record, or null when the builder drops it. */
|
|
47
50
|
record: LogRecord | null;
|
|
48
51
|
/** Reason for the drop. It is absent when the builder built a record. */
|
|
49
52
|
dropped?: DropReason;
|
|
@@ -76,14 +79,16 @@ export declare class RecordBuilder {
|
|
|
76
79
|
invalidateResource(): void;
|
|
77
80
|
/**
|
|
78
81
|
* Checks if logging is on and the level is at or above minLevel.
|
|
82
|
+
* minLevel does not apply to an action or a metric.
|
|
79
83
|
* @param level Target log severity level.
|
|
80
|
-
* @
|
|
84
|
+
* @param type Record type. Without it, the check applies minLevel.
|
|
85
|
+
* @returns True if the library builds a record of this level and type.
|
|
81
86
|
*/
|
|
82
|
-
isEnabled(level: LogLevel): boolean;
|
|
87
|
+
isEnabled(level: LogLevel, type?: LogType): boolean;
|
|
83
88
|
/**
|
|
84
89
|
* Builds a structured LogRecord from the input. It sanitizes attributes and applies size limits.
|
|
85
90
|
* @param input Logger call input parameters.
|
|
86
|
-
* @returns The record, or null with the reason
|
|
91
|
+
* @returns The record, or null with the reason of the drop.
|
|
87
92
|
*/
|
|
88
93
|
build(input: BuildInput): BuildResult;
|
|
89
94
|
/**
|
|
@@ -54,7 +54,7 @@ export declare class RemoteSampling {
|
|
|
54
54
|
current(): RemoteRules | null;
|
|
55
55
|
/**
|
|
56
56
|
* Returns the lowest level that the library sends.
|
|
57
|
-
* @returns The remote level if it is lower than `minLevel
|
|
57
|
+
* @returns The remote level if it is lower than `minLevel`. If not, `minLevel`.
|
|
58
58
|
*/
|
|
59
59
|
minLevel(): LogLevel;
|
|
60
60
|
/**
|