@interopio/otel 0.1.15 → 0.1.17

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/dist/index.d.ts CHANGED
@@ -39,6 +39,13 @@ export type InstanceCrashHandler = IOInsights.InstanceCrashHandler;
39
39
  export type InstanceCrashHandlerArgs = IOInsights.InstanceCrashHandlerArgs;
40
40
  export type InstanceErrorHandler = IOInsights.InstanceErrorHandler;
41
41
  export type InstanceErrorHandlerArgs = IOInsights.InstanceErrorHandlerArgs;
42
+ export type InstanceHangHandler = IOInsights.InstanceHangHandler;
43
+ export type InstanceHangHandlerArgs = IOInsights.InstanceHangHandlerArgs;
44
+ export type InstanceLoadFailedHandler = IOInsights.InstanceLoadFailedHandler;
45
+ export type InstanceLoadFailedHandlerArgs = IOInsights.InstanceLoadFailedHandlerArgs;
46
+ export type InstanceReloadHandler = IOInsights.InstanceReloadHandler;
47
+ export type InstanceReloadHandlerArgs = IOInsights.InstanceReloadHandlerArgs;
48
+ export type ApplicationStack = IOInsights.ApplicationStack;
42
49
  export type InstanceFocusedHandler = IOInsights.InstanceFocusedHandler;
43
50
  export type InstanceFocusedHandlerArgs = IOInsights.InstanceFocusedHandlerArgs;
44
51
  export type InstanceReadyHandler = IOInsights.InstanceReadyHandler;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASC,CAAC;AAKF,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,wDAAuD;AAA9C,8GAAA,aAAa,OAAA;AACtB,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AA0BlB,uCAA4C;AAAnC,kGAAA,UAAU,OAAA;AACnB,+EAA8E;AAArE,oIAAA,wBAAwB,OAAA;AAgEjC,0DAAoD;AAC3C,iBADF,gBAAM,CACE;AAAE,yFADC,iBAAQ,OACD;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L,CAAC;AACD,IAAK,cAcJ;AAdD,WAAK,cAAc;IACjB;;OAEG;IACH,qDAAS,CAAA;IACT;;;OAGG;IACH,+CAAM,CAAA;IACN;;OAEG;IACH,qDAAS,CAAA;AACX,CAAC,EAdI,cAAc,8BAAd,cAAc,QAclB"}
@@ -7,6 +7,9 @@ export declare class MetricsDependencyBuilder {
7
7
  private instanceFocusedHandler;
8
8
  private instanceErrorHandler;
9
9
  private instanceCrashHandler;
10
+ private instanceHangHandler;
11
+ private instanceLoadFailedHandler;
12
+ private instanceReloadHandler;
10
13
  private layoutRestoredHandler;
11
14
  private platformStartedHandler;
12
15
  private platformErrorHandler;
@@ -31,6 +34,9 @@ export declare class MetricsDependencyBuilder {
31
34
  withInstanceFocusedHandler(instanceFocusedHandler: IOInsights.InstanceFocusedHandler): this;
32
35
  withInstanceErrorHandler(instanceErrorHandler: IOInsights.InstanceErrorHandler): this;
33
36
  withInstanceCrashHandler(instanceCrashHandler: IOInsights.InstanceCrashHandler): this;
37
+ withInstanceHangHandler(instanceHangHandler: IOInsights.InstanceHangHandler): this;
38
+ withInstanceLoadFailedHandler(instanceLoadFailedHandler: IOInsights.InstanceLoadFailedHandler): this;
39
+ withInstanceReloadHandler(instanceReloadHandler: IOInsights.InstanceReloadHandler): this;
34
40
  withLayoutRestoredHandler(layoutRestoredHandler: IOInsights.LayoutRestoredHandler): this;
35
41
  withWorkspaceLoadedHandler(workspaceLoadedHandler: IOInsights.WorkspaceGenericActionHandler<IOInsights.WorkspaceLoadedHandlerArgs>): this;
36
42
  withWorkspaceSavedHandler(workspaceSavedHandler: IOInsights.WorkspaceGenericActionHandler<IOInsights.WorkspaceSavedHandlerArgs>): this;
@@ -11,6 +11,9 @@ class MetricsDependencyBuilder {
11
11
  this.instanceReadyHandler = () => () => { };
12
12
  this.instanceErrorHandler = () => () => { };
13
13
  this.instanceCrashHandler = () => () => { };
14
+ this.instanceHangHandler = () => () => { };
15
+ this.instanceLoadFailedHandler = () => () => { };
16
+ this.instanceReloadHandler = () => () => { };
14
17
  this.layoutRestoredHandler = () => () => { };
15
18
  this.platformStartedHandler = () => () => { };
16
19
  this.platformErrorHandler = () => () => { };
@@ -37,6 +40,9 @@ class MetricsDependencyBuilder {
37
40
  instanceFocusedHandler: this.instanceFocusedHandler,
38
41
  instanceErrorHandler: this.instanceErrorHandler,
39
42
  instanceCrashHandler: this.instanceCrashHandler,
43
+ instanceHangHandler: this.instanceHangHandler,
44
+ instanceLoadFailedHandler: this.instanceLoadFailedHandler,
45
+ instanceReloadHandler: this.instanceReloadHandler,
40
46
  layoutRestoredHandler: this.layoutRestoredHandler,
41
47
  platformStartedHandler: this.platformStartedHandler,
42
48
  platformErrorHandler: this.platformErrorHandler,
@@ -80,6 +86,18 @@ class MetricsDependencyBuilder {
80
86
  this.instanceCrashHandler = instanceCrashHandler;
81
87
  return this;
82
88
  }
89
+ withInstanceHangHandler(instanceHangHandler) {
90
+ this.instanceHangHandler = instanceHangHandler;
91
+ return this;
92
+ }
93
+ withInstanceLoadFailedHandler(instanceLoadFailedHandler) {
94
+ this.instanceLoadFailedHandler = instanceLoadFailedHandler;
95
+ return this;
96
+ }
97
+ withInstanceReloadHandler(instanceReloadHandler) {
98
+ this.instanceReloadHandler = instanceReloadHandler;
99
+ return this;
100
+ }
83
101
  withLayoutRestoredHandler(layoutRestoredHandler) {
84
102
  this.layoutRestoredHandler = layoutRestoredHandler;
85
103
  return this;
@@ -1 +1 @@
1
- {"version":3,"file":"metricsDependencyBuilder.js","sourceRoot":"","sources":["../../src/metrics/metricsDependencyBuilder.ts"],"names":[],"mappings":";;;AACA,yDAA6D;AAC7D,MAAa,wBAAwB;IA0BjC;QACI,IAAI,CAAC,mBAAmB,GAAG,IAAI,0CAAuB,EAAE,CAAC;QACzD,IAAI,CAAC,sBAAsB,GAAG,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC9C,IAAI,CAAC,sBAAsB,GAAG,GAAG,EAAE,CAAC,GAAG,EAA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G,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,2BAA2B,CAAC,uBAAyG;QACxI,IAAI,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;QACvD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,gCAAgC,CAAC,4BAAkH;QACtJ,IAAI,CAAC,4BAA4B,GAAG,4BAA4B,CAAC;QACjE,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,6BAA6B,CAAC,yBAA+G;QAChJ,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;QAC3D,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,iCAAiC,CAAC,6BAAmH;QACxJ,IAAI,CAAC,6BAA6B,GAAG,6BAA6B,CAAC;QACnE,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,wCAAwC,CAAC,oCAA0H;QACtK,IAAI,CAAC,oCAAoC,GAAG,oCAAoC,CAAC;QACjF,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,oCAAoC,CAAC,gCAAsH;QAC9J,IAAI,CAAC,gCAAgC,GAAG,gCAAgC,CAAC;QACzE,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,+BAA+B,CAAC,2BAAiH;QACpJ,IAAI,CAAC,2BAA2B,GAAG,2BAA2B,CAAC;QAC/D,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAhOD,4DAgOC"}
@@ -1,8 +1,11 @@
1
+ import { Attributes, ObservableResult } from "@opentelemetry/api";
1
2
  import { IOInsights } from "../../insights";
2
3
  import { NullManager } from "../nullManager";
3
4
  export declare class NullMetricsManager extends NullManager<IOInsights.MetricsSettings> implements IOInsights.MetricsManager {
4
5
  constructor(settings: IOInsights.MetricsSettings | undefined, otelSettings: IOInsights.Settings | undefined, logger: IOInsights.Logger);
6
+ getObservable<TData extends Attributes>(name: string, observeCallback: (result: ObservableResult<TData>) => Promise<void>, subscribeCallback?: () => Promise<void>, unsubscribeCallback?: () => Promise<void>): IOInsights.Metric | undefined;
7
+ getObservableFromSettings<TData extends Attributes>(settings: IOInsights.MetricSettings, observeCallback: (result: ObservableResult<TData>) => Promise<void>, subscribeCallback?: () => Promise<void>, unsubscribeCallback?: () => Promise<void>): IOInsights.Metric | undefined;
5
8
  waitForFinalExport(timeoutMs?: number | undefined): Promise<void>;
6
9
  getFromSettings(settings: IOInsights.MetricSettings): IOInsights.Metric | undefined;
7
- get(type: IOInsights.MetricType): IOInsights.Metric | undefined;
10
+ get(name: string): IOInsights.Metric | undefined;
8
11
  }
@@ -11,14 +11,20 @@ class NullMetricsManager extends nullManager_1.NullManager {
11
11
  }
12
12
  super();
13
13
  }
14
+ getObservable(name, observeCallback, subscribeCallback, unsubscribeCallback) {
15
+ return new null_1.NullMetric({ name, type: "null", enabled: false, description: name });
16
+ }
17
+ getObservableFromSettings(settings, observeCallback, subscribeCallback, unsubscribeCallback) {
18
+ return new null_1.NullMetric(settings);
19
+ }
14
20
  waitForFinalExport(timeoutMs) {
15
21
  return Promise.resolve();
16
22
  }
17
23
  getFromSettings(settings) {
18
24
  return new null_1.NullMetric(settings);
19
25
  }
20
- get(type) {
21
- return new null_1.NullMetric({ name: type, type, enabled: false, description: type });
26
+ get(name) {
27
+ return new null_1.NullMetric({ name, type: "null", enabled: false, description: name });
22
28
  }
23
29
  }
24
30
  exports.NullMetricsManager = NullMetricsManager;
@@ -1 +1 @@
1
- {"version":3,"file":"nullMetricsManager.js","sourceRoot":"","sources":["../../src/metrics/nullMetricsManager.ts"],"names":[],"mappings":";;;AACA,gDAA6C;AAC7C,4DAAwD;AACxD,iCAAoC;AACpC,MAAa,kBAAmB,SAAQ,yBAAuC;IAC3E,YAAY,QAAgD,EAAE,YAA6C,EAAE,MAAyB;QAClI,IAAI,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,oBAAoB,MAAK,KAAK,EAAE,CAAC;YAC/C,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE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;QACzC,OAAO,IAAI,iBAAU,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,kBAAkB,CAAC,SAA8B;QAC7C,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IACD,eAAe,CAAC,QAAmC;QAC/C,OAAO,IAAI,iBAAU,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IACM,GAAG,CAAC,IAAY;QACnB,OAAO,IAAI,iBAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IACrF,CAAC;CACJ;AAjCD,gDAiCC"}
package/insights.d.ts CHANGED
@@ -539,7 +539,10 @@ export namespace IOInsights {
539
539
  | "app_duration"
540
540
  | "app_duration_soft"
541
541
  | "app_error"
542
+ | "app_hang"
543
+ | "app_load_failed"
542
544
  | "app_memory"
545
+ | "app_reload"
543
546
  | "app_started"
544
547
  | "app_startup"
545
548
  | "app_stopped"
@@ -647,6 +650,9 @@ export namespace IOInsights {
647
650
  instanceFocusedHandler: InstanceFocusedHandler;
648
651
  instanceErrorHandler: InstanceErrorHandler;
649
652
  instanceCrashHandler: InstanceCrashHandler;
653
+ instanceHangHandler: InstanceHangHandler;
654
+ instanceLoadFailedHandler: InstanceLoadFailedHandler;
655
+ instanceReloadHandler: InstanceReloadHandler;
650
656
  layoutRestoredHandler: LayoutRestoredHandler;
651
657
  // vnikolov 2025-09-04 keeping these non-generic names to avoid breaking changes
652
658
  // in platforms
@@ -670,11 +676,19 @@ export namespace IOInsights {
670
676
  * @ignore
671
677
  */
672
678
  export type Unsubscribe = () => void;
679
+ /**
680
+ * Which runtime stack an application belongs to: "web" for renderer-backed
681
+ * applications (windows, workspaces, web groups), "exe" for external
682
+ * processes, "node" for node processes. Published as a metric attribute on
683
+ * the app_* metrics.
684
+ */
685
+ export type ApplicationStack = "web" | "exe" | "node" | "unknown";
673
686
  /**
674
687
  * @ignore
675
688
  */
676
689
  export interface InstanceActionHandlerArgs {
677
690
  application: string;
691
+ stack?: ApplicationStack;
678
692
  }
679
693
  /**
680
694
  * @ignore
@@ -685,6 +699,7 @@ export namespace IOInsights {
685
699
 
686
700
  export interface InstanceErrorHandlerArgs {
687
701
  application: string;
702
+ stack?: ApplicationStack;
688
703
  }
689
704
  /**
690
705
  * @ignore
@@ -708,6 +723,7 @@ export namespace IOInsights {
708
723
  export interface InstanceCrashHandlerArgs {
709
724
  application: string;
710
725
  reason: string;
726
+ stack?: ApplicationStack;
711
727
  }
712
728
  /**
713
729
  * @ignore
@@ -715,12 +731,72 @@ export namespace IOInsights {
715
731
  export type InstanceCrashHandler = (
716
732
  callback: (args: InstanceCrashHandlerArgs) => void
717
733
  ) => Unsubscribe;
734
+ /**
735
+ * @ignore
736
+ */
737
+ export interface InstanceHangHandlerArgs {
738
+ application: string;
739
+ /**
740
+ * How long the instance was unresponsive, in milliseconds: until it became
741
+ * responsive again, or until it was closed/killed while still hung.
742
+ */
743
+ durationMs: number;
744
+ /**
745
+ * Whether the instance became responsive again. false when it was
746
+ * closed/killed while still hung.
747
+ */
748
+ recovered?: boolean;
749
+ stack?: ApplicationStack;
750
+ }
751
+ /**
752
+ * @ignore
753
+ */
754
+ export type InstanceHangHandler = (
755
+ callback: (args: InstanceHangHandlerArgs) => void
756
+ ) => Unsubscribe;
757
+ /**
758
+ * @ignore
759
+ */
760
+ export interface InstanceLoadFailedHandlerArgs {
761
+ application: string;
762
+ /** Milliseconds from load start until the failure was determined. */
763
+ durationMs: number;
764
+ /** Why the load failed (e.g. "timeout", "crashed", "load-error"). */
765
+ reason?: string;
766
+ stack?: ApplicationStack;
767
+ }
768
+ /**
769
+ * @ignore
770
+ */
771
+ export type InstanceLoadFailedHandler = (
772
+ callback: (args: InstanceLoadFailedHandlerArgs) => void
773
+ ) => Unsubscribe;
774
+ /**
775
+ * @ignore
776
+ */
777
+ export interface InstanceReloadHandlerArgs {
778
+ application: string;
779
+ /**
780
+ * What initiated the reload, when known (e.g. "user" for F5/menu refresh,
781
+ * "app" for a page-initiated reload, "platform"). Keep the set of values
782
+ * small - it becomes a metric attribute.
783
+ */
784
+ initiator?: string;
785
+ stack?: ApplicationStack;
786
+ }
787
+ /**
788
+ * @ignore
789
+ */
790
+ export type InstanceReloadHandler = (
791
+ callback: (args: InstanceReloadHandlerArgs) => void
792
+ ) => Unsubscribe;
718
793
  /**
719
794
  * @ignore
720
795
  */
721
796
  export interface InstanceFocusedHandlerArgs {
722
797
  application: string;
723
798
  focused: boolean;
799
+ stack?: ApplicationStack;
724
800
  }
725
801
  /**
726
802
  * @ignore
@@ -847,6 +923,7 @@ export namespace IOInsights {
847
923
  startTime: Date;
848
924
  endTime: Date;
849
925
  api: string;
926
+ stack?: ApplicationStack;
850
927
  }
851
928
  /**
852
929
  * @ignore
@@ -886,6 +963,7 @@ export namespace IOInsights {
886
963
  app: string;
887
964
  instance: string;
888
965
  cpu: number;
966
+ stack?: ApplicationStack;
889
967
  }
890
968
  /**
891
969
  * @ignore
@@ -894,6 +972,7 @@ export namespace IOInsights {
894
972
  app: string;
895
973
  instance: string;
896
974
  memory: number;
975
+ stack?: ApplicationStack;
897
976
  }
898
977
  /**
899
978
  * @ignore
@@ -928,8 +1007,23 @@ export namespace IOInsights {
928
1007
  /**
929
1008
  * Called by the application to signify that its startup has completed
930
1009
  * and no further spans should be nested under the startup trace.
1010
+ *
1011
+ * @param reason Optional description of the startup finalization status, gets added to the span
931
1012
  */
932
- startupTraceFinished?: () => void;
1013
+ startupTraceFinished?: (reason?: string) => void;
1014
+
1015
+ /**
1016
+ * Instruments Electron's main-process `net` module (net.request and net.fetch)
1017
+ * with the request spans (source "interopio.api.instrumentation.electronNet" /
1018
+ * ".fetch") and the same request metrics as the renderer fetch/XHR
1019
+ * instrumentation. The net module is injected by the caller - io.Connect
1020
+ * Desktop's bootstrap, guarded by instrumentRequests.platform - because the
1021
+ * io.Insights packages have no electron dependency. Honors the
1022
+ * instrumentRequests configuration (ignore/match patterns, ignoreTelemetryURLs,
1023
+ * errorStatusCodes, spanNames, metric flags); no-op when instrumentRequests is
1024
+ * disabled.
1025
+ */
1026
+ instrumentElectronNet?: (netModule: unknown) => void;
933
1027
 
934
1028
  /**
935
1029
  * Optional callback function to programmatically create marker spans in the User Journey trace.
@@ -1240,36 +1334,85 @@ export namespace IOInsights {
1240
1334
  resultMetric?: string;
1241
1335
 
1242
1336
  /**
1243
- * If `true`, io.Insights will instrument and trace XMLHttpRequest and fetch()
1244
- * requests automatically.
1245
- *
1246
- * @default true
1337
+ * If `true` (or a configuration object with `enabled: true`), io.Insights
1338
+ * will instrument and trace XMLHttpRequest and fetch() requests
1339
+ * automatically. When enabled, the pre-init recorder (when installed)
1340
+ * also captures requests from page start - opt out of that with the
1341
+ * configuration object's `preInit: false`.
1342
+ *
1343
+ * @default false
1247
1344
  */
1248
1345
  instrumentRequests?: boolean | RequestTraceConfig;
1249
1346
 
1347
+ /**
1348
+ * If `true` (or a configuration object), WebSocket connections are instrumented:
1349
+ * each connection is published as a span ("interopio.api.instrumentation.webSocket")
1350
+ * covering its whole lifetime - construction until close - with the connect
1351
+ * duration, negotiated protocol, close code/reason/wasClean, and message/byte
1352
+ * totals in both directions. Abnormal closures (code 1006) and connection
1353
+ * failures mark the span as ERROR. Optional message/byte counters and a
1354
+ * connect-duration histogram can be enabled via the configuration object.
1355
+ * Telemetry endpoints are never instrumented; the io.Connect gateway connection
1356
+ * is tracked by default (its lifecycle is platform-health telemetry - exclude it
1357
+ * with ignoreGateway), and ignorePattern can exclude other infrastructure sockets.
1358
+ *
1359
+ * When the pre-init module (early.js) is loaded, sockets are tracked from page
1360
+ * start: connections that closed before initialization become retroactive spans,
1361
+ * and connections still open are adopted with spans starting at their true
1362
+ * construction time and counters carried across - a socket opened at bootstrap
1363
+ * is fully observed. Without the pre-init module, sockets constructed before
1364
+ * initialization are not observed at all.
1365
+ *
1366
+ * @default false
1367
+ */
1368
+ instrumentWebSockets?: boolean | WebSocketInstrumentationConfig;
1369
+
1370
+ /**
1371
+ * If `true` (or a configuration object), session-level Web Vitals are tracked:
1372
+ * CLS (cumulative layout shift, session-window algorithm), INP (interaction to
1373
+ * next paint, the web-vitals estimation over Event Timing entries) and the final
1374
+ * LCP. A "interopio.api.instrumentation.webVitals" span with the current values
1375
+ * is published each time the page becomes hidden (when the values changed), and
1376
+ * optional histogram metrics record one terminal sample per page at pagehide.
1377
+ * Complements the startup trace's perf.vitals, which cover only the startup
1378
+ * window - CLS accumulates and INP is defined over the whole session.
1379
+ *
1380
+ * @default false
1381
+ */
1382
+ instrumentWebVitals?: boolean | WebVitalsInstrumentationConfig;
1383
+
1250
1384
  // https://github.com/open-telemetry/opentelemetry-browser/blob/main/packages/instrumentation/README.md#fetch
1251
1385
  /**
1252
- * If `true`, uncaught errors and unhandled promise rejections are published as
1253
- * error spans ("interopio.api.instrumentation.error" / ".unhandledRejection"),
1386
+ * If `true` (or a configuration object with `enabled`), uncaught errors and
1387
+ * unhandled promise rejections are published as error spans
1388
+ * ("interopio.api.instrumentation.error" / ".unhandledRejection"),
1254
1389
  * including errors buffered before initialization by the pre-init recorder.
1255
1390
  * Capped per session to guard against error storms. When enabled, the app
1256
- * startup trace defers its own error capture to this instrumentation.
1391
+ * startup trace defers its own error capture to this instrumentation, and
1392
+ * the pre-init recorder (when installed) captures errors from page start -
1393
+ * opt out of that with the configuration object's `preInit: false`.
1257
1394
  *
1258
- * @default true
1395
+ * @default false
1259
1396
  */
1260
- instrumentErrors?: boolean;
1397
+ instrumentErrors?: boolean | ErrorInstrumentationConfig;
1261
1398
 
1262
1399
  /**
1263
- * If `true`, resource loads (scripts, stylesheets, images, fonts, ...) are
1264
- * published as spans ("interopio.api.instrumentation.resource") with their real
1265
- * timings from the resource timing buffer, including resources loaded before
1266
- * initialization. fetch/XHR resources are excluded (the request instrumentation
1267
- * covers them in more detail), as are telemetry uploads. When enabled, the app
1268
- * startup trace defers its slowest-resource child spans to this instrumentation.
1400
+ * If `true` (or a configuration object), resource loads (scripts, stylesheets,
1401
+ * images, fonts, ...) are published as spans
1402
+ * ("interopio.api.instrumentation.resource") with their real timings from the
1403
+ * resource timing buffer, including resources loaded before initialization, a
1404
+ * cacheState attribute ("hit", "revalidated", "network", or "unknown" -
1405
+ * cross-origin resources without a Timing-Allow-Origin header withhold cache
1406
+ * provenance), and the nonzero connection-phase timings (dns/connect/tls/ttfb).
1407
+ * By default fetch/XHR resources are excluded (the request instrumentation
1408
+ * covers them in more detail; see skipRequests), as are telemetry uploads.
1409
+ * Optional histogram/counter metrics can be enabled via the configuration
1410
+ * object. When enabled, the app startup trace defers its slowest-resource
1411
+ * child spans to this instrumentation.
1269
1412
  *
1270
- * @default true
1413
+ * @default false
1271
1414
  */
1272
- instrumentResources?: boolean;
1415
+ instrumentResources?: boolean | ResourceInstrumentationConfig;
1273
1416
 
1274
1417
  /**
1275
1418
  * If `true`, in-page (SPA) navigations - history pushState/replaceState,
@@ -1277,10 +1420,24 @@ export namespace IOInsights {
1277
1420
  * ("interopio.api.instrumentation.navigation") with the sanitized from/to URLs.
1278
1421
  * Same-URL state updates are not reported.
1279
1422
  *
1280
- * @default true
1423
+ * @default false
1281
1424
  */
1282
1425
  instrumentNavigation?: boolean;
1283
1426
 
1427
+ /**
1428
+ * If `true` (or a configuration object), event loop responsiveness is instrumented:
1429
+ * slow input events (Event Timing API) and main-thread-blocking long frames
1430
+ * (Long Animation Frames API, falling back to Long Tasks) are published as spans
1431
+ * ("interopio.api.instrumentation.inputDelay" / ".eventLoopBlocking"), with the
1432
+ * input-delay spans carrying the same element-describing attributes as the
1433
+ * clickstream spans. Optional histogram metrics can be enabled via the
1434
+ * configuration object. Entries recorded before initialization are replayed
1435
+ * from the performance buffers.
1436
+ *
1437
+ * @default false
1438
+ */
1439
+ instrumentEventLoop?: boolean | EventLoopInstrumentationConfig;
1440
+
1284
1441
  /**
1285
1442
  * If `true`, io.Insights will instrument and trace the application startup process
1286
1443
  * automatically.
@@ -1290,7 +1447,7 @@ export namespace IOInsights {
1290
1447
  instrumentAppStartup?: boolean;
1291
1448
 
1292
1449
  /**
1293
- * If `true`, io.Insights will instrument and trace the application loading process
1450
+ * If `true`, io.Insights will instrument and trace the application initialization process
1294
1451
  * automatically.
1295
1452
  *
1296
1453
  * @default true
@@ -1300,7 +1457,7 @@ export namespace IOInsights {
1300
1457
 
1301
1458
  /**
1302
1459
  * If `true`, io.Insights will instrument and trace the steps of the document load
1303
- * and initialization process automatically
1460
+ * process automatically
1304
1461
  *
1305
1462
  * @default true
1306
1463
  * @deprecated use instrumentAppStartup
@@ -1420,12 +1577,24 @@ export namespace IOInsights {
1420
1577
  */
1421
1578
  userJourney?: boolean | "nested" | "sibling" | UserJourneyTraceConfig;
1422
1579
  /**
1423
- * How long after application startup will any traced operations
1424
- * automatically be nested under the application startup trace.
1580
+ * If non-zero, how long after application startup will any traced operations
1581
+ * automatically be nested under the application startup trace. The timeout is counted from the moment
1582
+ * the io.Connect API begins initializing.
1425
1583
  *
1426
- * @default 3000
1584
+ * @default 0
1427
1585
  */
1428
1586
  startupParentSpanTimeoutMs?: number;
1587
+ /**
1588
+ * When will the application startup span be considered completed,
1589
+ * so that further spans are added under it.
1590
+ * * explicit - when Traces.instance.startupTraceFinished() is called by the application code
1591
+ * * timeout - same as "explicit" OR when startupParentSpanTimeoutMs have elapsed and the DOMContentLoaded event has fired
1592
+ * * loader - same as "explicit" OR when the loading animation of the window has completed
1593
+ * * any - when any of the above conditions are met
1594
+ *
1595
+ * @default "any"
1596
+ */
1597
+ startupParentSpanEnd?: "explicit" | "timeout" | "loader" | "any";
1429
1598
 
1430
1599
  /**
1431
1600
  * If `true`, the application will create a span with the name `interopio.api.application.close` when
@@ -1813,6 +1982,12 @@ export namespace IOInsights {
1813
1982
  * cross-origin ones - use it in filters whose `context.url` matches origins
1814
1983
  * known to accept the headers (e.g. via Access-Control-Allow-Headers).
1815
1984
  *
1985
+ * Applies to the fetch/XHR instrumentation and to the platform's Electron
1986
+ * net.request instrumentation. Note the main process has no origin, so
1987
+ * `"same-origin"` never matches there - opt platform backends in with
1988
+ * `"all-origins"` filters scoped by `context.url` (there is no CORS preflight
1989
+ * risk for main-process requests).
1990
+ *
1816
1991
  * @default false
1817
1992
  */
1818
1993
  injectOTELHeaders?: false | "same-origin" | "all-origins";
@@ -1918,12 +2093,79 @@ export namespace IOInsights {
1918
2093
  nestEventHandlersEagerly?: boolean;
1919
2094
  }
1920
2095
 
2096
+ export interface ErrorInstrumentationConfig {
2097
+ /**
2098
+ * Whether uncaught errors and unhandled promise rejections are published
2099
+ * as error spans.
2100
+ */
2101
+ enabled: boolean;
2102
+
2103
+ /**
2104
+ * Unless `false`, the pre-init recorder (installEarlyInstrumentation from
2105
+ * @interopio/insights-traces - installed by a window preload script or an
2106
+ * inline snippet before the SDK loads) also captures uncaught errors and
2107
+ * unhandled promise rejections from page start while this instrumentation
2108
+ * is enabled. The recorder reads this configuration from
2109
+ * glue42gd.insights; the buffered records are drained into this
2110
+ * instrumentation's retroactive error spans (with their real timestamps)
2111
+ * at initialization.
2112
+ *
2113
+ * @default true
2114
+ */
2115
+ preInit?: boolean;
2116
+ }
2117
+
1921
2118
  export interface RequestTraceConfig {
1922
2119
  /**
1923
2120
  * Whether fetch and XHR requests will be instrumented with traces automatically.
1924
2121
  */
1925
2122
  enabled: boolean;
1926
2123
 
2124
+ /**
2125
+ * If `true`, the io.Connect Desktop platform also instruments its OWN
2126
+ * main-process HTTP traffic - Electron's net module (net.request and
2127
+ * net.fetch) - at bootstrap, publishing through the platform's io.Insights
2128
+ * instance with the same span and metric shapes as the renderer fetch/XHR
2129
+ * instrumentation (spans under "interopio.api.instrumentation.electronNet").
2130
+ * Read by the platform's bootstrap, which guards its call to
2131
+ * TracesManager.instrumentElectronNet with it; has no effect outside the
2132
+ * platform process.
2133
+ *
2134
+ * @default false
2135
+ */
2136
+ platform?: boolean;
2137
+
2138
+ /**
2139
+ * Unless `false`, the pre-init recorder (installEarlyInstrumentation from
2140
+ * @interopio/insights-traces - installed by a window preload script or an
2141
+ * inline snippet before the SDK loads) also patches fetch and
2142
+ * XMLHttpRequest, so requests issued before the SDK initializes are
2143
+ * recorded and drained into retroactive spans and metric samples at
2144
+ * initialization, while this instrumentation is enabled. The recorder
2145
+ * reads this configuration from glue42gd.insights and derives its
2146
+ * measurement settings from it - request body sizing from
2147
+ * requestBytesMetric, responseBytesMeasurement, download-completion
2148
+ * observation from the total/download duration metrics - so pre-init and
2149
+ * live records measure identically.
2150
+ *
2151
+ * @default true
2152
+ */
2153
+ preInit?: boolean;
2154
+
2155
+ /**
2156
+ * If `false`, no request spans are published - metrics-only mode. The whole
2157
+ * instrumentation flow otherwise runs unchanged: measurement, the duration/size
2158
+ * metrics, error classification, and the pre-init drain (which then produces
2159
+ * metric samples but no retroactive spans). Applies to fetch, XHR, and the
2160
+ * platform's Electron net instrumentation alike. Note that trace header
2161
+ * injection requires a span context, so injectOTELHeaders has no effect in
2162
+ * metrics-only mode. This is a hard switch - span filters cannot re-enable
2163
+ * the spans.
2164
+ *
2165
+ * @default true
2166
+ */
2167
+ trace?: boolean;
2168
+
1927
2169
  /**
1928
2170
  * Whether request instrumentation spans can be root spans of new traces. This allows you
1929
2171
  * to trace requests without any instrumentation in your own code, but may create a large
@@ -2042,6 +2284,31 @@ export namespace IOInsights {
2042
2284
  */
2043
2285
  requestBodyDownloadDurationMetricBuckets?: number[];
2044
2286
 
2287
+ /**
2288
+ * If `true` or a string, effective download throughput (response body bytes over
2289
+ * the download window, in bytes per second) is published as a histogram metric.
2290
+ * If a string value is specified, this will be the name of the metric. Otherwise,
2291
+ * the default "io.insights.http.client.response.download.throughput" is used.
2292
+ *
2293
+ * Derived from the same observation as requestBodyDownloadDurationMetric (same
2294
+ * population and cost caveats), so it contributes samples only for successful
2295
+ * requests with an observable body completion - and only bodies of at least 32KB:
2296
+ * smaller transfers complete within the initial congestion window and would
2297
+ * measure round-trip time, not bandwidth. Per-stream effective throughput:
2298
+ * concurrent transfers share the link.
2299
+ *
2300
+ * @default false
2301
+ */
2302
+ requestBodyDownloadThroughputMetric?: boolean | string;
2303
+
2304
+ /**
2305
+ * Explicit histogram bucket boundaries for requestBodyDownloadThroughputMetric, in
2306
+ * bytes per second, ascending.
2307
+ *
2308
+ * @default [65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456]
2309
+ */
2310
+ requestBodyDownloadThroughputMetricBuckets?: number[];
2311
+
2045
2312
  /**
2046
2313
  * If `true` or a string, the request size in bytes will be published as a histogram metric.
2047
2314
  * If a string value is specified, this will be the name of the metric. Otherwise, the
@@ -2100,6 +2367,464 @@ export namespace IOInsights {
2100
2367
  responseBytesMeasurement?: "content-length" | "raw" | "both";
2101
2368
  }
2102
2369
 
2370
+ /**
2371
+ * Configuration for the event loop responsiveness instrumentation.
2372
+ *
2373
+ * Both measurements are event-driven (no polling): samples record only when the
2374
+ * browser delivers a performance entry, so an idle or smooth application produces
2375
+ * none. Metric export follows the meter's publish interval as usual.
2376
+ */
2377
+ export interface EventLoopInstrumentationConfig {
2378
+ /**
2379
+ * Whether the event loop instrumentation is enabled.
2380
+ */
2381
+ enabled: boolean;
2382
+
2383
+ /**
2384
+ * If `false`, no spans are published - metrics-only mode: the input-delay
2385
+ * and blocking histograms keep reporting. The master switch over
2386
+ * inputDelaySpans/eventLoopBlockingSpans, which refine it per kind.
2387
+ *
2388
+ * @default true
2389
+ */
2390
+ trace?: boolean;
2391
+
2392
+ /**
2393
+ * If `true`, slow input events are published as spans
2394
+ * ("interopio.api.instrumentation.inputDelay") spanning the event's timestamp until
2395
+ * its next paint, with the input delay / processing / presentation phases and the
2396
+ * same element-describing attributes as the clickstream spans (elementIdOrPath,
2397
+ * elementSelectorString, ...).
2398
+ *
2399
+ * @default true
2400
+ */
2401
+ inputDelaySpans?: boolean;
2402
+
2403
+ /**
2404
+ * If `true` or a string, the input event queueing delay (event timestamp until its
2405
+ * handlers started running - the event loop latency a user experienced) is published
2406
+ * as a histogram metric. If a string value is specified, this will be the name of the
2407
+ * metric. Otherwise, the default "io.insights.event_loop.input.delay" is used (no
2408
+ * semantic convention exists for this metric).
2409
+ *
2410
+ * Only events whose total duration reaches inputDelayDurationThresholdMs are surfaced
2411
+ * by the browser, so the distribution describes slow-ish interactions, not all input.
2412
+ *
2413
+ * @default false
2414
+ */
2415
+ inputDelayMetric?: boolean | string;
2416
+
2417
+ /**
2418
+ * Explicit histogram bucket boundaries for inputDelayMetric, in seconds, ascending.
2419
+ * The default brackets the INP "good" (0.2s) and "poor" (0.5s) thresholds.
2420
+ *
2421
+ * @default [0.001, 0.0025, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1]
2422
+ */
2423
+ inputDelayMetricBuckets?: number[];
2424
+
2425
+ /**
2426
+ * The Event Timing API durationThreshold, in milliseconds: only input events whose
2427
+ * total duration (event timestamp until next paint) reaches this value are observed.
2428
+ * The browser floor is 16ms.
2429
+ *
2430
+ * @default 16
2431
+ */
2432
+ inputDelayDurationThresholdMs?: number;
2433
+
2434
+ /**
2435
+ * If `true`, only interaction-eligible events (Event Timing entries with a non-zero
2436
+ * interactionId - discrete interactions like clicks and key presses, the population
2437
+ * INP is computed over) are observed. Disabling it also surfaces continuous events
2438
+ * (pointermoves etc.) that meet the duration threshold.
2439
+ *
2440
+ * @default true
2441
+ */
2442
+ inputDelayInteractionsOnly?: boolean;
2443
+
2444
+ /**
2445
+ * If `true`, main-thread-blocking long frames are published as spans
2446
+ * ("interopio.api.instrumentation.eventLoopBlocking") spanning the frame, with the
2447
+ * blocking duration and (where the Long Animation Frames API is available) the
2448
+ * attribution of the longest script in the frame.
2449
+ *
2450
+ * @default true
2451
+ */
2452
+ eventLoopBlockingSpans?: boolean;
2453
+
2454
+ /**
2455
+ * If `true` or a string, the main-thread blocking time per long frame (the time
2456
+ * beyond the 50ms threshold, per the Long Animation Frames API's blockingDuration;
2457
+ * where only Long Tasks are available, task duration minus 50ms) is published as a
2458
+ * histogram metric. If a string value is specified, this will be the name of the
2459
+ * metric. Otherwise, the default "io.insights.event_loop.blocking.duration" is used
2460
+ * (no semantic convention exists for this metric). Zero-blocking frames contribute
2461
+ * no sample. The "measurement" attribute says which API produced each sample.
2462
+ *
2463
+ * @default false
2464
+ */
2465
+ eventLoopBlockingMetric?: boolean | string;
2466
+
2467
+ /**
2468
+ * Explicit histogram bucket boundaries for eventLoopBlockingMetric, in seconds,
2469
+ * ascending.
2470
+ *
2471
+ * @default [0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5]
2472
+ */
2473
+ eventLoopBlockingMetricBuckets?: number[];
2474
+ }
2475
+
2476
+ /**
2477
+ * Configuration for the resource load instrumentation.
2478
+ *
2479
+ * The phase metrics record nonzero samples only: with connection reuse most
2480
+ * requests have no DNS/TCP/TLS phase at all, and recording those zeros would
2481
+ * drown the distributions. Each histogram therefore answers "when this phase
2482
+ * happened, what did it cost". Cross-origin resources without a
2483
+ * Timing-Allow-Origin header withhold the detailed timings and sizes and
2484
+ * contribute no phase/throughput samples.
2485
+ */
2486
+ export interface ResourceInstrumentationConfig {
2487
+ /**
2488
+ * Whether the resource instrumentation is enabled.
2489
+ */
2490
+ enabled: boolean;
2491
+
2492
+ /**
2493
+ * If `true`, resource timing entries produced by fetch/XMLHttpRequest are
2494
+ * skipped entirely (the request instrumentation covers those requests in more
2495
+ * detail). Set to `false` to also publish resource spans and metric samples
2496
+ * for them - e.g. to include API backends in the connection-phase and
2497
+ * throughput metrics. Beacon entries and telemetry uploads are always skipped.
2498
+ *
2499
+ * @default true
2500
+ */
2501
+ skipRequests?: boolean;
2502
+
2503
+ /**
2504
+ * If `false`, no resource spans are published - metrics-only mode: the
2505
+ * phase/TTFB/throughput histograms and the cache-state counter keep reporting.
2506
+ *
2507
+ * @default true
2508
+ */
2509
+ trace?: boolean;
2510
+
2511
+ /**
2512
+ * If `true` or a string, DNS lookup durations are published as a histogram
2513
+ * metric ("io.insights.resource.dns.duration" unless a string names it).
2514
+ * Nonzero lookups only. Tagged with server.address/server.port and the ALPN protocol.
2515
+ *
2516
+ * @default false
2517
+ */
2518
+ dnsDurationMetric?: boolean | string;
2519
+
2520
+ /**
2521
+ * Explicit histogram bucket boundaries for dnsDurationMetric, in seconds, ascending.
2522
+ *
2523
+ * @default [0.001, 0.0025, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5]
2524
+ */
2525
+ dnsDurationMetricBuckets?: number[];
2526
+
2527
+ /**
2528
+ * If `true` or a string, connection establishment durations (connectStart until
2529
+ * connectEnd - includes the TLS handshake when one happened) are published as a
2530
+ * histogram metric ("io.insights.resource.connect.duration" unless a string
2531
+ * names it). Nonzero connects only.
2532
+ *
2533
+ * @default false
2534
+ */
2535
+ connectDurationMetric?: boolean | string;
2536
+
2537
+ /**
2538
+ * Explicit histogram bucket boundaries for connectDurationMetric, in seconds, ascending.
2539
+ *
2540
+ * @default [0.001, 0.0025, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5]
2541
+ */
2542
+ connectDurationMetricBuckets?: number[];
2543
+
2544
+ /**
2545
+ * If `true` or a string, TLS handshake durations (secureConnectionStart until
2546
+ * connectEnd - a subset of the connect duration) are published as a histogram
2547
+ * metric ("io.insights.resource.tls.duration" unless a string names it).
2548
+ * Secure connections only.
2549
+ *
2550
+ * @default false
2551
+ */
2552
+ tlsDurationMetric?: boolean | string;
2553
+
2554
+ /**
2555
+ * Explicit histogram bucket boundaries for tlsDurationMetric, in seconds, ascending.
2556
+ *
2557
+ * @default [0.001, 0.0025, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5]
2558
+ */
2559
+ tlsDurationMetricBuckets?: number[];
2560
+
2561
+ /**
2562
+ * If `true` or a string, resource time-to-first-byte (requestStart until
2563
+ * responseStart) is published as a histogram metric
2564
+ * ("io.insights.resource.ttfb.duration" unless a string names it). Measures the
2565
+ * asset-serving infrastructure, distinct from the request instrumentation's TTFB
2566
+ * metric which covers fetch/XHR API traffic. Samples only resources that
2567
+ * actually hit the network ("network" and "revalidated" cache states) - cache
2568
+ * hits would contribute disk latency, not server latency.
2569
+ *
2570
+ * @default false
2571
+ */
2572
+ firstByteDurationMetric?: boolean | string;
2573
+
2574
+ /**
2575
+ * Explicit histogram bucket boundaries for firstByteDurationMetric, in seconds, ascending.
2576
+ *
2577
+ * @default [0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10]
2578
+ */
2579
+ firstByteDurationMetricBuckets?: number[];
2580
+
2581
+ /**
2582
+ * If `true` or a string, effective download throughput (encodedBodySize over the
2583
+ * responseStart-responseEnd window, in bytes per second) is published as a
2584
+ * histogram metric ("io.insights.resource.download.throughput" unless a string
2585
+ * names it). "network" cache state only, and only bodies of at least
2586
+ * downloadThroughputMinBytes - smaller transfers complete within the initial
2587
+ * congestion window and would measure round-trip time, not bandwidth. Note this
2588
+ * is per-stream effective throughput: concurrent downloads share the link, so it
2589
+ * reflects what a transfer experienced, not link capacity. For a byte-weighted
2590
+ * aggregate, sum sizes and durations at query time instead of averaging rates.
2591
+ *
2592
+ * @default false
2593
+ */
2594
+ downloadThroughputMetric?: boolean | string;
2595
+
2596
+ /**
2597
+ * Explicit histogram bucket boundaries for downloadThroughputMetric, in bytes
2598
+ * per second, ascending.
2599
+ *
2600
+ * @default [65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456]
2601
+ */
2602
+ downloadThroughputMetricBuckets?: number[];
2603
+
2604
+ /**
2605
+ * Minimum encodedBodySize, in bytes, for a resource to contribute a
2606
+ * downloadThroughputMetric sample.
2607
+ *
2608
+ * @default 32768
2609
+ */
2610
+ downloadThroughputMinBytes?: number;
2611
+
2612
+ /**
2613
+ * If `true` or a string, a counter of observed resource loads by cache state is
2614
+ * published ("io.insights.resource.cache.state" unless a string names it),
2615
+ * tagged with cacheState ("hit" / "revalidated" / "network" / "unknown") and
2616
+ * server.address/server.port - the cache hit ratio falls out at query time.
2617
+ *
2618
+ * @default false
2619
+ */
2620
+ cacheStateMetric?: boolean | string;
2621
+ }
2622
+
2623
+ /**
2624
+ * Configuration for the WebSocket instrumentation.
2625
+ */
2626
+ export interface WebSocketInstrumentationConfig {
2627
+ /**
2628
+ * Whether the WebSocket instrumentation is enabled.
2629
+ */
2630
+ enabled: boolean;
2631
+
2632
+ /**
2633
+ * If `true`, the io.Connect Desktop platform also tracks its OWN main-process
2634
+ * WebSocket connections - most importantly its gateway connection, which is
2635
+ * created before the platform's io.Insights initializes: the platform's
2636
+ * bootstrap installs the pre-init recorder (with WebSocket tracking enabled)
2637
+ * early enough that the connection is observed from construction, and the
2638
+ * platform's io.Insights instance adopts it at initialization. Read by the
2639
+ * platform's bootstrap; has no effect outside the platform process.
2640
+ *
2641
+ * @default false
2642
+ */
2643
+ platform?: boolean;
2644
+
2645
+ /**
2646
+ * Unless `false`, the pre-init recorder (installEarlyInstrumentation from
2647
+ * @interopio/insights-traces - installed by a window preload script or an
2648
+ * inline snippet before the SDK loads) tracks WebSocket connections from
2649
+ * page start while this instrumentation is enabled: connections closed
2650
+ * before initialization become retroactive spans, still-open ones are
2651
+ * adopted with spans starting at their true construction time. Opting out
2652
+ * restricts the instrumentation to sockets constructed after
2653
+ * initialization - a socket opened pre-init (the io.Connect gateway
2654
+ * connection, bootstrap-time data feeds) is then unobservable for its
2655
+ * whole lifetime, since WebSockets can only be intercepted at
2656
+ * construction.
2657
+ *
2658
+ * @default true
2659
+ */
2660
+ preInit?: boolean;
2661
+
2662
+ /**
2663
+ * If `true` (the default), each WebSocket connection is published as a span
2664
+ * ("interopio.api.instrumentation.webSocket") covering construction until close,
2665
+ * with connectMs, the negotiated protocol, close code/reason/wasClean, message
2666
+ * and byte totals in both directions, and the connection duration. Abnormal
2667
+ * closures (1006) and connection failures mark the span as ERROR.
2668
+ *
2669
+ * If `false`, no connection spans are published - metrics-only mode: the
2670
+ * message/byte counters and the connect-duration histogram keep reporting.
2671
+ *
2672
+ * @default true
2673
+ */
2674
+ trace?: boolean;
2675
+
2676
+ /**
2677
+ * If `true`, the io.Connect gateway connection is excluded from instrumentation.
2678
+ * By default the gateway socket IS tracked: its connection lifecycle (connects,
2679
+ * drops, close codes, reconnect attempts) is core platform-health telemetry. The
2680
+ * gateway is recognized via the platform-provided connection URL
2681
+ * (window.glue42gd.gwURL, compared by origin and path); where that is unavailable
2682
+ * the flag has no effect - use ignorePattern to exclude infrastructure sockets
2683
+ * explicitly.
2684
+ *
2685
+ * Cost note: with the message/byte metrics enabled, the gateway socket
2686
+ * contributes a sample per gateway message - volume that describes io.Connect
2687
+ * itself rather than the application. Enable those metrics deliberately, or set
2688
+ * this flag to exclude the gateway.
2689
+ *
2690
+ * Sockets explicitly handed to the pre-init recorder via its trackWebSocket hook
2691
+ * (e.g. the core-js gateway transport handing over its own connection) bypass
2692
+ * this flag even when set - explicit handover is a deliberate opt-in.
2693
+ * ignorePattern still applies to them and remains the veto.
2694
+ *
2695
+ * @default false
2696
+ */
2697
+ ignoreGateway?: boolean;
2698
+
2699
+ /**
2700
+ * Optional regex pattern for WebSocket URLs that should be excluded from
2701
+ * instrumentation - e.g. infrastructure sockets beyond the gateway connection
2702
+ * (which can be excluded using ignoreGateway).
2703
+ */
2704
+ ignorePattern?: string;
2705
+
2706
+ /**
2707
+ * Optional regex pattern; if specified, only matching WebSocket URLs are
2708
+ * instrumented.
2709
+ */
2710
+ matchPattern?: string;
2711
+
2712
+ /**
2713
+ * If `true` or a string, a counter of WebSocket messages is published
2714
+ * ("io.insights.websocket.messages" unless a string names it), tagged with
2715
+ * direction ("send" / "receive") and server.address/server.port.
2716
+ *
2717
+ * @default false
2718
+ */
2719
+ messagesMetric?: boolean | string;
2720
+
2721
+ /**
2722
+ * If `true` or a string, a counter summing WebSocket payload bytes is published
2723
+ * ("io.insights.websocket.bytes" unless a string names it), tagged with
2724
+ * direction ("send" / "receive") and server.address/server.port.
2725
+ *
2726
+ * @default false
2727
+ */
2728
+ bytesMetric?: boolean | string;
2729
+
2730
+ /**
2731
+ * If `true` or a string, the connection establishment time (construction until
2732
+ * the open event) is published as a histogram metric
2733
+ * ("io.insights.websocket.connect.duration" unless a string names it).
2734
+ * Successful connections only.
2735
+ *
2736
+ * @default false
2737
+ */
2738
+ connectDurationMetric?: boolean | string;
2739
+
2740
+ /**
2741
+ * Explicit histogram bucket boundaries for connectDurationMetric, in seconds, ascending.
2742
+ *
2743
+ * @default [0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10]
2744
+ */
2745
+ connectDurationMetricBuckets?: number[];
2746
+ }
2747
+
2748
+ /**
2749
+ * Configuration for the session-level Web Vitals instrumentation.
2750
+ *
2751
+ * Values are reported when the page becomes hidden: a span with the current
2752
+ * values on each hidden transition where they changed, and (for the metrics)
2753
+ * one terminal sample per page at pagehide - so each session contributes a
2754
+ * single sample per histogram.
2755
+ */
2756
+ export interface WebVitalsInstrumentationConfig {
2757
+ /**
2758
+ * Whether the Web Vitals instrumentation is enabled.
2759
+ */
2760
+ enabled: boolean;
2761
+
2762
+ /**
2763
+ * If `true` (the default), a "interopio.api.instrumentation.webVitals" span
2764
+ * carrying the current CLS/INP/LCP values and the interaction count is published
2765
+ * on each transition to hidden where the values changed since the last report.
2766
+ *
2767
+ * If `false`, no webVitals spans are published - metrics-only mode: the
2768
+ * terminal CLS/INP/LCP samples at pagehide keep reporting.
2769
+ *
2770
+ * @default true
2771
+ */
2772
+ trace?: boolean;
2773
+
2774
+ /**
2775
+ * If `true` or a string, the session's cumulative layout shift is published as a
2776
+ * histogram metric ("io.insights.web_vitals.cls" unless a string names it).
2777
+ * Unitless score, session-window algorithm (shifts without recent input,
2778
+ * windowed at 5s max / 1s gap, the worst window wins).
2779
+ *
2780
+ * @default false
2781
+ */
2782
+ clsMetric?: boolean | string;
2783
+
2784
+ /**
2785
+ * Explicit histogram bucket boundaries for clsMetric (unitless score), ascending.
2786
+ * The default brackets the CLS "good" (0.1) and "poor" (0.25) thresholds.
2787
+ *
2788
+ * @default [0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5]
2789
+ */
2790
+ clsMetricBuckets?: number[];
2791
+
2792
+ /**
2793
+ * If `true` or a string, the session's INP (interaction to next paint) is
2794
+ * published as a histogram metric ("io.insights.web_vitals.inp" unless a string
2795
+ * names it) - the worst interaction latency, moving to a high percentile as the
2796
+ * interaction count grows, per the web-vitals estimation.
2797
+ *
2798
+ * @default false
2799
+ */
2800
+ inpMetric?: boolean | string;
2801
+
2802
+ /**
2803
+ * Explicit histogram bucket boundaries for inpMetric, in seconds, ascending.
2804
+ * The default brackets the INP "good" (0.2s) and "poor" (0.5s) thresholds.
2805
+ *
2806
+ * @default [0.04, 0.1, 0.2, 0.3, 0.5, 0.75, 1, 2.5, 5]
2807
+ */
2808
+ inpMetricBuckets?: number[];
2809
+
2810
+ /**
2811
+ * If `true` or a string, the final largest contentful paint is published as a
2812
+ * histogram metric ("io.insights.web_vitals.lcp" unless a string names it), in
2813
+ * seconds from navigation start.
2814
+ *
2815
+ * @default false
2816
+ */
2817
+ lcpMetric?: boolean | string;
2818
+
2819
+ /**
2820
+ * Explicit histogram bucket boundaries for lcpMetric, in seconds, ascending.
2821
+ * The default brackets the LCP "good" (2.5s) and "poor" (4s) thresholds.
2822
+ *
2823
+ * @default [0.5, 1, 1.5, 2, 2.5, 4, 5, 7.5, 10, 15]
2824
+ */
2825
+ lcpMetricBuckets?: number[];
2826
+ }
2827
+
2103
2828
  /**
2104
2829
  * Configuration for User Journey trace behavior.
2105
2830
  * Controls how significant User Journey milestones are tracked throughout the platform session.
@@ -2256,11 +2981,11 @@ export namespace IOInsights {
2256
2981
  */
2257
2982
  levelCountMetric?: string;
2258
2983
 
2259
- /**
2260
- * How long after application startup will any log entries
2261
- * automatically be associated with the application startup trace.
2262
- */
2263
- startupTraceAssociationTimeoutMs?: number;
2984
+ // /**
2985
+ // * How long after application startup will any log entries
2986
+ // * automatically be associated with the application startup trace.
2987
+ // */
2988
+ // startupTraceAssociationTimeoutMs?: number;
2264
2989
 
2265
2990
  /**
2266
2991
  * If true, use a predefined list of filters for well-known
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interopio/otel",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "io.Insights observability library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",