@aztec/telemetry-client 0.0.1-commit.c31f2472 → 0.0.1-commit.c52d6e7
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/attributes.d.ts +17 -2
- package/dest/attributes.d.ts.map +1 -1
- package/dest/attributes.js +8 -1
- package/dest/config.d.ts +3 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +17 -9
- package/dest/lmdb_metrics.d.ts +2 -2
- package/dest/lmdb_metrics.d.ts.map +1 -1
- package/dest/metrics.d.ts +78 -5
- package/dest/metrics.d.ts.map +1 -1
- package/dest/metrics.js +414 -19
- package/dest/monitored_batch_span_processor.d.ts +29 -0
- package/dest/monitored_batch_span_processor.d.ts.map +1 -0
- package/dest/monitored_batch_span_processor.js +75 -0
- package/dest/otel.d.ts +6 -1
- package/dest/otel.d.ts.map +1 -1
- package/dest/otel.js +99 -4
- package/dest/otel_propagation.d.ts +3 -1
- package/dest/otel_propagation.d.ts.map +1 -1
- package/dest/otel_propagation.js +49 -1
- package/dest/otel_resource.d.ts +1 -1
- package/dest/otel_resource.d.ts.map +1 -1
- package/dest/otel_resource.js +14 -2
- package/dest/start.d.ts +1 -1
- package/dest/start.d.ts.map +1 -1
- package/dest/start.js +1 -1
- package/dest/telemetry.d.ts +2 -2
- package/dest/telemetry.d.ts.map +1 -1
- package/dest/wrappers/fetch.d.ts +3 -3
- package/dest/wrappers/fetch.d.ts.map +1 -1
- package/dest/wrappers/fetch.js +3 -2
- package/dest/wrappers/index.d.ts +1 -2
- package/dest/wrappers/index.d.ts.map +1 -1
- package/dest/wrappers/index.js +0 -1
- package/package.json +3 -3
- package/src/attributes.ts +21 -1
- package/src/config.ts +24 -9
- package/src/metrics.ts +435 -19
- package/src/monitored_batch_span_processor.ts +100 -0
- package/src/otel.ts +69 -3
- package/src/otel_propagation.ts +42 -1
- package/src/otel_resource.ts +19 -2
- package/src/start.ts +6 -1
- package/src/telemetry.ts +0 -1
- package/src/wrappers/fetch.ts +9 -3
- package/src/wrappers/index.ts +0 -1
- package/dest/wrappers/l2_block_stream.d.ts +0 -16
- package/dest/wrappers/l2_block_stream.d.ts.map +0 -1
- package/dest/wrappers/l2_block_stream.js +0 -400
- package/src/wrappers/l2_block_stream.ts +0 -41
package/src/config.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type ConfigMappingsType,
|
|
3
|
+
booleanConfigHelper,
|
|
4
|
+
getConfigFromMappings,
|
|
5
|
+
numberConfigHelper,
|
|
6
|
+
} from '@aztec/foundation/config';
|
|
2
7
|
|
|
3
8
|
export interface TelemetryClientConfig {
|
|
4
9
|
metricsCollectorUrl?: URL;
|
|
@@ -12,35 +17,35 @@ export interface TelemetryClientConfig {
|
|
|
12
17
|
otelExportTimeoutMs: number;
|
|
13
18
|
otelExcludeMetrics: string[];
|
|
14
19
|
otelIncludeMetrics: string[];
|
|
20
|
+
otelMinTraceDurationMs: number;
|
|
21
|
+
otelBspMaxQueueSize: number;
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
export const telemetryClientConfigMappings: ConfigMappingsType<TelemetryClientConfig> = {
|
|
18
25
|
metricsCollectorUrl: {
|
|
19
26
|
env: 'OTEL_EXPORTER_OTLP_METRICS_ENDPOINT',
|
|
20
27
|
description: 'The URL of the telemetry collector for metrics',
|
|
21
|
-
parseEnv: (val: string) =>
|
|
28
|
+
parseEnv: (val: string) => new URL(val),
|
|
22
29
|
},
|
|
23
30
|
tracesCollectorUrl: {
|
|
24
31
|
env: 'OTEL_EXPORTER_OTLP_TRACES_ENDPOINT',
|
|
25
32
|
description: 'The URL of the telemetry collector for traces',
|
|
26
|
-
parseEnv: (val: string) =>
|
|
33
|
+
parseEnv: (val: string) => new URL(val),
|
|
27
34
|
},
|
|
28
35
|
logsCollectorUrl: {
|
|
29
36
|
env: 'OTEL_EXPORTER_OTLP_LOGS_ENDPOINT',
|
|
30
37
|
description: 'The URL of the telemetry collector for logs',
|
|
31
|
-
parseEnv: (val: string) =>
|
|
38
|
+
parseEnv: (val: string) => new URL(val),
|
|
32
39
|
},
|
|
33
40
|
otelCollectIntervalMs: {
|
|
34
41
|
env: 'OTEL_COLLECT_INTERVAL_MS',
|
|
35
42
|
description: 'The interval at which to collect metrics',
|
|
36
|
-
|
|
37
|
-
parseEnv: (val: string) => parseInt(val),
|
|
43
|
+
...numberConfigHelper(60000),
|
|
38
44
|
},
|
|
39
45
|
otelExportTimeoutMs: {
|
|
40
46
|
env: 'OTEL_EXPORT_TIMEOUT_MS',
|
|
41
47
|
description: 'The timeout for exporting metrics',
|
|
42
|
-
|
|
43
|
-
parseEnv: (val: string) => parseInt(val),
|
|
48
|
+
...numberConfigHelper(30000),
|
|
44
49
|
},
|
|
45
50
|
otelExcludeMetrics: {
|
|
46
51
|
env: 'OTEL_EXCLUDE_METRICS',
|
|
@@ -54,6 +59,16 @@ export const telemetryClientConfigMappings: ConfigMappingsType<TelemetryClientCo
|
|
|
54
59
|
: [],
|
|
55
60
|
defaultValue: [],
|
|
56
61
|
},
|
|
62
|
+
otelMinTraceDurationMs: {
|
|
63
|
+
env: 'OTEL_MIN_TRACE_DURATION_MS',
|
|
64
|
+
description: 'The minimum successful trace duration to export in milliseconds. Set to 0 to export all traces.',
|
|
65
|
+
...numberConfigHelper(10),
|
|
66
|
+
},
|
|
67
|
+
otelBspMaxQueueSize: {
|
|
68
|
+
env: 'OTEL_BSP_MAX_QUEUE_SIZE',
|
|
69
|
+
description: 'The maximum number of completed spans to queue before export.',
|
|
70
|
+
...numberConfigHelper(16384),
|
|
71
|
+
},
|
|
57
72
|
otelIncludeMetrics: {
|
|
58
73
|
env: 'OTEL_INCLUDE_METRICS',
|
|
59
74
|
description: 'A list of metric prefixes to include in export (ignored if OTEL_EXCLUDE_METRICS is set)',
|
|
@@ -70,7 +85,7 @@ export const telemetryClientConfigMappings: ConfigMappingsType<TelemetryClientCo
|
|
|
70
85
|
publicMetricsCollectorUrl: {
|
|
71
86
|
env: 'PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT',
|
|
72
87
|
description: 'A URL to publish a subset of metrics for public consumption',
|
|
73
|
-
parseEnv: (val: string) =>
|
|
88
|
+
parseEnv: (val: string) => new URL(val),
|
|
74
89
|
},
|
|
75
90
|
publicMetricsCollectFrom: {
|
|
76
91
|
env: 'PUBLIC_OTEL_COLLECT_FROM',
|