@noego/telemetry 0.0.5 → 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.d.cts +6 -5
- package/dist/browser/index.d.ts +6 -5
- package/dist/{browser_telemetry_client-BSAMZ8Qb.d.cts → browser_telemetry_client-ClZl3awO.d.cts} +2 -2
- package/dist/{browser_telemetry_client-DPBU6NGw.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-ShVYQYmn.d.ts → client_defaults-CZ8PysZX.d.ts} +2 -2
- package/dist/{client_defaults-Dk0MMzvx.d.cts → client_defaults-lDbWYWWK.d.cts} +2 -2
- package/dist/core/index.cjs +5 -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 +5 -1
- package/dist/core/index.js.map +1 -1
- package/dist/electron/index.d.cts +5 -4
- package/dist/electron/index.d.ts +5 -4
- 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 +5 -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 +5 -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 +5 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +11 -9
- package/dist/node/index.d.ts +11 -9
- package/dist/node/index.js +5 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/producer/index.d.cts +5 -4
- package/dist/node/producer/index.d.ts +5 -4
- 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-BO5Pjp41.d.cts → telemetry_client-Bg5tbj5E.d.cts} +3 -2
- package/dist/{telemetry_client-D8uZ-mTL.d.ts → telemetry_client-DWKgufmc.d.ts} +3 -2
- 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/native/noego_telemetry_native.node +0 -0
- package/package.json +11 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type TelemetryJsonPrimitive = string | number | boolean | null;
|
|
2
|
+
type TelemetryJsonValue = TelemetryJsonPrimitive | TelemetryJsonObject | readonly TelemetryJsonValue[];
|
|
3
|
+
type TelemetryJsonObject = Readonly<{
|
|
4
|
+
[key: string]: TelemetryJsonValue;
|
|
5
|
+
}>;
|
|
6
|
+
|
|
7
|
+
export type { TelemetryJsonObject as T, TelemetryJsonValue as a, TelemetryJsonPrimitive as b };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type TelemetryJsonPrimitive = string | number | boolean | null;
|
|
2
|
+
type TelemetryJsonValue = TelemetryJsonPrimitive | TelemetryJsonObject | readonly TelemetryJsonValue[];
|
|
3
|
+
type TelemetryJsonObject = Readonly<{
|
|
4
|
+
[key: string]: TelemetryJsonValue;
|
|
5
|
+
}>;
|
|
6
|
+
|
|
7
|
+
export type { TelemetryJsonObject as T, TelemetryJsonValue as a, TelemetryJsonPrimitive as b };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as TelemetryStorageTransport, e as TelemetryStorageTarget, a as TelemetryStorageCapabilities, b as StorageTargetStatus, M as MaintenanceStageResult } from './storage.types-
|
|
2
|
-
import { M as MetricDefinition,
|
|
3
|
-
import { d as TelemetryBatch, a as TelemetryBatchValidationLimits, f as TelemetryDropCounter, c as TelemetryBatchReceiver, e as TelemetryAcknowledgement } from './transport.types-
|
|
1
|
+
import { T as TelemetryStorageTransport, e as TelemetryStorageTarget, a as TelemetryStorageCapabilities, b as StorageTargetStatus, M as MaintenanceStageResult } from './storage.types-DHbAm3j_.cjs';
|
|
2
|
+
import { M as MetricDefinition, b as MetricExtraction } from './metric.types-Dg4eZq6u.cjs';
|
|
3
|
+
import { d as TelemetryBatch, a as TelemetryBatchValidationLimits, f as TelemetryDropCounter, c as TelemetryBatchReceiver, e as TelemetryAcknowledgement } from './transport.types-C2dP-eed.cjs';
|
|
4
4
|
|
|
5
5
|
interface TelemetrySinkPlugin {
|
|
6
6
|
readonly name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as TelemetryStorageTransport, e as TelemetryStorageTarget, a as TelemetryStorageCapabilities, b as StorageTargetStatus, M as MaintenanceStageResult } from './storage.types-
|
|
2
|
-
import { M as MetricDefinition,
|
|
3
|
-
import { d as TelemetryBatch, a as TelemetryBatchValidationLimits, f as TelemetryDropCounter, c as TelemetryBatchReceiver, e as TelemetryAcknowledgement } from './transport.types-
|
|
1
|
+
import { T as TelemetryStorageTransport, e as TelemetryStorageTarget, a as TelemetryStorageCapabilities, b as StorageTargetStatus, M as MaintenanceStageResult } from './storage.types-BKWoIOHp.js';
|
|
2
|
+
import { M as MetricDefinition, b as MetricExtraction } from './metric.types-D8aOAnUm.js';
|
|
3
|
+
import { d as TelemetryBatch, a as TelemetryBatchValidationLimits, f as TelemetryDropCounter, c as TelemetryBatchReceiver, e as TelemetryAcknowledgement } from './transport.types-SA8KpLiK.js';
|
|
4
4
|
|
|
5
5
|
interface TelemetrySinkPlugin {
|
|
6
6
|
readonly name: string;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { T as TelemetryJsonObject } from './json.types-BqS77fcN.js';
|
|
2
|
+
|
|
3
|
+
declare const METRIC_AGGREGATES: readonly ["sum", "min", "max", "last"];
|
|
4
|
+
type MetricAggregate = (typeof METRIC_AGGREGATES)[number];
|
|
5
|
+
declare const METRIC_OVERFLOW_POLICIES: readonly ["other", "drop", "reject"];
|
|
6
|
+
type MetricOverflowPolicy = (typeof METRIC_OVERFLOW_POLICIES)[number];
|
|
7
|
+
type MetricCountMeasurement = Readonly<{
|
|
8
|
+
kind: 'count';
|
|
9
|
+
}>;
|
|
10
|
+
type MetricFieldMeasurement = Readonly<{
|
|
11
|
+
kind: 'field';
|
|
12
|
+
field: string;
|
|
13
|
+
aggregates: readonly MetricAggregate[];
|
|
14
|
+
}>;
|
|
15
|
+
type MetricMeasurement = MetricCountMeasurement | MetricFieldMeasurement;
|
|
16
|
+
type MetricCardinalityRule = Readonly<{
|
|
17
|
+
maxValuesPerBucket: number;
|
|
18
|
+
overflow: MetricOverflowPolicy;
|
|
19
|
+
}>;
|
|
20
|
+
type MetricDefinition = Readonly<{
|
|
21
|
+
name: string;
|
|
22
|
+
version: number;
|
|
23
|
+
selector: string;
|
|
24
|
+
groupBy: readonly string[];
|
|
25
|
+
measurements: readonly MetricMeasurement[];
|
|
26
|
+
cardinality: Readonly<Record<string, MetricCardinalityRule>>;
|
|
27
|
+
targetIds: readonly string[];
|
|
28
|
+
resolutionsMs: readonly number[];
|
|
29
|
+
missingField: 'skip' | 'record-failure';
|
|
30
|
+
}>;
|
|
31
|
+
type ExtractedMetricSample = Readonly<{
|
|
32
|
+
metricName: string;
|
|
33
|
+
definitionVersion: number;
|
|
34
|
+
occurredAtMs: number;
|
|
35
|
+
producerId: string;
|
|
36
|
+
sequence: number;
|
|
37
|
+
dimensions: TelemetryJsonObject;
|
|
38
|
+
dimensionKey: string;
|
|
39
|
+
values: Readonly<Record<string, number>>;
|
|
40
|
+
targetIds: readonly string[];
|
|
41
|
+
}>;
|
|
42
|
+
type MetricExtractionFailure = Readonly<{
|
|
43
|
+
metricName: string;
|
|
44
|
+
definitionVersion: number;
|
|
45
|
+
producerId: string;
|
|
46
|
+
sequence: number;
|
|
47
|
+
reason: string;
|
|
48
|
+
}>;
|
|
49
|
+
type MetricExtraction = Readonly<{
|
|
50
|
+
samples: readonly ExtractedMetricSample[];
|
|
51
|
+
failures: readonly MetricExtractionFailure[];
|
|
52
|
+
}>;
|
|
53
|
+
type MetricRollupValues = Readonly<{
|
|
54
|
+
count: number;
|
|
55
|
+
fields: Readonly<Record<string, Readonly<{
|
|
56
|
+
count: number;
|
|
57
|
+
sum: number;
|
|
58
|
+
min: number;
|
|
59
|
+
max: number;
|
|
60
|
+
last: number;
|
|
61
|
+
lastOccurredAtMs: number;
|
|
62
|
+
lastProducerId: string;
|
|
63
|
+
lastSequence: number;
|
|
64
|
+
}>>>;
|
|
65
|
+
}>;
|
|
66
|
+
|
|
67
|
+
export type { ExtractedMetricSample as E, MetricDefinition as M, MetricExtractionFailure as a, MetricExtraction as b, MetricAggregate as c, MetricCardinalityRule as d, MetricMeasurement as e, MetricOverflowPolicy as f, MetricRollupValues as g };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { T as TelemetryJsonObject } from './json.types-BqS77fcN.cjs';
|
|
2
|
+
|
|
3
|
+
declare const METRIC_AGGREGATES: readonly ["sum", "min", "max", "last"];
|
|
4
|
+
type MetricAggregate = (typeof METRIC_AGGREGATES)[number];
|
|
5
|
+
declare const METRIC_OVERFLOW_POLICIES: readonly ["other", "drop", "reject"];
|
|
6
|
+
type MetricOverflowPolicy = (typeof METRIC_OVERFLOW_POLICIES)[number];
|
|
7
|
+
type MetricCountMeasurement = Readonly<{
|
|
8
|
+
kind: 'count';
|
|
9
|
+
}>;
|
|
10
|
+
type MetricFieldMeasurement = Readonly<{
|
|
11
|
+
kind: 'field';
|
|
12
|
+
field: string;
|
|
13
|
+
aggregates: readonly MetricAggregate[];
|
|
14
|
+
}>;
|
|
15
|
+
type MetricMeasurement = MetricCountMeasurement | MetricFieldMeasurement;
|
|
16
|
+
type MetricCardinalityRule = Readonly<{
|
|
17
|
+
maxValuesPerBucket: number;
|
|
18
|
+
overflow: MetricOverflowPolicy;
|
|
19
|
+
}>;
|
|
20
|
+
type MetricDefinition = Readonly<{
|
|
21
|
+
name: string;
|
|
22
|
+
version: number;
|
|
23
|
+
selector: string;
|
|
24
|
+
groupBy: readonly string[];
|
|
25
|
+
measurements: readonly MetricMeasurement[];
|
|
26
|
+
cardinality: Readonly<Record<string, MetricCardinalityRule>>;
|
|
27
|
+
targetIds: readonly string[];
|
|
28
|
+
resolutionsMs: readonly number[];
|
|
29
|
+
missingField: 'skip' | 'record-failure';
|
|
30
|
+
}>;
|
|
31
|
+
type ExtractedMetricSample = Readonly<{
|
|
32
|
+
metricName: string;
|
|
33
|
+
definitionVersion: number;
|
|
34
|
+
occurredAtMs: number;
|
|
35
|
+
producerId: string;
|
|
36
|
+
sequence: number;
|
|
37
|
+
dimensions: TelemetryJsonObject;
|
|
38
|
+
dimensionKey: string;
|
|
39
|
+
values: Readonly<Record<string, number>>;
|
|
40
|
+
targetIds: readonly string[];
|
|
41
|
+
}>;
|
|
42
|
+
type MetricExtractionFailure = Readonly<{
|
|
43
|
+
metricName: string;
|
|
44
|
+
definitionVersion: number;
|
|
45
|
+
producerId: string;
|
|
46
|
+
sequence: number;
|
|
47
|
+
reason: string;
|
|
48
|
+
}>;
|
|
49
|
+
type MetricExtraction = Readonly<{
|
|
50
|
+
samples: readonly ExtractedMetricSample[];
|
|
51
|
+
failures: readonly MetricExtractionFailure[];
|
|
52
|
+
}>;
|
|
53
|
+
type MetricRollupValues = Readonly<{
|
|
54
|
+
count: number;
|
|
55
|
+
fields: Readonly<Record<string, Readonly<{
|
|
56
|
+
count: number;
|
|
57
|
+
sum: number;
|
|
58
|
+
min: number;
|
|
59
|
+
max: number;
|
|
60
|
+
last: number;
|
|
61
|
+
lastOccurredAtMs: number;
|
|
62
|
+
lastProducerId: string;
|
|
63
|
+
lastSequence: number;
|
|
64
|
+
}>>>;
|
|
65
|
+
}>;
|
|
66
|
+
|
|
67
|
+
export type { ExtractedMetricSample as E, MetricDefinition as M, MetricExtractionFailure as a, MetricExtraction as b, MetricAggregate as c, MetricCardinalityRule as d, MetricMeasurement as e, MetricOverflowPolicy as f, MetricRollupValues as g };
|
package/dist/node/index.cjs
CHANGED
|
@@ -495,11 +495,15 @@ var MetricDefinitionContract = class {
|
|
|
495
495
|
if (!eventSelector || !bracket) {
|
|
496
496
|
return { ok: false, error: `Invalid metric selector ${selector}` };
|
|
497
497
|
}
|
|
498
|
+
const groupBy = bracket === "*" ? [] : bracket.split(",").map((field) => field.trim());
|
|
499
|
+
if (groupBy.some((field) => field.length === 0)) {
|
|
500
|
+
return { ok: false, error: `Invalid metric selector ${selector}` };
|
|
501
|
+
}
|
|
498
502
|
return {
|
|
499
503
|
ok: true,
|
|
500
504
|
value: {
|
|
501
505
|
selector: eventSelector,
|
|
502
|
-
groupBy
|
|
506
|
+
groupBy,
|
|
503
507
|
wildcardUngrouped: bracket === "*"
|
|
504
508
|
}
|
|
505
509
|
};
|