@observtech/rum 0.1.33 → 0.1.34

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.
@@ -0,0 +1,25 @@
1
+ import { registerInstrumentations } from './chunk-P6VK4P6W.js';
2
+ import { ZoneContextManager } from '@opentelemetry/context-zone';
3
+ import { UserInteractionInstrumentation } from '@opentelemetry/instrumentation-user-interaction';
4
+
5
+ var USER_INTERACTION_EVENTS = [
6
+ "click",
7
+ "submit",
8
+ "keydown",
9
+ "change",
10
+ "dblclick"
11
+ ];
12
+ function setupUserInteraction(provider, baseInstrumentations) {
13
+ provider.register({ contextManager: new ZoneContextManager() });
14
+ return registerInstrumentations({
15
+ tracerProvider: provider,
16
+ instrumentations: [
17
+ ...baseInstrumentations,
18
+ new UserInteractionInstrumentation({ eventNames: USER_INTERACTION_EVENTS })
19
+ ]
20
+ });
21
+ }
22
+
23
+ export { USER_INTERACTION_EVENTS, setupUserInteraction };
24
+ //# sourceMappingURL=user-interaction-HZJLQRUN.js.map
25
+ //# sourceMappingURL=user-interaction-HZJLQRUN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/user-interaction.ts"],"names":[],"mappings":";;;;AAsBO,IAAM,uBAAA,GAAyD;AAAA,EACpE,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;AASO,SAAS,oBAAA,CACd,UACA,oBAAA,EACY;AAGZ,EAAA,QAAA,CAAS,SAAS,EAAE,cAAA,EAAgB,IAAI,kBAAA,IAAsB,CAAA;AAC9D,EAAA,OAAO,wBAAA,CAAyB;AAAA,IAC9B,cAAA,EAAgB,QAAA;AAAA,IAChB,gBAAA,EAAkB;AAAA,MAChB,GAAG,oBAAA;AAAA,MACH,IAAI,8BAAA,CAA+B,EAAE,UAAA,EAAY,yBAAyB;AAAA;AAC5E,GACD,CAAA;AACH","file":"user-interaction-HZJLQRUN.js","sourcesContent":["/**\n * User-interaction tracing (opt-in, Kapitalvins parity) — the zone.js-bearing\n * module.\n *\n * `@opentelemetry/instrumentation-user-interaction` turns DOM interactions\n * (click / submit / keydown / change / dblclick) into spans, and\n * `@opentelemetry/context-zone`'s {@link ZoneContextManager} keeps the trace\n * context across the async work those interactions kick off (so a fetch fired from\n * a click is a child of the interaction span).\n *\n * BOTH pull in zone.js, which monkey-patches the host's global timers / `Promise`\n * / `addEventListener` AT IMPORT. To honour the SDK's \"never disturb the host\n * unless asked\" contract, this module is imported ONLY via a dynamic `import()`\n * from {@link import('./otel-rum.js')} when `userInteraction` is enabled — so\n * zone.js never loads (and the bundle never grows) for consumers who don't opt in.\n */\nimport { ZoneContextManager } from '@opentelemetry/context-zone'\nimport { registerInstrumentations, type Instrumentation } from '@opentelemetry/instrumentation'\nimport { UserInteractionInstrumentation } from '@opentelemetry/instrumentation-user-interaction'\nimport type { WebTracerProvider } from '@opentelemetry/sdk-trace-web'\n\n/** DOM events promoted to interaction spans (parity with the Kapitalvins SDK). */\nexport const USER_INTERACTION_EVENTS: (keyof HTMLElementEventMap)[] = [\n 'click',\n 'submit',\n 'keydown',\n 'change',\n 'dblclick',\n]\n\n/**\n * Register the tracer provider with a {@link ZoneContextManager} and attach the\n * always-on base instrumentations plus user-interaction. Returns the disposer from\n * {@link registerInstrumentations} (the caller stores it for teardown). Must be\n * called at most once per provider — it performs the provider's single\n * `register()`.\n */\nexport function setupUserInteraction(\n provider: WebTracerProvider,\n baseInstrumentations: Instrumentation[],\n): () => void {\n // ZoneContextManager replaces the default StackContextManager so trace context\n // survives across the interaction's async continuations.\n provider.register({ contextManager: new ZoneContextManager() })\n return registerInstrumentations({\n tracerProvider: provider,\n instrumentations: [\n ...baseInstrumentations,\n new UserInteractionInstrumentation({ eventNames: USER_INTERACTION_EVENTS }),\n ],\n })\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@observtech/rum",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "description": "Observ browser RUM + Session Replay SDK (rrweb + OpenTelemetry, replay-as-context).",
5
5
  "license": "MIT",
6
6
  "author": "Observ",
@@ -66,11 +66,13 @@
66
66
  "dependencies": {
67
67
  "@opentelemetry/api": "1.9.1",
68
68
  "@opentelemetry/api-logs": "0.218.0",
69
+ "@opentelemetry/context-zone": "2.7.1",
69
70
  "@opentelemetry/exporter-logs-otlp-http": "0.218.0",
70
71
  "@opentelemetry/exporter-metrics-otlp-http": "0.218.0",
71
72
  "@opentelemetry/exporter-trace-otlp-http": "0.218.0",
72
73
  "@opentelemetry/instrumentation-document-load": "0.63.0",
73
74
  "@opentelemetry/instrumentation-fetch": "0.218.0",
75
+ "@opentelemetry/instrumentation-user-interaction": "0.62.0",
74
76
  "@opentelemetry/instrumentation-xml-http-request": "0.218.0",
75
77
  "@opentelemetry/resources": "2.7.1",
76
78
  "@opentelemetry/sdk-logs": "0.218.0",
@@ -80,6 +82,7 @@
80
82
  "@opentelemetry/semantic-conventions": "1.41.1",
81
83
  "@rrweb/record": "2.0.1",
82
84
  "rrweb": "2.0.1",
83
- "web-vitals": "4.2.4"
85
+ "web-vitals": "4.2.4",
86
+ "zone.js": "0.16.2"
84
87
  }
85
88
  }