@dxos/observability 0.8.4-main.84f28bd → 0.8.4-main.a4bbb77
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/lib/browser/chunk-5ICT2XF2.mjs +1 -0
- package/dist/lib/browser/{chunk-MWTIKIBZ.mjs → chunk-ICKR6U3G.mjs} +44 -30
- package/dist/lib/browser/chunk-ICKR6U3G.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YEPQFAES.mjs → chunk-LJO63BXO.mjs} +2 -2
- package/dist/lib/browser/{chunk-YEPQFAES.mjs.map → chunk-LJO63BXO.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-33TCMAUB.mjs → chunk-YTRUOREY.mjs} +75 -46
- package/dist/lib/browser/chunk-YTRUOREY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/observability-CQGG3MID.mjs +10 -0
- package/dist/lib/browser/{otel-IRDZ7PES.mjs → otel-6FVBNA5F.mjs} +131 -81
- package/dist/lib/browser/otel-6FVBNA5F.mjs.map +7 -0
- package/dist/lib/browser/segment/index.mjs +3 -3
- package/dist/lib/browser/sentry/index.mjs +2 -2
- package/dist/lib/browser/{sentry-log-processor-3F3SBJXM.mjs → sentry-log-processor-RG4CFVGL.mjs} +59 -43
- package/dist/lib/browser/sentry-log-processor-RG4CFVGL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-552KLA6Z.mjs → chunk-24NMRR4E.mjs} +67 -40
- package/dist/lib/node-esm/chunk-24NMRR4E.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-EYW4X3O6.mjs → chunk-4EWQFQ2F.mjs} +75 -46
- package/dist/lib/{browser/chunk-33TCMAUB.mjs.map → node-esm/chunk-4EWQFQ2F.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-TEH6VIKV.mjs → chunk-QK5IUYVA.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-TEH6VIKV.mjs.map → chunk-QK5IUYVA.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-MRAK2H7O.mjs → chunk-QUZL7LKE.mjs} +1 -1
- package/dist/lib/node-esm/index.mjs +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/observability-DHNVVRC7.mjs +11 -0
- package/dist/lib/node-esm/{otel-62HYJETM.mjs → otel-KHSGBROB.mjs} +127 -77
- package/dist/lib/node-esm/otel-KHSGBROB.mjs.map +7 -0
- package/dist/lib/node-esm/segment/index.mjs +3 -3
- package/dist/lib/node-esm/sentry/index.mjs +2 -2
- package/dist/lib/node-esm/{sentry-log-processor-JAYRA23C.mjs → sentry-log-processor-3BDS4BB4.mjs} +59 -43
- package/dist/lib/node-esm/sentry-log-processor-3BDS4BB4.mjs.map +7 -0
- package/dist/types/src/helpers/browser-observability.d.ts.map +1 -1
- package/dist/types/src/helpers/browser-observability.js +4 -6
- package/dist/types/src/helpers/browser-observability.js.map +1 -1
- package/dist/types/src/helpers/common.js +1 -1
- package/dist/types/src/helpers/common.js.map +1 -1
- package/dist/types/src/helpers/map-spaces.js +5 -6
- package/dist/types/src/helpers/map-spaces.js.map +1 -1
- package/dist/types/src/helpers/node-observability.d.ts +1 -1
- package/dist/types/src/helpers/node-observability.d.ts.map +1 -1
- package/dist/types/src/helpers/node-observability.js +7 -11
- package/dist/types/src/helpers/node-observability.js.map +1 -1
- package/dist/types/src/helpers/setup-telemetry-listeners.d.ts.map +1 -1
- package/dist/types/src/helpers/setup-telemetry-listeners.js +4 -7
- package/dist/types/src/helpers/setup-telemetry-listeners.js.map +1 -1
- package/dist/types/src/observability.d.ts +1 -1
- package/dist/types/src/observability.d.ts.map +1 -1
- package/dist/types/src/observability.js +68 -59
- package/dist/types/src/observability.js.map +1 -1
- package/dist/types/src/otel/logs.d.ts.map +1 -1
- package/dist/types/src/otel/logs.js +26 -23
- package/dist/types/src/otel/logs.js.map +1 -1
- package/dist/types/src/otel/metrics.d.ts +0 -1
- package/dist/types/src/otel/metrics.d.ts.map +1 -1
- package/dist/types/src/otel/metrics.js +6 -4
- package/dist/types/src/otel/metrics.js.map +1 -1
- package/dist/types/src/otel/otel.js +1 -1
- package/dist/types/src/otel/otel.js.map +1 -1
- package/dist/types/src/otel/traces-browser.d.ts.map +1 -1
- package/dist/types/src/otel/traces-browser.js +19 -13
- package/dist/types/src/otel/traces-browser.js.map +1 -1
- package/dist/types/src/otel/traces.d.ts.map +1 -1
- package/dist/types/src/otel/traces.js +18 -12
- package/dist/types/src/otel/traces.js.map +1 -1
- package/dist/types/src/segment/base.d.ts +1 -1
- package/dist/types/src/segment/base.d.ts.map +1 -1
- package/dist/types/src/segment/base.js +2 -1
- package/dist/types/src/segment/base.js.map +1 -1
- package/dist/types/src/segment/browser.d.ts +1 -1
- package/dist/types/src/segment/browser.d.ts.map +1 -1
- package/dist/types/src/segment/browser.js +6 -10
- package/dist/types/src/segment/browser.js.map +1 -1
- package/dist/types/src/segment/node.d.ts +1 -1
- package/dist/types/src/segment/node.d.ts.map +1 -1
- package/dist/types/src/segment/node.js +2 -1
- package/dist/types/src/segment/node.js.map +1 -1
- package/dist/types/src/sentry/browser.d.ts.map +1 -1
- package/dist/types/src/sentry/browser.js +4 -6
- package/dist/types/src/sentry/browser.js.map +1 -1
- package/dist/types/src/sentry/index.d.ts +1 -1
- package/dist/types/src/sentry/index.d.ts.map +1 -1
- package/dist/types/src/sentry/index.js +0 -1
- package/dist/types/src/sentry/index.js.map +1 -1
- package/dist/types/src/sentry/node.d.ts.map +1 -1
- package/dist/types/src/sentry/node.js +8 -13
- package/dist/types/src/sentry/node.js.map +1 -1
- package/dist/types/src/sentry/node.node.test.js +3 -5
- package/dist/types/src/sentry/node.node.test.js.map +1 -1
- package/dist/types/src/sentry/sentry-log-processor.d.ts.map +1 -1
- package/dist/types/src/sentry/sentry-log-processor.js +58 -63
- package/dist/types/src/sentry/sentry-log-processor.js.map +1 -1
- package/dist/types/src/sentry/sentry.node.test.js +1 -1
- package/dist/types/src/sentry/sentry.node.test.js.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -27
- package/src/helpers/browser-observability.ts +2 -1
- package/src/helpers/node-observability.ts +5 -4
- package/src/helpers/setup-telemetry-listeners.ts +2 -1
- package/src/observability.ts +4 -4
- package/src/otel/logs.ts +9 -7
- package/src/otel/metrics.ts +5 -12
- package/src/otel/otel.ts +1 -1
- package/src/otel/traces-browser.ts +23 -20
- package/src/otel/traces.ts +22 -19
- package/src/segment/base.ts +1 -1
- package/src/segment/browser.ts +3 -2
- package/src/segment/node.ts +3 -2
- package/src/sentry/browser.ts +7 -7
- package/src/sentry/index.ts +1 -1
- package/src/sentry/node.node.test.ts +2 -1
- package/src/sentry/node.ts +3 -3
- package/src/sentry/sentry-log-processor.ts +15 -7
- package/src/sentry/sentry.node.test.ts +2 -1
- package/dist/lib/browser/chunk-5OQYI27L.mjs +0 -1
- package/dist/lib/browser/chunk-MWTIKIBZ.mjs.map +0 -7
- package/dist/lib/browser/observability-EEM6BEY6.mjs +0 -10
- package/dist/lib/browser/otel-IRDZ7PES.mjs.map +0 -7
- package/dist/lib/browser/sentry-log-processor-3F3SBJXM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-552KLA6Z.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EYW4X3O6.mjs.map +0 -7
- package/dist/lib/node-esm/observability-DAXZGOBS.mjs +0 -11
- package/dist/lib/node-esm/otel-62HYJETM.mjs.map +0 -7
- package/dist/lib/node-esm/sentry-log-processor-JAYRA23C.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-5OQYI27L.mjs.map → chunk-5ICT2XF2.mjs.map} +0 -0
- /package/dist/lib/browser/{observability-EEM6BEY6.mjs.map → observability-CQGG3MID.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-MRAK2H7O.mjs.map → chunk-QUZL7LKE.mjs.map} +0 -0
- /package/dist/lib/node-esm/{observability-DAXZGOBS.mjs.map → observability-DHNVVRC7.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/observability",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.a4bbb77",
|
|
4
4
|
"description": "Provides a common interface for app and platform observability",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,16 +10,19 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
16
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
17
|
},
|
|
17
18
|
"./segment": {
|
|
19
|
+
"source": "./src/segment/index.ts",
|
|
18
20
|
"types": "./dist/types/src/segment/index.d.ts",
|
|
19
21
|
"browser": "./dist/lib/browser/segment/index.mjs",
|
|
20
22
|
"node": "./dist/lib/node-esm/segment/index.mjs"
|
|
21
23
|
},
|
|
22
24
|
"./sentry": {
|
|
25
|
+
"source": "./src/sentry/index.ts",
|
|
23
26
|
"types": "./dist/types/src/sentry/index.d.ts",
|
|
24
27
|
"browser": "./dist/lib/browser/sentry/index.mjs",
|
|
25
28
|
"node": "./dist/lib/node-esm/sentry/index.mjs"
|
|
@@ -48,18 +51,18 @@
|
|
|
48
51
|
],
|
|
49
52
|
"dependencies": {
|
|
50
53
|
"@opentelemetry/api": "^1.9.0",
|
|
51
|
-
"@opentelemetry/api-logs": "^0.
|
|
52
|
-
"@opentelemetry/auto-instrumentations-web": "^0.
|
|
53
|
-
"@opentelemetry/exporter-logs-otlp-http": "^0.
|
|
54
|
-
"@opentelemetry/exporter-metrics-otlp-http": "^0.
|
|
55
|
-
"@opentelemetry/exporter-trace-otlp-http": "^0.
|
|
56
|
-
"@opentelemetry/instrumentation": "^0.
|
|
57
|
-
"@opentelemetry/resources": "^1.
|
|
58
|
-
"@opentelemetry/sdk-logs": "^0.
|
|
59
|
-
"@opentelemetry/sdk-metrics": "^1.
|
|
60
|
-
"@opentelemetry/sdk-trace-base": "^1.
|
|
61
|
-
"@opentelemetry/sdk-trace-web": "^1.
|
|
62
|
-
"@opentelemetry/semantic-conventions": "^1.
|
|
54
|
+
"@opentelemetry/api-logs": "^0.203.0",
|
|
55
|
+
"@opentelemetry/auto-instrumentations-web": "^0.51.0",
|
|
56
|
+
"@opentelemetry/exporter-logs-otlp-http": "^0.203.0",
|
|
57
|
+
"@opentelemetry/exporter-metrics-otlp-http": "^0.203.0",
|
|
58
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.203.0",
|
|
59
|
+
"@opentelemetry/instrumentation": "^0.203.0",
|
|
60
|
+
"@opentelemetry/resources": "^2.1.0",
|
|
61
|
+
"@opentelemetry/sdk-logs": "^0.203.0",
|
|
62
|
+
"@opentelemetry/sdk-metrics": "^2.1.0",
|
|
63
|
+
"@opentelemetry/sdk-trace-base": "^2.1.0",
|
|
64
|
+
"@opentelemetry/sdk-trace-web": "^2.1.0",
|
|
65
|
+
"@opentelemetry/semantic-conventions": "^1.37.0",
|
|
63
66
|
"@segment/analytics-node": "^2.1.0",
|
|
64
67
|
"@segment/snippet": "^4.15.3",
|
|
65
68
|
"@sentry/browser": "^8.8.0",
|
|
@@ -68,20 +71,20 @@
|
|
|
68
71
|
"js-yaml": "^4.1.0",
|
|
69
72
|
"localforage": "^1.10.0",
|
|
70
73
|
"uuid": "^9.0.0",
|
|
71
|
-
"@dxos/async": "0.8.4-main.
|
|
72
|
-
"@dxos/client": "0.8.4-main.
|
|
73
|
-
"@dxos/client-protocol": "0.8.4-main.
|
|
74
|
-
"@dxos/client-services": "0.8.4-main.
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/protocols": "0.8.4-main.
|
|
83
|
-
"@dxos/tracing": "0.8.4-main.
|
|
84
|
-
"@dxos/util": "0.8.4-main.
|
|
74
|
+
"@dxos/async": "0.8.4-main.a4bbb77",
|
|
75
|
+
"@dxos/client": "0.8.4-main.a4bbb77",
|
|
76
|
+
"@dxos/client-protocol": "0.8.4-main.a4bbb77",
|
|
77
|
+
"@dxos/client-services": "0.8.4-main.a4bbb77",
|
|
78
|
+
"@dxos/context": "0.8.4-main.a4bbb77",
|
|
79
|
+
"@dxos/config": "0.8.4-main.a4bbb77",
|
|
80
|
+
"@dxos/invariant": "0.8.4-main.a4bbb77",
|
|
81
|
+
"@dxos/debug": "0.8.4-main.a4bbb77",
|
|
82
|
+
"@dxos/log": "0.8.4-main.a4bbb77",
|
|
83
|
+
"@dxos/network-manager": "0.8.4-main.a4bbb77",
|
|
84
|
+
"@dxos/node-std": "0.8.4-main.a4bbb77",
|
|
85
|
+
"@dxos/protocols": "0.8.4-main.a4bbb77",
|
|
86
|
+
"@dxos/tracing": "0.8.4-main.a4bbb77",
|
|
87
|
+
"@dxos/util": "0.8.4-main.a4bbb77"
|
|
85
88
|
},
|
|
86
89
|
"devDependencies": {
|
|
87
90
|
"@sentry/types": "^8.8.0",
|
|
@@ -11,9 +11,10 @@ import * as localForage from 'localforage';
|
|
|
11
11
|
import type { Config } from '@dxos/client';
|
|
12
12
|
import { log } from '@dxos/log';
|
|
13
13
|
|
|
14
|
-
import type { IPData } from './common';
|
|
15
14
|
import type { Mode, Observability } from '../observability';
|
|
16
15
|
|
|
16
|
+
import type { IPData } from './common';
|
|
17
|
+
|
|
17
18
|
export const OBSERVABILITY_DISABLED_KEY = 'observability-disabled';
|
|
18
19
|
export const OBSERVABILITY_GROUP_KEY = 'observability-group';
|
|
19
20
|
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
//
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
|
-
import yaml from 'js-yaml';
|
|
5
4
|
import { existsSync, statSync } from 'node:fs';
|
|
6
5
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
7
6
|
import { join } from 'node:path';
|
|
7
|
+
|
|
8
|
+
import yaml from 'js-yaml';
|
|
8
9
|
import { v4 as uuid, validate as validateUuid } from 'uuid';
|
|
9
10
|
|
|
10
11
|
import type { Config } from '@dxos/client';
|
|
11
12
|
import { log } from '@dxos/log';
|
|
12
13
|
|
|
13
|
-
import {
|
|
14
|
+
import { type Mode, Observability } from '../observability';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Print observability banner once per installation.
|
|
@@ -63,7 +64,7 @@ const initializeState = async (idPath: string): Promise<PersistentObservabilityS
|
|
|
63
64
|
const observabilityState = {
|
|
64
65
|
installationId: uuid(),
|
|
65
66
|
group: process.env.DX_OBSERVABILITY_GROUP ?? undefined,
|
|
66
|
-
mode: (process.env.DX_DISABLE_OBSERVABILITY ? 'disabled' : process.env.DX_OBSERVABILITY_MODE ?? 'basic') as Mode,
|
|
67
|
+
mode: (process.env.DX_DISABLE_OBSERVABILITY ? 'disabled' : (process.env.DX_OBSERVABILITY_MODE ?? 'basic')) as Mode,
|
|
67
68
|
};
|
|
68
69
|
|
|
69
70
|
await writeFile(
|
|
@@ -80,7 +81,7 @@ const validate = (contextString: string) => {
|
|
|
80
81
|
if (Boolean(context.installationId) && validateUuid(context.installationId!)) {
|
|
81
82
|
return {
|
|
82
83
|
...context,
|
|
83
|
-
mode: process.env.DX_DISABLE_OBSERVABILITY ? 'disabled' : context.mode ?? 'basic',
|
|
84
|
+
mode: process.env.DX_DISABLE_OBSERVABILITY ? 'disabled' : (context.mode ?? 'basic'),
|
|
84
85
|
};
|
|
85
86
|
}
|
|
86
87
|
};
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import type { Client } from '@dxos/client';
|
|
6
6
|
|
|
7
|
-
import { getTelemetryIdentity } from './common';
|
|
8
7
|
import { type Observability } from '../observability';
|
|
9
8
|
|
|
9
|
+
import { getTelemetryIdentity } from './common';
|
|
10
|
+
|
|
10
11
|
let lastFocusEvent = new Date();
|
|
11
12
|
let totalTime = 0;
|
|
12
13
|
|
package/src/observability.ts
CHANGED
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Event, scheduleTaskInterval } from '@dxos/async';
|
|
6
|
-
import {
|
|
6
|
+
import { type Client, type Config, PublicKey } from '@dxos/client';
|
|
7
7
|
import { type ClientServices, type Space } from '@dxos/client-protocol';
|
|
8
8
|
import { Context } from '@dxos/context';
|
|
9
9
|
import { invariant } from '@dxos/invariant';
|
|
10
|
-
import {
|
|
10
|
+
import { LogLevel, log } from '@dxos/log';
|
|
11
11
|
import { ConnectionState } from '@dxos/network-manager';
|
|
12
12
|
import { DeviceKind, type NetworkStatus, Platform } from '@dxos/protocols/proto/dxos/client/services';
|
|
13
13
|
import { isNode } from '@dxos/util';
|
|
14
14
|
|
|
15
15
|
import buildSecrets from './cli-observability-secrets.json';
|
|
16
|
-
import {
|
|
16
|
+
import { type IPData, getTelemetryIdentity, mapSpaces } from './helpers';
|
|
17
17
|
import { type OtelLogs, type OtelMetrics, type OtelTraces } from './otel';
|
|
18
|
-
import { type
|
|
18
|
+
import { type PageOptions, type SegmentTelemetry, TelemetryEvent, type TrackOptions } from './segment';
|
|
19
19
|
import { type InitOptions, type captureException as SentryCaptureException } from './sentry';
|
|
20
20
|
import { type SentryLogProcessor } from './sentry/sentry-log-processor';
|
|
21
21
|
|
package/src/otel/logs.ts
CHANGED
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import { SeverityNumber } from '@opentelemetry/api-logs';
|
|
6
6
|
import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';
|
|
7
|
-
import {
|
|
7
|
+
import { defaultResource, resourceFromAttributes } from '@opentelemetry/resources';
|
|
8
8
|
import { BatchLogRecordProcessor, LoggerProvider } from '@opentelemetry/sdk-logs';
|
|
9
9
|
import { SEMRESATTRS_SERVICE_NAME, SEMRESATTRS_SERVICE_VERSION } from '@opentelemetry/semantic-conventions';
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
|
-
getContextFromEntry,
|
|
13
|
-
getRelativeFilename,
|
|
14
12
|
type LogConfig,
|
|
15
13
|
type LogEntry,
|
|
16
14
|
LogLevel,
|
|
17
15
|
type LogProcessor,
|
|
16
|
+
getContextFromEntry,
|
|
17
|
+
getRelativeFilename,
|
|
18
18
|
} from '@dxos/log';
|
|
19
19
|
import { jsonlogify } from '@dxos/util';
|
|
20
20
|
|
|
@@ -33,8 +33,8 @@ export class OtelLogs {
|
|
|
33
33
|
private _loggerProvider: LoggerProvider;
|
|
34
34
|
constructor(private readonly options: OtelLogOptions) {
|
|
35
35
|
setDiagLogger(options.consoleDiagLogLevel);
|
|
36
|
-
const resource =
|
|
37
|
-
|
|
36
|
+
const resource = defaultResource().merge(
|
|
37
|
+
resourceFromAttributes({
|
|
38
38
|
[SEMRESATTRS_SERVICE_NAME]: this.options.serviceName,
|
|
39
39
|
[SEMRESATTRS_SERVICE_VERSION]: this.options.serviceVersion,
|
|
40
40
|
}),
|
|
@@ -46,8 +46,10 @@ export class OtelLogs {
|
|
|
46
46
|
},
|
|
47
47
|
concurrencyLimit: 10, // an optional limit on pending requests
|
|
48
48
|
});
|
|
49
|
-
this._loggerProvider = new LoggerProvider({
|
|
50
|
-
|
|
49
|
+
this._loggerProvider = new LoggerProvider({
|
|
50
|
+
resource,
|
|
51
|
+
processors: [new BatchLogRecordProcessor(logExporter)],
|
|
52
|
+
});
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
public readonly logProcessor: LogProcessor = (config: LogConfig, entry: LogEntry) => {
|
package/src/otel/metrics.ts
CHANGED
|
@@ -2,36 +2,29 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Meter } from '@opentelemetry/api';
|
|
6
6
|
import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-http';
|
|
7
|
-
import {
|
|
7
|
+
import { defaultResource, resourceFromAttributes } from '@opentelemetry/resources';
|
|
8
8
|
import { MeterProvider, PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics';
|
|
9
9
|
import { SEMRESATTRS_SERVICE_NAME, SEMRESATTRS_SERVICE_VERSION } from '@opentelemetry/semantic-conventions';
|
|
10
10
|
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
|
-
import {
|
|
12
|
+
import { type MetricData, TRACE_PROCESSOR } from '@dxos/tracing';
|
|
13
13
|
|
|
14
14
|
import { type OtelOptions, setDiagLogger } from './otel';
|
|
15
15
|
|
|
16
16
|
const EXPORT_INTERVAL = 60 * 1000;
|
|
17
17
|
|
|
18
|
-
type SynchronousGauge = {
|
|
19
|
-
gauge: ObservableGauge<Attributes>;
|
|
20
|
-
nextValue: number;
|
|
21
|
-
nextTags?: any;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
18
|
export class OtelMetrics {
|
|
25
19
|
private _meterProvider: MeterProvider;
|
|
26
20
|
private _meter: Meter;
|
|
27
|
-
private _gauges = new Map<string, SynchronousGauge>();
|
|
28
21
|
|
|
29
22
|
constructor(private readonly options: OtelOptions) {
|
|
30
23
|
// TODO: improve error handling/logging
|
|
31
24
|
// https://github.com/open-telemetry/opentelemetry-js/issues/4823
|
|
32
25
|
setDiagLogger(options.consoleDiagLogLevel);
|
|
33
|
-
const resource =
|
|
34
|
-
|
|
26
|
+
const resource = defaultResource().merge(
|
|
27
|
+
resourceFromAttributes({
|
|
35
28
|
[SEMRESATTRS_SERVICE_NAME]: this.options.serviceName,
|
|
36
29
|
[SEMRESATTRS_SERVICE_VERSION]: this.options.serviceVersion,
|
|
37
30
|
}),
|
package/src/otel/otel.ts
CHANGED
|
@@ -2,45 +2,48 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type Tracer, trace } from '@opentelemetry/api';
|
|
6
6
|
import { getWebAutoInstrumentations } from '@opentelemetry/auto-instrumentations-web';
|
|
7
7
|
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
|
|
8
8
|
import { registerInstrumentations } from '@opentelemetry/instrumentation';
|
|
9
|
-
import {
|
|
10
|
-
import { ConsoleSpanExporter, SimpleSpanProcessor
|
|
9
|
+
import { defaultResource, resourceFromAttributes } from '@opentelemetry/resources';
|
|
10
|
+
import { BatchSpanProcessor, ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
11
11
|
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
|
|
12
12
|
import { SEMRESATTRS_SERVICE_NAME, SEMRESATTRS_SERVICE_VERSION } from '@opentelemetry/semantic-conventions';
|
|
13
13
|
|
|
14
14
|
import { log } from '@dxos/log';
|
|
15
|
-
import {
|
|
15
|
+
import { type StartSpanOptions, TRACE_PROCESSOR } from '@dxos/tracing';
|
|
16
16
|
|
|
17
17
|
import { type OtelOptions } from './otel';
|
|
18
18
|
|
|
19
19
|
export class OtelTraces {
|
|
20
20
|
private _tracer: Tracer;
|
|
21
21
|
constructor(private readonly options: OtelOptions) {
|
|
22
|
-
const resource =
|
|
23
|
-
|
|
22
|
+
const resource = defaultResource().merge(
|
|
23
|
+
resourceFromAttributes({
|
|
24
24
|
[SEMRESATTRS_SERVICE_NAME]: this.options.serviceName,
|
|
25
25
|
[SEMRESATTRS_SERVICE_VERSION]: this.options.serviceVersion,
|
|
26
26
|
}),
|
|
27
27
|
);
|
|
28
28
|
|
|
29
|
-
const tracerProvider = new WebTracerProvider({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
new
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
const tracerProvider = new WebTracerProvider({
|
|
30
|
+
resource,
|
|
31
|
+
spanProcessors: [
|
|
32
|
+
new SimpleSpanProcessor(new ConsoleSpanExporter()),
|
|
33
|
+
new BatchSpanProcessor(
|
|
34
|
+
new OTLPTraceExporter({
|
|
35
|
+
url: this.options.endpoint + '/v1/traces',
|
|
36
|
+
headers: {
|
|
37
|
+
Authorization: this.options.authorizationHeader,
|
|
38
|
+
},
|
|
39
|
+
concurrencyLimit: 10, // an optional limit on pending requests
|
|
40
|
+
}),
|
|
41
|
+
),
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
|
|
42
45
|
// TODO(nf): ContextManager? Propogator?
|
|
43
|
-
|
|
46
|
+
trace.setGlobalTracerProvider(tracerProvider);
|
|
44
47
|
this._tracer = trace.getTracer('dxos-observability', this.options.serviceVersion);
|
|
45
48
|
}
|
|
46
49
|
|
package/src/otel/traces.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type Tracer, trace } from '@opentelemetry/api';
|
|
6
6
|
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
|
|
7
|
-
import {
|
|
7
|
+
import { defaultResource, resourceFromAttributes } from '@opentelemetry/resources';
|
|
8
8
|
import {
|
|
9
9
|
BasicTracerProvider,
|
|
10
10
|
BatchSpanProcessor,
|
|
@@ -14,34 +14,37 @@ import {
|
|
|
14
14
|
import { SEMRESATTRS_SERVICE_NAME, SEMRESATTRS_SERVICE_VERSION } from '@opentelemetry/semantic-conventions';
|
|
15
15
|
import { log } from 'debug';
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { type StartSpanOptions, TRACE_PROCESSOR } from '@dxos/tracing';
|
|
18
18
|
|
|
19
19
|
import { type OtelOptions } from './otel';
|
|
20
20
|
|
|
21
21
|
export class OtelTraces {
|
|
22
22
|
private _tracer: Tracer;
|
|
23
23
|
constructor(private readonly options: OtelOptions) {
|
|
24
|
-
const resource =
|
|
25
|
-
|
|
24
|
+
const resource = defaultResource().merge(
|
|
25
|
+
resourceFromAttributes({
|
|
26
26
|
[SEMRESATTRS_SERVICE_NAME]: this.options.serviceName,
|
|
27
27
|
[SEMRESATTRS_SERVICE_VERSION]: this.options.serviceVersion,
|
|
28
28
|
}),
|
|
29
29
|
);
|
|
30
30
|
|
|
31
|
-
const tracerProvider = new BasicTracerProvider({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
new
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
const tracerProvider = new BasicTracerProvider({
|
|
32
|
+
resource,
|
|
33
|
+
spanProcessors: [
|
|
34
|
+
new SimpleSpanProcessor(new ConsoleSpanExporter()),
|
|
35
|
+
new BatchSpanProcessor(
|
|
36
|
+
new OTLPTraceExporter({
|
|
37
|
+
url: this.options.endpoint + '/v1/traces',
|
|
38
|
+
headers: {
|
|
39
|
+
Authorization: this.options.authorizationHeader,
|
|
40
|
+
},
|
|
41
|
+
concurrencyLimit: 10, // an optional limit on pending requests
|
|
42
|
+
}),
|
|
43
|
+
),
|
|
44
|
+
],
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
trace.setGlobalTracerProvider(tracerProvider);
|
|
45
48
|
this._tracer = trace.getTracer('dxos-observability', this.options.serviceVersion);
|
|
46
49
|
}
|
|
47
50
|
|
package/src/segment/base.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type IdentifyParams, type PageParams, type TrackParams } from '@segment/analytics-node';
|
|
6
6
|
|
|
7
7
|
import { log } from '@dxos/log';
|
|
8
8
|
|
package/src/segment/browser.ts
CHANGED
|
@@ -7,10 +7,11 @@ import snippet from '@segment/snippet';
|
|
|
7
7
|
|
|
8
8
|
import { log } from '@dxos/log';
|
|
9
9
|
|
|
10
|
-
import { AbstractSegmentTelemetry } from './base';
|
|
11
|
-
import type { TrackOptions, SegmentTelemetryOptions, PageOptions } from './types';
|
|
12
10
|
import { captureException } from '../sentry';
|
|
13
11
|
|
|
12
|
+
import { AbstractSegmentTelemetry } from './base';
|
|
13
|
+
import type { PageOptions, SegmentTelemetryOptions, TrackOptions } from './types';
|
|
14
|
+
|
|
14
15
|
/**
|
|
15
16
|
* Browser telemetry.
|
|
16
17
|
*/
|
package/src/segment/node.ts
CHANGED
|
@@ -7,10 +7,11 @@ import { Analytics, type IdentifyParams } from '@segment/analytics-node';
|
|
|
7
7
|
import { invariant } from '@dxos/invariant';
|
|
8
8
|
import { log } from '@dxos/log';
|
|
9
9
|
|
|
10
|
-
import { AbstractSegmentTelemetry } from './base';
|
|
11
|
-
import type { SegmentTelemetryOptions, PageOptions, TrackOptions } from './types';
|
|
12
10
|
import { captureException } from '../sentry';
|
|
13
11
|
|
|
12
|
+
import { AbstractSegmentTelemetry } from './base';
|
|
13
|
+
import type { PageOptions, SegmentTelemetryOptions, TrackOptions } from './types';
|
|
14
|
+
|
|
14
15
|
/**
|
|
15
16
|
* Node telemetry.
|
|
16
17
|
*/
|
package/src/sentry/browser.ts
CHANGED
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
breadcrumbsIntegration,
|
|
7
|
+
browserTracingIntegration,
|
|
8
|
+
feedbackIntegration,
|
|
9
|
+
httpClientIntegration,
|
|
10
|
+
metrics,
|
|
8
11
|
addBreadcrumb as naturalAddBreadcrumb,
|
|
9
12
|
captureException as naturalCaptureException,
|
|
10
13
|
captureMessage as naturalCaptureMessage,
|
|
14
|
+
init as naturalInit,
|
|
11
15
|
sendFeedback as naturalSendFeedback,
|
|
12
16
|
withScope as naturalWithScope,
|
|
13
|
-
breadcrumbsIntegration,
|
|
14
|
-
browserTracingIntegration,
|
|
15
|
-
feedbackIntegration,
|
|
16
|
-
httpClientIntegration,
|
|
17
17
|
replayIntegration,
|
|
18
|
-
|
|
18
|
+
setTag,
|
|
19
19
|
startInactiveSpan,
|
|
20
20
|
} from '@sentry/browser';
|
|
21
21
|
|
package/src/sentry/index.ts
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
import type { Stacktrace } from '@sentry/types';
|
|
6
6
|
import { beforeAll, beforeEach, describe, expect, test } from 'vitest';
|
|
7
7
|
|
|
8
|
-
import * as Sentry from './node';
|
|
9
8
|
import { sentryTestkit } from '../testing';
|
|
10
9
|
|
|
10
|
+
import * as Sentry from './node';
|
|
11
|
+
|
|
11
12
|
const { testkit, sentryTransport } = sentryTestkit();
|
|
12
13
|
|
|
13
14
|
// TODO(burdon): https://example.com?
|
package/src/sentry/node.ts
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
type Event,
|
|
7
|
-
|
|
8
|
-
setTag,
|
|
7
|
+
metrics,
|
|
9
8
|
addBreadcrumb as naturalAddBreadcrumb,
|
|
10
9
|
captureException as naturalCaptureException,
|
|
11
10
|
captureMessage as naturalCaptureMessage,
|
|
11
|
+
init as naturalInit,
|
|
12
12
|
withScope as naturalWithScope,
|
|
13
|
-
|
|
13
|
+
setTag,
|
|
14
14
|
startInactiveSpan,
|
|
15
15
|
} from '@sentry/node';
|
|
16
16
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import type { Breadcrumb,
|
|
5
|
+
import type { Breadcrumb, Event, SeverityLevel } from '@sentry/types';
|
|
6
6
|
|
|
7
7
|
import { InvariantViolation } from '@dxos/invariant';
|
|
8
8
|
import { type LogConfig, type LogEntry, LogLevel, type LogProcessor, shouldLog } from '@dxos/log';
|
|
9
9
|
import { CircularBuffer, getDebugName } from '@dxos/util';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { captureException, captureMessage, withScope } from './node';
|
|
12
12
|
|
|
13
13
|
const MAX_LOG_BREADCRUMBS = 150;
|
|
14
14
|
|
|
@@ -20,7 +20,12 @@ export class SentryLogProcessor {
|
|
|
20
20
|
// Don't forward logs from remote sessions.
|
|
21
21
|
if (!shouldLog(entry, config.captureFilters) || meta?.S?.remoteSessionId) {
|
|
22
22
|
if (entry.level > LogLevel.DEBUG) {
|
|
23
|
-
this._addBreadcrumb(
|
|
23
|
+
this._addBreadcrumb(
|
|
24
|
+
undefined,
|
|
25
|
+
entry.message ?? (entry.error ? (entry.error.message ?? String(entry.error)) : ''),
|
|
26
|
+
convertLevel(entry.level),
|
|
27
|
+
undefined,
|
|
28
|
+
);
|
|
24
29
|
}
|
|
25
30
|
return;
|
|
26
31
|
}
|
|
@@ -66,7 +71,8 @@ export class SentryLogProcessor {
|
|
|
66
71
|
return;
|
|
67
72
|
}
|
|
68
73
|
|
|
69
|
-
|
|
74
|
+
const message = entry.message ?? (entry.error ? (entry.error.message ?? String(entry.error)) : '');
|
|
75
|
+
scope.setFingerprint([message]);
|
|
70
76
|
const eventId = captureMessage(extendedMessage);
|
|
71
77
|
this._addBreadcrumb(eventId, extendedMessage, severity, entry.context);
|
|
72
78
|
});
|
|
@@ -117,18 +123,20 @@ export class SentryLogProcessor {
|
|
|
117
123
|
}
|
|
118
124
|
}
|
|
119
125
|
|
|
120
|
-
const formatMessageForSentry = (entry: LogEntry) => {
|
|
126
|
+
const formatMessageForSentry = (entry: LogEntry): string => {
|
|
127
|
+
const message = entry.message ?? (entry.error ? (entry.error.message ?? String(entry.error)) : '');
|
|
128
|
+
|
|
121
129
|
let scopePrefix: string | undefined;
|
|
122
130
|
if (entry.meta?.S) {
|
|
123
131
|
const scope = entry.meta?.S;
|
|
124
132
|
scopePrefix = scope.name || getDebugName(scope);
|
|
125
133
|
}
|
|
126
134
|
if (scopePrefix == null) {
|
|
127
|
-
return
|
|
135
|
+
return message;
|
|
128
136
|
}
|
|
129
137
|
|
|
130
138
|
const workerPrefix = entry.meta?.S?.hostSessionId ? '[worker] ' : '';
|
|
131
|
-
return `${workerPrefix}${scopePrefix} ${
|
|
139
|
+
return `${workerPrefix}${scopePrefix} ${message}`;
|
|
132
140
|
};
|
|
133
141
|
|
|
134
142
|
const convertLevel = (level: LogLevel): SeverityLevel => {
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import { beforeAll, beforeEach, describe, expect, test } from 'vitest';
|
|
6
6
|
|
|
7
|
-
import * as Sentry from './node';
|
|
8
7
|
import { sentryTestkit } from '../testing';
|
|
9
8
|
|
|
9
|
+
import * as Sentry from './node';
|
|
10
|
+
|
|
10
11
|
const { testkit, sentryTransport } = sentryTestkit();
|
|
11
12
|
|
|
12
13
|
const MOCK_DESTINATION = 'https://acacaeaccacacacabcaacdacdacadaca@sentry.io/000001';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-5OQYI27L.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/segment/browser.ts", "../../../src/segment/base.ts", "../../../src/segment/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { type IdentifyParams } from '@segment/analytics-node';\nimport snippet from '@segment/snippet';\n\nimport { log } from '@dxos/log';\n\nimport { AbstractSegmentTelemetry } from './base';\nimport type { TrackOptions, SegmentTelemetryOptions, PageOptions } from './types';\nimport { captureException } from '../sentry';\n\n/**\n * Browser telemetry.\n */\n// https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#basic-tracking-methods\nexport class SegmentTelemetry extends AbstractSegmentTelemetry {\n constructor({ apiKey, batchSize, getTags }: SegmentTelemetryOptions) {\n super(getTags);\n try {\n const contents = snippet.min({ apiKey, page: false });\n const script = document.createElement('script');\n script.innerHTML = contents;\n document.body.append(script);\n } catch (err) {\n log.catch('failed to initialize telemetry', err);\n }\n }\n\n identify(options: IdentifyParams): void {\n try {\n (window as any).analytics?.identify(options.userId, options.traits);\n } catch (err) {\n log.catch('failed to identify', err);\n }\n }\n\n page(options: PageOptions): void {\n try {\n const props = this.createPageProps(options);\n (window as any).analytics?.page(props.category, props.name, props.properties);\n } catch (err) {\n log.catch('failed to track page', err);\n }\n }\n\n track(options: TrackOptions): void {\n try {\n const props = this.createTrackProps(options);\n (window as any).analytics?.track(props.event, props.properties);\n } catch (err) {\n log.catch('failed to track event', err);\n }\n }\n\n async flush(): Promise<void> {\n try {\n await (window as any).analytics?.flush((err: any) => {\n captureException(err);\n });\n } catch (err) {\n log.catch('failed to flush telemetry', err);\n }\n }\n\n async close(): Promise<void> {}\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type TrackParams, type PageParams, type IdentifyParams } from '@segment/analytics-node';\n\nimport { log } from '@dxos/log';\n\nimport {\n type IdentityOptions,\n type PageOptions,\n type SegmentIdentityOptions,\n type Tags,\n TelemetryEvent,\n type TrackOptions,\n} from './types';\n\n/**\n * NOTE: Segment provides a default ID if we don't provide one.\n */\nconst getIdentityOptions = ({ did, installationId }: IdentityOptions): SegmentIdentityOptions => {\n if (!did && !installationId) {\n log.warn('No telemetry identifier provided.');\n }\n\n return {\n userId: did,\n anonymousId: installationId,\n } as SegmentIdentityOptions;\n};\n\n/**\n * Base class for Node and BrowserSegment telemetry.\n */\nexport abstract class AbstractSegmentTelemetry {\n constructor(private readonly _getTags: () => Tags) {}\n\n abstract identify(options: IdentifyParams): void;\n\n abstract page(options: PageOptions): void;\n\n abstract track(options: TrackOptions): void;\n\n protected createPageProps(options: PageOptions): PageParams {\n const { properties, ...rest } = options;\n return {\n ...getIdentityOptions(options),\n ...rest,\n properties: {\n common: this._getTags(),\n custom: properties,\n },\n };\n }\n\n protected createTrackProps(options: TrackOptions): TrackParams {\n const { event, action, properties, ...rest } = options;\n return {\n ...getIdentityOptions(options),\n ...rest,\n event: event ?? TelemetryEvent.ACTION,\n properties: {\n action,\n common: this._getTags(),\n custom: properties,\n },\n };\n }\n}\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport type Tags = Record<string, string>;\n\nexport type SegmentTelemetryOptions = {\n apiKey?: string;\n batchSize?: number;\n enable?: boolean;\n getTags: () => Tags;\n};\n\n// Copied from @segment/analytics-node.\nexport type SegmentIdentityOptions =\n | { userId: string; anonymousId?: string }\n | { userId?: string; anonymousId: string };\n\n// TODO(burdon): Should require one or the other.\nexport type IdentityOptions = { did?: string; installationId?: string };\n\nexport type CommonOptions = IdentityOptions & {\n timestamp?: Date;\n properties?: Record<string, unknown>;\n};\n\n/**\n * Page views.\n * https://segment.com/docs/connections/sources/catalog/libraries/server/node/#page\n */\nexport type PageOptions = CommonOptions & {\n category?: string;\n name?: string;\n};\n\n/**\n * Track actions.\n * https://segment.com/docs/connections/sources/catalog/libraries/server/node/#track\n */\nexport type TrackOptions = CommonOptions & {\n event?: TelemetryEvent;\n action: string;\n};\n\n/**\n * Each event will be mapped to a different Postgres table via segment.\n */\nexport enum TelemetryEvent {\n /**\n * Use actions.\n */\n ACTION = 'action',\n /**\n * High-volume technical metrics.\n */\n METRICS = 'metrics',\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAKA,OAAOA,aAAa;AAEpB,SAASC,OAAAA,YAAW;;;ACDpB,SAASC,WAAW;;;ACyCb,IAAKC,iBAAAA,yBAAAA,iBAAAA;AAGT,EAAAA,gBAAA,QAAA,IAAA;AAIA,EAAAA,gBAAA,SAAA,IAAA;SAPSA;;;;;AD3BZ,IAAMC,qBAAqB,CAAC,EAAEC,KAAKC,eAAc,MAAmB;AAClE,MAAI,CAACD,OAAO,CAACC,gBAAgB;AAC3BC,QAAIC,KAAK,qCAAA,QAAA;;;;;;EACX;AAEA,SAAO;IACLC,QAAQJ;IACRK,aAAaJ;EACf;AACF;AAKO,IAAeK,2BAAf,MAAeA;EACpB,YAA6BC,UAAsB;SAAtBA,WAAAA;EAAuB;EAQ1CC,gBAAgBC,SAAkC;AAC1D,UAAM,EAAEC,YAAY,GAAGC,KAAAA,IAASF;AAChC,WAAO;MACL,GAAGV,mBAAmBU,OAAAA;MACtB,GAAGE;MACHD,YAAY;QACVE,QAAQ,KAAKL,SAAQ;QACrBM,QAAQH;MACV;IACF;EACF;EAEUI,iBAAiBL,SAAoC;AAC7D,UAAM,EAAEM,OAAOC,QAAQN,YAAY,GAAGC,KAAAA,IAASF;AAC/C,WAAO;MACL,GAAGV,mBAAmBU,OAAAA;MACtB,GAAGE;MACHI,OAAOA,SAASE,eAAeC;MAC/BR,YAAY;QACVM;QACAJ,QAAQ,KAAKL,SAAQ;QACrBM,QAAQH;MACV;IACF;EACF;AACF;;;;ADnDO,IAAMS,mBAAN,cAA+BC,yBAAAA;EACpC,YAAY,EAAEC,QAAQC,WAAWC,QAAO,GAA6B;AACnE,UAAMA,OAAAA;AACN,QAAI;AACF,YAAMC,WAAWC,QAAQC,IAAI;QAAEL;QAAQM,MAAM;MAAM,CAAA;AACnD,YAAMC,SAASC,SAASC,cAAc,QAAA;AACtCF,aAAOG,YAAYP;AACnBK,eAASG,KAAKC,OAAOL,MAAAA;IACvB,SAASM,KAAK;AACZC,MAAAA,KAAIC,MAAM,kCAAkCF,KAAAA;;;;;;IAC9C;EACF;EAEAG,SAASC,SAA+B;AACtC,QAAI;AACDC,aAAeC,WAAWH,SAASC,QAAQG,QAAQH,QAAQI,MAAM;IACpE,SAASR,KAAK;AACZC,MAAAA,KAAIC,MAAM,sBAAsBF,KAAAA;;;;;;IAClC;EACF;EAEAP,KAAKW,SAA4B;AAC/B,QAAI;AACF,YAAMK,QAAQ,KAAKC,gBAAgBN,OAAAA;AAClCC,aAAeC,WAAWb,KAAKgB,MAAME,UAAUF,MAAMG,MAAMH,MAAMI,UAAU;IAC9E,SAASb,KAAK;AACZC,MAAAA,KAAIC,MAAM,wBAAwBF,KAAAA;;;;;;IACpC;EACF;EAEAc,MAAMV,SAA6B;AACjC,QAAI;AACF,YAAMK,QAAQ,KAAKM,iBAAiBX,OAAAA;AACnCC,aAAeC,WAAWQ,MAAML,MAAMO,OAAOP,MAAMI,UAAU;IAChE,SAASb,KAAK;AACZC,MAAAA,KAAIC,MAAM,yBAAyBF,KAAAA;;;;;;IACrC;EACF;EAEA,MAAMiB,QAAuB;AAC3B,QAAI;AACF,YAAOZ,OAAeC,WAAWW,MAAM,CAACjB,QAAAA;AACtCkB,yBAAiBlB,GAAAA;MACnB,CAAA;IACF,SAASA,KAAK;AACZC,MAAAA,KAAIC,MAAM,6BAA6BF,KAAAA;;;;;;IACzC;EACF;EAEA,MAAMmB,QAAuB;EAAC;AAChC;",
|
|
6
|
-
"names": ["snippet", "log", "log", "TelemetryEvent", "getIdentityOptions", "did", "installationId", "log", "warn", "userId", "anonymousId", "AbstractSegmentTelemetry", "_getTags", "createPageProps", "options", "properties", "rest", "common", "custom", "createTrackProps", "event", "action", "TelemetryEvent", "ACTION", "SegmentTelemetry", "AbstractSegmentTelemetry", "apiKey", "batchSize", "getTags", "contents", "snippet", "min", "page", "script", "document", "createElement", "innerHTML", "body", "append", "err", "log", "catch", "identify", "options", "window", "analytics", "userId", "traits", "props", "createPageProps", "category", "name", "properties", "track", "createTrackProps", "event", "flush", "captureException", "close"]
|
|
7
|
-
}
|