@dxos/observability 0.5.8 → 0.5.9-main.079a532
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-64DLKIEF.mjs → chunk-Y56RE3XY.mjs} +43 -20
- package/dist/lib/browser/chunk-Y56RE3XY.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-ISNTBWXN.mjs → observability-PQXVFXD7.mjs} +2 -2
- package/dist/lib/node/{chunk-JK37YWUB.cjs → chunk-AUTP6TII.cjs} +46 -23
- package/dist/lib/node/chunk-AUTP6TII.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-VXJOCKID.cjs → observability-LPC6KPIO.cjs} +6 -6
- package/dist/lib/node/{observability-VXJOCKID.cjs.map → observability-LPC6KPIO.cjs.map} +2 -2
- package/dist/types/src/helpers/map-spaces.js +1 -1
- package/dist/types/src/helpers/map-spaces.js.map +1 -1
- package/dist/types/src/helpers/setup-telemetry-listeners.d.ts.map +1 -1
- package/dist/types/src/helpers/setup-telemetry-listeners.js +11 -2
- package/dist/types/src/helpers/setup-telemetry-listeners.js.map +1 -1
- package/dist/types/src/observability.d.ts.map +1 -1
- package/dist/types/src/observability.js +11 -5
- package/dist/types/src/observability.js.map +1 -1
- package/dist/types/src/sentry/sentry-log-processor.d.ts.map +1 -1
- package/dist/types/src/sentry/sentry-log-processor.js +4 -0
- package/dist/types/src/sentry/sentry-log-processor.js.map +1 -1
- package/package.json +15 -15
- package/src/helpers/map-spaces.ts +1 -1
- package/src/helpers/setup-telemetry-listeners.ts +8 -3
- package/src/observability.ts +11 -5
- package/src/sentry/sentry-log-processor.ts +4 -0
- package/dist/lib/browser/chunk-64DLKIEF.mjs.map +0 -7
- package/dist/lib/node/chunk-JK37YWUB.cjs.map +0 -7
- /package/dist/lib/browser/{observability-ISNTBWXN.mjs.map → observability-PQXVFXD7.mjs.map} +0 -0
|
@@ -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_AUTP6TII_exports = {};
|
|
30
|
+
__export(chunk_AUTP6TII_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_JK37YWUB_exports, {
|
|
|
43
43
|
storeObservabilityDisabled: () => storeObservabilityDisabled,
|
|
44
44
|
storeObservabilityGroup: () => storeObservabilityGroup
|
|
45
45
|
});
|
|
46
|
-
module.exports = __toCommonJS(
|
|
46
|
+
module.exports = __toCommonJS(chunk_AUTP6TII_exports);
|
|
47
47
|
var import_chunk_HKBUNAUG = require("./chunk-HKBUNAUG.cjs");
|
|
48
48
|
var import_async = require("@dxos/async");
|
|
49
49
|
var import_context = require("@dxos/context");
|
|
@@ -60,6 +60,7 @@ var import_promises = require("node:fs/promises");
|
|
|
60
60
|
var import_node_path = require("node:path");
|
|
61
61
|
var import_uuid = require("uuid");
|
|
62
62
|
var import_log3 = require("@dxos/log");
|
|
63
|
+
var import_invariant2 = require("@dxos/invariant");
|
|
63
64
|
var import_log4 = require("@dxos/log");
|
|
64
65
|
var import_util2 = require("@dxos/util");
|
|
65
66
|
var cli_observability_secrets_default = {
|
|
@@ -134,7 +135,7 @@ var initializeAppObservability = async ({ namespace, config, mode = "basic", tra
|
|
|
134
135
|
const release = `${namespace}@${config.get("runtime.app.build.version")}`;
|
|
135
136
|
const environment = config.get("runtime.app.env.DX_ENVIRONMENT");
|
|
136
137
|
const observabilityDisabled = await isObservabilityDisabled(namespace);
|
|
137
|
-
const { Observability: Observability2 } = await import("./observability-
|
|
138
|
+
const { Observability: Observability2 } = await import("./observability-LPC6KPIO.cjs");
|
|
138
139
|
const observability = new Observability2({
|
|
139
140
|
namespace,
|
|
140
141
|
release,
|
|
@@ -323,7 +324,7 @@ var mapSpaces = (spaces, options = {
|
|
|
323
324
|
key: space.key.truncate(),
|
|
324
325
|
open: space.isOpen,
|
|
325
326
|
members: space.members.get().length,
|
|
326
|
-
objects: space.db.
|
|
327
|
+
objects: space.db.coreDatabase.getAllObjectIds().length,
|
|
327
328
|
startup,
|
|
328
329
|
epoch,
|
|
329
330
|
// appliedEpoch,
|
|
@@ -339,13 +340,17 @@ var lastFocusEvent = /* @__PURE__ */ new Date();
|
|
|
339
340
|
var totalTime = 0;
|
|
340
341
|
var setupTelemetryListeners = (namespace, client, observability) => {
|
|
341
342
|
const clickCallback = (event) => {
|
|
343
|
+
const id = event.target?.id;
|
|
344
|
+
if (!id) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
342
347
|
setTimeout(() => observability.event({
|
|
343
348
|
identityId: getTelemetryIdentifier(client),
|
|
344
349
|
name: `${namespace}.window.click`,
|
|
345
350
|
properties: {
|
|
346
351
|
href: window.location.href,
|
|
347
352
|
id: event.target?.id,
|
|
348
|
-
path: event.
|
|
353
|
+
path: event.composedPath().filter((el) => Boolean(el.tagName)).map((el) => `${el.tagName.toLowerCase()}${el.id ? `#${el.id}` : ""}`).reverse().join(">")
|
|
349
354
|
}
|
|
350
355
|
}));
|
|
351
356
|
};
|
|
@@ -444,6 +449,9 @@ var SentryLogProcessor = class {
|
|
|
444
449
|
capturedError = Object.values(entry.context ?? {}).find((v) => v instanceof Error);
|
|
445
450
|
}
|
|
446
451
|
if (capturedError) {
|
|
452
|
+
if (capturedError instanceof import_invariant2.InvariantViolation) {
|
|
453
|
+
scope.setExtra("invariant_violation", true);
|
|
454
|
+
}
|
|
447
455
|
const isMessageDifferentFromStackTrace = error == null;
|
|
448
456
|
if (isMessageDifferentFromStackTrace) {
|
|
449
457
|
scope.setExtra("message", extendedMessage);
|
|
@@ -527,6 +535,7 @@ var getRelativeFilename = (filename) => {
|
|
|
527
535
|
};
|
|
528
536
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/observability/src/observability.ts";
|
|
529
537
|
var SPACE_METRICS_MIN_INTERVAL = 1e3 * 60;
|
|
538
|
+
var SPACE_TELEMETRY_MIN_INTERVAL = 1e3 * 60 * 60;
|
|
530
539
|
var NETWORK_METRICS_MIN_INTERVAL = 1e3 * 60 * 5;
|
|
531
540
|
var Observability = class {
|
|
532
541
|
// TODO(nf): make platform a required extension?
|
|
@@ -584,7 +593,7 @@ var Observability = class {
|
|
|
584
593
|
config
|
|
585
594
|
}, {
|
|
586
595
|
F: __dxlog_file3,
|
|
587
|
-
L:
|
|
596
|
+
L: 146,
|
|
588
597
|
S: this,
|
|
589
598
|
C: (f, a) => f(...a)
|
|
590
599
|
});
|
|
@@ -640,7 +649,7 @@ var Observability = class {
|
|
|
640
649
|
idqr
|
|
641
650
|
}, {
|
|
642
651
|
F: __dxlog_file3,
|
|
643
|
-
L:
|
|
652
|
+
L: 209,
|
|
644
653
|
S: this,
|
|
645
654
|
C: (f, a) => f(...a)
|
|
646
655
|
});
|
|
@@ -654,7 +663,7 @@ var Observability = class {
|
|
|
654
663
|
device: dqr
|
|
655
664
|
}, {
|
|
656
665
|
F: __dxlog_file3,
|
|
657
|
-
L:
|
|
666
|
+
L: 218,
|
|
658
667
|
S: this,
|
|
659
668
|
C: (f, a) => f(...a)
|
|
660
669
|
});
|
|
@@ -662,7 +671,7 @@ var Observability = class {
|
|
|
662
671
|
}
|
|
663
672
|
(0, import_invariant.invariant)(dqr, "empty response from device service", {
|
|
664
673
|
F: __dxlog_file3,
|
|
665
|
-
L:
|
|
674
|
+
L: 221,
|
|
666
675
|
S: this,
|
|
667
676
|
A: [
|
|
668
677
|
"dqr",
|
|
@@ -675,7 +684,7 @@ var Observability = class {
|
|
|
675
684
|
device: dqr
|
|
676
685
|
}, {
|
|
677
686
|
F: __dxlog_file3,
|
|
678
|
-
L:
|
|
687
|
+
L: 225,
|
|
679
688
|
S: this,
|
|
680
689
|
C: (f, a) => f(...a)
|
|
681
690
|
});
|
|
@@ -707,7 +716,7 @@ var Observability = class {
|
|
|
707
716
|
} else {
|
|
708
717
|
(0, import_log.log)("datadog disabled", void 0, {
|
|
709
718
|
F: __dxlog_file3,
|
|
710
|
-
L:
|
|
719
|
+
L: 256,
|
|
711
720
|
S: this,
|
|
712
721
|
C: (f, a) => f(...a)
|
|
713
722
|
});
|
|
@@ -727,7 +736,7 @@ var Observability = class {
|
|
|
727
736
|
updateSignalMetrics.on(this._ctx, async () => {
|
|
728
737
|
(0, import_log.log)("send signal metrics", void 0, {
|
|
729
738
|
F: __dxlog_file3,
|
|
730
|
-
L:
|
|
739
|
+
L: 275,
|
|
731
740
|
S: this,
|
|
732
741
|
C: (f, a) => f(...a)
|
|
733
742
|
});
|
|
@@ -777,9 +786,9 @@ var Observability = class {
|
|
|
777
786
|
this._ctx.onDispose(() => subscriptions.forEach((subscription) => subscription.unsubscribe()));
|
|
778
787
|
const updateSpaceMetrics = new import_async.Event().debounce(SPACE_METRICS_MIN_INTERVAL);
|
|
779
788
|
updateSpaceMetrics.on(this._ctx, async () => {
|
|
780
|
-
(0, import_log.log)("send space
|
|
789
|
+
(0, import_log.log)("send space metrics", void 0, {
|
|
781
790
|
F: __dxlog_file3,
|
|
782
|
-
L:
|
|
791
|
+
L: 329,
|
|
783
792
|
S: this,
|
|
784
793
|
C: (f, a) => f(...a)
|
|
785
794
|
});
|
|
@@ -798,6 +807,19 @@ var Observability = class {
|
|
|
798
807
|
this.gauge("dxos.client.space.currentDataMutations", data.currentDataMutations, {
|
|
799
808
|
key: data.key
|
|
800
809
|
});
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
const updateSpaceTelemetry = new import_async.Event().debounce(SPACE_TELEMETRY_MIN_INTERVAL);
|
|
813
|
+
updateSpaceTelemetry.on(this._ctx, async () => {
|
|
814
|
+
(0, import_log.log)("send space telemetry", void 0, {
|
|
815
|
+
F: __dxlog_file3,
|
|
816
|
+
L: 340,
|
|
817
|
+
S: this,
|
|
818
|
+
C: (f, a) => f(...a)
|
|
819
|
+
});
|
|
820
|
+
for (const data of mapSpaces(spaces, {
|
|
821
|
+
truncateKeys: true
|
|
822
|
+
})) {
|
|
801
823
|
this.event({
|
|
802
824
|
identityId: getTelemetryIdentifier(client),
|
|
803
825
|
name: `${namespace}.space.update`,
|
|
@@ -808,6 +830,7 @@ var Observability = class {
|
|
|
808
830
|
const subscribeToSpaceUpdate = (space) => space.pipeline.subscribe({
|
|
809
831
|
next: () => {
|
|
810
832
|
updateSpaceMetrics.emit();
|
|
833
|
+
updateSpaceTelemetry.emit();
|
|
811
834
|
}
|
|
812
835
|
});
|
|
813
836
|
spaces.forEach((space) => {
|
|
@@ -826,7 +849,7 @@ var Observability = class {
|
|
|
826
849
|
const platform = await client.services.services.SystemService?.getPlatform();
|
|
827
850
|
(0, import_invariant.invariant)(platform, "platform is required", {
|
|
828
851
|
F: __dxlog_file3,
|
|
829
|
-
L:
|
|
852
|
+
L: 377,
|
|
830
853
|
S: this,
|
|
831
854
|
A: [
|
|
832
855
|
"platform",
|
|
@@ -848,7 +871,7 @@ var Observability = class {
|
|
|
848
871
|
(0, import_async.scheduleTaskInterval)(this._ctx, async () => {
|
|
849
872
|
(0, import_log.log)("platform", void 0, {
|
|
850
873
|
F: __dxlog_file3,
|
|
851
|
-
L:
|
|
874
|
+
L: 396,
|
|
852
875
|
S: this,
|
|
853
876
|
C: (f, a) => f(...a)
|
|
854
877
|
});
|
|
@@ -857,7 +880,7 @@ var Observability = class {
|
|
|
857
880
|
platform: platform2
|
|
858
881
|
}, {
|
|
859
882
|
F: __dxlog_file3,
|
|
860
|
-
L:
|
|
883
|
+
L: 399,
|
|
861
884
|
S: this,
|
|
862
885
|
C: (f, a) => f(...a)
|
|
863
886
|
});
|
|
@@ -870,7 +893,7 @@ var Observability = class {
|
|
|
870
893
|
error
|
|
871
894
|
}, {
|
|
872
895
|
F: __dxlog_file3,
|
|
873
|
-
L:
|
|
896
|
+
L: 406,
|
|
874
897
|
S: this,
|
|
875
898
|
C: (f, a) => f(...a)
|
|
876
899
|
}));
|
|
@@ -895,7 +918,7 @@ var Observability = class {
|
|
|
895
918
|
} else {
|
|
896
919
|
(0, import_log.log)("segment disabled", void 0, {
|
|
897
920
|
F: __dxlog_file3,
|
|
898
|
-
L:
|
|
921
|
+
L: 432,
|
|
899
922
|
S: this,
|
|
900
923
|
C: (f, a) => f(...a)
|
|
901
924
|
});
|
|
@@ -931,7 +954,7 @@ var Observability = class {
|
|
|
931
954
|
options: this._errorReportingOptions
|
|
932
955
|
}, {
|
|
933
956
|
F: __dxlog_file3,
|
|
934
|
-
L:
|
|
957
|
+
L: 467,
|
|
935
958
|
S: this,
|
|
936
959
|
C: (f, a) => f(...a)
|
|
937
960
|
});
|
|
@@ -951,7 +974,7 @@ var Observability = class {
|
|
|
951
974
|
} else {
|
|
952
975
|
(0, import_log.log)("sentry disabled", void 0, {
|
|
953
976
|
F: __dxlog_file3,
|
|
954
|
-
L:
|
|
977
|
+
L: 490,
|
|
955
978
|
S: this,
|
|
956
979
|
C: (f, a) => f(...a)
|
|
957
980
|
});
|
|
@@ -993,4 +1016,4 @@ var Observability = class {
|
|
|
993
1016
|
storeObservabilityDisabled,
|
|
994
1017
|
storeObservabilityGroup
|
|
995
1018
|
});
|
|
996
|
-
//# sourceMappingURL=chunk-
|
|
1019
|
+
//# sourceMappingURL=chunk-AUTP6TII.cjs.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", "../../../src/sentry/sentry-log-processor.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Event, scheduleTaskInterval } from '@dxos/async';\nimport { type Client, type Config } from '@dxos/client';\nimport { type Space } from '@dxos/client-protocol';\nimport { Context } from '@dxos/context';\nimport { invariant } from '@dxos/invariant';\nimport { log } 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 DatadogMetrics } from './datadog';\nimport { type IPData, getTelemetryIdentifier, mapSpaces } from './helpers';\nimport { type SegmentTelemetry, type EventOptions, type PageOptions } from './segment';\nimport { type InitOptions, type captureException as SentryCaptureException } from './sentry';\nimport { 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 DATADOG_API_KEY: string | null;\n DATADOG_APP_KEY: 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, Datadog, and Segment.\n */\nexport class Observability {\n // TODO(wittjosiah): Generic metrics interface.\n private _metrics?: DatadogMetrics;\n // TODO(wittjosiah): Generic telemetry interface.\n private _telemetryBatchSize: number;\n private _telemetry?: SegmentTelemetry;\n // TODO(wittjosiah): Generic error logging interface.\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 }\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 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.DATADOG_API_KEY && (mergedSecrets.DATADOG_API_KEY = process.env.DATADOG_API_KEY);\n process.env.DATADOG_APP_KEY && (mergedSecrets.DATADOG_APP_KEY = process.env.DATADOG_APP_KEY);\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 DATADOG_API_KEY: config?.get('runtime.app.env.DX_DATADOG_API_KEY'),\n DATADOG_APP_KEY: config?.get('runtime.app.env.DX_DATADOG_APP_KEY'),\n ...secrets,\n };\n }\n }\n\n async initialize() {\n await this._initMetrics();\n await this._initTelemetry();\n await this._initErrorLogs();\n }\n\n async close() {\n if (this._telemetry) {\n await this._telemetry.close();\n }\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(client: Client) {\n client.services.services.IdentityService!.queryIdentity().subscribe((idqr) => {\n if (!idqr?.identity?.identityKey) {\n log('empty response from identity service', { idqr });\n return;\n }\n\n this.setTag('identityKey', idqr.identity.identityKey.truncate());\n });\n\n client.services.services.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 // Metrics\n //\n\n private async _initMetrics() {\n if (this.enabled && this._secrets.DATADOG_API_KEY) {\n const { DatadogMetrics } = await import('./datadog');\n this._metrics = new DatadogMetrics({\n apiKey: this._secrets.DATADOG_API_KEY,\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 // TODO(nf): move/refactor from telemetryContext, needed to read CORS proxy\n config: this._config!,\n });\n } else {\n log('datadog disabled');\n }\n }\n\n /**\n * Gauge metric.\n *\n * The default implementation uses Datadog.\n */\n gauge(name: string, value: number | any, extraTags?: any) {\n this._metrics?.gauge(name, value, extraTags);\n }\n\n // TODO(nf): Refactor into ObservabilityExtensions.\n\n startNetworkMetrics(client: Client) {\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 client.services.services.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 identityId: 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.key.toHex(), subscribeToSpaceUpdate(space));\n });\n\n client.spaces.subscribe({\n next: async (spaces) => {\n spaces\n .filter((space) => !subscriptions.has(space.key.toHex()))\n .forEach((space) => {\n subscriptions.set(space.key.toHex(), 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 log('platform');\n client.services.services.SystemService?.getPlatform()\n .then((platform) => {\n log('platform', { platform });\n if (platform.memory) {\n this.gauge('dxos.client.runtime.rss', platform.memory.rss);\n this.gauge('dxos.client.runtime.heapTotal', platform.memory.heapTotal);\n this.gauge('dxos.client.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') {\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 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\n const logProcessor = new SentryLogProcessor();\n init({\n ...this._errorReportingOptions,\n destination: this._secrets.SENTRY_DESTINATION,\n scrubFilenames: this._mode !== 'full',\n onError: (event) => logProcessor.addLogBreadcrumbsTo(event),\n });\n\n // TODO(nf): set platform at instantiation? needed for node.\n log.runtimeConfig.processors.push(logProcessor.logProcessor);\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 /**\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 \"DATADOG_API_KEY\": null,\n \"DATADOG_APP_KEY\": null\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 = true,\n replayEnable = true,\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 replaySampleRate: 0.1,\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\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.identityKey.truncate();\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 identityId: 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 identityId: 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 identityId: 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 identityId: 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 identityId: 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", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Breadcrumb, SeverityLevel, Event } from '@sentry/types';\n\nimport { InvariantViolation } from '@dxos/invariant';\nimport { type LogConfig, type LogEntry, LogLevel, type LogProcessor, shouldLog } from '@dxos/log';\nimport { CircularBuffer, getDebugName } from '@dxos/util';\n\nimport { withScope, captureException, captureMessage } from './node';\n\nconst MAX_LOG_BREADCRUMBS = 80;\n\nexport class SentryLogProcessor {\n private _breadcrumbs = new CircularBuffer<Breadcrumb>(MAX_LOG_BREADCRUMBS);\n\n public readonly logProcessor: LogProcessor = (config: LogConfig, entry: LogEntry) => {\n const { level, meta, error } = entry;\n // Don't forward logs from remote sessions.\n if (!shouldLog(entry, config.captureFilters) || meta?.S?.remoteSessionId) {\n return;\n }\n if (entry.level !== LogLevel.WARN && entry.level !== LogLevel.ERROR) {\n return;\n }\n // TODO(nf): add rate limiting to avoid spamming Sentry/consuming excessive quota.\n withScope((scope) => {\n const severity = convertLevel(level);\n scope.setLevel(severity);\n scope.setContext('dxoslog', entry.context ?? null);\n if (meta) {\n scope.setTag('transaction', `${getRelativeFilename(meta.F)}:${meta.L}`);\n\n if (meta.S?.hostSessionId) {\n scope.setTags({\n service_host_issue: true,\n service_host_session: meta.S?.hostSessionId,\n });\n }\n\n if (!Number.isNaN(meta.S?.uptimeSeconds)) {\n scope.setExtra('uptime_seconds', meta.S?.uptimeSeconds);\n }\n }\n\n const extendedMessage = formatMessageForSentry(entry);\n let capturedError = error;\n if (capturedError == null && entry.level === LogLevel.ERROR) {\n capturedError = Object.values(entry.context ?? {}).find((v): v is Error => v instanceof Error);\n }\n if (capturedError) {\n if (capturedError instanceof InvariantViolation) {\n scope.setExtra('invariant_violation', true);\n }\n const isMessageDifferentFromStackTrace = error == null;\n if (isMessageDifferentFromStackTrace) {\n scope.setExtra('message', extendedMessage);\n }\n const eventId = captureException(capturedError);\n this._addBreadcrumb(eventId, extendedMessage, severity, entry.context);\n return;\n }\n\n scope.setFingerprint([entry.message]);\n const eventId = captureMessage(extendedMessage);\n this._addBreadcrumb(eventId, extendedMessage, severity, entry.context);\n });\n };\n\n public addLogBreadcrumbsTo(event: Event) {\n event.breadcrumbs ??= [];\n for (const breadcrumb of this._breadcrumbs) {\n event.breadcrumbs.push(breadcrumb);\n }\n event.breadcrumbs.sort((b1, b2) => {\n if (b1.timestamp === undefined || b2.timestamp === undefined) {\n return b1.timestamp === b2.timestamp ? 0 : b1.timestamp === undefined ? -1 : 1;\n }\n return b1.timestamp - b2.timestamp;\n });\n }\n\n private _addBreadcrumb(\n eventId: string,\n message: string,\n severity: SeverityLevel,\n context: { [key: string]: any } | undefined,\n ): void {\n const breadcrumb: Breadcrumb = {\n type: 'console',\n level: severity,\n event_id: eventId,\n category: 'log',\n message,\n data: context,\n timestamp: Math.floor(Date.now() / 1000),\n };\n const lastRecorded = this._breadcrumbs.getLast();\n if (lastRecorded && lastRecorded.message === breadcrumb.message) {\n const firstBreadcrumbData = lastRecorded.data?.firstBreadcrumbData ?? lastRecorded.data ?? {};\n const mergedBreadcrumbCount = Number.isNaN(lastRecorded.data?.mergedBreadcrumbCount)\n ? 1\n : Number(lastRecorded.data?.mergedBreadcrumbCount);\n lastRecorded.data = {\n mergedBreadcrumbCount: mergedBreadcrumbCount + 1,\n firstBreadcrumbData,\n lastBreadcrumbData: breadcrumb.data,\n };\n return;\n }\n this._breadcrumbs.push(breadcrumb);\n }\n}\n\nconst formatMessageForSentry = (entry: LogEntry) => {\n let scopePrefix: string | undefined;\n if (entry.meta?.S) {\n const scope = entry.meta?.S;\n scopePrefix = scope.name || getDebugName(scope);\n }\n if (scopePrefix == null) {\n return entry.message;\n }\n const workerPrefix = entry.meta?.S?.hostSessionId ? '[worker] ' : '';\n return `${workerPrefix}${scopePrefix} ${entry.message}`;\n};\n\nconst convertLevel = (level: LogLevel): SeverityLevel => {\n if (level === LogLevel.TRACE) {\n return 'debug';\n }\n if (level === LogLevel.WARN) {\n return 'warning';\n }\n return LogLevel[level].toLowerCase() as SeverityLevel;\n};\n\nconst getRelativeFilename = (filename: string) => {\n // TODO(burdon): Hack uses \"packages\" as an anchor (pre-parse NX?)\n // Including `packages/` part of the path so that excluded paths (e.g. from dist) are clickable in vscode.\n const match = filename.match(/.+\\/(packages\\/.+\\/.+)/);\n if (match) {\n const [, filePath] = match;\n return fil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,QAAA;;;;;;IACN;EACF;;;;;;EAOA0C,iBAAiB3C,KAAU;AACzB,QAAI,KAAKoQ,SAAS;AAChB,WAAKwG,oBAAoB5W,GAAAA;IAC3B;EACF;;;;;;EAOA0W,oBAAoBtN,MAAciO,OAAehN,SAAiB;AAIhE,SAAK,KAAKwM,uBAAuBzN,MAAMiO,OAAOhN,OAAAA;EAChD;AACF;",
|
|
6
|
+
"names": ["import_log", "import_invariant", "import_util", "OBSERVABILITY_DISABLED_KEY", "OBSERVABILITY_GROUP_KEY", "isObservabilityDisabled", "namespace", "getItem", "err", "log", "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", "ipData", "addIPDataTelemetryTags", "navigator", "storage", "estimate", "setInterval", "storageEstimate", "usage", "setTag", "toString", "quota", "error", "warn", "getTelemetryIdentifier", "client", "initialized", "identity", "halo", "identityKey", "truncate", "showObservabilityBanner", "configDir", "bannercb", "path", "join", "existsSync", "writeFile", "getObservabilityState", "statSync", "isDirectory", "Error", "mkdir", "recursive", "idPath", "context", "readFile", "validate", "initializeState", "observabilityState", "installationId", "uuid", "process", "env", "DX_OBSERVABILITY_GROUP", "DX_DISABLE_OBSERVABILITY", "DX_OBSERVABILITY_MODE", "yaml", "dump", "contextString", "load", "Boolean", "validateUuid", "initializeNodeObservability", "version", "DX_ENVIRONMENT", "mapSpaces", "spaces", "options", "verbose", "truncateKeys", "map", "space", "open", "ready", "internal", "metrics", "startup", "getTime", "pipeline", "startDataMutations", "currentEpoch", "subject", "assertion", "timeframe", "totalMessages", "epoch", "number", "currentDataMutations", "currentDataTimeframe", "totalDataMutations", "targetDataTimeframe", "key", "isOpen", "members", "length", "objects", "db", "coreDatabase", "getAllObjectIds", "progress", "Math", "min", "abs", "toFixed", "lastFocusEvent", "totalTime", "setupTelemetryListeners", "clickCallback", "event", "id", "target", "setTimeout", "identityId", "name", "properties", "href", "window", "location", "composedPath", "filter", "el", "tagName", "toLowerCase", "reverse", "focusCallback", "timeAway", "blurCallback", "timeSpent", "unloadCallback", "errorCallback", "message", "filename", "stack", "addEventListener", "removeEventListener", "MAX_LOG_BREADCRUMBS", "SentryLogProcessor", "_breadcrumbs", "CircularBuffer", "logProcessor", "entry", "level", "meta", "shouldLog", "captureFilters", "S", "remoteSessionId", "LogLevel", "WARN", "ERROR", "withScope", "scope", "severity", "convertLevel", "setLevel", "setContext", "getRelativeFilename", "F", "L", "hostSessionId", "setTags", "service_host_issue", "service_host_session", "Number", "isNaN", "uptimeSeconds", "setExtra", "extendedMessage", "formatMessageForSentry", "capturedError", "Object", "values", "find", "v", "InvariantViolation", "isMessageDifferentFromStackTrace", "eventId", "_addBreadcrumb", "setFingerprint", "captureMessage", "addLogBreadcrumbsTo", "breadcrumbs", "breadcrumb", "push", "sort", "b1", "b2", "type", "event_id", "category", "floor", "lastRecorded", "getLast", "firstBreadcrumbData", "mergedBreadcrumbCount", "lastBreadcrumbData", "scopePrefix", "getDebugName", "workerPrefix", "TRACE", "match", "filePath", "SPACE_METRICS_MIN_INTERVAL", "SPACE_TELEMETRY_MIN_INTERVAL", "NETWORK_METRICS_MIN_INTERVAL", "constructor", "secrets", "telemetry", "Context", "_tags", "Map", "city", "region", "country", "latitude", "longitude", "_namespace", "_mode", "_config", "_group", "_secrets", "_loadSecrets", "_telemetryBatchSize", "batchSize", "_errorReportingOptions", "enabled", "isNode", "mergedSecrets", "buildSecrets", "DX_RELEASE", "SENTRY_DESTINATION", "TELEMETRY_API_KEY", "DATADOG_API_KEY", "DATADOG_APP_KEY", "rtc", "_initMetrics", "_initTelemetry", "_initErrorLogs", "close", "_telemetry", "_ctx", "dispose", "_setTag", "set", "getTag", "setIdentityTags", "services", "IdentityService", "queryIdentity", "subscribe", "idqr", "DevicesService", "queryDevices", "dqr", "devices", "device", "invariant", "thisDevice", "kind", "DeviceKind", "CURRENT", "deviceKey", "profile", "label", "DatadogMetrics", "_metrics", "apiKey", "getTags", "fromEntries", "Array", "from", "gauge", "extraTags", "startNetworkMetrics", "updateSignalMetrics", "Event", "debounce", "on", "_lastNetworkStatus", "signaling", "forEach", "server", "state", "swarmCount", "connectionStates", "ConnectionState", "totalReadBufferSize", "totalWriteBufferSize", "totalChannelBufferSize", "connectionInfo", "conn", "connections", "readBufferSize", "writeBufferSize", "stream", "streams", "NetworkService", "queryStatus", "networkStatus", "emit", "scheduleTaskInterval", "startSpacesMetrics", "subscriptions", "onDispose", "subscription", "unsubscribe", "updateSpaceMetrics", "updateSpaceTelemetry", "subscribeToSpaceUpdate", "next", "toHex", "has", "startRuntimeMetrics", "frequency", "platform", "SystemService", "getPlatform", "Platform", "PLATFORM_TYPE", "arch", "runtime", "memory", "rss", "heapTotal", "heapUsed", "SegmentTelemetry", "page", "captureUserFeedback", "init", "_captureException", "_captureUserFeedback", "dest", "destination", "scrubFilenames", "onError", "runtimeConfig", "processors", "k", "email"]
|
|
7
|
+
}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -18,23 +18,23 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var node_exports = {};
|
|
20
20
|
__export(node_exports, {
|
|
21
|
-
OBSERVABILITY_DISABLED_KEY: () =>
|
|
22
|
-
OBSERVABILITY_GROUP_KEY: () =>
|
|
23
|
-
Observability: () =>
|
|
24
|
-
getObservabilityGroup: () =>
|
|
25
|
-
getObservabilityState: () =>
|
|
26
|
-
getTelemetryIdentifier: () =>
|
|
27
|
-
initializeAppObservability: () =>
|
|
28
|
-
initializeNodeObservability: () =>
|
|
29
|
-
isObservabilityDisabled: () =>
|
|
30
|
-
mapSpaces: () =>
|
|
31
|
-
setupTelemetryListeners: () =>
|
|
32
|
-
showObservabilityBanner: () =>
|
|
33
|
-
storeObservabilityDisabled: () =>
|
|
34
|
-
storeObservabilityGroup: () =>
|
|
21
|
+
OBSERVABILITY_DISABLED_KEY: () => import_chunk_AUTP6TII.OBSERVABILITY_DISABLED_KEY,
|
|
22
|
+
OBSERVABILITY_GROUP_KEY: () => import_chunk_AUTP6TII.OBSERVABILITY_GROUP_KEY,
|
|
23
|
+
Observability: () => import_chunk_AUTP6TII.Observability,
|
|
24
|
+
getObservabilityGroup: () => import_chunk_AUTP6TII.getObservabilityGroup,
|
|
25
|
+
getObservabilityState: () => import_chunk_AUTP6TII.getObservabilityState,
|
|
26
|
+
getTelemetryIdentifier: () => import_chunk_AUTP6TII.getTelemetryIdentifier,
|
|
27
|
+
initializeAppObservability: () => import_chunk_AUTP6TII.initializeAppObservability,
|
|
28
|
+
initializeNodeObservability: () => import_chunk_AUTP6TII.initializeNodeObservability,
|
|
29
|
+
isObservabilityDisabled: () => import_chunk_AUTP6TII.isObservabilityDisabled,
|
|
30
|
+
mapSpaces: () => import_chunk_AUTP6TII.mapSpaces,
|
|
31
|
+
setupTelemetryListeners: () => import_chunk_AUTP6TII.setupTelemetryListeners,
|
|
32
|
+
showObservabilityBanner: () => import_chunk_AUTP6TII.showObservabilityBanner,
|
|
33
|
+
storeObservabilityDisabled: () => import_chunk_AUTP6TII.storeObservabilityDisabled,
|
|
34
|
+
storeObservabilityGroup: () => import_chunk_AUTP6TII.storeObservabilityGroup
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(node_exports);
|
|
37
|
-
var
|
|
37
|
+
var import_chunk_AUTP6TII = require("./chunk-AUTP6TII.cjs");
|
|
38
38
|
var import_chunk_HKBUNAUG = require("./chunk-HKBUNAUG.cjs");
|
|
39
39
|
// Annotate the CommonJS export names for ESM import in node:
|
|
40
40
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n OBSERVABILITY_DISABLED_KEY,\n OBSERVABILITY_GROUP_KEY,\n Observability,\n getObservabilityGroup,\n getObservabilityState,\n getTelemetryIdentifier,\n initializeAppObservability,\n initializeNodeObservability,\n isObservabilityDisabled,\n mapSpaces,\n setupTelemetryListeners,\n showObservabilityBanner,\n storeObservabilityDisabled,\n storeObservabilityGroup\n} from \"./chunk-
|
|
4
|
+
"sourcesContent": ["import {\n OBSERVABILITY_DISABLED_KEY,\n OBSERVABILITY_GROUP_KEY,\n Observability,\n getObservabilityGroup,\n getObservabilityState,\n getTelemetryIdentifier,\n initializeAppObservability,\n initializeNodeObservability,\n isObservabilityDisabled,\n mapSpaces,\n setupTelemetryListeners,\n showObservabilityBanner,\n storeObservabilityDisabled,\n storeObservabilityGroup\n} from \"./chunk-AUTP6TII.cjs\";\nimport \"./chunk-HKBUNAUG.cjs\";\nexport {\n OBSERVABILITY_DISABLED_KEY,\n OBSERVABILITY_GROUP_KEY,\n Observability,\n getObservabilityGroup,\n getObservabilityState,\n getTelemetryIdentifier,\n initializeAppObservability,\n initializeNodeObservability,\n isObservabilityDisabled,\n mapSpaces,\n setupTelemetryListeners,\n showObservabilityBanner,\n storeObservabilityDisabled,\n storeObservabilityGroup\n};\n//# sourceMappingURL=index.cjs.map\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAeO;AACP,4BAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/sdk/observability/src/datadog/node.ts":{"bytes":1741,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/observability/src/datadog/metrics.ts":{"bytes":4778,"imports":[{"path":"datadog-metrics","kind":"import-statement","external":true},{"path":"debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/datadog/node.ts","kind":"import-statement","original":"./node"}],"format":"esm"},"packages/sdk/observability/src/datadog/index.ts":{"bytes":585,"imports":[{"path":"packages/sdk/observability/src/datadog/node.ts","kind":"import-statement","original":"./node"},{"path":"packages/sdk/observability/src/datadog/metrics.ts","kind":"import-statement","original":"./metrics"}],"format":"esm"},"packages/sdk/observability/src/cli-observability-secrets.json":{"bytes":315,"imports":[]},"packages/sdk/observability/src/sentry/node.ts":{"bytes":14071,"imports":[{"path":"@sentry/node","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@sentry/node","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/observability/src/sentry/sentry-log-processor.ts":{"bytes":17662,"imports":[{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/sentry/node.ts","kind":"import-statement","original":"./node"}],"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/node.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/node.ts":{"bytes":9871,"imports":[{"path":"@segment/analytics-node","kind":"import-statement","external":true},{"path":"@dxos/invariant","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/node.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/observability.ts":{"bytes":60749,"imports":[{"path":"@dxos/async","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/sentry/sentry-log-processor.ts","kind":"import-statement","original":"./sentry/sentry-log-processor"},{"path":"packages/sdk/observability/src/datadog/index.ts","kind":"dynamic-import","original":"./datadog"},{"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"}],"format":"esm"},"packages/sdk/observability/src/helpers/browser-observability.ts":{"bytes":19595,"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":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node: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":6438,"imports":[],"format":"esm"},"packages/sdk/observability/src/helpers/setup-telemetry-listeners.ts":{"bytes":11012,"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/node/datadog/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3062},"packages/sdk/observability/dist/lib/node/datadog/index.cjs":{"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"datadog-metrics","kind":"import-statement","external":true},{"path":"debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["DatadogMetrics","defaultOptions"],"entryPoint":"packages/sdk/observability/src/datadog/index.ts","inputs":{"packages/sdk/observability/src/datadog/node.ts":{"bytesInOutput":450},"packages/sdk/observability/src/datadog/index.ts":{"bytesInOutput":0},"packages/sdk/observability/src/datadog/metrics.ts":{"bytesInOutput":1149}},"bytes":1785},"packages/sdk/observability/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/node/index.cjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/node/chunk-JK37YWUB.cjs","kind":"import-statement"},{"path":"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs","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":840},"packages/sdk/observability/dist/lib/node/segment/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4166},"packages/sdk/observability/dist/lib/node/segment/index.cjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/node/chunk-GIYJMZEQ.cjs","kind":"import-statement"},{"path":"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs","kind":"import-statement"},{"path":"@segment/analytics-node","kind":"import-statement","external":true},{"path":"@dxos/invariant","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/node.ts":{"bytesInOutput":2875},"packages/sdk/observability/src/segment/index.ts":{"bytesInOutput":0}},"bytes":3084},"packages/sdk/observability/dist/lib/node/sentry/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/node/sentry/index.cjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/node/chunk-GIYJMZEQ.cjs","kind":"import-statement"},{"path":"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs","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/node/chunk-GIYJMZEQ.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/node/chunk-GIYJMZEQ.cjs":{"imports":[],"exports":[],"inputs":{"packages/sdk/observability/src/sentry/index.ts":{"bytesInOutput":0}},"bytes":44},"packages/sdk/observability/dist/lib/node/observability-VXJOCKID.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/node/observability-VXJOCKID.cjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/node/chunk-JK37YWUB.cjs","kind":"import-statement"},{"path":"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs","kind":"import-statement"}],"exports":["Observability"],"entryPoint":"packages/sdk/observability/src/observability.ts","inputs":{},"bytes":167},"packages/sdk/observability/dist/lib/node/chunk-JK37YWUB.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":64940},"packages/sdk/observability/dist/lib/node/chunk-JK37YWUB.cjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs","kind":"import-statement"},{"path":"@dxos/async","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/node/observability-VXJOCKID.cjs","kind":"dynamic-import"},{"path":"js-yaml","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"uuid","kind":"import-statement","external":true},{"path":"@dxos/log","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/dist/lib/node/datadog/index.cjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/node/segment/index.cjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/node/sentry/index.cjs","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":15202},"packages/sdk/observability/src/cli-observability-secrets.json":{"bytesInOutput":347},"packages/sdk/observability/src/helpers/browser-observability.ts":{"bytesInOutput":4772},"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":3415},"packages/sdk/observability/src/helpers/map-spaces.ts":{"bytesInOutput":1189},"packages/sdk/observability/src/helpers/setup-telemetry-listeners.ts":{"bytesInOutput":2580},"packages/sdk/observability/src/sentry/sentry-log-processor.ts":{"bytesInOutput":4078}},"bytes":32871},"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6690},"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs":{"imports":[{"path":"@sentry/node","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@sentry/node","kind":"import-statement","external":true}],"exports":["addBreadcrumb","captureException","captureMessage","captureUserFeedback","init","setTag","setTags","setUser","withScope"],"inputs":{"packages/sdk/observability/src/sentry/node.ts":{"bytesInOutput":3389}},"bytes":3636}}}
|
|
1
|
+
{"inputs":{"packages/sdk/observability/src/datadog/node.ts":{"bytes":1741,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/observability/src/datadog/metrics.ts":{"bytes":4778,"imports":[{"path":"datadog-metrics","kind":"import-statement","external":true},{"path":"debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/sdk/observability/src/datadog/node.ts","kind":"import-statement","original":"./node"}],"format":"esm"},"packages/sdk/observability/src/datadog/index.ts":{"bytes":585,"imports":[{"path":"packages/sdk/observability/src/datadog/node.ts","kind":"import-statement","original":"./node"},{"path":"packages/sdk/observability/src/datadog/metrics.ts","kind":"import-statement","original":"./metrics"}],"format":"esm"},"packages/sdk/observability/src/cli-observability-secrets.json":{"bytes":315,"imports":[]},"packages/sdk/observability/src/sentry/node.ts":{"bytes":14071,"imports":[{"path":"@sentry/node","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@sentry/node","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/observability/src/sentry/sentry-log-processor.ts":{"bytes":18274,"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/node.ts","kind":"import-statement","original":"./node"}],"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/node.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/node.ts":{"bytes":9871,"imports":[{"path":"@segment/analytics-node","kind":"import-statement","external":true},{"path":"@dxos/invariant","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/node.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/observability.ts":{"bytes":62175,"imports":[{"path":"@dxos/async","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/sentry/sentry-log-processor.ts","kind":"import-statement","original":"./sentry/sentry-log-processor"},{"path":"packages/sdk/observability/src/datadog/index.ts","kind":"dynamic-import","original":"./datadog"},{"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"}],"format":"esm"},"packages/sdk/observability/src/helpers/browser-observability.ts":{"bytes":19595,"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":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node: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":11391,"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/node/datadog/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3062},"packages/sdk/observability/dist/lib/node/datadog/index.cjs":{"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"datadog-metrics","kind":"import-statement","external":true},{"path":"debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["DatadogMetrics","defaultOptions"],"entryPoint":"packages/sdk/observability/src/datadog/index.ts","inputs":{"packages/sdk/observability/src/datadog/node.ts":{"bytesInOutput":450},"packages/sdk/observability/src/datadog/index.ts":{"bytesInOutput":0},"packages/sdk/observability/src/datadog/metrics.ts":{"bytesInOutput":1149}},"bytes":1785},"packages/sdk/observability/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/node/index.cjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/node/chunk-AUTP6TII.cjs","kind":"import-statement"},{"path":"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs","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":840},"packages/sdk/observability/dist/lib/node/segment/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4166},"packages/sdk/observability/dist/lib/node/segment/index.cjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/node/chunk-GIYJMZEQ.cjs","kind":"import-statement"},{"path":"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs","kind":"import-statement"},{"path":"@segment/analytics-node","kind":"import-statement","external":true},{"path":"@dxos/invariant","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/node.ts":{"bytesInOutput":2875},"packages/sdk/observability/src/segment/index.ts":{"bytesInOutput":0}},"bytes":3084},"packages/sdk/observability/dist/lib/node/sentry/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/node/sentry/index.cjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/node/chunk-GIYJMZEQ.cjs","kind":"import-statement"},{"path":"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs","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/node/chunk-GIYJMZEQ.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/node/chunk-GIYJMZEQ.cjs":{"imports":[],"exports":[],"inputs":{"packages/sdk/observability/src/sentry/index.ts":{"bytesInOutput":0}},"bytes":44},"packages/sdk/observability/dist/lib/node/observability-LPC6KPIO.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/observability/dist/lib/node/observability-LPC6KPIO.cjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/node/chunk-AUTP6TII.cjs","kind":"import-statement"},{"path":"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs","kind":"import-statement"}],"exports":["Observability"],"entryPoint":"packages/sdk/observability/src/observability.ts","inputs":{},"bytes":167},"packages/sdk/observability/dist/lib/node/chunk-AUTP6TII.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":66106},"packages/sdk/observability/dist/lib/node/chunk-AUTP6TII.cjs":{"imports":[{"path":"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs","kind":"import-statement"},{"path":"@dxos/async","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/node/observability-LPC6KPIO.cjs","kind":"dynamic-import"},{"path":"js-yaml","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"uuid","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"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/dist/lib/node/datadog/index.cjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/node/segment/index.cjs","kind":"dynamic-import"},{"path":"packages/sdk/observability/dist/lib/node/sentry/index.cjs","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":15671},"packages/sdk/observability/src/cli-observability-secrets.json":{"bytesInOutput":347},"packages/sdk/observability/src/helpers/browser-observability.ts":{"bytesInOutput":4772},"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":3415},"packages/sdk/observability/src/helpers/map-spaces.ts":{"bytesInOutput":1192},"packages/sdk/observability/src/helpers/setup-telemetry-listeners.ts":{"bytesInOutput":2657},"packages/sdk/observability/src/sentry/sentry-log-processor.ts":{"bytesInOutput":4262}},"bytes":33604},"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6690},"packages/sdk/observability/dist/lib/node/chunk-HKBUNAUG.cjs":{"imports":[{"path":"@sentry/node","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/tracing","kind":"import-statement","external":true},{"path":"@sentry/node","kind":"import-statement","external":true}],"exports":["addBreadcrumb","captureException","captureMessage","captureUserFeedback","init","setTag","setTags","setUser","withScope"],"inputs":{"packages/sdk/observability/src/sentry/node.ts":{"bytesInOutput":3389}},"bytes":3636}}}
|
|
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
Observability: () =>
|
|
19
|
+
var observability_LPC6KPIO_exports = {};
|
|
20
|
+
__export(observability_LPC6KPIO_exports, {
|
|
21
|
+
Observability: () => import_chunk_AUTP6TII.Observability
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(observability_LPC6KPIO_exports);
|
|
24
|
+
var import_chunk_AUTP6TII = require("./chunk-AUTP6TII.cjs");
|
|
25
25
|
var import_chunk_HKBUNAUG = require("./chunk-HKBUNAUG.cjs");
|
|
26
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
27
|
0 && (module.exports = {
|
|
28
28
|
Observability
|
|
29
29
|
});
|
|
30
|
-
//# sourceMappingURL=observability-
|
|
30
|
+
//# sourceMappingURL=observability-LPC6KPIO.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["observability-
|
|
4
|
-
"sourcesContent": ["import {\n Observability\n} from \"./chunk-
|
|
3
|
+
"sources": ["observability-LPC6KPIO.cjs"],
|
|
4
|
+
"sourcesContent": ["import {\n Observability\n} from \"./chunk-AUTP6TII.cjs\";\nimport \"./chunk-HKBUNAUG.cjs\";\nexport {\n Observability\n};\n//# sourceMappingURL=observability-LPC6KPIO.cjs.map\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAEO;AACP,4BAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|