@dxos/observability 0.7.5-main.9d2a38b → 0.7.5-main.b19bfc8
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-EE4ONYIP.mjs → chunk-RWIBODSU.mjs} +14 -14
- package/dist/lib/browser/chunk-RWIBODSU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/observability-VEOITBLM.mjs +7 -0
- package/dist/lib/browser/segment/index.mjs +2 -2
- package/dist/lib/browser/segment/index.mjs.map +3 -3
- package/dist/lib/node/{chunk-4TP5PWSE.cjs → chunk-X2D2I2IE.cjs} +17 -17
- package/dist/lib/node/chunk-X2D2I2IE.cjs.map +7 -0
- package/dist/lib/node/index.cjs +15 -15
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{observability-2HKMGFQE.cjs → observability-MM62IY7P.cjs} +6 -6
- package/dist/lib/node/{observability-2HKMGFQE.cjs.map → observability-MM62IY7P.cjs.map} +2 -2
- package/dist/lib/node/segment/index.cjs +2 -2
- package/dist/lib/node/segment/index.cjs.map +3 -3
- package/dist/lib/node-esm/{chunk-ZLCW6LTG.mjs → chunk-S7JHPCWW.mjs} +14 -14
- package/dist/lib/node-esm/chunk-S7JHPCWW.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{observability-CJZWSHQX.mjs → observability-OLS7SWZT.mjs} +2 -2
- package/dist/lib/node-esm/segment/index.mjs +2 -2
- package/dist/lib/node-esm/segment/index.mjs.map +3 -3
- package/dist/types/src/helpers/browser-observability.js +24 -65
- package/dist/types/src/helpers/browser-observability.js.map +1 -1
- package/dist/types/src/helpers/common.js +2 -6
- package/dist/types/src/helpers/common.js.map +1 -1
- package/dist/types/src/helpers/index.js +5 -21
- package/dist/types/src/helpers/index.js.map +1 -1
- package/dist/types/src/helpers/map-spaces.js +1 -5
- package/dist/types/src/helpers/map-spaces.js.map +1 -1
- package/dist/types/src/helpers/node-observability.js +25 -34
- package/dist/types/src/helpers/node-observability.js.map +1 -1
- package/dist/types/src/helpers/setup-telemetry-listeners.js +7 -11
- package/dist/types/src/helpers/setup-telemetry-listeners.js.map +1 -1
- package/dist/types/src/index.js +2 -18
- package/dist/types/src/index.js.map +1 -1
- package/dist/types/src/observability.js +59 -99
- package/dist/types/src/observability.js.map +1 -1
- package/dist/types/src/otel/index.js +4 -20
- package/dist/types/src/otel/index.js.map +1 -1
- package/dist/types/src/otel/logs.js +29 -33
- package/dist/types/src/otel/logs.js.map +1 -1
- package/dist/types/src/otel/metrics.js +19 -23
- package/dist/types/src/otel/metrics.js.map +1 -1
- package/dist/types/src/otel/otel.js +4 -8
- package/dist/types/src/otel/otel.js.map +1 -1
- package/dist/types/src/otel/traces-browser.js +23 -27
- package/dist/types/src/otel/traces-browser.js.map +1 -1
- package/dist/types/src/otel/traces.js +18 -22
- package/dist/types/src/otel/traces.js.map +1 -1
- package/dist/types/src/segment/browser.d.ts +2 -2
- package/dist/types/src/segment/browser.d.ts.map +1 -1
- package/dist/types/src/segment/browser.js +12 -19
- package/dist/types/src/segment/browser.js.map +1 -1
- package/dist/types/src/segment/index.js +2 -18
- package/dist/types/src/segment/index.js.map +1 -1
- package/dist/types/src/segment/node.d.ts +2 -2
- package/dist/types/src/segment/node.d.ts.map +1 -1
- package/dist/types/src/segment/node.js +17 -21
- package/dist/types/src/segment/node.js.map +1 -1
- package/dist/types/src/segment/types.d.ts +1 -1
- package/dist/types/src/segment/types.d.ts.map +1 -1
- package/dist/types/src/segment/types.js +0 -2
- package/dist/types/src/segment/types.js.map +1 -1
- package/dist/types/src/sentry/browser.js +32 -43
- package/dist/types/src/sentry/browser.js.map +1 -1
- package/dist/types/src/sentry/index.js +2 -18
- package/dist/types/src/sentry/index.js.map +1 -1
- package/dist/types/src/sentry/node.js +25 -36
- package/dist/types/src/sentry/node.js.map +1 -1
- package/dist/types/src/sentry/node.node.test.js +10 -45
- package/dist/types/src/sentry/node.node.test.js.map +1 -1
- package/dist/types/src/sentry/sentry-log-processor.js +18 -22
- package/dist/types/src/sentry/sentry-log-processor.js.map +1 -1
- package/dist/types/src/sentry/sentry.node.test.js +10 -45
- package/dist/types/src/sentry/sentry.node.test.js.map +1 -1
- package/dist/types/src/sentry/types.js +0 -2
- package/dist/types/src/sentry/types.js.map +1 -1
- package/dist/types/src/testing/index.js +1 -17
- package/dist/types/src/testing/index.js.map +1 -1
- package/dist/types/src/testing/testkit/browser.js +2 -8
- package/dist/types/src/testing/testkit/browser.js.map +1 -1
- package/dist/types/src/testing/testkit/index.js +2 -8
- package/dist/types/src/testing/testkit/index.js.map +1 -1
- package/package.json +17 -16
- package/src/helpers/common.ts +1 -1
- package/src/helpers/setup-telemetry-listeners.ts +5 -5
- package/src/observability.ts +6 -6
- package/src/segment/browser.ts +2 -2
- package/src/segment/node.ts +2 -2
- package/src/segment/types.ts +1 -1
- package/dist/lib/browser/chunk-EE4ONYIP.mjs.map +0 -7
- package/dist/lib/browser/observability-GXID2L6O.mjs +0 -7
- package/dist/lib/node/chunk-4TP5PWSE.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZLCW6LTG.mjs.map +0 -7
- /package/dist/lib/browser/{observability-GXID2L6O.mjs.map → observability-VEOITBLM.mjs.map} +0 -0
- /package/dist/lib/node-esm/{observability-CJZWSHQX.mjs.map → observability-OLS7SWZT.mjs.map} +0 -0
|
@@ -85,7 +85,7 @@ var initializeAppObservability = async ({ namespace, config, mode = "basic", tra
|
|
|
85
85
|
const release = `${namespace}@${config.get("runtime.app.build.version")}`;
|
|
86
86
|
const environment = config.get("runtime.app.env.DX_ENVIRONMENT");
|
|
87
87
|
const observabilityDisabled = await isObservabilityDisabled(namespace);
|
|
88
|
-
const { Observability: Observability2 } = await import("./observability-
|
|
88
|
+
const { Observability: Observability2 } = await import("./observability-VEOITBLM.mjs");
|
|
89
89
|
const observability = new Observability2({
|
|
90
90
|
namespace,
|
|
91
91
|
release,
|
|
@@ -173,7 +173,7 @@ var getTelemetryIdentifier = (client) => {
|
|
|
173
173
|
}
|
|
174
174
|
const identity = client.halo.identity.get();
|
|
175
175
|
if (identity) {
|
|
176
|
-
return identity.
|
|
176
|
+
return identity.did;
|
|
177
177
|
}
|
|
178
178
|
return void 0;
|
|
179
179
|
};
|
|
@@ -311,7 +311,7 @@ var setupTelemetryListeners = (namespace, client, observability) => {
|
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
313
|
setTimeout(() => observability.event({
|
|
314
|
-
|
|
314
|
+
did: getTelemetryIdentifier(client),
|
|
315
315
|
name: `${namespace}.window.click`,
|
|
316
316
|
properties: {
|
|
317
317
|
href: window.location.href,
|
|
@@ -323,7 +323,7 @@ var setupTelemetryListeners = (namespace, client, observability) => {
|
|
|
323
323
|
const focusCallback = () => {
|
|
324
324
|
const now = /* @__PURE__ */ new Date();
|
|
325
325
|
setTimeout(() => observability.event({
|
|
326
|
-
|
|
326
|
+
did: getTelemetryIdentifier(client),
|
|
327
327
|
name: `${namespace}.window.focus`,
|
|
328
328
|
properties: {
|
|
329
329
|
href: window.location.href,
|
|
@@ -336,7 +336,7 @@ var setupTelemetryListeners = (namespace, client, observability) => {
|
|
|
336
336
|
const now = /* @__PURE__ */ new Date();
|
|
337
337
|
const timeSpent = now.getTime() - lastFocusEvent.getTime();
|
|
338
338
|
setTimeout(() => observability.event({
|
|
339
|
-
|
|
339
|
+
did: getTelemetryIdentifier(client),
|
|
340
340
|
name: `${namespace}.window.blur`,
|
|
341
341
|
properties: {
|
|
342
342
|
href: window.location.href,
|
|
@@ -348,7 +348,7 @@ var setupTelemetryListeners = (namespace, client, observability) => {
|
|
|
348
348
|
};
|
|
349
349
|
const unloadCallback = () => {
|
|
350
350
|
setTimeout(() => observability.event({
|
|
351
|
-
|
|
351
|
+
did: getTelemetryIdentifier(client),
|
|
352
352
|
name: `${namespace}.page.unload`,
|
|
353
353
|
properties: {
|
|
354
354
|
href: window.location.href,
|
|
@@ -358,7 +358,7 @@ var setupTelemetryListeners = (namespace, client, observability) => {
|
|
|
358
358
|
};
|
|
359
359
|
const errorCallback = (event) => {
|
|
360
360
|
setTimeout(() => observability.event({
|
|
361
|
-
|
|
361
|
+
did: getTelemetryIdentifier(client),
|
|
362
362
|
name: `${namespace}.window.error`,
|
|
363
363
|
properties: {
|
|
364
364
|
href: window.location.href,
|
|
@@ -504,7 +504,7 @@ var Observability = class {
|
|
|
504
504
|
async setIdentityTags(clientServices) {
|
|
505
505
|
if (clientServices.IdentityService) {
|
|
506
506
|
clientServices.IdentityService.queryIdentity().subscribe((idqr) => {
|
|
507
|
-
if (!idqr?.identity?.
|
|
507
|
+
if (!idqr?.identity?.did) {
|
|
508
508
|
log3("empty response from identity service", {
|
|
509
509
|
idqr
|
|
510
510
|
}, {
|
|
@@ -515,7 +515,7 @@ var Observability = class {
|
|
|
515
515
|
});
|
|
516
516
|
return;
|
|
517
517
|
}
|
|
518
|
-
this.setTag("
|
|
518
|
+
this.setTag("did", idqr.identity.did);
|
|
519
519
|
});
|
|
520
520
|
}
|
|
521
521
|
if (clientServices.DevicesService) {
|
|
@@ -732,7 +732,7 @@ var Observability = class {
|
|
|
732
732
|
truncateKeys: true
|
|
733
733
|
})) {
|
|
734
734
|
this.event({
|
|
735
|
-
|
|
735
|
+
did: getTelemetryIdentifier(client),
|
|
736
736
|
name: `${namespace}.space.update`,
|
|
737
737
|
properties: data
|
|
738
738
|
});
|
|
@@ -745,12 +745,12 @@ var Observability = class {
|
|
|
745
745
|
}
|
|
746
746
|
});
|
|
747
747
|
spaces.forEach((space) => {
|
|
748
|
-
subscriptions.set(space.
|
|
748
|
+
subscriptions.set(space.id, subscribeToSpaceUpdate(space));
|
|
749
749
|
});
|
|
750
750
|
client.spaces.subscribe({
|
|
751
751
|
next: async (spaces2) => {
|
|
752
|
-
spaces2.filter((space) => !subscriptions.has(space.
|
|
753
|
-
subscriptions.set(space.
|
|
752
|
+
spaces2.filter((space) => !subscriptions.has(space.id)).forEach((space) => {
|
|
753
|
+
subscriptions.set(space.id, subscribeToSpaceUpdate(space));
|
|
754
754
|
});
|
|
755
755
|
}
|
|
756
756
|
});
|
|
@@ -945,4 +945,4 @@ export {
|
|
|
945
945
|
mapSpaces,
|
|
946
946
|
setupTelemetryListeners
|
|
947
947
|
};
|
|
948
|
-
//# sourceMappingURL=chunk-
|
|
948
|
+
//# sourceMappingURL=chunk-RWIBODSU.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/observability.ts", "../../../src/cli-observability-secrets.json", "../../../src/helpers/browser-observability.ts", "../../../src/helpers/common.ts", "../../../src/helpers/node-observability.ts", "../../../src/helpers/map-spaces.ts", "../../../src/helpers/setup-telemetry-listeners.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Event, scheduleTaskInterval } from '@dxos/async';\nimport { PublicKey, type Client, type Config } from '@dxos/client';\nimport { type ClientServices, type Space } from '@dxos/client-protocol';\nimport { Context } from '@dxos/context';\nimport { invariant } from '@dxos/invariant';\nimport { log, LogLevel } from '@dxos/log';\nimport { ConnectionState } from '@dxos/network-manager';\nimport { DeviceKind, type NetworkStatus, Platform } from '@dxos/protocols/proto/dxos/client/services';\nimport { isNode } from '@dxos/util';\n\nimport buildSecrets from './cli-observability-secrets.json';\nimport { type IPData, getTelemetryIdentifier, mapSpaces } from './helpers';\nimport { type OtelLogs, type OtelMetrics, type OtelTraces } from './otel';\nimport { type SegmentTelemetry, type EventOptions, type PageOptions } from './segment';\nimport { type InitOptions, type captureException as SentryCaptureException } from './sentry';\nimport { type SentryLogProcessor } from './sentry/sentry-log-processor';\n\nconst SPACE_METRICS_MIN_INTERVAL = 1000 * 60; // 1 minute\nconst SPACE_TELEMETRY_MIN_INTERVAL = 1000 * 60 * 60; // 1 hour\nconst NETWORK_METRICS_MIN_INTERVAL = 1000 * 60 * 5; // 5 minutes\n\n// Secrets? EnvironmentConfig?\n\nexport type ObservabilitySecrets = {\n DX_ENVIRONMENT: string | null;\n DX_RELEASE: string | null;\n SENTRY_DESTINATION: string | null;\n TELEMETRY_API_KEY: string | null;\n IPDATA_API_KEY: string | null;\n OTEL_ENDPOINT: string | null;\n OTEL_AUTHORIZATION: string | null;\n};\n\nexport type Mode = 'basic' | 'full' | 'disabled';\nexport type TagScope = 'errors' | 'telemetry' | 'metrics' | 'all';\n\nexport type ObservabilityOptions = {\n /// The webapp (e.g. 'composer.dxos.org'), 'cli', or 'agent'.\n namespace: string;\n mode: Mode;\n // TODO(nf): make platform a required extension?\n // platform: Platform;\n release?: string;\n environment?: string;\n config?: Config;\n secrets?: Record<string, string>;\n group?: string;\n\n telemetry?: {\n batchSize?: number;\n };\n\n errorLog?: {\n sentryInitOptions?: InitOptions;\n };\n};\n\n/*\n * Observability provides a common interface for error logging, metrics, and telemetry.\n * It currently provides these capabilities using Sentry, OpenTelemetry, and Segment.\n */\nexport class Observability {\n // TODO(wittjosiah): Generic metrics interface.\n private _otelMetrics?: OtelMetrics;\n private _otelTraces?: OtelTraces;\n // TODO(wittjosiah): Generic telemetry interface.\n private _telemetryBatchSize: number;\n private _telemetry?: SegmentTelemetry;\n // TODO(wittjosiah): Generic error logging interface.\n private _sentryLogProcessor?: SentryLogProcessor;\n private _otelLogs?: OtelLogs;\n private _errorReportingOptions?: InitOptions;\n private _captureException?: typeof SentryCaptureException;\n private _captureUserFeedback?: (name: string, email: string, message: string) => Promise<void>;\n private _setTag?: (key: string, value: string) => void;\n\n private _secrets: ObservabilitySecrets;\n private _namespace: string;\n private _mode: Mode;\n private _config?: Config;\n private _group?: string;\n // TODO(nf): accept upstream context?\n private _ctx = new Context();\n private _tags = new Map<string, { value: string; scope: TagScope }>();\n private _lastNetworkStatus?: NetworkStatus;\n\n // TODO(nf): make platform a required extension?\n constructor({\n namespace,\n environment,\n release,\n config,\n secrets,\n group,\n mode,\n telemetry,\n errorLog,\n }: ObservabilityOptions) {\n this._namespace = namespace;\n this._mode = mode;\n this._config = config;\n this._group = group;\n this._secrets = this._loadSecrets(config, secrets);\n this._telemetryBatchSize = telemetry?.batchSize ?? 30;\n this._errorReportingOptions = errorLog?.sentryInitOptions;\n\n if (this._group) {\n this.setTag('group', this._group);\n }\n this.setTag('namespace', this._namespace);\n environment && this.setTag('environment', environment);\n release && this.setTag('release', release);\n this.setTag('mode', this._mode);\n this.setTag('session', PublicKey.random().toHex());\n }\n\n get mode() {\n return this._mode;\n }\n\n get group() {\n return this._group;\n }\n\n get enabled() {\n return this._mode !== 'disabled';\n }\n\n private _loadSecrets(config: Config | undefined, secrets?: Record<string, string>) {\n if (isNode()) {\n const mergedSecrets = {\n ...(buildSecrets as ObservabilitySecrets),\n ...secrets,\n };\n\n process.env.DX_ENVIRONMENT && (mergedSecrets.DX_ENVIRONMENT = process.env.DX_ENVIRONMENT);\n process.env.DX_RELEASE && (mergedSecrets.DX_RELEASE = process.env.DX_RELEASE);\n // TODO: prefix these with DX_?\n process.env.SENTRY_DESTINATION && (mergedSecrets.SENTRY_DESTINATION = process.env.SENTRY_DESTINATION);\n process.env.TELEMETRY_API_KEY && (mergedSecrets.TELEMETRY_API_KEY = process.env.TELEMETRY_API_KEY);\n process.env.IPDATA_API_KEY && (mergedSecrets.IPDATA_API_KEY = process.env.IPDATA_API_KEY);\n process.env.DX_OTEL_ENDPOINT && (mergedSecrets.OTEL_ENDPOINT = process.env.DX_OTEL_ENDPOINT);\n process.env.DX_OTEL_AUTHORIZATION && (mergedSecrets.OTEL_AUTHORIZATION = process.env.DX_OTEL_AUTHORIZATION);\n\n return mergedSecrets;\n } else {\n log('config', { rtc: this._secrets, config });\n return {\n DX_ENVIRONMENT: config?.get('runtime.app.env.DX_ENVIRONMENT'),\n DX_RELEASE: config?.get('runtime.app.env.DX_RELEASE'),\n SENTRY_DESTINATION: config?.get('runtime.app.env.DX_SENTRY_DESTINATION'),\n TELEMETRY_API_KEY: config?.get('runtime.app.env.DX_TELEMETRY_API_KEY'),\n IPDATA_API_KEY: config?.get('runtime.app.env.DX_IPDATA_API_KEY'),\n OTEL_ENDPOINT: config?.get('runtime.app.env.DX_OTEL_ENDPOINT'),\n OTEL_AUTHORIZATION: config?.get('runtime.app.env.DX_OTEL_AUTHORIZATION'),\n ...secrets,\n };\n }\n }\n\n async initialize() {\n await this._initLogs();\n await this._initMetrics();\n await this._initTelemetry();\n await this._initErrorLogs();\n await this._initTraces();\n }\n\n async close() {\n const closes: Promise<void>[] = [];\n this._telemetry && closes.push(this._telemetry.close());\n this._otelMetrics && closes.push(this._otelMetrics.close());\n this._otelLogs && closes.push(this._otelLogs.close());\n\n await Promise.all(closes);\n await this._ctx.dispose();\n\n // TODO(wittjosiah): Remove telemetry, etc. scripts.\n }\n\n setMode(mode: Mode) {\n this._mode = mode;\n }\n\n //\n // Tags\n //\n\n setTag(key: string, value: string, scope?: TagScope) {\n if (this.enabled && (scope === undefined || scope === 'all' || scope === 'errors')) {\n this._setTag?.(key, value);\n }\n if (!scope) {\n scope = 'all';\n }\n this._tags.set(key, { value, scope });\n }\n\n getTag(key: string) {\n return this._tags.get(key);\n }\n\n addIPDataTelemetryTags = (ipData: IPData) => {\n this.setTag('city', ipData.city, 'telemetry');\n this.setTag('region', ipData.region, 'telemetry');\n this.setTag('country', ipData.country, 'telemetry');\n ipData.latitude && this.setTag('latitude', ipData.latitude.toString(), 'telemetry');\n ipData.longitude && this.setTag('longitude', ipData.longitude.toString(), 'telemetry');\n };\n\n // TODO(wittjosiah): Improve privacy of telemetry identifiers. See `getTelemetryIdentifier`.\n async setIdentityTags(clientServices: Partial<ClientServices>) {\n if (clientServices.IdentityService) {\n clientServices.IdentityService.queryIdentity().subscribe((idqr) => {\n if (!idqr?.identity?.did) {\n log('empty response from identity service', { idqr });\n return;\n }\n this.setTag('did', idqr.identity.did);\n });\n }\n\n if (clientServices.DevicesService) {\n clientServices.DevicesService.queryDevices().subscribe((dqr) => {\n if (!dqr || !dqr.devices || dqr.devices.length === 0) {\n log('empty response from device service', { device: dqr });\n return;\n }\n invariant(dqr, 'empty response from device service');\n\n const thisDevice = dqr.devices.find((device) => device.kind === DeviceKind.CURRENT);\n if (!thisDevice) {\n log('no current device', { device: dqr });\n return;\n }\n this.setTag('deviceKey', thisDevice.deviceKey.truncate());\n if (thisDevice.profile?.label) {\n this.setTag('deviceProfile', thisDevice.profile.label);\n }\n });\n }\n }\n\n //\n // Logs\n //\n\n private async _initLogs() {\n if (this._secrets.OTEL_ENDPOINT && this._secrets.OTEL_AUTHORIZATION && this._mode !== 'disabled') {\n const { OtelLogs } = await import('./otel');\n this._otelLogs = new OtelLogs({\n endpoint: this._secrets.OTEL_ENDPOINT,\n authorizationHeader: this._secrets.OTEL_AUTHORIZATION,\n serviceName: this._namespace,\n serviceVersion: this.getTag('release')?.value ?? '0.0.0',\n getTags: () =>\n Object.fromEntries(\n Array.from(this._tags)\n .filter(([key, value]) => {\n return value.scope === 'all' || value.scope === 'errors';\n })\n .map(([key, value]) => [key, value.value]),\n ),\n logLevel: LogLevel.VERBOSE,\n includeSharedWorkerLogs: false,\n });\n this._otelLogs && log.runtimeConfig.processors.push(this._otelLogs.logProcessor);\n log('otel logs enabled', { namespace: this._namespace });\n } else {\n log('otel logs disabled');\n }\n }\n\n //\n // Metrics\n //\n\n private async _initMetrics() {\n if (this.enabled && this._secrets.OTEL_ENDPOINT && this._secrets.OTEL_AUTHORIZATION) {\n const { OtelMetrics } = await import('./otel');\n this._otelMetrics = new OtelMetrics({\n endpoint: this._secrets.OTEL_ENDPOINT,\n authorizationHeader: this._secrets.OTEL_AUTHORIZATION,\n serviceName: this._namespace,\n serviceVersion: this.getTag('release')?.value ?? '0.0.0',\n getTags: () =>\n Object.fromEntries(\n Array.from(this._tags)\n .filter(([key, value]) => {\n return value.scope === 'all' || value.scope === 'metrics';\n })\n .map(([key, value]) => [key, value.value]),\n ),\n });\n log('otel metrics enabled');\n } else {\n log('otel metrics disabled');\n }\n }\n\n /**\n * Gauge metric.\n *\n * The default implementation uses OpenTelemetry\n */\n gauge(name: string, value: number | any, extraTags?: any) {\n this._otelMetrics?.gauge(name, value, extraTags);\n }\n\n // TODO(nf): Refactor into ObservabilityExtensions.\n\n startNetworkMetrics(clientServices: Partial<ClientServices>) {\n if (!clientServices.NetworkService) {\n return;\n }\n // TODO(nf): support type in debounce()\n const updateSignalMetrics = new Event<NetworkStatus>().debounce(NETWORK_METRICS_MIN_INTERVAL);\n updateSignalMetrics.on(this._ctx, async () => {\n log('send signal metrics');\n (this._lastNetworkStatus?.signaling as NetworkStatus.Signal[])?.forEach(({ server, state }) => {\n this.gauge('dxos.client.network.signal.connectionState', state, { server });\n });\n\n let swarmCount = 0;\n const connectionStates = new Map<string, number>();\n for (const state in ConnectionState) {\n connectionStates.set(state, 0);\n }\n\n let totalReadBufferSize = 0;\n let totalWriteBufferSize = 0;\n let totalChannelBufferSize = 0;\n\n this._lastNetworkStatus?.connectionInfo?.forEach((connectionInfo) => {\n swarmCount++;\n\n for (const conn of connectionInfo.connections ?? []) {\n connectionStates.set(conn.state, (connectionStates.get(conn.state) ?? 0) + 1);\n totalReadBufferSize += conn.readBufferSize ?? 0;\n totalWriteBufferSize += conn.writeBufferSize ?? 0;\n\n for (const stream of conn.streams ?? []) {\n totalChannelBufferSize += stream.writeBufferSize ?? 0;\n }\n }\n\n this.gauge('dxos.client.network.swarm.count', swarmCount);\n for (const state in ConnectionState) {\n this.gauge('dxos.client.network.connection.count', connectionStates.get(state) ?? 0, { state });\n }\n this.gauge('dxos.client.network.totalReadBufferSize', totalReadBufferSize);\n this.gauge('dxos.client.network.totalWriteBufferSize', totalWriteBufferSize);\n this.gauge('dxos.client.network.totalChannelBufferSize', totalChannelBufferSize);\n });\n });\n\n clientServices.NetworkService.queryStatus().subscribe((networkStatus) => {\n this._lastNetworkStatus = networkStatus;\n updateSignalMetrics.emit();\n });\n\n scheduleTaskInterval(this._ctx, async () => updateSignalMetrics.emit(), NETWORK_METRICS_MIN_INTERVAL);\n }\n\n startSpacesMetrics(client: Client, namespace: string) {\n // TODO(nf): update subscription on new spaces\n const spaces = client.spaces.get();\n const subscriptions = new Map<string, { unsubscribe: () => void }>();\n this._ctx.onDispose(() => subscriptions.forEach((subscription) => subscription.unsubscribe()));\n\n const updateSpaceMetrics = new Event<Space>().debounce(SPACE_METRICS_MIN_INTERVAL);\n updateSpaceMetrics.on(this._ctx, async () => {\n log('send space metrics');\n for (const data of mapSpaces(spaces, { truncateKeys: true })) {\n this.gauge('dxos.client.space.members', data.members, { key: data.key });\n this.gauge('dxos.client.space.objects', data.objects, { key: data.key });\n this.gauge('dxos.client.space.epoch', data.epoch, { key: data.key });\n this.gauge('dxos.client.space.currentDataMutations', data.currentDataMutations, { key: data.key });\n }\n });\n\n const updateSpaceTelemetry = new Event<Space>().debounce(SPACE_TELEMETRY_MIN_INTERVAL);\n updateSpaceTelemetry.on(this._ctx, async () => {\n log('send space telemetry');\n for (const data of mapSpaces(spaces, { truncateKeys: true })) {\n this.event({\n did: getTelemetryIdentifier(client),\n name: `${namespace}.space.update`,\n properties: data,\n });\n }\n });\n\n const subscribeToSpaceUpdate = (space: Space) =>\n space.pipeline.subscribe({\n next: () => {\n updateSpaceMetrics.emit();\n updateSpaceTelemetry.emit();\n },\n });\n\n spaces.forEach((space) => {\n subscriptions.set(space.id, subscribeToSpaceUpdate(space));\n });\n\n client.spaces.subscribe({\n next: async (spaces) => {\n spaces\n .filter((space) => !subscriptions.has(space.id))\n .forEach((space) => {\n subscriptions.set(space.id, subscribeToSpaceUpdate(space));\n });\n },\n });\n\n scheduleTaskInterval(this._ctx, async () => updateSpaceMetrics.emit(), NETWORK_METRICS_MIN_INTERVAL);\n }\n\n async startRuntimeMetrics(client: Client, frequency: number = NETWORK_METRICS_MIN_INTERVAL) {\n const platform = await client.services.services.SystemService?.getPlatform();\n invariant(platform, 'platform is required');\n\n this.setTag('platform_type', Platform.PLATFORM_TYPE[platform.type as number].toLowerCase());\n if (this._mode === 'full') {\n // platform[foo] does not work?\n if (platform.platform) {\n this.setTag('platform', platform.platform);\n }\n if (platform.arch) {\n this.setTag('arch', platform.arch);\n }\n if (platform.runtime) {\n this.setTag('runtime', platform.runtime);\n }\n }\n\n scheduleTaskInterval(\n this._ctx,\n async () => {\n if (client.services.constructor.name === 'WorkerClientServices') {\n const memory = (window.performance as any).memory;\n if (memory) {\n this.gauge('dxos.client.runtime.heapTotal', memory.totalJSHeapSize);\n this.gauge('dxos.client.runtime.heapUsed', memory.usedJSHeapSize);\n this.gauge('dxos.client.runtime.heapSizeLimit', memory.jsHeapSizeLimit);\n }\n }\n client.services.services.SystemService?.getPlatform()\n .then((platform) => {\n if (platform.memory) {\n this.gauge('dxos.client.services.runtime.rss', platform.memory.rss);\n this.gauge('dxos.client.services.runtime.heapTotal', platform.memory.heapTotal);\n this.gauge('dxos.client.services.runtime.heapUsed', platform.memory.heapUsed);\n }\n })\n .catch((error) => log('platform error', { error }));\n },\n frequency,\n );\n }\n\n //\n // Telemetry\n //\n\n private async _initTelemetry() {\n if (this._secrets.TELEMETRY_API_KEY && this._mode !== 'disabled' && typeof document !== 'undefined') {\n const { SegmentTelemetry } = await import('./segment');\n this._telemetry = new SegmentTelemetry({\n apiKey: this._secrets.TELEMETRY_API_KEY,\n batchSize: this._telemetryBatchSize,\n getTags: () =>\n Object.fromEntries(\n Array.from(this._tags)\n .filter(([key, value]) => {\n return value.scope === 'all' || value.scope === 'telemetry';\n })\n .map(([key, value]) => [key, value.value]),\n ),\n });\n } else {\n log('segment disabled');\n }\n }\n\n /**\n * A telemetry event.\n *\n * The default implementation uses Segment.\n */\n event(options: EventOptions) {\n this._telemetry?.event(options);\n }\n\n /**\n * A telemetry page view.\n *\n * The default implementation uses Segment.\n */\n page(options: PageOptions) {\n this._telemetry?.page(options);\n }\n\n //\n // Error Logs\n //\n\n private async _initErrorLogs() {\n if (this._secrets.SENTRY_DESTINATION && this._mode !== 'disabled') {\n const { captureException, captureUserFeedback, init, setTag } = await import('./sentry');\n const { SentryLogProcessor } = await import('./sentry/sentry-log-processor');\n this._captureException = captureException;\n this._captureUserFeedback = captureUserFeedback;\n\n this._setTag = setTag;\n\n // TODO(nf): refactor package into this one?\n log.info('Initializing Sentry', {\n dest: this._secrets.SENTRY_DESTINATION,\n options: this._errorReportingOptions,\n });\n this._sentryLogProcessor = new SentryLogProcessor();\n init({\n ...this._errorReportingOptions,\n destination: this._secrets.SENTRY_DESTINATION,\n scrubFilenames: this._mode !== 'full',\n onError: (event) => this._sentryLogProcessor!.addLogBreadcrumbsTo(event),\n });\n // TODO(nf): set platform at instantiation? needed for node.\n\n // TODO(nf): is this different than passing as properties in options?\n this._tags.forEach((v, k) => {\n if (v.scope === 'all' || v.scope === 'errors') {\n setTag(k, v.value);\n }\n });\n } else {\n log('sentry disabled');\n }\n }\n\n startErrorLogs() {\n this._sentryLogProcessor && log.runtimeConfig.processors.push(this._sentryLogProcessor.logProcessor);\n }\n\n startTraces() {\n this._otelTraces && this._otelTraces.start();\n }\n\n // TODO(nf): refactor init based on providers and their capabilities\n private async _initTraces() {\n if (this._secrets.OTEL_ENDPOINT && this._secrets.OTEL_AUTHORIZATION && this._mode !== 'disabled') {\n const { OtelTraces } = await import('./otel');\n this._otelTraces = new OtelTraces({\n endpoint: this._secrets.OTEL_ENDPOINT,\n authorizationHeader: this._secrets.OTEL_AUTHORIZATION,\n serviceName: this._namespace,\n serviceVersion: this.getTag('release')?.value ?? '0.0.0',\n getTags: () =>\n Object.fromEntries(\n Array.from(this._tags)\n .filter(([key, value]) => {\n return value.scope === 'all' || value.scope === 'metrics';\n })\n .map(([key, value]) => [key, value.value]),\n ),\n });\n }\n }\n\n /**\n * Manually capture an exception.\n *\n * The default implementation uses Sentry.\n */\n captureException(err: any) {\n if (this.enabled) {\n this._captureException?.(err);\n }\n }\n\n /**\n * Manually capture user feedback.\n *\n * The default implementation uses Sentry.\n */\n captureUserFeedback(name: string, email: string, message: string) {\n // TODO(Zan): Should this respect telemetry mode? Sending feedback is explicitly user-initiated.\n // - Maybe if telemetry is disable we shouldn't enable replay.\n // - (Check the browser.ts implementation for reference).\n void this._captureUserFeedback?.(name, email, message);\n }\n}\n", "{\n \"SENTRY_DESTINATION\": \"https://2647916221e643869965e78469479aa4@o4504012000067584.ingest.sentry.io/4504012027265029\",\n \"TELEMETRY_API_KEY\": \"B00QG6PtJJrJ0VVFe0H5a6bcUUShKyZM\",\n \"IPDATA_API_KEY\": \"73dfdecdf979c18f07d50cf841bbdd9e589f237256326ac8cca23786\",\n \"OTEL_ENDPOINT\": \"https://otlp-proxy.dxos.workers.dev\",\n \"OTEL_AUTHORIZATION\": \"Basic OTA3MzIzOmdsY19leUp2SWpvaU1URXdNVEl6TnlJc0ltNGlPaUp6ZEdGamF5MDVNRGN6TWpNdGFXNTBaV2R5WVhScGIyNHRZMnh2ZFdSbWJHRnlaUzF2ZEd4d0xYQnliM2g1SWl3aWF5STZJalZ2Tkd4cFYydE5iRmszTlRNMGJUVXpTemRTVjNBeVNpSXNJbTBpT25zaWNpSTZJbkJ5YjJRdGRYTXRaV0Z6ZEMwd0luMTk=\"\n}", "//\n// Copyright 2022 DXOS.org\n//\n\n// NOTE: localStorage is not available in web workers.\nimport * as localForage from 'localforage';\n\n// import { type Platform } from '@dxos/client-services';\n// import { type InitOptions as TelemetryInitOptions } from '@dxos/telemetry';\n\nimport type { Config } from '@dxos/client';\nimport { log } from '@dxos/log';\n\nimport type { IPData } from './common';\nimport type { Mode, Observability } from '../observability';\n\nexport const OBSERVABILITY_DISABLED_KEY = 'observability-disabled';\nexport const OBSERVABILITY_GROUP_KEY = 'observability-group';\n\nexport const isObservabilityDisabled = async (namespace: string): Promise<boolean> => {\n try {\n return (await localForage.getItem(`${namespace}:${OBSERVABILITY_DISABLED_KEY}`)) === 'true';\n } catch (err) {\n log.catch('Failed to check if observability is disabled, assuming it is', err);\n return true;\n }\n};\n\nexport const storeObservabilityDisabled = async (namespace: string, value: boolean) => {\n try {\n await localForage.setItem(`${namespace}:${OBSERVABILITY_DISABLED_KEY}`, String(value));\n } catch (err) {\n log.catch('Failed to store observability disabled', err);\n }\n};\n\nexport const getObservabilityGroup = async (namespace: string): Promise<string | undefined> => {\n try {\n return (await localForage.getItem(`${namespace}:${OBSERVABILITY_GROUP_KEY}`)) ?? undefined;\n } catch (err) {\n log.catch('Failed to get observability group', err);\n }\n};\n\nexport const storeObservabilityGroup = async (namespace: string, value: string) => {\n try {\n await localForage.setItem(`${namespace}:${OBSERVABILITY_GROUP_KEY}`, value);\n } catch (err) {\n log.catch('Failed to store observability group', err);\n }\n};\n\nexport type AppObservabilityOptions = {\n namespace: string;\n config: Config;\n mode?: Mode;\n tracingEnable?: boolean;\n replayEnable?: boolean;\n // TODO(nf): options for providers?\n};\n\n// TODO(wittjosiah): Store preference for disabling observability.\n// At minimum should be stored locally (i.e., localstorage), possibly in halo preference.\n// Needs to be hooked up to settings page for user visibility.\nexport const initializeAppObservability = async ({\n namespace,\n config,\n mode = 'basic',\n tracingEnable = false,\n replayEnable = false,\n}: AppObservabilityOptions): Promise<Observability> => {\n log('initializeAppObservability', { config });\n\n /*\n const platform = (await client.services.services.SystemService?.getPlatform()) as Platform;\n if (!platform) {\n log.error('failed to get platform, could not initialize observability');\n return undefined;\n }\n */\n\n const group = (await getObservabilityGroup(namespace)) ?? undefined;\n const release = `${namespace}@${config.get('runtime.app.build.version')}`;\n const environment = config.get('runtime.app.env.DX_ENVIRONMENT');\n\n const observabilityDisabled = await isObservabilityDisabled(namespace);\n\n const { Observability } = await import('../observability');\n\n // TODO(nf): configure mode\n const observability = new Observability({\n namespace,\n release,\n environment,\n group,\n mode,\n config,\n errorLog: {\n sentryInitOptions: {\n environment,\n release,\n tracing: tracingEnable,\n replay: replayEnable,\n // TODO(wittjosiah): Configure these.\n sampleRate: 1.0,\n // TODO(mykola): Lower this to 0.1.\n replaySampleRate: 1.0,\n replaySampleRateOnError: 1.0,\n },\n },\n });\n\n // global kill switch\n if (observabilityDisabled) {\n observability.setMode('disabled');\n log.info('observability disabled');\n return observability;\n }\n\n try {\n const getIPData = async (config: Config): Promise<IPData | void> => {\n const IP_DATA_CACHE_TIMEOUT = 6 * 60 * 60 * 1000; // 6 hours\n type CachedIPData = {\n data: IPData;\n timestamp: number;\n };\n\n // Check cache first.\n const cachedData: null | CachedIPData = await localForage.getItem('dxos:observability:ipdata');\n if (cachedData && cachedData.timestamp > Date.now() - IP_DATA_CACHE_TIMEOUT) {\n return cachedData.data;\n }\n\n // Fetch data if not cached.\n const IPDATA_API_KEY = config.get('runtime.app.env.DX_IPDATA_API_KEY');\n if (IPDATA_API_KEY) {\n return fetch(`https://api.ipdata.co?api-key=${IPDATA_API_KEY}`)\n .then((res) => res.json())\n .then((data) => {\n // Cache data.\n localForage\n .setItem('dxos:observability:ipdata', {\n data,\n timestamp: Date.now(),\n })\n .catch((err) => observability.captureException(err));\n\n return data;\n })\n .catch((err) => observability.captureException(err));\n }\n };\n\n // TODO(nf): plugin state?\n\n // TODO(nf): should provide capability to init Sentry earlier in booting process to capture errors during initialization.\n\n await observability.initialize();\n observability.startErrorLogs();\n\n const ipData = await getIPData(config);\n\n ipData && observability.addIPDataTelemetryTags(ipData);\n\n if (typeof navigator !== 'undefined' && navigator.storage?.estimate) {\n setInterval(async () => {\n try {\n const storageEstimate = await navigator.storage.estimate();\n storageEstimate.usage && observability.setTag('storageUsage', storageEstimate.usage.toString(), 'telemetry');\n storageEstimate.quota && observability.setTag('storageQuota', storageEstimate.quota.toString(), 'telemetry');\n } catch (error) {\n log.warn('Failed to run estimate()', error);\n }\n }, 10e3);\n }\n } catch (err: any) {\n log.error('Failed to initialize app observability', err);\n }\n\n return observability;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport type { Client } from '@dxos/client';\n\n// TODO(wittjosiah): Improve privacy of telemetry identifiers.\n// - Identifier should be generated client-side with no attachment to identity.\n// - Identifier can then be reset by user.\n// - Identifier can be synced via HALO to allow for correlation of events bewteen devices.\n// - Identifier should also be stored outside of HALO such that it is available immediately on startup.\nexport const getTelemetryIdentifier = (client: Client) => {\n if (!client?.initialized) {\n return undefined;\n }\n\n const identity = client.halo.identity.get();\n if (identity) {\n return identity.did;\n }\n\n return undefined;\n};\n\nexport type IPData = { city: string; region: string; country: string; latitude: number; longitude: number };\n", "//\n// Copyright 2022 DXOS.org\n//\nimport yaml from 'js-yaml';\nimport { existsSync, statSync } from 'node:fs';\nimport { mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { v4 as uuid, validate as validateUuid } from 'uuid';\n\nimport type { Config } from '@dxos/client';\nimport { log } from '@dxos/log';\n\nimport { Observability, type Mode } from '../observability';\n\n/**\n * Print observability banner once per installation.\n */\nexport const showObservabilityBanner = async (configDir: string, bannercb: (input: string) => void) => {\n const path = join(configDir, '.observability-banner-printed');\n if (existsSync(path)) {\n return;\n }\n bannercb(\n // eslint-disable-next-line no-multi-str\n 'Basic observability data will be sent to the DXOS team in order to improve the product. This includes \\\n performance metrics, error logs, and usage data. No personally identifiable information, other than your \\\n public key, is included with this data and no private data ever leaves your devices. To disable sending \\\n observability data, set the environment variable DX_DISABLE_OBSERVABILITY=true.',\n );\n\n await writeFile(path, '', 'utf-8');\n};\n\nexport const getObservabilityState = async (configDir: string): Promise<PersistentObservabilityState> => {\n // check whether configDir exists and if it's a directory\n\n if (existsSync(configDir)) {\n if (!statSync(configDir).isDirectory()) {\n throw new Error(`Config directory ${configDir} exists but is not a directory`);\n }\n } else {\n await mkdir(configDir, { recursive: true });\n }\n\n const idPath = join(configDir, 'observability.yml');\n if (existsSync(idPath)) {\n const context = await readFile(idPath, 'utf-8');\n return validate(context) ?? initializeState(idPath);\n }\n\n return initializeState(idPath);\n};\n\nexport type PersistentObservabilityState = {\n installationId: string;\n group?: string;\n mode: Mode;\n};\n\n// create initial state and write to file, using environment variables to override defaults.\nconst initializeState = async (idPath: string): Promise<PersistentObservabilityState> => {\n // TODO(nf): read initial values from config or seed file\n const observabilityState = {\n installationId: uuid(),\n group: process.env.DX_OBSERVABILITY_GROUP ?? undefined,\n mode: (process.env.DX_DISABLE_OBSERVABILITY ? 'disabled' : process.env.DX_OBSERVABILITY_MODE ?? 'basic') as Mode,\n };\n\n await writeFile(\n idPath,\n '# This file is automatically generated by the @dxos/cli.\\n' + yaml.dump(observabilityState),\n 'utf-8',\n );\n\n return observabilityState;\n};\n\nconst validate = (contextString: string) => {\n const context = yaml.load(contextString) as PersistentObservabilityState;\n if (Boolean(context.installationId) && validateUuid(context.installationId!)) {\n return {\n ...context,\n mode: process.env.DX_DISABLE_OBSERVABILITY ? 'disabled' : context.mode ?? 'basic',\n };\n }\n};\n\nexport type NodeObservabilityOptions = {\n installationId: string;\n group?: string;\n namespace: string;\n version: string;\n config: Config;\n mode?: Mode;\n tracingEnable?: boolean;\n replayEnable?: boolean;\n // TODO(nf): options for providers?\n};\n\nexport const initializeNodeObservability = async ({\n namespace,\n version,\n config,\n installationId,\n group,\n mode = 'basic',\n tracingEnable = true,\n replayEnable = true,\n}: NodeObservabilityOptions): Promise<Observability> => {\n log('initializeCliObservability', { config });\n\n // TODO(nf): make CLI build populate runtime.app.build config?\n const release = `${namespace}@${version}`;\n const environment = process.env.DX_ENVIRONMENT ?? 'unknown';\n\n const observability = new Observability({\n namespace,\n release,\n environment,\n group,\n mode,\n errorLog: {\n sentryInitOptions: {\n environment,\n release,\n // TODO(wittjosiah): Configure this.\n sampleRate: 1.0,\n },\n },\n });\n\n observability.setTag('installationId', installationId);\n\n // TODO(nf): cache ipdata to avoid repeated requests\n const IPDATA_API_KEY = config.get('runtime.app.env.DX_IPDATA_API_KEY');\n try {\n const res = await fetch(`https://api.ipdata.co/?api-key=${IPDATA_API_KEY}`);\n const ipData = await res.json();\n ipData && observability.addIPDataTelemetryTags(ipData);\n } catch (err) {\n observability?.captureException(err);\n }\n return observability;\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { Space } from '@dxos/client-protocol';\n\nexport type MapSpacesOptions = {\n verbose?: boolean;\n truncateKeys?: boolean;\n};\n\nexport const mapSpaces = (spaces: Space[], options: MapSpacesOptions = { verbose: false, truncateKeys: false }) => {\n return spaces.map((space) => {\n // TODO(burdon): Factor out.\n // TODO(burdon): Agent needs to restart before `ready` is available.\n const { open, ready } = space.internal.data.metrics ?? {};\n const startup = open && ready && ready.getTime() - open.getTime();\n\n // TODO(burdon): Get feeds from client-services if verbose (factor out from devtools/diagnostics).\n // const host = client.services.services.DevtoolsHost!;\n const pipeline = space.internal.data.pipeline;\n const startDataMutations = pipeline?.currentEpoch?.subject.assertion.timeframe.totalMessages() ?? 0;\n const epoch = pipeline?.currentEpoch?.subject.assertion.number;\n // const appliedEpoch = pipeline?.appliedEpoch?.subject.assertion.number;\n const currentDataMutations = pipeline?.currentDataTimeframe?.totalMessages() ?? 0;\n const totalDataMutations = pipeline?.targetDataTimeframe?.totalMessages() ?? 0;\n\n return {\n // TODO(nf): truncate keys for DD?\n key: space.key.truncate(),\n open: space.isOpen,\n members: space.members.get().length,\n objects: space.db.coreDatabase.getAllObjectIds().length,\n startup,\n epoch,\n // appliedEpoch,\n startDataMutations,\n currentDataMutations,\n totalDataMutations,\n\n // TODO(burdon): Negative?\n progress: (\n Math.min(Math.abs((currentDataMutations - startDataMutations) / (totalDataMutations - startDataMutations)), 1) *\n 100\n ).toFixed(0),\n };\n });\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport type { Client } from '@dxos/client';\n\nimport { getTelemetryIdentifier } from './common';\nimport type { Observability } from '../observability';\n\nlet lastFocusEvent = new Date();\nlet totalTime = 0;\n\nexport const setupTelemetryListeners = (namespace: string, client: Client, observability: Observability) => {\n const clickCallback = (event: Event) => {\n const id = (event.target as HTMLElement)?.id;\n if (!id) {\n return;\n }\n\n setTimeout(() =>\n observability.event({\n did: getTelemetryIdentifier(client),\n name: `${namespace}.window.click`,\n properties: {\n href: window.location.href,\n id: (event.target as HTMLElement)?.id,\n path: (event.composedPath() as HTMLElement[])\n .filter((el) => Boolean(el.tagName))\n .map((el) => `${el.tagName.toLowerCase()}${el.id ? `#${el.id}` : ''}`)\n .reverse()\n .join('>'),\n },\n }),\n );\n };\n\n const focusCallback = () => {\n const now = new Date();\n setTimeout(() =>\n observability.event({\n did: getTelemetryIdentifier(client),\n name: `${namespace}.window.focus`,\n properties: {\n href: window.location.href,\n timeAway: now.getTime() - lastFocusEvent.getTime(),\n },\n }),\n );\n lastFocusEvent = now;\n };\n\n const blurCallback = () => {\n const now = new Date();\n const timeSpent = now.getTime() - lastFocusEvent.getTime();\n setTimeout(() =>\n observability.event({\n did: getTelemetryIdentifier(client),\n name: `${namespace}.window.blur`,\n properties: {\n href: window.location.href,\n timeSpent,\n },\n }),\n );\n lastFocusEvent = now;\n totalTime = totalTime + timeSpent;\n };\n\n const unloadCallback = () => {\n setTimeout(() =>\n observability.event({\n did: getTelemetryIdentifier(client),\n name: `${namespace}.page.unload`,\n properties: {\n href: window.location.href,\n timeSpent: totalTime,\n },\n }),\n );\n };\n\n const errorCallback = (event: ErrorEvent) => {\n setTimeout(() =>\n observability.event({\n did: getTelemetryIdentifier(client),\n name: `${namespace}.window.error`,\n properties: {\n href: window.location.href,\n message: event.message,\n filename: event.filename,\n stack: (event.error as Error)?.stack,\n },\n }),\n );\n };\n\n window.addEventListener('click', clickCallback, true);\n window.addEventListener('focus', focusCallback);\n window.addEventListener('blur', blurCallback);\n window.addEventListener('beforeunload', unloadCallback);\n window.addEventListener('error', errorCallback);\n\n return () => {\n window.removeEventListener('click', clickCallback, true);\n window.removeEventListener('focus', focusCallback);\n window.removeEventListener('blur', blurCallback);\n window.removeEventListener('beforeunload', unloadCallback);\n window.removeEventListener('error', errorCallback);\n };\n};\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,OAAOC,4BAA4B;AAC5C,SAASC,iBAA2C;AAEpD,SAASC,eAAe;AACxB,SAASC,iBAAiB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ey", "Context", "invariant", "log", "LogLevel", "ConnectionState", "DeviceKind", "Platform", "isNode", "localForage", "log", "OBSERVABILITY_DISABLED_KEY", "OBSERVABILITY_GROUP_KEY", "isObservabilityDisabled", "namespace", "getItem", "err", "catch", "storeObservabilityDisabled", "value", "setItem", "String", "getObservabilityGroup", "undefined", "storeObservabilityGroup", "initializeAppObservability", "config", "mode", "tracingEnable", "replayEnable", "group", "release", "get", "environment", "observabilityDisabled", "Observability", "observability", "errorLog", "sentryInitOptions", "tracing", "replay", "sampleRate", "replaySampleRate", "replaySampleRateOnError", "setMode", "info", "getIPData", "IP_DATA_CACHE_TIMEOUT", "cachedData", "timestamp", "Date", "now", "data", "IPDATA_API_KEY", "fetch", "then", "res", "json", "captureException", "initialize", "startErrorLogs", "ipData", "addIPDataTelemetryTags", "navigator", "storage", "estimate", "setInterval", "storageEstimate", "usage", "setTag", "toString", "quota", "error", "warn", "getTelemetryIdentifier", "client", "initialized", "undefined", "identity", "halo", "get", "did", "yaml", "existsSync", "statSync", "mkdir", "readFile", "writeFile", "join", "v4", "uuid", "validate", "validateUuid", "log", "showObservabilityBanner", "configDir", "bannercb", "path", "join", "existsSync", "writeFile", "getObservabilityState", "statSync", "isDirectory", "Error", "mkdir", "recursive", "idPath", "context", "readFile", "validate", "initializeState", "observabilityState", "installationId", "uuid", "group", "process", "env", "DX_OBSERVABILITY_GROUP", "undefined", "mode", "DX_DISABLE_OBSERVABILITY", "DX_OBSERVABILITY_MODE", "yaml", "dump", "contextString", "load", "Boolean", "validateUuid", "initializeNodeObservability", "namespace", "version", "config", "tracingEnable", "replayEnable", "log", "release", "environment", "DX_ENVIRONMENT", "observability", "Observability", "errorLog", "sentryInitOptions", "sampleRate", "setTag", "IPDATA_API_KEY", "get", "res", "fetch", "ipData", "json", "addIPDataTelemetryTags", "err", "captureException", "mapSpaces", "spaces", "options", "verbose", "truncateKeys", "map", "space", "open", "ready", "internal", "data", "metrics", "startup", "getTime", "pipeline", "startDataMutations", "currentEpoch", "subject", "assertion", "timeframe", "totalMessages", "epoch", "number", "currentDataMutations", "currentDataTimeframe", "totalDataMutations", "targetDataTimeframe", "key", "truncate", "isOpen", "members", "get", "length", "objects", "db", "coreDatabase", "getAllObjectIds", "progress", "Math", "min", "abs", "toFixed", "lastFocusEvent", "Date", "totalTime", "setupTelemetryListeners", "namespace", "client", "observability", "clickCallback", "event", "id", "target", "setTimeout", "did", "getTelemetryIdentifier", "name", "properties", "href", "window", "location", "path", "composedPath", "filter", "el", "Boolean", "tagName", "map", "toLowerCase", "reverse", "join", "focusCallback", "now", "timeAway", "getTime", "blurCallback", "timeSpent", "unloadCallback", "errorCallback", "message", "filename", "stack", "error", "addEventListener", "removeEventListener", "SPACE_METRICS_MIN_INTERVAL", "SPACE_TELEMETRY_MIN_INTERVAL", "NETWORK_METRICS_MIN_INTERVAL", "Observability", "constructor", "namespace", "environment", "release", "config", "secrets", "group", "mode", "telemetry", "errorLog", "_ctx", "Context", "_tags", "Map", "addIPDataTelemetryTags", "ipData", "setTag", "city", "region", "country", "latitude", "toString", "longitude", "_namespace", "_mode", "_config", "_group", "_secrets", "_loadSecrets", "_telemetryBatchSize", "batchSize", "_errorReportingOptions", "sentryInitOptions", "PublicKey", "random", "toHex", "enabled", "isNode", "mergedSecrets", "buildSecrets", "process", "env", "DX_ENVIRONMENT", "DX_RELEASE", "SENTRY_DESTINATION", "TELEMETRY_API_KEY", "IPDATA_API_KEY", "DX_OTEL_ENDPOINT", "OTEL_ENDPOINT", "DX_OTEL_AUTHORIZATION", "OTEL_AUTHORIZATION", "log", "rtc", "get", "initialize", "_initLogs", "_initMetrics", "_initTelemetry", "_initErrorLogs", "_initTraces", "close", "closes", "_telemetry", "push", "_otelMetrics", "_otelLogs", "Promise", "all", "dispose", "setMode", "key", "value", "scope", "undefined", "_setTag", "set", "getTag", "setIdentityTags", "clientServices", "IdentityService", "queryIdentity", "subscribe", "idqr", "identity", "did", "DevicesService", "queryDevices", "dqr", "devices", "length", "device", "invariant", "thisDevice", "find", "kind", "DeviceKind", "CURRENT", "deviceKey", "truncate", "profile", "label", "OtelLogs", "endpoint", "authorizationHeader", "serviceName", "serviceVersion", "getTags", "Object", "fromEntries", "Array", "from", "filter", "map", "logLevel", "LogLevel", "VERBOSE", "includeSharedWorkerLogs", "runtimeConfig", "processors", "logProcessor", "OtelMetrics", "gauge", "name", "extraTags", "startNetworkMetrics", "NetworkService", "updateSignalMetrics", "Event", "debounce", "on", "_lastNetworkStatus", "signaling", "forEach", "server", "state", "swarmCount", "connectionStates", "ConnectionState", "totalReadBufferSize", "totalWriteBufferSize", "totalChannelBufferSize", "connectionInfo", "conn", "connections", "readBufferSize", "writeBufferSize", "stream", "streams", "queryStatus", "networkStatus", "emit", "scheduleTaskInterval", "startSpacesMetrics", "client", "spaces", "subscriptions", "onDispose", "subscription", "unsubscribe", "updateSpaceMetrics", "data", "mapSpaces", "truncateKeys", "members", "objects", "epoch", "currentDataMutations", "updateSpaceTelemetry", "event", "getTelemetryIdentifier", "properties", "subscribeToSpaceUpdate", "space", "pipeline", "next", "id", "has", "startRuntimeMetrics", "frequency", "platform", "services", "SystemService", "getPlatform", "Platform", "PLATFORM_TYPE", "type", "toLowerCase", "arch", "runtime", "memory", "window", "performance", "totalJSHeapSize", "usedJSHeapSize", "jsHeapSizeLimit", "then", "rss", "heapTotal", "heapUsed", "catch", "error", "document", "SegmentTelemetry", "apiKey", "options", "page", "captureException", "captureUserFeedback", "init", "SentryLogProcessor", "_captureException", "_captureUserFeedback", "info", "dest", "_sentryLogProcessor", "destination", "scrubFilenames", "onError", "addLogBreadcrumbsTo", "v", "k", "startErrorLogs", "startTraces", "_otelTraces", "start", "OtelTraces", "err", "email", "message"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/sdk/observability/src/cli-observability-secrets.json":{"bytes":593,"imports":[]},"packages/sdk/observability/src/otel/otel.ts":{"bytes":1960,"imports":[{"path":"@opentelemetry/api","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/observability/src/otel/logs.ts":{"bytes":11081,"imports":[{"path":"@opentelemetry/api-logs","kind":"import-statement","external":true},{"path":"@opentelemetry/exporter-logs-otlp-http","kind":"import-statement","external":true},{"path":"@opentelemetry/resources","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-logs","kind":"import-statement","external":true},{"path":"@opentelemetry/semantic-conventions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/otel/otel.ts","kind":"import-statement","original":"./otel"}],"format":"esm"},"packages/sdk/observability/src/otel/metrics.ts":{"bytes":14358,"imports":[{"path":"@opentelemetry/exporter-metrics-otlp-http","kind":"import-statement","external":true},{"path":"@opentelemetry/resources","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-metrics","kind":"import-statement","external":true},{"path":"@opentelemetry/semantic-conventions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/otel/otel.ts","kind":"import-statement","original":"./otel"}],"format":"esm"},"packages/sdk/observability/src/otel/traces-browser.ts":{"bytes":8340,"imports":[{"path":"@opentelemetry/api","kind":"import-statement","external":true},{"path":"@opentelemetry/auto-instrumentations-web","kind":"import-statement","external":true},{"path":"@opentelemetry/exporter-trace-otlp-http","kind":"import-statement","external":true},{"path":"@opentelemetry/instrumentation","kind":"import-statement","external":true},{"path":"@opentelemetry/resources","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-trace-base","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-trace-web","kind":"import-statement","external":true},{"path":"@opentelemetry/semantic-conventions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/observability/src/otel/index.ts":{"bytes":744,"imports":[{"path":"packages/sdk/observability/src/otel/otel.ts","kind":"import-statement","original":"./otel"},{"path":"packages/sdk/observability/src/otel/logs.ts","kind":"import-statement","original":"./logs"},{"path":"packages/sdk/observability/src/otel/metrics.ts","kind":"import-statement","original":"./metrics"},{"path":"packages/sdk/observability/src/otel/traces-browser.ts","kind":"import-statement","original":"./traces"}],"format":"esm"},"packages/sdk/observability/src/sentry/browser.ts":{"bytes":15544,"imports":[{"path":"@sentry/browser","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@sentry/browser","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/observability/src/sentry/types.ts":{"bytes":1065,"imports":[],"format":"esm"},"packages/sdk/observability/src/sentry/index.ts":{"bytes":578,"imports":[{"path":"packages/sdk/observability/src/sentry/browser.ts","kind":"import-statement","original":"./node"},{"path":"packages/sdk/observability/src/sentry/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/sdk/observability/src/segment/browser.ts":{"bytes":6738,"imports":[{"path":"@segment/snippet","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/sentry/index.ts","kind":"import-statement","original":"../sentry"}],"format":"esm"},"packages/sdk/observability/src/segment/types.ts":{"bytes":1070,"imports":[],"format":"esm"},"packages/sdk/observability/src/segment/index.ts":{"bytes":579,"imports":[{"path":"packages/sdk/observability/src/segment/browser.ts","kind":"import-statement","original":"./node"},{"path":"packages/sdk/observability/src/segment/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/sdk/observability/src/sentry/sentry-log-processor.ts":{"bytes":18866,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/sentry/browser.ts","kind":"import-statement","original":"./node"}],"format":"esm"},"packages/sdk/observability/src/observability.ts":{"bytes":74949,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/network-manager","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/cli-observability-secrets.json","kind":"import-statement","original":"./cli-observability-secrets.json"},{"path":"packages/sdk/observability/src/helpers/index.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/observability/src/otel/index.ts","kind":"dynamic-import","original":"./otel"},{"path":"packages/sdk/observability/src/otel/index.ts","kind":"dynamic-import","original":"./otel"},{"path":"packages/sdk/observability/src/segment/index.ts","kind":"dynamic-import","original":"./segment"},{"path":"packages/sdk/observability/src/sentry/index.ts","kind":"dynamic-import","original":"./sentry"},{"path":"packages/sdk/observability/src/sentry/sentry-log-processor.ts","kind":"dynamic-import","original":"./sentry/sentry-log-processor"},{"path":"packages/sdk/observability/src/otel/index.ts","kind":"dynamic-import","original":"./otel"}],"format":"esm"},"packages/sdk/observability/src/helpers/browser-observability.ts":{"bytes":19873,"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/observability.ts","kind":"dynamic-import","original":"../observability"}],"format":"esm"},"packages/sdk/observability/src/helpers/common.ts":{"bytes":2674,"imports":[],"format":"esm"},"packages/sdk/observability/src/helpers/node-observability.ts":{"bytes":14364,"imports":[{"path":"js-yaml","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs/promises","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"uuid","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/observability.ts","kind":"import-statement","original":"../observability"}],"format":"esm"},"packages/sdk/observability/src/helpers/map-spaces.ts":{"bytes":6449,"imports":[],"format":"esm"},"packages/sdk/observability/src/helpers/setup-telemetry-listeners.ts":{"bytes":11380,"imports":[{"path":"packages/sdk/observability/src/helpers/common.ts","kind":"import-statement","original":"./common"}],"format":"esm"},"packages/sdk/observability/src/helpers/index.ts":{"bytes":966,"imports":[{"path":"packages/sdk/observability/src/helpers/browser-observability.ts","kind":"import-statement","original":"./browser-observability"},{"path":"packages/sdk/observability/src/helpers/common.ts","kind":"import-statement","original":"./common"},{"path":"packages/sdk/observability/src/helpers/node-observability.ts","kind":"import-statement","original":"./node-observability"},{"path":"packages/sdk/observability/src/helpers/map-spaces.ts","kind":"import-statement","original":"./map-spaces"},{"path":"packages/sdk/observability/src/helpers/setup-telemetry-listeners.ts","kind":"import-statement","original":"./setup-telemetry-listeners"}],"format":"esm"},"packages/sdk/observability/src/index.ts":{"bytes":598,"imports":[{"path":"packages/sdk/observability/src/helpers/index.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/observability/src/observability.ts","kind":"import-statement","original":"./observability"}],"format":"esm"}},"outputs":{"packages/sdk/observability/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/browser/chunk-EE4ONYIP.mjs","kind":"import-statement"}],"exports":["OBSERVABILITY_DISABLED_KEY","OBSERVABILITY_GROUP_KEY","Observability","getObservabilityGroup","getObservabilityState","getTelemetryIdentifier","initializeAppObservability","initializeNodeObservability","isObservabilityDisabled","mapSpaces","setupTelemetryListeners","showObservabilityBanner","storeObservabilityDisabled","storeObservabilityGroup"],"entryPoint":"packages/sdk/observability/src/index.ts","inputs":{"packages/sdk/observability/src/index.ts":{"bytesInOutput":0}},"bytes":809},"packages/sdk/observability/dist/lib/browser/segment/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3133},"packages/sdk/observability/dist/lib/browser/segment/index.mjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/browser/chunk-KDP3SESE.mjs","kind":"import-statement"},{"path":"packages/sdk/observability/dist/lib/browser/chunk-3LKCQYWD.mjs","kind":"import-statement"},{"path":"@segment/snippet","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["SegmentTelemetry"],"entryPoint":"packages/sdk/observability/src/segment/index.ts","inputs":{"packages/sdk/observability/src/segment/browser.ts":{"bytesInOutput":1760},"packages/sdk/observability/src/segment/index.ts":{"bytesInOutput":0}},"bytes":1972},"packages/sdk/observability/dist/lib/browser/sentry/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/browser/sentry/index.mjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/browser/chunk-KDP3SESE.mjs","kind":"import-statement"},{"path":"packages/sdk/observability/dist/lib/browser/chunk-3LKCQYWD.mjs","kind":"import-statement"}],"exports":["addBreadcrumb","captureException","captureMessage","captureUserFeedback","init","setTag","setTags","setUser","withScope"],"entryPoint":"packages/sdk/observability/src/sentry/index.ts","inputs":{},"bytes":380},"packages/sdk/observability/dist/lib/browser/chunk-KDP3SESE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/browser/chunk-KDP3SESE.mjs":{"imports":[],"exports":[],"inputs":{"packages/sdk/observability/src/sentry/index.ts":{"bytesInOutput":0}},"bytes":44},"packages/sdk/observability/dist/lib/browser/otel-WFASQZXZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17970},"packages/sdk/observability/dist/lib/browser/otel-WFASQZXZ.mjs":{"imports":[{"path":"@opentelemetry/api","kind":"import-statement","external":true},{"path":"@opentelemetry/api-logs","kind":"import-statement","external":true},{"path":"@opentelemetry/exporter-logs-otlp-http","kind":"import-statement","external":true},{"path":"@opentelemetry/resources","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-logs","kind":"import-statement","external":true},{"path":"@opentelemetry/semantic-conventions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@opentelemetry/exporter-metrics-otlp-http","kind":"import-statement","external":true},{"path":"@opentelemetry/resources","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-metrics","kind":"import-statement","external":true},{"path":"@opentelemetry/semantic-conventions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@opentelemetry/api","kind":"import-statement","external":true},{"path":"@opentelemetry/auto-instrumentations-web","kind":"import-statement","external":true},{"path":"@opentelemetry/exporter-trace-otlp-http","kind":"import-statement","external":true},{"path":"@opentelemetry/instrumentation","kind":"import-statement","external":true},{"path":"@opentelemetry/resources","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-trace-base","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-trace-web","kind":"import-statement","external":true},{"path":"@opentelemetry/semantic-conventions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true}],"exports":["OtelLogs","OtelMetrics","OtelTraces","setDiagLogger"],"entryPoint":"packages/sdk/observability/src/otel/index.ts","inputs":{"packages/sdk/observability/src/otel/otel.ts":{"bytesInOutput":229},"packages/sdk/observability/src/otel/index.ts":{"bytesInOutput":0},"packages/sdk/observability/src/otel/logs.ts":{"bytesInOutput":2448},"packages/sdk/observability/src/otel/metrics.ts":{"bytesInOutput":3528},"packages/sdk/observability/src/otel/traces-browser.ts":{"bytesInOutput":2328}},"bytes":8849},"packages/sdk/observability/dist/lib/browser/sentry-log-processor-2KNHVHXL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9663},"packages/sdk/observability/dist/lib/browser/sentry-log-processor-2KNHVHXL.mjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/browser/chunk-3LKCQYWD.mjs","kind":"import-statement"},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["SentryLogProcessor"],"entryPoint":"packages/sdk/observability/src/sentry/sentry-log-processor.ts","inputs":{"packages/sdk/observability/src/sentry/sentry-log-processor.ts":{"bytesInOutput":4406}},"bytes":4654},"packages/sdk/observability/dist/lib/browser/chunk-3LKCQYWD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7145},"packages/sdk/observability/dist/lib/browser/chunk-3LKCQYWD.mjs":{"imports":[{"path":"@sentry/browser","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@sentry/browser","kind":"import-statement","external":true}],"exports":["addBreadcrumb","captureException","captureMessage","captureUserFeedback","init","setTag","setTags","setUser","withScope"],"inputs":{"packages/sdk/observability/src/sentry/browser.ts":{"bytesInOutput":3907}},"bytes":4157},"packages/sdk/observability/dist/lib/browser/observability-GXID2L6O.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/browser/observability-GXID2L6O.mjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/browser/chunk-EE4ONYIP.mjs","kind":"import-statement"}],"exports":["Observability"],"entryPoint":"packages/sdk/observability/src/observability.ts","inputs":{},"bytes":136},"packages/sdk/observability/dist/lib/browser/chunk-EE4ONYIP.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":63257},"packages/sdk/observability/dist/lib/browser/chunk-EE4ONYIP.mjs":{"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/network-manager","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/observability/dist/lib/browser/observability-GXID2L6O.mjs","kind":"dynamic-import"},{"path":"js-yaml","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs/promises","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"uuid","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/observability/dist/lib/browser/otel-WFASQZXZ.mjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/browser/otel-WFASQZXZ.mjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/browser/segment/index.mjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/browser/sentry/index.mjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/browser/sentry-log-processor-2KNHVHXL.mjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/browser/otel-WFASQZXZ.mjs","kind":"dynamic-import"}],"exports":["OBSERVABILITY_DISABLED_KEY","OBSERVABILITY_GROUP_KEY","Observability","getObservabilityGroup","getObservabilityState","getTelemetryIdentifier","initializeAppObservability","initializeNodeObservability","isObservabilityDisabled","mapSpaces","setupTelemetryListeners","showObservabilityBanner","storeObservabilityDisabled","storeObservabilityGroup"],"inputs":{"packages/sdk/observability/src/observability.ts":{"bytesInOutput":18948},"packages/sdk/observability/src/cli-observability-secrets.json":{"bytesInOutput":625},"packages/sdk/observability/src/helpers/browser-observability.ts":{"bytesInOutput":4852},"packages/sdk/observability/src/helpers/index.ts":{"bytesInOutput":0},"packages/sdk/observability/src/helpers/common.ts":{"bytesInOutput":229},"packages/sdk/observability/src/helpers/node-observability.ts":{"bytesInOutput":3445},"packages/sdk/observability/src/helpers/map-spaces.ts":{"bytesInOutput":1192},"packages/sdk/observability/src/helpers/setup-telemetry-listeners.ts":{"bytesInOutput":2658}},"bytes":32851}}}
|
|
1
|
+
{"inputs":{"packages/sdk/observability/src/cli-observability-secrets.json":{"bytes":593,"imports":[]},"packages/sdk/observability/src/otel/otel.ts":{"bytes":1960,"imports":[{"path":"@opentelemetry/api","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/observability/src/otel/logs.ts":{"bytes":11081,"imports":[{"path":"@opentelemetry/api-logs","kind":"import-statement","external":true},{"path":"@opentelemetry/exporter-logs-otlp-http","kind":"import-statement","external":true},{"path":"@opentelemetry/resources","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-logs","kind":"import-statement","external":true},{"path":"@opentelemetry/semantic-conventions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/otel/otel.ts","kind":"import-statement","original":"./otel"}],"format":"esm"},"packages/sdk/observability/src/otel/metrics.ts":{"bytes":14358,"imports":[{"path":"@opentelemetry/exporter-metrics-otlp-http","kind":"import-statement","external":true},{"path":"@opentelemetry/resources","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-metrics","kind":"import-statement","external":true},{"path":"@opentelemetry/semantic-conventions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/otel/otel.ts","kind":"import-statement","original":"./otel"}],"format":"esm"},"packages/sdk/observability/src/otel/traces-browser.ts":{"bytes":8340,"imports":[{"path":"@opentelemetry/api","kind":"import-statement","external":true},{"path":"@opentelemetry/auto-instrumentations-web","kind":"import-statement","external":true},{"path":"@opentelemetry/exporter-trace-otlp-http","kind":"import-statement","external":true},{"path":"@opentelemetry/instrumentation","kind":"import-statement","external":true},{"path":"@opentelemetry/resources","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-trace-base","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-trace-web","kind":"import-statement","external":true},{"path":"@opentelemetry/semantic-conventions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/observability/src/otel/index.ts":{"bytes":744,"imports":[{"path":"packages/sdk/observability/src/otel/otel.ts","kind":"import-statement","original":"./otel"},{"path":"packages/sdk/observability/src/otel/logs.ts","kind":"import-statement","original":"./logs"},{"path":"packages/sdk/observability/src/otel/metrics.ts","kind":"import-statement","original":"./metrics"},{"path":"packages/sdk/observability/src/otel/traces-browser.ts","kind":"import-statement","original":"./traces"}],"format":"esm"},"packages/sdk/observability/src/sentry/browser.ts":{"bytes":15544,"imports":[{"path":"@sentry/browser","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@sentry/browser","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/observability/src/sentry/types.ts":{"bytes":1065,"imports":[],"format":"esm"},"packages/sdk/observability/src/sentry/index.ts":{"bytes":578,"imports":[{"path":"packages/sdk/observability/src/sentry/browser.ts","kind":"import-statement","original":"./node"},{"path":"packages/sdk/observability/src/sentry/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/sdk/observability/src/segment/browser.ts":{"bytes":6696,"imports":[{"path":"@segment/snippet","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/sentry/index.ts","kind":"import-statement","original":"../sentry"}],"format":"esm"},"packages/sdk/observability/src/segment/types.ts":{"bytes":1062,"imports":[],"format":"esm"},"packages/sdk/observability/src/segment/index.ts":{"bytes":579,"imports":[{"path":"packages/sdk/observability/src/segment/browser.ts","kind":"import-statement","original":"./node"},{"path":"packages/sdk/observability/src/segment/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/sdk/observability/src/sentry/sentry-log-processor.ts":{"bytes":18866,"imports":[{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/sentry/browser.ts","kind":"import-statement","original":"./node"}],"format":"esm"},"packages/sdk/observability/src/observability.ts":{"bytes":74692,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/network-manager","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/cli-observability-secrets.json","kind":"import-statement","original":"./cli-observability-secrets.json"},{"path":"packages/sdk/observability/src/helpers/index.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/observability/src/otel/index.ts","kind":"dynamic-import","original":"./otel"},{"path":"packages/sdk/observability/src/otel/index.ts","kind":"dynamic-import","original":"./otel"},{"path":"packages/sdk/observability/src/segment/index.ts","kind":"dynamic-import","original":"./segment"},{"path":"packages/sdk/observability/src/sentry/index.ts","kind":"dynamic-import","original":"./sentry"},{"path":"packages/sdk/observability/src/sentry/sentry-log-processor.ts","kind":"dynamic-import","original":"./sentry/sentry-log-processor"},{"path":"packages/sdk/observability/src/otel/index.ts","kind":"dynamic-import","original":"./otel"}],"format":"esm"},"packages/sdk/observability/src/helpers/browser-observability.ts":{"bytes":19873,"imports":[{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/observability.ts","kind":"dynamic-import","original":"../observability"}],"format":"esm"},"packages/sdk/observability/src/helpers/common.ts":{"bytes":2587,"imports":[],"format":"esm"},"packages/sdk/observability/src/helpers/node-observability.ts":{"bytes":14364,"imports":[{"path":"js-yaml","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs/promises","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"uuid","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/observability.ts","kind":"import-statement","original":"../observability"}],"format":"esm"},"packages/sdk/observability/src/helpers/map-spaces.ts":{"bytes":6449,"imports":[],"format":"esm"},"packages/sdk/observability/src/helpers/setup-telemetry-listeners.ts":{"bytes":11289,"imports":[{"path":"packages/sdk/observability/src/helpers/common.ts","kind":"import-statement","original":"./common"}],"format":"esm"},"packages/sdk/observability/src/helpers/index.ts":{"bytes":966,"imports":[{"path":"packages/sdk/observability/src/helpers/browser-observability.ts","kind":"import-statement","original":"./browser-observability"},{"path":"packages/sdk/observability/src/helpers/common.ts","kind":"import-statement","original":"./common"},{"path":"packages/sdk/observability/src/helpers/node-observability.ts","kind":"import-statement","original":"./node-observability"},{"path":"packages/sdk/observability/src/helpers/map-spaces.ts","kind":"import-statement","original":"./map-spaces"},{"path":"packages/sdk/observability/src/helpers/setup-telemetry-listeners.ts","kind":"import-statement","original":"./setup-telemetry-listeners"}],"format":"esm"},"packages/sdk/observability/src/index.ts":{"bytes":598,"imports":[{"path":"packages/sdk/observability/src/helpers/index.ts","kind":"import-statement","original":"./helpers"},{"path":"packages/sdk/observability/src/observability.ts","kind":"import-statement","original":"./observability"}],"format":"esm"}},"outputs":{"packages/sdk/observability/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/browser/chunk-RWIBODSU.mjs","kind":"import-statement"}],"exports":["OBSERVABILITY_DISABLED_KEY","OBSERVABILITY_GROUP_KEY","Observability","getObservabilityGroup","getObservabilityState","getTelemetryIdentifier","initializeAppObservability","initializeNodeObservability","isObservabilityDisabled","mapSpaces","setupTelemetryListeners","showObservabilityBanner","storeObservabilityDisabled","storeObservabilityGroup"],"entryPoint":"packages/sdk/observability/src/index.ts","inputs":{"packages/sdk/observability/src/index.ts":{"bytesInOutput":0}},"bytes":809},"packages/sdk/observability/dist/lib/browser/segment/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3112},"packages/sdk/observability/dist/lib/browser/segment/index.mjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/browser/chunk-KDP3SESE.mjs","kind":"import-statement"},{"path":"packages/sdk/observability/dist/lib/browser/chunk-3LKCQYWD.mjs","kind":"import-statement"},{"path":"@segment/snippet","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["SegmentTelemetry"],"entryPoint":"packages/sdk/observability/src/segment/index.ts","inputs":{"packages/sdk/observability/src/segment/browser.ts":{"bytesInOutput":1746},"packages/sdk/observability/src/segment/index.ts":{"bytesInOutput":0}},"bytes":1958},"packages/sdk/observability/dist/lib/browser/sentry/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/browser/sentry/index.mjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/browser/chunk-KDP3SESE.mjs","kind":"import-statement"},{"path":"packages/sdk/observability/dist/lib/browser/chunk-3LKCQYWD.mjs","kind":"import-statement"}],"exports":["addBreadcrumb","captureException","captureMessage","captureUserFeedback","init","setTag","setTags","setUser","withScope"],"entryPoint":"packages/sdk/observability/src/sentry/index.ts","inputs":{},"bytes":380},"packages/sdk/observability/dist/lib/browser/chunk-KDP3SESE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/browser/chunk-KDP3SESE.mjs":{"imports":[],"exports":[],"inputs":{"packages/sdk/observability/src/sentry/index.ts":{"bytesInOutput":0}},"bytes":44},"packages/sdk/observability/dist/lib/browser/otel-WFASQZXZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17970},"packages/sdk/observability/dist/lib/browser/otel-WFASQZXZ.mjs":{"imports":[{"path":"@opentelemetry/api","kind":"import-statement","external":true},{"path":"@opentelemetry/api-logs","kind":"import-statement","external":true},{"path":"@opentelemetry/exporter-logs-otlp-http","kind":"import-statement","external":true},{"path":"@opentelemetry/resources","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-logs","kind":"import-statement","external":true},{"path":"@opentelemetry/semantic-conventions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@opentelemetry/exporter-metrics-otlp-http","kind":"import-statement","external":true},{"path":"@opentelemetry/resources","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-metrics","kind":"import-statement","external":true},{"path":"@opentelemetry/semantic-conventions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@opentelemetry/api","kind":"import-statement","external":true},{"path":"@opentelemetry/auto-instrumentations-web","kind":"import-statement","external":true},{"path":"@opentelemetry/exporter-trace-otlp-http","kind":"import-statement","external":true},{"path":"@opentelemetry/instrumentation","kind":"import-statement","external":true},{"path":"@opentelemetry/resources","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-trace-base","kind":"import-statement","external":true},{"path":"@opentelemetry/sdk-trace-web","kind":"import-statement","external":true},{"path":"@opentelemetry/semantic-conventions","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true}],"exports":["OtelLogs","OtelMetrics","OtelTraces","setDiagLogger"],"entryPoint":"packages/sdk/observability/src/otel/index.ts","inputs":{"packages/sdk/observability/src/otel/otel.ts":{"bytesInOutput":229},"packages/sdk/observability/src/otel/index.ts":{"bytesInOutput":0},"packages/sdk/observability/src/otel/logs.ts":{"bytesInOutput":2448},"packages/sdk/observability/src/otel/metrics.ts":{"bytesInOutput":3528},"packages/sdk/observability/src/otel/traces-browser.ts":{"bytesInOutput":2328}},"bytes":8849},"packages/sdk/observability/dist/lib/browser/sentry-log-processor-2KNHVHXL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9663},"packages/sdk/observability/dist/lib/browser/sentry-log-processor-2KNHVHXL.mjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/browser/chunk-3LKCQYWD.mjs","kind":"import-statement"},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["SentryLogProcessor"],"entryPoint":"packages/sdk/observability/src/sentry/sentry-log-processor.ts","inputs":{"packages/sdk/observability/src/sentry/sentry-log-processor.ts":{"bytesInOutput":4406}},"bytes":4654},"packages/sdk/observability/dist/lib/browser/chunk-3LKCQYWD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7145},"packages/sdk/observability/dist/lib/browser/chunk-3LKCQYWD.mjs":{"imports":[{"path":"@sentry/browser","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@sentry/browser","kind":"import-statement","external":true}],"exports":["addBreadcrumb","captureException","captureMessage","captureUserFeedback","init","setTag","setTags","setUser","withScope"],"inputs":{"packages/sdk/observability/src/sentry/browser.ts":{"bytesInOutput":3907}},"bytes":4157},"packages/sdk/observability/dist/lib/browser/observability-VEOITBLM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/browser/observability-VEOITBLM.mjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/browser/chunk-RWIBODSU.mjs","kind":"import-statement"}],"exports":["Observability"],"entryPoint":"packages/sdk/observability/src/observability.ts","inputs":{},"bytes":136},"packages/sdk/observability/dist/lib/browser/chunk-RWIBODSU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":63029},"packages/sdk/observability/dist/lib/browser/chunk-RWIBODSU.mjs":{"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/network-manager","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"localforage","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/observability/dist/lib/browser/observability-VEOITBLM.mjs","kind":"dynamic-import"},{"path":"js-yaml","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs","kind":"import-statement","external":true},{"path":"@dxos/node-std/fs/promises","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"uuid","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/observability/dist/lib/browser/otel-WFASQZXZ.mjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/browser/otel-WFASQZXZ.mjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/browser/segment/index.mjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/browser/sentry/index.mjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/browser/sentry-log-processor-2KNHVHXL.mjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/browser/otel-WFASQZXZ.mjs","kind":"dynamic-import"}],"exports":["OBSERVABILITY_DISABLED_KEY","OBSERVABILITY_GROUP_KEY","Observability","getObservabilityGroup","getObservabilityState","getTelemetryIdentifier","initializeAppObservability","initializeNodeObservability","isObservabilityDisabled","mapSpaces","setupTelemetryListeners","showObservabilityBanner","storeObservabilityDisabled","storeObservabilityGroup"],"inputs":{"packages/sdk/observability/src/observability.ts":{"bytesInOutput":18879},"packages/sdk/observability/src/cli-observability-secrets.json":{"bytesInOutput":625},"packages/sdk/observability/src/helpers/browser-observability.ts":{"bytesInOutput":4852},"packages/sdk/observability/src/helpers/index.ts":{"bytesInOutput":0},"packages/sdk/observability/src/helpers/common.ts":{"bytesInOutput":210},"packages/sdk/observability/src/helpers/node-observability.ts":{"bytesInOutput":3445},"packages/sdk/observability/src/helpers/map-spaces.ts":{"bytesInOutput":1192},"packages/sdk/observability/src/helpers/setup-telemetry-listeners.ts":{"bytesInOutput":2623}},"bytes":32728}}}
|
|
@@ -27,7 +27,7 @@ var SegmentTelemetry = class {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
page({
|
|
30
|
+
page({ did: userId, ...options } = {}) {
|
|
31
31
|
try {
|
|
32
32
|
window.analytics?.page({
|
|
33
33
|
context: this._getTags(),
|
|
@@ -43,7 +43,7 @@ var SegmentTelemetry = class {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
event({
|
|
46
|
+
event({ did: userId, name: event, ...options }) {
|
|
47
47
|
try {
|
|
48
48
|
options.properties = {
|
|
49
49
|
...options.properties,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/segment/browser.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport snippet from '@segment/snippet';\n\nimport { log } from '@dxos/log';\n\nimport type { EventOptions, SegmentTelemetryOptions, PageOptions } from './types';\nimport { captureException } from '../sentry';\n\nexport class SegmentTelemetry {\n private _getTags: () => { [key: string]: string };\n\n constructor({ apiKey, batchSize, getTags }: SegmentTelemetryOptions) {\n this._getTags = getTags;\n try {\n const contents = snippet.min({\n apiKey,\n page: false,\n });\n\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 page({
|
|
5
|
-
"mappings": ";;;;;;AAIA,OAAOA,aAAa;AAEpB,SAASC,WAAW;;AAKb,IAAMC,mBAAN,MAAMA;EAGXC,YAAY,EAAEC,QAAQC,WAAWC,QAAO,GAA6B;AACnE,SAAKC,WAAWD;AAChB,QAAI;AACF,YAAME,WAAWC,QAAQC,IAAI;QAC3BN;QACAO,MAAM;MACR,CAAA;AAEA,YAAMC,SAASC,SAASC,cAAc,QAAA;AACtCF,aAAOG,YAAYP;AACnBK,eAASG,KAAKC,OAAOL,MAAAA;IACvB,SAASM,KAAK;AACZC,UAAIC,MAAM,kCAAkCF,KAAAA;;;;;;IAC9C;EACF;EAEAP,KAAK,EAAEU,
|
|
6
|
-
"names": ["snippet", "log", "SegmentTelemetry", "constructor", "apiKey", "batchSize", "getTags", "_getTags", "contents", "snippet", "min", "page", "script", "document", "createElement", "innerHTML", "body", "append", "err", "log", "catch", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport snippet from '@segment/snippet';\n\nimport { log } from '@dxos/log';\n\nimport type { EventOptions, SegmentTelemetryOptions, PageOptions } from './types';\nimport { captureException } from '../sentry';\n\nexport class SegmentTelemetry {\n private _getTags: () => { [key: string]: string };\n\n constructor({ apiKey, batchSize, getTags }: SegmentTelemetryOptions) {\n this._getTags = getTags;\n try {\n const contents = snippet.min({\n apiKey,\n page: false,\n });\n\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 page({ did: userId, ...options }: PageOptions = {}) {\n try {\n (window as any).analytics?.page({\n context: this._getTags(),\n ...options,\n userId,\n });\n } catch (err) {\n log.catch('Failed to track page', err);\n }\n }\n\n event({ did: userId, name: event, ...options }: EventOptions) {\n try {\n options.properties = {\n ...options.properties,\n ...this._getTags(),\n };\n (window as any).analytics?.track({\n ...options,\n event,\n });\n } catch (err) {\n log.catch('Failed to track event', err);\n }\n }\n\n async flush() {\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() {}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,OAAOA,aAAa;AAEpB,SAASC,WAAW;;AAKb,IAAMC,mBAAN,MAAMA;EAGXC,YAAY,EAAEC,QAAQC,WAAWC,QAAO,GAA6B;AACnE,SAAKC,WAAWD;AAChB,QAAI;AACF,YAAME,WAAWC,QAAQC,IAAI;QAC3BN;QACAO,MAAM;MACR,CAAA;AAEA,YAAMC,SAASC,SAASC,cAAc,QAAA;AACtCF,aAAOG,YAAYP;AACnBK,eAASG,KAAKC,OAAOL,MAAAA;IACvB,SAASM,KAAK;AACZC,UAAIC,MAAM,kCAAkCF,KAAAA;;;;;;IAC9C;EACF;EAEAP,KAAK,EAAEU,KAAKC,QAAQ,GAAGC,QAAAA,IAAyB,CAAC,GAAG;AAClD,QAAI;AACDC,aAAeC,WAAWd,KAAK;QAC9Be,SAAS,KAAKnB,SAAQ;QACtB,GAAGgB;QACHD;MACF,CAAA;IACF,SAASJ,KAAK;AACZC,UAAIC,MAAM,wBAAwBF,KAAAA;;;;;;IACpC;EACF;EAEAS,MAAM,EAAEN,KAAKC,QAAQM,MAAMD,OAAO,GAAGJ,QAAAA,GAAyB;AAC5D,QAAI;AACFA,cAAQM,aAAa;QACnB,GAAGN,QAAQM;QACX,GAAG,KAAKtB,SAAQ;MAClB;AACCiB,aAAeC,WAAWK,MAAM;QAC/B,GAAGP;QACHI;MACF,CAAA;IACF,SAAST,KAAK;AACZC,UAAIC,MAAM,yBAAyBF,KAAAA;;;;;;IACrC;EACF;EAEA,MAAMa,QAAQ;AACZ,QAAI;AACF,YAAOP,OAAeC,WAAWM,MAAM,CAACb,QAAAA;AACtCc,yBAAiBd,GAAAA;MACnB,CAAA;IACF,SAASA,KAAK;AACZC,UAAIC,MAAM,6BAA6BF,KAAAA;;;;;;IACzC;EACF;EAEA,MAAMe,QAAQ;EAAC;AACjB;",
|
|
6
|
+
"names": ["snippet", "log", "SegmentTelemetry", "constructor", "apiKey", "batchSize", "getTags", "_getTags", "contents", "snippet", "min", "page", "script", "document", "createElement", "innerHTML", "body", "append", "err", "log", "catch", "did", "userId", "options", "window", "analytics", "context", "event", "name", "properties", "track", "flush", "captureException", "close"]
|
|
7
7
|
}
|
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_X2D2I2IE_exports = {};
|
|
30
|
+
__export(chunk_X2D2I2IE_exports, {
|
|
31
31
|
OBSERVABILITY_DISABLED_KEY: () => OBSERVABILITY_DISABLED_KEY,
|
|
32
32
|
OBSERVABILITY_GROUP_KEY: () => OBSERVABILITY_GROUP_KEY,
|
|
33
33
|
Observability: () => Observability,
|
|
@@ -43,7 +43,7 @@ __export(chunk_4TP5PWSE_exports, {
|
|
|
43
43
|
storeObservabilityDisabled: () => storeObservabilityDisabled,
|
|
44
44
|
storeObservabilityGroup: () => storeObservabilityGroup
|
|
45
45
|
});
|
|
46
|
-
module.exports = __toCommonJS(
|
|
46
|
+
module.exports = __toCommonJS(chunk_X2D2I2IE_exports);
|
|
47
47
|
var import_async = require("@dxos/async");
|
|
48
48
|
var import_client = require("@dxos/client");
|
|
49
49
|
var import_context = require("@dxos/context");
|
|
@@ -132,7 +132,7 @@ var initializeAppObservability = async ({ namespace, config, mode = "basic", tra
|
|
|
132
132
|
const release = `${namespace}@${config.get("runtime.app.build.version")}`;
|
|
133
133
|
const environment = config.get("runtime.app.env.DX_ENVIRONMENT");
|
|
134
134
|
const observabilityDisabled = await isObservabilityDisabled(namespace);
|
|
135
|
-
const { Observability: Observability2 } = await import("./observability-
|
|
135
|
+
const { Observability: Observability2 } = await import("./observability-MM62IY7P.cjs");
|
|
136
136
|
const observability = new Observability2({
|
|
137
137
|
namespace,
|
|
138
138
|
release,
|
|
@@ -218,7 +218,7 @@ var getTelemetryIdentifier = (client) => {
|
|
|
218
218
|
}
|
|
219
219
|
const identity = client.halo.identity.get();
|
|
220
220
|
if (identity) {
|
|
221
|
-
return identity.
|
|
221
|
+
return identity.did;
|
|
222
222
|
}
|
|
223
223
|
return void 0;
|
|
224
224
|
};
|
|
@@ -344,7 +344,7 @@ var setupTelemetryListeners = (namespace, client, observability) => {
|
|
|
344
344
|
return;
|
|
345
345
|
}
|
|
346
346
|
setTimeout(() => observability.event({
|
|
347
|
-
|
|
347
|
+
did: getTelemetryIdentifier(client),
|
|
348
348
|
name: `${namespace}.window.click`,
|
|
349
349
|
properties: {
|
|
350
350
|
href: window.location.href,
|
|
@@ -356,7 +356,7 @@ var setupTelemetryListeners = (namespace, client, observability) => {
|
|
|
356
356
|
const focusCallback = () => {
|
|
357
357
|
const now = /* @__PURE__ */ new Date();
|
|
358
358
|
setTimeout(() => observability.event({
|
|
359
|
-
|
|
359
|
+
did: getTelemetryIdentifier(client),
|
|
360
360
|
name: `${namespace}.window.focus`,
|
|
361
361
|
properties: {
|
|
362
362
|
href: window.location.href,
|
|
@@ -369,7 +369,7 @@ var setupTelemetryListeners = (namespace, client, observability) => {
|
|
|
369
369
|
const now = /* @__PURE__ */ new Date();
|
|
370
370
|
const timeSpent = now.getTime() - lastFocusEvent.getTime();
|
|
371
371
|
setTimeout(() => observability.event({
|
|
372
|
-
|
|
372
|
+
did: getTelemetryIdentifier(client),
|
|
373
373
|
name: `${namespace}.window.blur`,
|
|
374
374
|
properties: {
|
|
375
375
|
href: window.location.href,
|
|
@@ -381,7 +381,7 @@ var setupTelemetryListeners = (namespace, client, observability) => {
|
|
|
381
381
|
};
|
|
382
382
|
const unloadCallback = () => {
|
|
383
383
|
setTimeout(() => observability.event({
|
|
384
|
-
|
|
384
|
+
did: getTelemetryIdentifier(client),
|
|
385
385
|
name: `${namespace}.page.unload`,
|
|
386
386
|
properties: {
|
|
387
387
|
href: window.location.href,
|
|
@@ -391,7 +391,7 @@ var setupTelemetryListeners = (namespace, client, observability) => {
|
|
|
391
391
|
};
|
|
392
392
|
const errorCallback = (event) => {
|
|
393
393
|
setTimeout(() => observability.event({
|
|
394
|
-
|
|
394
|
+
did: getTelemetryIdentifier(client),
|
|
395
395
|
name: `${namespace}.window.error`,
|
|
396
396
|
properties: {
|
|
397
397
|
href: window.location.href,
|
|
@@ -534,7 +534,7 @@ var Observability = class {
|
|
|
534
534
|
async setIdentityTags(clientServices) {
|
|
535
535
|
if (clientServices.IdentityService) {
|
|
536
536
|
clientServices.IdentityService.queryIdentity().subscribe((idqr) => {
|
|
537
|
-
if (!idqr?.identity?.
|
|
537
|
+
if (!idqr?.identity?.did) {
|
|
538
538
|
(0, import_log.log)("empty response from identity service", {
|
|
539
539
|
idqr
|
|
540
540
|
}, {
|
|
@@ -545,7 +545,7 @@ var Observability = class {
|
|
|
545
545
|
});
|
|
546
546
|
return;
|
|
547
547
|
}
|
|
548
|
-
this.setTag("
|
|
548
|
+
this.setTag("did", idqr.identity.did);
|
|
549
549
|
});
|
|
550
550
|
}
|
|
551
551
|
if (clientServices.DevicesService) {
|
|
@@ -762,7 +762,7 @@ var Observability = class {
|
|
|
762
762
|
truncateKeys: true
|
|
763
763
|
})) {
|
|
764
764
|
this.event({
|
|
765
|
-
|
|
765
|
+
did: getTelemetryIdentifier(client),
|
|
766
766
|
name: `${namespace}.space.update`,
|
|
767
767
|
properties: data
|
|
768
768
|
});
|
|
@@ -775,12 +775,12 @@ var Observability = class {
|
|
|
775
775
|
}
|
|
776
776
|
});
|
|
777
777
|
spaces.forEach((space) => {
|
|
778
|
-
subscriptions.set(space.
|
|
778
|
+
subscriptions.set(space.id, subscribeToSpaceUpdate(space));
|
|
779
779
|
});
|
|
780
780
|
client.spaces.subscribe({
|
|
781
781
|
next: async (spaces2) => {
|
|
782
|
-
spaces2.filter((space) => !subscriptions.has(space.
|
|
783
|
-
subscriptions.set(space.
|
|
782
|
+
spaces2.filter((space) => !subscriptions.has(space.id)).forEach((space) => {
|
|
783
|
+
subscriptions.set(space.id, subscribeToSpaceUpdate(space));
|
|
784
784
|
});
|
|
785
785
|
}
|
|
786
786
|
});
|
|
@@ -975,4 +975,4 @@ var Observability = class {
|
|
|
975
975
|
storeObservabilityDisabled,
|
|
976
976
|
storeObservabilityGroup
|
|
977
977
|
});
|
|
978
|
-
//# sourceMappingURL=chunk-
|
|
978
|
+
//# sourceMappingURL=chunk-X2D2I2IE.cjs.map
|