@aztec/telemetry-client 4.0.0-nightly.20250907 → 4.0.0-nightly.20260108
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 +21 -1
- package/dest/attributes.d.ts.map +1 -1
- package/dest/attributes.js +11 -1
- package/dest/bench.d.ts +3 -1
- package/dest/bench.d.ts.map +1 -1
- package/dest/bench.js +6 -0
- package/dest/config.d.ts +2 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +7 -1
- package/dest/index.d.ts +1 -1
- package/dest/l1_metrics.d.ts +1 -1
- package/dest/l1_metrics.d.ts.map +1 -1
- package/dest/lmdb_metrics.d.ts +3 -3
- package/dest/lmdb_metrics.d.ts.map +1 -1
- package/dest/metrics.d.ts +44 -9
- package/dest/metrics.d.ts.map +1 -1
- package/dest/metrics.js +44 -8
- package/dest/nodejs_metrics_monitor.d.ts +1 -1
- package/dest/nodejs_metrics_monitor.d.ts.map +1 -1
- package/dest/nodejs_metrics_monitor.js +16 -9
- package/dest/noop.d.ts +4 -2
- package/dest/noop.d.ts.map +1 -1
- package/dest/noop.js +6 -0
- package/dest/otel.d.ts +4 -2
- package/dest/otel.d.ts.map +1 -1
- package/dest/otel.js +31 -3
- package/dest/otel_filter_metric_exporter.d.ts +1 -1
- package/dest/otel_filter_metric_exporter.d.ts.map +1 -1
- package/dest/otel_logger_provider.d.ts +1 -1
- package/dest/otel_propagation.d.ts +1 -1
- package/dest/otel_resource.d.ts +1 -1
- package/dest/otel_resource.js +2 -0
- package/dest/prom_otel_adapter.d.ts +1 -1
- package/dest/prom_otel_adapter.d.ts.map +1 -1
- package/dest/start.d.ts +2 -2
- package/dest/start.d.ts.map +1 -1
- package/dest/start.js +3 -2
- package/dest/telemetry.d.ts +18 -4
- package/dest/telemetry.d.ts.map +1 -1
- package/dest/telemetry.js +45 -23
- package/dest/vendor/attributes.d.ts +1 -1
- package/dest/vendor/otel-pino-stream.d.ts +1 -1
- package/dest/vendor/otel-pino-stream.d.ts.map +1 -1
- package/dest/with_tracer.d.ts +1 -1
- package/dest/with_tracer.d.ts.map +1 -1
- package/dest/wrappers/fetch.d.ts +2 -2
- package/dest/wrappers/fetch.d.ts.map +1 -1
- package/dest/wrappers/index.d.ts +1 -1
- package/dest/wrappers/json_rpc_server.d.ts +1 -1
- package/dest/wrappers/l2_block_stream.d.ts +3 -2
- package/dest/wrappers/l2_block_stream.d.ts.map +1 -1
- package/dest/wrappers/l2_block_stream.js +385 -11
- package/package.json +10 -7
- package/src/attributes.ts +26 -1
- package/src/bench.ts +8 -0
- package/src/config.ts +14 -1
- package/src/metrics.ts +53 -9
- package/src/nodejs_metrics_monitor.ts +19 -9
- package/src/noop.ts +16 -1
- package/src/otel.ts +36 -3
- package/src/otel_resource.ts +2 -0
- package/src/start.ts +3 -2
- package/src/telemetry.ts +84 -45
- package/src/wrappers/l2_block_stream.ts +2 -1
|
@@ -1,17 +1,396 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
function applyDecs2203RFactory() {
|
|
2
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
3
|
+
return function addInitializer(initializer) {
|
|
4
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
5
|
+
assertCallable(initializer, "An initializer");
|
|
6
|
+
initializers.push(initializer);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
10
|
+
var kindStr;
|
|
11
|
+
switch(kind){
|
|
12
|
+
case 1:
|
|
13
|
+
kindStr = "accessor";
|
|
14
|
+
break;
|
|
15
|
+
case 2:
|
|
16
|
+
kindStr = "method";
|
|
17
|
+
break;
|
|
18
|
+
case 3:
|
|
19
|
+
kindStr = "getter";
|
|
20
|
+
break;
|
|
21
|
+
case 4:
|
|
22
|
+
kindStr = "setter";
|
|
23
|
+
break;
|
|
24
|
+
default:
|
|
25
|
+
kindStr = "field";
|
|
26
|
+
}
|
|
27
|
+
var ctx = {
|
|
28
|
+
kind: kindStr,
|
|
29
|
+
name: isPrivate ? "#" + name : name,
|
|
30
|
+
static: isStatic,
|
|
31
|
+
private: isPrivate,
|
|
32
|
+
metadata: metadata
|
|
33
|
+
};
|
|
34
|
+
var decoratorFinishedRef = {
|
|
35
|
+
v: false
|
|
36
|
+
};
|
|
37
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
38
|
+
var get, set;
|
|
39
|
+
if (kind === 0) {
|
|
40
|
+
if (isPrivate) {
|
|
41
|
+
get = desc.get;
|
|
42
|
+
set = desc.set;
|
|
43
|
+
} else {
|
|
44
|
+
get = function() {
|
|
45
|
+
return this[name];
|
|
46
|
+
};
|
|
47
|
+
set = function(v) {
|
|
48
|
+
this[name] = v;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
} else if (kind === 2) {
|
|
52
|
+
get = function() {
|
|
53
|
+
return desc.value;
|
|
54
|
+
};
|
|
55
|
+
} else {
|
|
56
|
+
if (kind === 1 || kind === 3) {
|
|
57
|
+
get = function() {
|
|
58
|
+
return desc.get.call(this);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (kind === 1 || kind === 4) {
|
|
62
|
+
set = function(v) {
|
|
63
|
+
desc.set.call(this, v);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
ctx.access = get && set ? {
|
|
68
|
+
get: get,
|
|
69
|
+
set: set
|
|
70
|
+
} : get ? {
|
|
71
|
+
get: get
|
|
72
|
+
} : {
|
|
73
|
+
set: set
|
|
74
|
+
};
|
|
75
|
+
try {
|
|
76
|
+
return dec(value, ctx);
|
|
77
|
+
} finally{
|
|
78
|
+
decoratorFinishedRef.v = true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
82
|
+
if (decoratorFinishedRef.v) {
|
|
83
|
+
throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function assertCallable(fn, hint) {
|
|
87
|
+
if (typeof fn !== "function") {
|
|
88
|
+
throw new TypeError(hint + " must be a function");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function assertValidReturnValue(kind, value) {
|
|
92
|
+
var type = typeof value;
|
|
93
|
+
if (kind === 1) {
|
|
94
|
+
if (type !== "object" || value === null) {
|
|
95
|
+
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
96
|
+
}
|
|
97
|
+
if (value.get !== undefined) {
|
|
98
|
+
assertCallable(value.get, "accessor.get");
|
|
99
|
+
}
|
|
100
|
+
if (value.set !== undefined) {
|
|
101
|
+
assertCallable(value.set, "accessor.set");
|
|
102
|
+
}
|
|
103
|
+
if (value.init !== undefined) {
|
|
104
|
+
assertCallable(value.init, "accessor.init");
|
|
105
|
+
}
|
|
106
|
+
} else if (type !== "function") {
|
|
107
|
+
var hint;
|
|
108
|
+
if (kind === 0) {
|
|
109
|
+
hint = "field";
|
|
110
|
+
} else if (kind === 10) {
|
|
111
|
+
hint = "class";
|
|
112
|
+
} else {
|
|
113
|
+
hint = "method";
|
|
114
|
+
}
|
|
115
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
119
|
+
var decs = decInfo[0];
|
|
120
|
+
var desc, init, value;
|
|
121
|
+
if (isPrivate) {
|
|
122
|
+
if (kind === 0 || kind === 1) {
|
|
123
|
+
desc = {
|
|
124
|
+
get: decInfo[3],
|
|
125
|
+
set: decInfo[4]
|
|
126
|
+
};
|
|
127
|
+
} else if (kind === 3) {
|
|
128
|
+
desc = {
|
|
129
|
+
get: decInfo[3]
|
|
130
|
+
};
|
|
131
|
+
} else if (kind === 4) {
|
|
132
|
+
desc = {
|
|
133
|
+
set: decInfo[3]
|
|
134
|
+
};
|
|
135
|
+
} else {
|
|
136
|
+
desc = {
|
|
137
|
+
value: decInfo[3]
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
} else if (kind !== 0) {
|
|
141
|
+
desc = Object.getOwnPropertyDescriptor(base, name);
|
|
142
|
+
}
|
|
143
|
+
if (kind === 1) {
|
|
144
|
+
value = {
|
|
145
|
+
get: desc.get,
|
|
146
|
+
set: desc.set
|
|
147
|
+
};
|
|
148
|
+
} else if (kind === 2) {
|
|
149
|
+
value = desc.value;
|
|
150
|
+
} else if (kind === 3) {
|
|
151
|
+
value = desc.get;
|
|
152
|
+
} else if (kind === 4) {
|
|
153
|
+
value = desc.set;
|
|
154
|
+
}
|
|
155
|
+
var newValue, get, set;
|
|
156
|
+
if (typeof decs === "function") {
|
|
157
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
158
|
+
if (newValue !== void 0) {
|
|
159
|
+
assertValidReturnValue(kind, newValue);
|
|
160
|
+
if (kind === 0) {
|
|
161
|
+
init = newValue;
|
|
162
|
+
} else if (kind === 1) {
|
|
163
|
+
init = newValue.init;
|
|
164
|
+
get = newValue.get || value.get;
|
|
165
|
+
set = newValue.set || value.set;
|
|
166
|
+
value = {
|
|
167
|
+
get: get,
|
|
168
|
+
set: set
|
|
169
|
+
};
|
|
170
|
+
} else {
|
|
171
|
+
value = newValue;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
} else {
|
|
175
|
+
for(var i = decs.length - 1; i >= 0; i--){
|
|
176
|
+
var dec = decs[i];
|
|
177
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
178
|
+
if (newValue !== void 0) {
|
|
179
|
+
assertValidReturnValue(kind, newValue);
|
|
180
|
+
var newInit;
|
|
181
|
+
if (kind === 0) {
|
|
182
|
+
newInit = newValue;
|
|
183
|
+
} else if (kind === 1) {
|
|
184
|
+
newInit = newValue.init;
|
|
185
|
+
get = newValue.get || value.get;
|
|
186
|
+
set = newValue.set || value.set;
|
|
187
|
+
value = {
|
|
188
|
+
get: get,
|
|
189
|
+
set: set
|
|
190
|
+
};
|
|
191
|
+
} else {
|
|
192
|
+
value = newValue;
|
|
193
|
+
}
|
|
194
|
+
if (newInit !== void 0) {
|
|
195
|
+
if (init === void 0) {
|
|
196
|
+
init = newInit;
|
|
197
|
+
} else if (typeof init === "function") {
|
|
198
|
+
init = [
|
|
199
|
+
init,
|
|
200
|
+
newInit
|
|
201
|
+
];
|
|
202
|
+
} else {
|
|
203
|
+
init.push(newInit);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (kind === 0 || kind === 1) {
|
|
210
|
+
if (init === void 0) {
|
|
211
|
+
init = function(instance, init) {
|
|
212
|
+
return init;
|
|
213
|
+
};
|
|
214
|
+
} else if (typeof init !== "function") {
|
|
215
|
+
var ownInitializers = init;
|
|
216
|
+
init = function(instance, init) {
|
|
217
|
+
var value = init;
|
|
218
|
+
for(var i = 0; i < ownInitializers.length; i++){
|
|
219
|
+
value = ownInitializers[i].call(instance, value);
|
|
220
|
+
}
|
|
221
|
+
return value;
|
|
222
|
+
};
|
|
223
|
+
} else {
|
|
224
|
+
var originalInitializer = init;
|
|
225
|
+
init = function(instance, init) {
|
|
226
|
+
return originalInitializer.call(instance, init);
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
ret.push(init);
|
|
230
|
+
}
|
|
231
|
+
if (kind !== 0) {
|
|
232
|
+
if (kind === 1) {
|
|
233
|
+
desc.get = value.get;
|
|
234
|
+
desc.set = value.set;
|
|
235
|
+
} else if (kind === 2) {
|
|
236
|
+
desc.value = value;
|
|
237
|
+
} else if (kind === 3) {
|
|
238
|
+
desc.get = value;
|
|
239
|
+
} else if (kind === 4) {
|
|
240
|
+
desc.set = value;
|
|
241
|
+
}
|
|
242
|
+
if (isPrivate) {
|
|
243
|
+
if (kind === 1) {
|
|
244
|
+
ret.push(function(instance, args) {
|
|
245
|
+
return value.get.call(instance, args);
|
|
246
|
+
});
|
|
247
|
+
ret.push(function(instance, args) {
|
|
248
|
+
return value.set.call(instance, args);
|
|
249
|
+
});
|
|
250
|
+
} else if (kind === 2) {
|
|
251
|
+
ret.push(value);
|
|
252
|
+
} else {
|
|
253
|
+
ret.push(function(instance, args) {
|
|
254
|
+
return value.call(instance, args);
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
} else {
|
|
258
|
+
Object.defineProperty(base, name, desc);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
263
|
+
var ret = [];
|
|
264
|
+
var protoInitializers;
|
|
265
|
+
var staticInitializers;
|
|
266
|
+
var existingProtoNonFields = new Map();
|
|
267
|
+
var existingStaticNonFields = new Map();
|
|
268
|
+
for(var i = 0; i < decInfos.length; i++){
|
|
269
|
+
var decInfo = decInfos[i];
|
|
270
|
+
if (!Array.isArray(decInfo)) continue;
|
|
271
|
+
var kind = decInfo[1];
|
|
272
|
+
var name = decInfo[2];
|
|
273
|
+
var isPrivate = decInfo.length > 3;
|
|
274
|
+
var isStatic = kind >= 5;
|
|
275
|
+
var base;
|
|
276
|
+
var initializers;
|
|
277
|
+
if (isStatic) {
|
|
278
|
+
base = Class;
|
|
279
|
+
kind = kind - 5;
|
|
280
|
+
staticInitializers = staticInitializers || [];
|
|
281
|
+
initializers = staticInitializers;
|
|
282
|
+
} else {
|
|
283
|
+
base = Class.prototype;
|
|
284
|
+
protoInitializers = protoInitializers || [];
|
|
285
|
+
initializers = protoInitializers;
|
|
286
|
+
}
|
|
287
|
+
if (kind !== 0 && !isPrivate) {
|
|
288
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
289
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
290
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
|
|
291
|
+
throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
292
|
+
} else if (!existingKind && kind > 2) {
|
|
293
|
+
existingNonFields.set(name, kind);
|
|
294
|
+
} else {
|
|
295
|
+
existingNonFields.set(name, true);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
299
|
+
}
|
|
300
|
+
pushInitializers(ret, protoInitializers);
|
|
301
|
+
pushInitializers(ret, staticInitializers);
|
|
302
|
+
return ret;
|
|
303
|
+
}
|
|
304
|
+
function pushInitializers(ret, initializers) {
|
|
305
|
+
if (initializers) {
|
|
306
|
+
ret.push(function(instance) {
|
|
307
|
+
for(var i = 0; i < initializers.length; i++){
|
|
308
|
+
initializers[i].call(instance);
|
|
309
|
+
}
|
|
310
|
+
return instance;
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
315
|
+
if (classDecs.length > 0) {
|
|
316
|
+
var initializers = [];
|
|
317
|
+
var newClass = targetClass;
|
|
318
|
+
var name = targetClass.name;
|
|
319
|
+
for(var i = classDecs.length - 1; i >= 0; i--){
|
|
320
|
+
var decoratorFinishedRef = {
|
|
321
|
+
v: false
|
|
322
|
+
};
|
|
323
|
+
try {
|
|
324
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
325
|
+
kind: "class",
|
|
326
|
+
name: name,
|
|
327
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
328
|
+
metadata
|
|
329
|
+
});
|
|
330
|
+
} finally{
|
|
331
|
+
decoratorFinishedRef.v = true;
|
|
332
|
+
}
|
|
333
|
+
if (nextNewClass !== undefined) {
|
|
334
|
+
assertValidReturnValue(10, nextNewClass);
|
|
335
|
+
newClass = nextNewClass;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return [
|
|
339
|
+
defineMetadata(newClass, metadata),
|
|
340
|
+
function() {
|
|
341
|
+
for(var i = 0; i < initializers.length; i++){
|
|
342
|
+
initializers[i].call(newClass);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
];
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
function defineMetadata(Class, metadata) {
|
|
349
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
350
|
+
configurable: true,
|
|
351
|
+
enumerable: true,
|
|
352
|
+
value: metadata
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
356
|
+
if (parentClass !== void 0) {
|
|
357
|
+
var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
358
|
+
}
|
|
359
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
360
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
361
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
362
|
+
return {
|
|
363
|
+
e: e,
|
|
364
|
+
get c () {
|
|
365
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
371
|
+
return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
|
|
6
372
|
}
|
|
373
|
+
var _dec, _initProto;
|
|
7
374
|
import { createLogger } from '@aztec/foundation/log';
|
|
8
375
|
import { L2BlockStream } from '@aztec/stdlib/block';
|
|
9
376
|
import { trackSpan } from '@aztec/telemetry-client';
|
|
377
|
+
_dec = trackSpan(function() {
|
|
378
|
+
return `${this.name}.work`;
|
|
379
|
+
});
|
|
10
380
|
/** Extends an L2BlockStream with a tracer to create a new trace per iteration. */ export class TraceableL2BlockStream extends L2BlockStream {
|
|
11
381
|
tracer;
|
|
12
382
|
name;
|
|
383
|
+
static{
|
|
384
|
+
({ e: [_initProto] } = _apply_decs_2203_r(this, [
|
|
385
|
+
[
|
|
386
|
+
_dec,
|
|
387
|
+
2,
|
|
388
|
+
"work"
|
|
389
|
+
]
|
|
390
|
+
], []));
|
|
391
|
+
}
|
|
13
392
|
constructor(l2BlockSource, localData, handler, tracer, name = 'L2BlockStream', log = createLogger('types:block_stream'), opts = {}){
|
|
14
|
-
super(l2BlockSource, localData, handler, log, opts), this.tracer = tracer, this.name = name;
|
|
393
|
+
super(l2BlockSource, localData, handler, log, opts), this.tracer = tracer, this.name = name, _initProto(this);
|
|
15
394
|
}
|
|
16
395
|
// We need to use a non-arrow function to be able to access `this`
|
|
17
396
|
// See https://www.typescriptlang.org/docs/handbook/2/functions.html#declaring-this-in-a-function
|
|
@@ -19,8 +398,3 @@ import { trackSpan } from '@aztec/telemetry-client';
|
|
|
19
398
|
return super.work();
|
|
20
399
|
}
|
|
21
400
|
}
|
|
22
|
-
_ts_decorate([
|
|
23
|
-
trackSpan(function() {
|
|
24
|
-
return `${this.name}.work`;
|
|
25
|
-
})
|
|
26
|
-
], TraceableL2BlockStream.prototype, "work", null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/telemetry-client",
|
|
3
|
-
"version": "4.0.0-nightly.
|
|
3
|
+
"version": "4.0.0-nightly.20260108",
|
|
4
4
|
"inherits": [
|
|
5
5
|
"../package.common.json"
|
|
6
6
|
],
|
|
@@ -8,11 +8,13 @@
|
|
|
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": {
|
|
14
|
-
"build": "yarn clean && tsc
|
|
15
|
-
"build:dev": "tsc
|
|
16
|
+
"build": "yarn clean && ../scripts/tsc.sh",
|
|
17
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
16
18
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
17
19
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
18
20
|
},
|
|
@@ -25,15 +27,15 @@
|
|
|
25
27
|
"!*.test.*"
|
|
26
28
|
],
|
|
27
29
|
"dependencies": {
|
|
28
|
-
"@aztec/foundation": "4.0.0-nightly.
|
|
29
|
-
"@aztec/stdlib": "4.0.0-nightly.
|
|
30
|
+
"@aztec/foundation": "4.0.0-nightly.20260108",
|
|
31
|
+
"@aztec/stdlib": "4.0.0-nightly.20260108",
|
|
30
32
|
"@opentelemetry/api": "^1.9.0",
|
|
31
33
|
"@opentelemetry/api-logs": "^0.55.0",
|
|
32
34
|
"@opentelemetry/core": "^1.28.0",
|
|
33
35
|
"@opentelemetry/exporter-logs-otlp-http": "^0.55.0",
|
|
34
36
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.55.0",
|
|
35
37
|
"@opentelemetry/exporter-trace-otlp-http": "^0.55.0",
|
|
36
|
-
"@opentelemetry/host-metrics": "^0.
|
|
38
|
+
"@opentelemetry/host-metrics": "^0.36.2",
|
|
37
39
|
"@opentelemetry/otlp-exporter-base": "^0.55.0",
|
|
38
40
|
"@opentelemetry/resource-detector-gcp": "^0.32.0",
|
|
39
41
|
"@opentelemetry/resources": "^1.28.0",
|
|
@@ -42,12 +44,13 @@
|
|
|
42
44
|
"@opentelemetry/sdk-trace-node": "^1.28.0",
|
|
43
45
|
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
44
46
|
"prom-client": "^15.1.3",
|
|
45
|
-
"viem": "2.
|
|
47
|
+
"viem": "npm:@aztec/viem@2.38.2"
|
|
46
48
|
},
|
|
47
49
|
"devDependencies": {
|
|
48
50
|
"@jest/globals": "^30.0.0",
|
|
49
51
|
"@types/jest": "^30.0.0",
|
|
50
52
|
"@types/koa": "^2.15.0",
|
|
53
|
+
"@typescript/native-preview": "7.0.0-dev.20251126.1",
|
|
51
54
|
"jest": "^30.0.0",
|
|
52
55
|
"ts-node": "^10.9.1",
|
|
53
56
|
"typescript": "^5.3.3"
|
package/src/attributes.ts
CHANGED
|
@@ -41,8 +41,12 @@ export const APP_CIRCUIT_NAME = 'aztec.circuit.app_circuit_name';
|
|
|
41
41
|
export const BLOCK_ARCHIVE = 'aztec.block.archive';
|
|
42
42
|
/** The block number */
|
|
43
43
|
export const BLOCK_NUMBER = 'aztec.block.number';
|
|
44
|
+
/** The L2 block hash */
|
|
45
|
+
export const BLOCK_HASH = 'aztec.block.hash';
|
|
44
46
|
/** The slot number */
|
|
45
47
|
export const SLOT_NUMBER = 'aztec.slot.number';
|
|
48
|
+
/** The checkpoint number */
|
|
49
|
+
export const CHECKPOINT_NUMBER = 'aztec.checkpoint.number';
|
|
46
50
|
/** The parent's block number */
|
|
47
51
|
export const BLOCK_PARENT = 'aztec.block.parent';
|
|
48
52
|
/** How many txs are being processed to build this block */
|
|
@@ -79,18 +83,24 @@ export const P2P_GOODBYE_REASON = 'aztec.p2p.goodbye.reason';
|
|
|
79
83
|
export const PROVING_JOB_TYPE = 'aztec.proving.job_type';
|
|
80
84
|
/** The proving job id */
|
|
81
85
|
export const PROVING_JOB_ID = 'aztec.proving.job_id';
|
|
82
|
-
|
|
86
|
+
/** Merkle tree name */
|
|
83
87
|
export const MERKLE_TREE_NAME = 'aztec.merkle_tree.name';
|
|
84
88
|
/** The prover-id in a root rollup proof. */
|
|
85
89
|
export const ROLLUP_PROVER_ID = 'aztec.rollup.prover_id';
|
|
86
90
|
/** Whether the proof submission was timed out (delayed more than 20 min) */
|
|
87
91
|
export const PROOF_TIMED_OUT = 'aztec.proof.timed_out';
|
|
92
|
+
/** Status of the validator (eg proposer, in-committee, none) */
|
|
93
|
+
export const VALIDATOR_STATUS = 'aztec.validator_status';
|
|
88
94
|
|
|
89
95
|
export const P2P_ID = 'aztec.p2p.id';
|
|
90
96
|
export const P2P_REQ_RESP_PROTOCOL = 'aztec.p2p.req_resp.protocol';
|
|
91
97
|
export const P2P_REQ_RESP_BATCH_REQUESTS_COUNT = 'aztec.p2p.req_resp.batch_requests_count';
|
|
98
|
+
/** The state of a peer (Healthy, Disconnect, Banned) */
|
|
99
|
+
export const P2P_PEER_SCORE_STATE = 'aztec.p2p.peer_score_state';
|
|
92
100
|
export const POOL_NAME = 'aztec.pool.name';
|
|
93
101
|
|
|
102
|
+
export const PEER_ID = 'aztec.p2p.peer_id';
|
|
103
|
+
|
|
94
104
|
export const SEQUENCER_STATE = 'aztec.sequencer.state';
|
|
95
105
|
|
|
96
106
|
export const SIMULATOR_PHASE = 'aztec.simulator.phase';
|
|
@@ -119,3 +129,18 @@ export const NODEJS_EVENT_LOOP_STATE = 'nodejs.eventloop.state';
|
|
|
119
129
|
export const TOPIC_NAME = 'aztec.gossip.topic_name';
|
|
120
130
|
|
|
121
131
|
export const TX_COLLECTION_METHOD = 'aztec.tx_collection.method';
|
|
132
|
+
|
|
133
|
+
/** Scope of L1 transaction (sequencer, prover, or other) */
|
|
134
|
+
export const L1_TX_SCOPE = 'aztec.l1_tx.scope';
|
|
135
|
+
|
|
136
|
+
/** Generic error type attribute */
|
|
137
|
+
export const IS_COMMITTEE_MEMBER = 'aztec.is_committee_member';
|
|
138
|
+
|
|
139
|
+
/** Fisherman fee analysis strategy identifier */
|
|
140
|
+
export const FISHERMAN_FEE_STRATEGY_ID = 'aztec.fisherman.strategy_id';
|
|
141
|
+
|
|
142
|
+
/** The L1 transaction target for block proposal */
|
|
143
|
+
export const L1_BLOCK_PROPOSAL_TX_TARGET = 'aztec.l1.block_proposal_tx_target';
|
|
144
|
+
|
|
145
|
+
/** Whether tracing methods were used to extract block proposal data */
|
|
146
|
+
export const L1_BLOCK_PROPOSAL_USED_TRACE = 'aztec.l1.block_proposal_used_trace';
|
package/src/bench.ts
CHANGED
|
@@ -61,6 +61,14 @@ export class BenchmarkTelemetryClient implements TelemetryClient {
|
|
|
61
61
|
return true;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
getTraceContext(): string | undefined {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
extractPropagatedContext() {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
64
72
|
getMeters(): BenchmarkMetricsType {
|
|
65
73
|
return this.meters;
|
|
66
74
|
}
|
package/src/config.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface TelemetryClientConfig {
|
|
|
11
11
|
otelCollectIntervalMs: number;
|
|
12
12
|
otelExportTimeoutMs: number;
|
|
13
13
|
otelExcludeMetrics: string[];
|
|
14
|
+
otelIncludeMetrics: string[];
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export const telemetryClientConfigMappings: ConfigMappingsType<TelemetryClientConfig> = {
|
|
@@ -53,6 +54,18 @@ export const telemetryClientConfigMappings: ConfigMappingsType<TelemetryClientCo
|
|
|
53
54
|
: [],
|
|
54
55
|
defaultValue: [],
|
|
55
56
|
},
|
|
57
|
+
otelIncludeMetrics: {
|
|
58
|
+
env: 'OTEL_INCLUDE_METRICS',
|
|
59
|
+
description: 'A list of metric prefixes to include in export (ignored if OTEL_EXCLUDE_METRICS is set)',
|
|
60
|
+
parseEnv: (val: string) =>
|
|
61
|
+
val
|
|
62
|
+
? val
|
|
63
|
+
.split(',')
|
|
64
|
+
.map(s => s.trim())
|
|
65
|
+
.filter(s => s.length > 0)
|
|
66
|
+
: [],
|
|
67
|
+
defaultValue: [],
|
|
68
|
+
},
|
|
56
69
|
|
|
57
70
|
publicMetricsCollectorUrl: {
|
|
58
71
|
env: 'PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT',
|
|
@@ -86,7 +99,7 @@ export const telemetryClientConfigMappings: ConfigMappingsType<TelemetryClientCo
|
|
|
86
99
|
publicMetricsOptOut: {
|
|
87
100
|
env: 'PUBLIC_OTEL_OPT_OUT',
|
|
88
101
|
description: 'Whether to opt out of sharing optional telemetry',
|
|
89
|
-
...booleanConfigHelper(
|
|
102
|
+
...booleanConfigHelper(true),
|
|
90
103
|
},
|
|
91
104
|
};
|
|
92
105
|
|