@aztec/telemetry-client 3.0.0-nightly.20251211 → 3.0.0-nightly.20251213
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/dest/start.d.ts +2 -2
- package/dest/start.d.ts.map +1 -1
- package/dest/start.js +3 -2
- package/package.json +5 -3
- package/src/start.ts +3 -2
package/dest/start.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TelemetryClientConfig } from './config.js';
|
|
2
2
|
import type { TelemetryClient } from './telemetry.js';
|
|
3
3
|
export * from './config.js';
|
|
4
|
-
export declare function initTelemetryClient(config: TelemetryClientConfig): TelemetryClient
|
|
4
|
+
export declare function initTelemetryClient(config: TelemetryClientConfig): Promise<TelemetryClient>;
|
|
5
5
|
export declare function getTelemetryClient(): TelemetryClient;
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhcnQuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9zdGFydC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEtBQUssRUFBRSxxQkFBcUIsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUV6RCxPQUFPLEtBQUssRUFBRSxlQUFlLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUV0RCxjQUFjLGFBQWEsQ0FBQztBQUs1Qix3QkFBc0IsbUJBQW1CLENBQUMsTUFBTSxFQUFFLHFCQUFxQixHQUFHLE9BQU8sQ0FBQyxlQUFlLENBQUMsQ0FrQmpHO0FBRUQsd0JBQWdCLGtCQUFrQixJQUFJLGVBQWUsQ0FFcEQifQ==
|
package/dest/start.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,cAAc,aAAa,CAAC;AAK5B,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAkBjG;AAED,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD"}
|
package/dest/start.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import { NoopTelemetryClient } from './noop.js';
|
|
3
|
-
import { OpenTelemetryClient } from './otel.js';
|
|
4
3
|
export * from './config.js';
|
|
5
4
|
let initialized = false;
|
|
6
5
|
let telemetry = new NoopTelemetryClient();
|
|
7
|
-
export function initTelemetryClient(config) {
|
|
6
|
+
export async function initTelemetryClient(config) {
|
|
8
7
|
const log = createLogger('telemetry:client');
|
|
9
8
|
if (initialized) {
|
|
10
9
|
log.warn('Telemetry client has already been initialized once');
|
|
@@ -12,6 +11,8 @@ export function initTelemetryClient(config) {
|
|
|
12
11
|
}
|
|
13
12
|
if (config.metricsCollectorUrl || config.publicMetricsCollectorUrl) {
|
|
14
13
|
log.info(`Using OpenTelemetry client with custom collector`);
|
|
14
|
+
// Lazy load OpenTelemetry to avoid loading heavy deps at startup
|
|
15
|
+
const { OpenTelemetryClient } = await import('./otel.js');
|
|
15
16
|
telemetry = OpenTelemetryClient.createAndStart(config, log);
|
|
16
17
|
} else {
|
|
17
18
|
log.info('Using NoopTelemetryClient');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/telemetry-client",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251213",
|
|
4
4
|
"inherits": [
|
|
5
5
|
"../package.common.json"
|
|
6
6
|
],
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": "./dest/index.js",
|
|
10
10
|
"./bench": "./dest/bench.js",
|
|
11
|
+
"./config": "./dest/config.js",
|
|
12
|
+
"./start": "./dest/start.js",
|
|
11
13
|
"./otel-pino-stream": "./dest/vendor/otel-pino-stream.js"
|
|
12
14
|
},
|
|
13
15
|
"scripts": {
|
|
@@ -25,8 +27,8 @@
|
|
|
25
27
|
"!*.test.*"
|
|
26
28
|
],
|
|
27
29
|
"dependencies": {
|
|
28
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
29
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
30
|
+
"@aztec/foundation": "3.0.0-nightly.20251213",
|
|
31
|
+
"@aztec/stdlib": "3.0.0-nightly.20251213",
|
|
30
32
|
"@opentelemetry/api": "^1.9.0",
|
|
31
33
|
"@opentelemetry/api-logs": "^0.55.0",
|
|
32
34
|
"@opentelemetry/core": "^1.28.0",
|
package/src/start.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
2
2
|
|
|
3
3
|
import type { TelemetryClientConfig } from './config.js';
|
|
4
4
|
import { NoopTelemetryClient } from './noop.js';
|
|
5
|
-
import { OpenTelemetryClient } from './otel.js';
|
|
6
5
|
import type { TelemetryClient } from './telemetry.js';
|
|
7
6
|
|
|
8
7
|
export * from './config.js';
|
|
@@ -10,7 +9,7 @@ export * from './config.js';
|
|
|
10
9
|
let initialized = false;
|
|
11
10
|
let telemetry: TelemetryClient = new NoopTelemetryClient();
|
|
12
11
|
|
|
13
|
-
export function initTelemetryClient(config: TelemetryClientConfig): TelemetryClient {
|
|
12
|
+
export async function initTelemetryClient(config: TelemetryClientConfig): Promise<TelemetryClient> {
|
|
14
13
|
const log = createLogger('telemetry:client');
|
|
15
14
|
if (initialized) {
|
|
16
15
|
log.warn('Telemetry client has already been initialized once');
|
|
@@ -19,6 +18,8 @@ export function initTelemetryClient(config: TelemetryClientConfig): TelemetryCli
|
|
|
19
18
|
|
|
20
19
|
if (config.metricsCollectorUrl || config.publicMetricsCollectorUrl) {
|
|
21
20
|
log.info(`Using OpenTelemetry client with custom collector`);
|
|
21
|
+
// Lazy load OpenTelemetry to avoid loading heavy deps at startup
|
|
22
|
+
const { OpenTelemetryClient } = await import('./otel.js');
|
|
22
23
|
telemetry = OpenTelemetryClient.createAndStart(config, log);
|
|
23
24
|
} else {
|
|
24
25
|
log.info('Using NoopTelemetryClient');
|