@noego/telemetry 0.0.3 → 0.1.0
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/README.md +6 -0
- package/dist/browser/index.cjs +21 -0
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +6 -5
- package/dist/browser/index.d.ts +6 -5
- 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-ClZl3awO.d.cts} +2 -2
- package/dist/{browser_telemetry_client-Ch_VzwEa.d.ts → browser_telemetry_client-t4dPp8Ku.d.ts} +2 -2
- package/dist/cli/telemetry_bin.cjs +393 -35
- package/dist/cli/telemetry_bin.cjs.map +1 -1
- package/dist/cli/telemetry_bin.js +378 -20
- package/dist/cli/telemetry_bin.js.map +1 -1
- package/dist/cli/telemetry_cli.cjs +393 -35
- package/dist/cli/telemetry_cli.cjs.map +1 -1
- package/dist/cli/telemetry_cli.d.cts +35 -5
- package/dist/cli/telemetry_cli.d.ts +35 -5
- package/dist/cli/telemetry_cli.js +378 -20
- package/dist/cli/telemetry_cli.js.map +1 -1
- package/dist/{client_defaults-B5tC-TgG.d.ts → client_defaults-CZ8PysZX.d.ts} +2 -2
- package/dist/{client_defaults-C9LnSX4j.d.cts → client_defaults-lDbWYWWK.d.cts} +2 -2
- package/dist/core/index.cjs +26 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +15 -12
- package/dist/core/index.d.ts +15 -12
- package/dist/core/index.js +26 -1
- 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 +5 -4
- package/dist/electron/index.d.ts +5 -4
- package/dist/electron/index.js +21 -0
- package/dist/electron/index.js.map +1 -1
- package/dist/{envelope.types-rOLpWXRC.d.cts → envelope.types-DIvZD3xH.d.ts} +2 -6
- package/dist/{envelope.types-rOLpWXRC.d.ts → envelope.types-DyrlRG49.d.cts} +2 -6
- package/dist/{in_memory_batch_transport-DKW9EZnU.d.cts → in_memory_batch_transport-3T6gElXP.d.cts} +1 -1
- package/dist/{in_memory_batch_transport-oOwNxXnA.d.ts → in_memory_batch_transport-DpQU6JqM.d.ts} +1 -1
- package/dist/index.cjs +26 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -12
- package/dist/index.d.ts +14 -12
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/dist/json.types-BqS77fcN.d.cts +7 -0
- package/dist/json.types-BqS77fcN.d.ts +7 -0
- package/dist/{maintenance_coordinator.types-C4ULi4A4.d.cts → maintenance_coordinator.types-Crhx9i9k.d.cts} +3 -3
- package/dist/{maintenance_coordinator.types-ikUrRXmO.d.ts → maintenance_coordinator.types-DprmgpVn.d.ts} +3 -3
- package/dist/metric.types-D8aOAnUm.d.ts +67 -0
- package/dist/metric.types-Dg4eZq6u.d.cts +67 -0
- package/dist/{metric_definition_contract-BYtnODhu.d.ts → metric_definition_contract-C6MERhJs.d.ts} +1 -1
- package/dist/{metric_definition_contract-DfhhmTZ1.d.cts → metric_definition_contract-DoAk7NOw.d.cts} +1 -1
- package/dist/node/index.cjs +38 -2
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +62 -10
- package/dist/node/index.d.ts +62 -10
- package/dist/node/index.js +37 -2
- 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 +5 -4
- package/dist/node/producer/index.d.ts +5 -4
- package/dist/node/producer/index.js +21 -0
- package/dist/node/producer/index.js.map +1 -1
- package/dist/projector/index.cjs +1370 -0
- package/dist/projector/index.cjs.map +1 -0
- package/dist/projector/index.d.cts +246 -0
- package/dist/projector/index.d.ts +246 -0
- package/dist/projector/index.js +1328 -0
- package/dist/projector/index.js.map +1 -0
- package/dist/{query.types-DU5v7vM0.d.ts → query.types-CRqAsGTX.d.cts} +4 -66
- package/dist/{query.types-DuYWbFFe.d.cts → query.types-DnOMYXpC.d.ts} +4 -66
- package/dist/sqlite/index.cjs +5 -1
- package/dist/sqlite/index.cjs.map +1 -1
- package/dist/sqlite/index.d.cts +7 -5
- package/dist/sqlite/index.d.ts +7 -5
- package/dist/sqlite/index.js +5 -1
- package/dist/sqlite/index.js.map +1 -1
- package/dist/{storage.types-k7oElEB3.d.ts → storage.types-BKWoIOHp.d.ts} +3 -2
- package/dist/{storage.types-Bji_pWqr.d.cts → storage.types-DHbAm3j_.d.cts} +3 -2
- package/dist/{telemetry_client-BXw8WH_F.d.ts → telemetry_client-Bg5tbj5E.d.cts} +12 -3
- package/dist/{telemetry_client-CYaPYfOl.d.cts → telemetry_client-DWKgufmc.d.ts} +12 -3
- package/dist/{telemetry_configuration_parser-BZ8Nvnle.d.ts → telemetry_configuration_parser-6BR3_dD_.d.ts} +2 -2
- package/dist/{telemetry_configuration_parser-CgSN7R6A.d.cts → telemetry_configuration_parser-ybeweUPE.d.cts} +2 -2
- package/dist/testing/index.d.cts +7 -5
- package/dist/testing/index.d.ts +7 -5
- package/dist/trace-adapter/index.d.cts +4 -3
- package/dist/trace-adapter/index.d.ts +4 -3
- package/dist/{transport.types-BAl_TRtU.d.cts → transport.types-C2dP-eed.d.cts} +1 -1
- package/dist/{transport.types-DDnZoKWi.d.ts → transport.types-SA8KpLiK.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 +11 -4
package/dist/core/index.d.cts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
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-
|
|
3
|
-
export { M as MetricDefinitionContract } from '../metric_definition_contract-
|
|
4
|
-
import { T as TelemetryEnvelope } from '../envelope.types-
|
|
5
|
-
export { a as TelemetryAdmitInput, b as TelemetryEmitInput, c as
|
|
6
|
-
import { M as MetricDefinition,
|
|
7
|
-
export { E as ExtractedMetricSample,
|
|
1
|
+
import { M as MetadataSnapshotLimits, d as MetadataSnapshot } from '../telemetry_client-Bg5tbj5E.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-Bg5tbj5E.cjs';
|
|
3
|
+
export { M as MetricDefinitionContract } from '../metric_definition_contract-DoAk7NOw.cjs';
|
|
4
|
+
import { T as TelemetryEnvelope } from '../envelope.types-DyrlRG49.cjs';
|
|
5
|
+
export { a as TelemetryAdmitInput, b as TelemetryEmitInput, c as TelemetryLevel } from '../envelope.types-DyrlRG49.cjs';
|
|
6
|
+
import { M as MetricDefinition, b as MetricExtraction } from '../metric.types-Dg4eZq6u.cjs';
|
|
7
|
+
export { E as ExtractedMetricSample, c as MetricAggregate, d as MetricCardinalityRule, a as MetricExtractionFailure, e as MetricMeasurement, f as MetricOverflowPolicy, g as MetricRollupValues } from '../metric.types-Dg4eZq6u.cjs';
|
|
8
8
|
import { T as TelemetryResult } from '../result.types-171Huujb.cjs';
|
|
9
|
-
import { d as TelemetryBatch, e as TelemetryAcknowledgement, a as TelemetryBatchValidationLimits, f as TelemetryDropCounter, T as TelemetryBatchTransport, b as TelemetryBatchTransportCapabilities, i as TelemetryBatchRouterOptions } from '../transport.types-
|
|
10
|
-
export { c as TelemetryBatchReceiver, h as TelemetryBatchRoute, g as TelemetryDeliveryMode, j as TelemetryTargetDeliveryState } from '../transport.types-
|
|
11
|
-
import { T as
|
|
12
|
-
export {
|
|
13
|
-
|
|
9
|
+
import { d as TelemetryBatch, e as TelemetryAcknowledgement, a as TelemetryBatchValidationLimits, f as TelemetryDropCounter, T as TelemetryBatchTransport, b as TelemetryBatchTransportCapabilities, i as TelemetryBatchRouterOptions } from '../transport.types-C2dP-eed.cjs';
|
|
10
|
+
export { c as TelemetryBatchReceiver, h as TelemetryBatchRoute, g as TelemetryDeliveryMode, j as TelemetryTargetDeliveryState } from '../transport.types-C2dP-eed.cjs';
|
|
11
|
+
import { T as TimelineQuery, a as TimelineQueryResponse, b as TelemetryQueryError, M as MetricQuery, c as MetricQueryResponse } from '../query.types-CRqAsGTX.cjs';
|
|
12
|
+
export { d as MetricBucket, e as MetricQueryGap, f as MetricQuerySegment, R as ResolvedTelemetryConfiguration, g as SqliteMaintenanceConfiguration, h as SqliteRetentionConfiguration, i as SqliteSchemaConfiguration, j as SqliteTableOverrides, S as SqliteTargetConfiguration, k as TelemetryRole, l as TimelineGap } from '../query.types-CRqAsGTX.cjs';
|
|
13
|
+
import { T as TelemetryStorageTransport, a as TelemetryStorageCapabilities, d as TelemetryStorageRouterOptions, S as StoragePersistRequest, M as MaintenanceStageResult, b as StorageTargetStatus } from '../storage.types-DHbAm3j_.cjs';
|
|
14
|
+
export { c as MaintenanceRunRecord, e as TelemetryStorageTarget } from '../storage.types-DHbAm3j_.cjs';
|
|
15
|
+
export { D as DEFAULT_METADATA_SNAPSHOT_LIMITS, a as DEFAULT_TELEMETRY_ADMISSION_POLICY, b as DEFAULT_TELEMETRY_BATCH_VALIDATION_LIMITS } from '../client_defaults-lDbWYWWK.cjs';
|
|
16
|
+
export { T as TelemetryJsonObject, b as TelemetryJsonPrimitive, a as TelemetryJsonValue } from '../json.types-BqS77fcN.cjs';
|
|
14
17
|
|
|
15
18
|
declare class BoundedMetadataSnapshotter {
|
|
16
19
|
private readonly limits;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
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-
|
|
3
|
-
export { M as MetricDefinitionContract } from '../metric_definition_contract-
|
|
4
|
-
import { T as TelemetryEnvelope } from '../envelope.types-
|
|
5
|
-
export { a as TelemetryAdmitInput, b as TelemetryEmitInput, c as
|
|
6
|
-
import { M as MetricDefinition,
|
|
7
|
-
export { E as ExtractedMetricSample,
|
|
1
|
+
import { M as MetadataSnapshotLimits, d as MetadataSnapshot } from '../telemetry_client-DWKgufmc.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-DWKgufmc.js';
|
|
3
|
+
export { M as MetricDefinitionContract } from '../metric_definition_contract-C6MERhJs.js';
|
|
4
|
+
import { T as TelemetryEnvelope } from '../envelope.types-DIvZD3xH.js';
|
|
5
|
+
export { a as TelemetryAdmitInput, b as TelemetryEmitInput, c as TelemetryLevel } from '../envelope.types-DIvZD3xH.js';
|
|
6
|
+
import { M as MetricDefinition, b as MetricExtraction } from '../metric.types-D8aOAnUm.js';
|
|
7
|
+
export { E as ExtractedMetricSample, c as MetricAggregate, d as MetricCardinalityRule, a as MetricExtractionFailure, e as MetricMeasurement, f as MetricOverflowPolicy, g as MetricRollupValues } from '../metric.types-D8aOAnUm.js';
|
|
8
8
|
import { T as TelemetryResult } from '../result.types-171Huujb.js';
|
|
9
|
-
import { d as TelemetryBatch, e as TelemetryAcknowledgement, a as TelemetryBatchValidationLimits, f as TelemetryDropCounter, T as TelemetryBatchTransport, b as TelemetryBatchTransportCapabilities, i as TelemetryBatchRouterOptions } from '../transport.types-
|
|
10
|
-
export { c as TelemetryBatchReceiver, h as TelemetryBatchRoute, g as TelemetryDeliveryMode, j as TelemetryTargetDeliveryState } from '../transport.types-
|
|
11
|
-
import { T as
|
|
12
|
-
export {
|
|
13
|
-
|
|
9
|
+
import { d as TelemetryBatch, e as TelemetryAcknowledgement, a as TelemetryBatchValidationLimits, f as TelemetryDropCounter, T as TelemetryBatchTransport, b as TelemetryBatchTransportCapabilities, i as TelemetryBatchRouterOptions } from '../transport.types-SA8KpLiK.js';
|
|
10
|
+
export { c as TelemetryBatchReceiver, h as TelemetryBatchRoute, g as TelemetryDeliveryMode, j as TelemetryTargetDeliveryState } from '../transport.types-SA8KpLiK.js';
|
|
11
|
+
import { T as TimelineQuery, a as TimelineQueryResponse, b as TelemetryQueryError, M as MetricQuery, c as MetricQueryResponse } from '../query.types-DnOMYXpC.js';
|
|
12
|
+
export { d as MetricBucket, e as MetricQueryGap, f as MetricQuerySegment, R as ResolvedTelemetryConfiguration, g as SqliteMaintenanceConfiguration, h as SqliteRetentionConfiguration, i as SqliteSchemaConfiguration, j as SqliteTableOverrides, S as SqliteTargetConfiguration, k as TelemetryRole, l as TimelineGap } from '../query.types-DnOMYXpC.js';
|
|
13
|
+
import { T as TelemetryStorageTransport, a as TelemetryStorageCapabilities, d as TelemetryStorageRouterOptions, S as StoragePersistRequest, M as MaintenanceStageResult, b as StorageTargetStatus } from '../storage.types-BKWoIOHp.js';
|
|
14
|
+
export { c as MaintenanceRunRecord, e as TelemetryStorageTarget } from '../storage.types-BKWoIOHp.js';
|
|
15
|
+
export { D as DEFAULT_METADATA_SNAPSHOT_LIMITS, a as DEFAULT_TELEMETRY_ADMISSION_POLICY, b as DEFAULT_TELEMETRY_BATCH_VALIDATION_LIMITS } from '../client_defaults-CZ8PysZX.js';
|
|
16
|
+
export { T as TelemetryJsonObject, b as TelemetryJsonPrimitive, a as TelemetryJsonValue } from '../json.types-BqS77fcN.js';
|
|
14
17
|
|
|
15
18
|
declare class BoundedMetadataSnapshotter {
|
|
16
19
|
private readonly limits;
|
package/dist/core/index.js
CHANGED
|
@@ -303,11 +303,15 @@ var MetricDefinitionContract = class {
|
|
|
303
303
|
if (!eventSelector || !bracket) {
|
|
304
304
|
return { ok: false, error: `Invalid metric selector ${selector}` };
|
|
305
305
|
}
|
|
306
|
+
const groupBy = bracket === "*" ? [] : bracket.split(",").map((field) => field.trim());
|
|
307
|
+
if (groupBy.some((field) => field.length === 0)) {
|
|
308
|
+
return { ok: false, error: `Invalid metric selector ${selector}` };
|
|
309
|
+
}
|
|
306
310
|
return {
|
|
307
311
|
ok: true,
|
|
308
312
|
value: {
|
|
309
313
|
selector: eventSelector,
|
|
310
|
-
groupBy
|
|
314
|
+
groupBy,
|
|
311
315
|
wildcardUngrouped: bracket === "*"
|
|
312
316
|
}
|
|
313
317
|
};
|
|
@@ -1346,6 +1350,14 @@ var TelemetryBatchRouter = class {
|
|
|
1346
1350
|
};
|
|
1347
1351
|
|
|
1348
1352
|
// src/core/telemetry_client.ts
|
|
1353
|
+
var TELEMETRY_LEVEL_RANKS = Object.freeze({
|
|
1354
|
+
trace: 0,
|
|
1355
|
+
debug: 1,
|
|
1356
|
+
info: 2,
|
|
1357
|
+
warn: 3,
|
|
1358
|
+
error: 4,
|
|
1359
|
+
fatal: 5
|
|
1360
|
+
});
|
|
1349
1361
|
var TelemetryClient = class {
|
|
1350
1362
|
constructor(options) {
|
|
1351
1363
|
this.options = options;
|
|
@@ -1408,6 +1420,10 @@ var TelemetryClient = class {
|
|
|
1408
1420
|
return { kind: "dropped", producerId: this.options.producerId, sequence, reason: "invalid-label" };
|
|
1409
1421
|
}
|
|
1410
1422
|
const priority = this.priorityFor(input.level);
|
|
1423
|
+
if (!this.meetsMinimumLevel(input.level)) {
|
|
1424
|
+
this.incrementDrop("sampled", priority);
|
|
1425
|
+
return { kind: "dropped", producerId: this.options.producerId, sequence, reason: "below-minimum-level" };
|
|
1426
|
+
}
|
|
1411
1427
|
if (!this.isSampled(priority)) {
|
|
1412
1428
|
this.incrementDrop("sampled", priority);
|
|
1413
1429
|
return { kind: "dropped", producerId: this.options.producerId, sequence, reason: "sampled" };
|
|
@@ -1788,6 +1804,15 @@ var TelemetryClient = class {
|
|
|
1788
1804
|
const sampleRate = this.options.admission.sampleRates[priority];
|
|
1789
1805
|
return sampleRate >= 1 || this.options.random() < sampleRate;
|
|
1790
1806
|
}
|
|
1807
|
+
meetsMinimumLevel(level) {
|
|
1808
|
+
const minimum = this.options.admission.minimumLevel;
|
|
1809
|
+
if (minimum === void 0) {
|
|
1810
|
+
return true;
|
|
1811
|
+
}
|
|
1812
|
+
const normalized = level.trim().toLowerCase();
|
|
1813
|
+
const rank = TELEMETRY_LEVEL_RANKS[normalized] ?? TELEMETRY_LEVEL_RANKS.info;
|
|
1814
|
+
return rank >= TELEMETRY_LEVEL_RANKS[minimum];
|
|
1815
|
+
}
|
|
1791
1816
|
isValidLabel(label) {
|
|
1792
1817
|
return /^[A-Za-z0-9][A-Za-z0-9_.:-]*$/.test(label) && label.length <= 256;
|
|
1793
1818
|
}
|