@noego/telemetry 0.0.2 → 0.0.5
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/browser/index.cjs +21 -0
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +3 -3
- package/dist/browser/index.d.ts +3 -3
- package/dist/browser/index.js +21 -0
- package/dist/browser/index.js.map +1 -1
- package/dist/{browser_telemetry_client-BzBPQm4m.d.cts → browser_telemetry_client-BSAMZ8Qb.d.cts} +1 -1
- package/dist/{browser_telemetry_client-Ch_VzwEa.d.ts → browser_telemetry_client-DPBU6NGw.d.ts} +1 -1
- package/dist/{client_defaults-C9LnSX4j.d.cts → client_defaults-Dk0MMzvx.d.cts} +1 -1
- package/dist/{client_defaults-B5tC-TgG.d.ts → client_defaults-ShVYQYmn.d.ts} +1 -1
- package/dist/core/index.cjs +21 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +21 -0
- package/dist/core/index.js.map +1 -1
- package/dist/electron/index.cjs +21 -0
- package/dist/electron/index.cjs.map +1 -1
- package/dist/electron/index.d.cts +2 -2
- package/dist/electron/index.d.ts +2 -2
- package/dist/electron/index.js +21 -0
- package/dist/electron/index.js.map +1 -1
- package/dist/index.cjs +21 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +33 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +53 -3
- package/dist/node/index.d.ts +53 -3
- package/dist/node/index.js +32 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/producer/index.cjs +21 -0
- package/dist/node/producer/index.cjs.map +1 -1
- package/dist/node/producer/index.d.cts +2 -2
- package/dist/node/producer/index.d.ts +2 -2
- package/dist/node/producer/index.js +21 -0
- package/dist/node/producer/index.js.map +1 -1
- package/dist/{telemetry_client-CYaPYfOl.d.cts → telemetry_client-BO5Pjp41.d.cts} +9 -1
- package/dist/{telemetry_client-BXw8WH_F.d.ts → telemetry_client-D8uZ-mTL.d.ts} +9 -1
- package/dist/trace-adapter/index.d.cts +1 -1
- package/dist/trace-adapter/index.d.ts +1 -1
- package/migrations/1786100000000_animation_artifacts.down.sql +5 -0
- package/migrations/1786100000000_animation_artifacts.up.sql +41 -0
- package/native/noego_telemetry_native.node +0 -0
- package/package.json +1 -1
package/dist/core/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MetadataSnapshotLimits, d as MetadataSnapshot } from '../telemetry_client-
|
|
2
|
-
export { c as MetadataRedactionRule, e as MetadataSnapshotStats, T as TelemetryAdmissionPolicy, f as TelemetryAdmissionPriority, b as TelemetryAdmissionResult, a as TelemetryClient, g as TelemetryClientOptions, h as TelemetryClientStatus } from '../telemetry_client-
|
|
1
|
+
import { M as MetadataSnapshotLimits, d as MetadataSnapshot } from '../telemetry_client-BO5Pjp41.cjs';
|
|
2
|
+
export { c as MetadataRedactionRule, e as MetadataSnapshotStats, T as TelemetryAdmissionPolicy, f as TelemetryAdmissionPriority, b as TelemetryAdmissionResult, a as TelemetryClient, g as TelemetryClientOptions, h as TelemetryClientStatus, i as TelemetryMinimumLevel } from '../telemetry_client-BO5Pjp41.cjs';
|
|
3
3
|
export { M as MetricDefinitionContract } from '../metric_definition_contract-DfhhmTZ1.cjs';
|
|
4
4
|
import { T as TelemetryEnvelope } from '../envelope.types-rOLpWXRC.cjs';
|
|
5
5
|
export { a as TelemetryAdmitInput, b as TelemetryEmitInput, c as TelemetryJsonObject, d as TelemetryJsonPrimitive, e as TelemetryJsonValue, f as TelemetryLevel } from '../envelope.types-rOLpWXRC.cjs';
|
|
@@ -10,7 +10,7 @@ import { d as TelemetryBatch, e as TelemetryAcknowledgement, a as TelemetryBatch
|
|
|
10
10
|
export { c as TelemetryBatchReceiver, h as TelemetryBatchRoute, g as TelemetryDeliveryMode, j as TelemetryTargetDeliveryState } from '../transport.types-BAl_TRtU.cjs';
|
|
11
11
|
import { T as TelemetryStorageTransport, a as TelemetryStorageCapabilities, d as TelemetryStorageRouterOptions, S as StoragePersistRequest, M as MaintenanceStageResult, b as StorageTargetStatus } from '../storage.types-Bji_pWqr.cjs';
|
|
12
12
|
export { c as MaintenanceRunRecord, e as TelemetryStorageTarget } from '../storage.types-Bji_pWqr.cjs';
|
|
13
|
-
export { D as DEFAULT_METADATA_SNAPSHOT_LIMITS, a as DEFAULT_TELEMETRY_ADMISSION_POLICY, b as DEFAULT_TELEMETRY_BATCH_VALIDATION_LIMITS } from '../client_defaults-
|
|
13
|
+
export { D as DEFAULT_METADATA_SNAPSHOT_LIMITS, a as DEFAULT_TELEMETRY_ADMISSION_POLICY, b as DEFAULT_TELEMETRY_BATCH_VALIDATION_LIMITS } from '../client_defaults-Dk0MMzvx.cjs';
|
|
14
14
|
|
|
15
15
|
declare class BoundedMetadataSnapshotter {
|
|
16
16
|
private readonly limits;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MetadataSnapshotLimits, d as MetadataSnapshot } from '../telemetry_client-
|
|
2
|
-
export { c as MetadataRedactionRule, e as MetadataSnapshotStats, T as TelemetryAdmissionPolicy, f as TelemetryAdmissionPriority, b as TelemetryAdmissionResult, a as TelemetryClient, g as TelemetryClientOptions, h as TelemetryClientStatus } from '../telemetry_client-
|
|
1
|
+
import { M as MetadataSnapshotLimits, d as MetadataSnapshot } from '../telemetry_client-D8uZ-mTL.js';
|
|
2
|
+
export { c as MetadataRedactionRule, e as MetadataSnapshotStats, T as TelemetryAdmissionPolicy, f as TelemetryAdmissionPriority, b as TelemetryAdmissionResult, a as TelemetryClient, g as TelemetryClientOptions, h as TelemetryClientStatus, i as TelemetryMinimumLevel } from '../telemetry_client-D8uZ-mTL.js';
|
|
3
3
|
export { M as MetricDefinitionContract } from '../metric_definition_contract-BYtnODhu.js';
|
|
4
4
|
import { T as TelemetryEnvelope } from '../envelope.types-rOLpWXRC.js';
|
|
5
5
|
export { a as TelemetryAdmitInput, b as TelemetryEmitInput, c as TelemetryJsonObject, d as TelemetryJsonPrimitive, e as TelemetryJsonValue, f as TelemetryLevel } from '../envelope.types-rOLpWXRC.js';
|
|
@@ -10,7 +10,7 @@ import { d as TelemetryBatch, e as TelemetryAcknowledgement, a as TelemetryBatch
|
|
|
10
10
|
export { c as TelemetryBatchReceiver, h as TelemetryBatchRoute, g as TelemetryDeliveryMode, j as TelemetryTargetDeliveryState } from '../transport.types-DDnZoKWi.js';
|
|
11
11
|
import { T as TelemetryStorageTransport, a as TelemetryStorageCapabilities, d as TelemetryStorageRouterOptions, S as StoragePersistRequest, M as MaintenanceStageResult, b as StorageTargetStatus } from '../storage.types-k7oElEB3.js';
|
|
12
12
|
export { c as MaintenanceRunRecord, e as TelemetryStorageTarget } from '../storage.types-k7oElEB3.js';
|
|
13
|
-
export { D as DEFAULT_METADATA_SNAPSHOT_LIMITS, a as DEFAULT_TELEMETRY_ADMISSION_POLICY, b as DEFAULT_TELEMETRY_BATCH_VALIDATION_LIMITS } from '../client_defaults-
|
|
13
|
+
export { D as DEFAULT_METADATA_SNAPSHOT_LIMITS, a as DEFAULT_TELEMETRY_ADMISSION_POLICY, b as DEFAULT_TELEMETRY_BATCH_VALIDATION_LIMITS } from '../client_defaults-ShVYQYmn.js';
|
|
14
14
|
|
|
15
15
|
declare class BoundedMetadataSnapshotter {
|
|
16
16
|
private readonly limits;
|
package/dist/core/index.js
CHANGED
|
@@ -1346,6 +1346,14 @@ var TelemetryBatchRouter = class {
|
|
|
1346
1346
|
};
|
|
1347
1347
|
|
|
1348
1348
|
// src/core/telemetry_client.ts
|
|
1349
|
+
var TELEMETRY_LEVEL_RANKS = Object.freeze({
|
|
1350
|
+
trace: 0,
|
|
1351
|
+
debug: 1,
|
|
1352
|
+
info: 2,
|
|
1353
|
+
warn: 3,
|
|
1354
|
+
error: 4,
|
|
1355
|
+
fatal: 5
|
|
1356
|
+
});
|
|
1349
1357
|
var TelemetryClient = class {
|
|
1350
1358
|
constructor(options) {
|
|
1351
1359
|
this.options = options;
|
|
@@ -1408,6 +1416,10 @@ var TelemetryClient = class {
|
|
|
1408
1416
|
return { kind: "dropped", producerId: this.options.producerId, sequence, reason: "invalid-label" };
|
|
1409
1417
|
}
|
|
1410
1418
|
const priority = this.priorityFor(input.level);
|
|
1419
|
+
if (!this.meetsMinimumLevel(input.level)) {
|
|
1420
|
+
this.incrementDrop("sampled", priority);
|
|
1421
|
+
return { kind: "dropped", producerId: this.options.producerId, sequence, reason: "below-minimum-level" };
|
|
1422
|
+
}
|
|
1411
1423
|
if (!this.isSampled(priority)) {
|
|
1412
1424
|
this.incrementDrop("sampled", priority);
|
|
1413
1425
|
return { kind: "dropped", producerId: this.options.producerId, sequence, reason: "sampled" };
|
|
@@ -1788,6 +1800,15 @@ var TelemetryClient = class {
|
|
|
1788
1800
|
const sampleRate = this.options.admission.sampleRates[priority];
|
|
1789
1801
|
return sampleRate >= 1 || this.options.random() < sampleRate;
|
|
1790
1802
|
}
|
|
1803
|
+
meetsMinimumLevel(level) {
|
|
1804
|
+
const minimum = this.options.admission.minimumLevel;
|
|
1805
|
+
if (minimum === void 0) {
|
|
1806
|
+
return true;
|
|
1807
|
+
}
|
|
1808
|
+
const normalized = level.trim().toLowerCase();
|
|
1809
|
+
const rank = TELEMETRY_LEVEL_RANKS[normalized] ?? TELEMETRY_LEVEL_RANKS.info;
|
|
1810
|
+
return rank >= TELEMETRY_LEVEL_RANKS[minimum];
|
|
1811
|
+
}
|
|
1791
1812
|
isValidLabel(label) {
|
|
1792
1813
|
return /^[A-Za-z0-9][A-Za-z0-9_.:-]*$/.test(label) && label.length <= 256;
|
|
1793
1814
|
}
|