@ue-shed/observability 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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/health.d.ts +56 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/health.js +58 -0
- package/dist/health.js.map +1 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +221 -0
- package/dist/index.js.map +1 -0
- package/dist/telemetry-sdk.d.ts +8 -0
- package/dist/telemetry-sdk.d.ts.map +1 -0
- package/dist/telemetry-sdk.js +31 -0
- package/dist/telemetry-sdk.js.map +1 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 UE Shed contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# `@ue-shed/observability`
|
|
2
|
+
|
|
3
|
+
Shared, headless OpenTelemetry composition, bounded runtime metrics, and schema-owned health for UE
|
|
4
|
+
Shed hosts. Applications provide `runtimeObservabilityLayer` once at their root. Local use does not
|
|
5
|
+
require an exporter; set `UE_SHED_TELEMETRY_MODE=console` to emit local traces, metrics, and logs.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install --save-exact @ue-shed/observability
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`RuntimeHealthService` is the diagnostic authority for CLI and UI clients. Consumers report typed
|
|
12
|
+
capability, connection, reader, stream, and telemetry state rather than parsing logs.
|
|
13
|
+
|
|
14
|
+
Node.js 22.14 or newer is required. This is a headless Node-host package; it does not depend on
|
|
15
|
+
Workbench, Electron, or any Unreal plugin.
|
package/dist/health.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
2
|
+
export declare const CapabilityHealth: Schema.Struct<{
|
|
3
|
+
readonly available: Schema.Boolean;
|
|
4
|
+
readonly name: Schema.String;
|
|
5
|
+
readonly required: Schema.Boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export interface CapabilityHealth extends Schema.Schema.Type<typeof CapabilityHealth> {
|
|
8
|
+
}
|
|
9
|
+
export declare const RuntimeHealthInput: Schema.Struct<{
|
|
10
|
+
readonly capabilities: Schema.$Array<Schema.Struct<{
|
|
11
|
+
readonly available: Schema.Boolean;
|
|
12
|
+
readonly name: Schema.String;
|
|
13
|
+
readonly required: Schema.Boolean;
|
|
14
|
+
}>>;
|
|
15
|
+
readonly connection: Schema.Literals<readonly ["not_configured", "connected", "reconnecting", "failed"]>;
|
|
16
|
+
readonly reader: Schema.Literals<readonly ["not_configured", "ready", "failed"]>;
|
|
17
|
+
readonly stream: Schema.Struct<{
|
|
18
|
+
readonly drops: Schema.Number;
|
|
19
|
+
readonly gaps: Schema.Number;
|
|
20
|
+
readonly queueDepth: Schema.Number;
|
|
21
|
+
}>;
|
|
22
|
+
readonly telemetry: Schema.Literals<readonly ["disabled", "ready", "degraded"]>;
|
|
23
|
+
}>;
|
|
24
|
+
export interface RuntimeHealthInput extends Schema.Schema.Type<typeof RuntimeHealthInput> {
|
|
25
|
+
}
|
|
26
|
+
export declare const RuntimeHealth: Schema.Struct<{
|
|
27
|
+
readonly reasons: Schema.$Array<Schema.String>;
|
|
28
|
+
readonly status: Schema.Literals<readonly ["healthy", "degraded", "unhealthy"]>;
|
|
29
|
+
readonly capabilities: Schema.$Array<Schema.Struct<{
|
|
30
|
+
readonly available: Schema.Boolean;
|
|
31
|
+
readonly name: Schema.String;
|
|
32
|
+
readonly required: Schema.Boolean;
|
|
33
|
+
}>>;
|
|
34
|
+
readonly connection: Schema.Literals<readonly ["not_configured", "connected", "reconnecting", "failed"]>;
|
|
35
|
+
readonly reader: Schema.Literals<readonly ["not_configured", "ready", "failed"]>;
|
|
36
|
+
readonly stream: Schema.Struct<{
|
|
37
|
+
readonly drops: Schema.Number;
|
|
38
|
+
readonly gaps: Schema.Number;
|
|
39
|
+
readonly queueDepth: Schema.Number;
|
|
40
|
+
}>;
|
|
41
|
+
readonly telemetry: Schema.Literals<readonly ["disabled", "ready", "degraded"]>;
|
|
42
|
+
}>;
|
|
43
|
+
export interface RuntimeHealth extends Schema.Schema.Type<typeof RuntimeHealth> {
|
|
44
|
+
}
|
|
45
|
+
export declare const defaultHealthInput: RuntimeHealthInput;
|
|
46
|
+
export declare function aggregateHealth(input: RuntimeHealthInput): RuntimeHealth;
|
|
47
|
+
export interface RuntimeHealthServiceShape {
|
|
48
|
+
readonly report: (input: RuntimeHealthInput) => Effect.Effect<RuntimeHealth>;
|
|
49
|
+
readonly snapshot: () => Effect.Effect<RuntimeHealth>;
|
|
50
|
+
}
|
|
51
|
+
declare const RuntimeHealthService_base: Context.ServiceClass<RuntimeHealthService, "@ue-shed/observability/RuntimeHealthService", RuntimeHealthServiceShape>;
|
|
52
|
+
export declare class RuntimeHealthService extends RuntimeHealthService_base {
|
|
53
|
+
}
|
|
54
|
+
export declare function runtimeHealthLayer(initial?: RuntimeHealthInput): Layer.Layer<RuntimeHealthService>;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAO,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE7D,eAAO,MAAM,gBAAgB;;;;EAI3B,CAAC;AACH,MAAM,WAAW,gBAAiB,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC;CAAG;AAExF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;EAU7B,CAAC;AACH,MAAM,WAAW,kBAAmB,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC;CAAG;AAE5F,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;EAIxB,CAAC;AACH,MAAM,WAAW,aAAc,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,aAAa,CAAC;CAAG;AAElF,eAAO,MAAM,kBAAkB,EAAE,kBAMhC,CAAC;AAEF,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAsBxE;AAED,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAC7E,QAAQ,CAAC,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;CACtD;;AAED,qBAAa,oBAAqB,SAAQ,yBAGQ;CAAG;AAErD,wBAAgB,kBAAkB,CACjC,OAAO,GAAE,kBAAuC,GAC9C,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAenC"}
|
package/dist/health.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Ref, Schema } from "effect";
|
|
2
|
+
export const CapabilityHealth = Schema.Struct({
|
|
3
|
+
available: Schema.Boolean,
|
|
4
|
+
name: Schema.String,
|
|
5
|
+
required: Schema.Boolean
|
|
6
|
+
});
|
|
7
|
+
export const RuntimeHealthInput = Schema.Struct({
|
|
8
|
+
capabilities: Schema.Array(CapabilityHealth),
|
|
9
|
+
connection: Schema.Literals(["not_configured", "connected", "reconnecting", "failed"]),
|
|
10
|
+
reader: Schema.Literals(["not_configured", "ready", "failed"]),
|
|
11
|
+
stream: Schema.Struct({
|
|
12
|
+
drops: Schema.Number,
|
|
13
|
+
gaps: Schema.Number,
|
|
14
|
+
queueDepth: Schema.Number
|
|
15
|
+
}),
|
|
16
|
+
telemetry: Schema.Literals(["disabled", "ready", "degraded"])
|
|
17
|
+
});
|
|
18
|
+
export const RuntimeHealth = Schema.Struct({
|
|
19
|
+
...RuntimeHealthInput.fields,
|
|
20
|
+
reasons: Schema.Array(Schema.String),
|
|
21
|
+
status: Schema.Literals(["healthy", "degraded", "unhealthy"])
|
|
22
|
+
});
|
|
23
|
+
export const defaultHealthInput = {
|
|
24
|
+
capabilities: [],
|
|
25
|
+
connection: "not_configured",
|
|
26
|
+
reader: "not_configured",
|
|
27
|
+
stream: { drops: 0, gaps: 0, queueDepth: 0 },
|
|
28
|
+
telemetry: "disabled"
|
|
29
|
+
};
|
|
30
|
+
export function aggregateHealth(input) {
|
|
31
|
+
const missingRequired = input.capabilities.filter((capability) => capability.required && !capability.available);
|
|
32
|
+
const reasons = [
|
|
33
|
+
...missingRequired.map((capability) => `Required capability unavailable: ${capability.name}`),
|
|
34
|
+
...(input.connection === "failed" ? ["Connection failed"] : []),
|
|
35
|
+
...(input.connection === "reconnecting" ? ["Connection is reconnecting"] : []),
|
|
36
|
+
...(input.reader === "failed" ? ["Saved-asset reader failed"] : []),
|
|
37
|
+
...(input.telemetry === "degraded" ? ["Telemetry export is degraded"] : []),
|
|
38
|
+
...(input.stream.gaps > 0 ? [`Stream reported ${input.stream.gaps} gap(s)`] : []),
|
|
39
|
+
...(input.stream.drops > 0 ? [`Stream reported ${input.stream.drops} drop(s)`] : [])
|
|
40
|
+
];
|
|
41
|
+
const unhealthy = missingRequired.length > 0 || input.connection === "failed" || input.reader === "failed";
|
|
42
|
+
return {
|
|
43
|
+
...input,
|
|
44
|
+
reasons,
|
|
45
|
+
status: unhealthy ? "unhealthy" : reasons.length > 0 ? "degraded" : "healthy"
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export class RuntimeHealthService extends Context.Service()("@ue-shed/observability/RuntimeHealthService") {
|
|
49
|
+
}
|
|
50
|
+
export function runtimeHealthLayer(initial = defaultHealthInput) {
|
|
51
|
+
return Layer.effect(RuntimeHealthService, Effect.gen(function* () {
|
|
52
|
+
const state = yield* Ref.make(aggregateHealth(initial));
|
|
53
|
+
const report = Effect.fn("Observability.RuntimeHealth.report")((input) => Ref.set(state, aggregateHealth(input)).pipe(Effect.as(aggregateHealth(input))));
|
|
54
|
+
const snapshot = Effect.fn("Observability.RuntimeHealth.snapshot")(() => Ref.get(state));
|
|
55
|
+
return RuntimeHealthService.of({ report, snapshot });
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AA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@opentelemetry/sdk-trace-base";
|
|
2
|
+
import { Config, Effect, Layer, Metric, Schema } from "effect";
|
|
3
|
+
export * from "./health.js";
|
|
4
|
+
export declare const TelemetryMode: Schema.Literals<readonly ["disabled", "console"]>;
|
|
5
|
+
export type TelemetryMode = typeof TelemetryMode.Type;
|
|
6
|
+
export declare const queueDepth: Metric.Gauge<number>;
|
|
7
|
+
export declare const streamDrops: Metric.Counter<number>;
|
|
8
|
+
export declare const streamGaps: Metric.Counter<number>;
|
|
9
|
+
export declare const cameraReplacements: Metric.Counter<number>;
|
|
10
|
+
export declare const authoringTransitions: Metric.Frequency;
|
|
11
|
+
export declare const coverage: Metric.Gauge<number>;
|
|
12
|
+
export declare const observatoryMetrics: {
|
|
13
|
+
actorsChanged: Metric.Counter<number>;
|
|
14
|
+
actorsSampled: Metric.Counter<number>;
|
|
15
|
+
boundsCalculations: Metric.Counter<number>;
|
|
16
|
+
bytes: Metric.Counter<number>;
|
|
17
|
+
catalogDuration: Metric.Histogram<number>;
|
|
18
|
+
decodeApplyDuration: Metric.Histogram<number>;
|
|
19
|
+
ipcReplacements: Metric.Counter<number>;
|
|
20
|
+
packets: Metric.Counter<number>;
|
|
21
|
+
paintDuration: Metric.Histogram<number>;
|
|
22
|
+
presentationHz: Metric.Gauge<number>;
|
|
23
|
+
producerReplacements: Metric.Counter<number>;
|
|
24
|
+
receiverReplacements: Metric.Counter<number>;
|
|
25
|
+
sampleHz: Metric.Gauge<number>;
|
|
26
|
+
sequenceGaps: Metric.Counter<number>;
|
|
27
|
+
};
|
|
28
|
+
export declare const reviewAssessmentMetrics: {
|
|
29
|
+
attempts: Metric.Counter<number>;
|
|
30
|
+
duration: Metric.Histogram<number>;
|
|
31
|
+
failures: Metric.Counter<number>;
|
|
32
|
+
samples: Metric.Histogram<number>;
|
|
33
|
+
};
|
|
34
|
+
export declare const operationMetrics: {
|
|
35
|
+
errors: Metric.Counter<number>;
|
|
36
|
+
latency: Metric.Histogram<number>;
|
|
37
|
+
traffic: Metric.Counter<number>;
|
|
38
|
+
};
|
|
39
|
+
export declare function recordStreamState(state: {
|
|
40
|
+
readonly drops: number;
|
|
41
|
+
readonly gaps: number;
|
|
42
|
+
readonly queueDepth: number;
|
|
43
|
+
}): Effect.Effect<void>;
|
|
44
|
+
export declare const recordCameraReplacements: (count: number) => Effect.Effect<void>;
|
|
45
|
+
export declare const recordAuthoringTransition: (transition: string) => Effect.Effect<void>;
|
|
46
|
+
export declare const recordCoverage: (ratio: number) => Effect.Effect<void>;
|
|
47
|
+
export declare function recordObservatoryCatalog(input: {
|
|
48
|
+
readonly boundsCalculations: number;
|
|
49
|
+
readonly durationMs: number;
|
|
50
|
+
}): Effect.Effect<void>;
|
|
51
|
+
export declare function recordObservatoryPacket(input: {
|
|
52
|
+
readonly actorsChanged: number;
|
|
53
|
+
readonly actorsSampled: number;
|
|
54
|
+
readonly bytes: number;
|
|
55
|
+
readonly decodeApplyMs: number;
|
|
56
|
+
readonly producerReplacements?: number;
|
|
57
|
+
readonly sequenceGap?: boolean;
|
|
58
|
+
}): Effect.Effect<void>;
|
|
59
|
+
export declare const recordObservatoryReceiverReplacements: (count: number) => Effect.Effect<void>;
|
|
60
|
+
export declare const recordObservatoryIpcReplacements: (count: number) => Effect.Effect<void>;
|
|
61
|
+
export declare const recordObservatoryPaintDuration: (durationMs: number) => Effect.Effect<void>;
|
|
62
|
+
export declare function recordObservatoryCadence(input: {
|
|
63
|
+
readonly presentationHz?: number;
|
|
64
|
+
readonly sampleHz?: number;
|
|
65
|
+
}): Effect.Effect<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Aggregates only bounded assessment facts. Callers must not attach actor, view, operation, map,
|
|
68
|
+
* artifact, or filesystem identity to these metrics.
|
|
69
|
+
*/
|
|
70
|
+
export declare function recordReviewAssessment(input: {
|
|
71
|
+
readonly assessmentDurationMs?: number;
|
|
72
|
+
readonly sampleCount?: number;
|
|
73
|
+
readonly status: "assessed" | "assessment_failed" | "not_assessed";
|
|
74
|
+
}): Effect.Effect<void>;
|
|
75
|
+
export declare function observeOperation<A, E, R>(name: string, effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R>;
|
|
76
|
+
export interface RuntimeObservabilityOptions {
|
|
77
|
+
readonly serviceName: string;
|
|
78
|
+
readonly serviceVersion?: string;
|
|
79
|
+
readonly spanProcessor?: SpanProcessor;
|
|
80
|
+
}
|
|
81
|
+
export declare function runtimeObservabilityLayer(options: RuntimeObservabilityOptions): Layer.Layer<import("./health.js").RuntimeHealthService, Config.ConfigError, never>;
|
|
82
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAQ,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrE,cAAc,aAAa,CAAC;AAE5B,eAAO,MAAM,aAAa,mDAA2C,CAAC;AACtE,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAC;AActD,eAAO,MAAM,UAAU,sBAErB,CAAC;AACH,eAAO,MAAM,WAAW,wBAGtB,CAAC;AACH,eAAO,MAAM,UAAU,wBAGrB,CAAC;AACH,eAAO,MAAM,kBAAkB,wBAG7B,CAAC;AACH,eAAO,MAAM,oBAAoB,kBAE/B,CAAC;AACH,eAAO,MAAM,QAAQ,sBAEnB,CAAC;AAqFH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;CAe9B,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;CAKnC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAA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AAElE,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC/C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAStB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,mBAAmB,GAAG,cAAc,CAAC;CACnE,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CActB;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EACvC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAC5B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAUxB;AAMD,MAAM,WAAW,2BAA2B;IAC3C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC;CACvC;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,2BAA2B,sFAiB7E"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { Config, Effect, Exit, Layer, Metric, Schema } from "effect";
|
|
2
|
+
import { defaultHealthInput, runtimeHealthLayer } from "./health.js";
|
|
3
|
+
export * from "./health.js";
|
|
4
|
+
export const TelemetryMode = Schema.Literals(["disabled", "console"]);
|
|
5
|
+
const operationTraffic = Metric.counter("ue_shed_operation_total", {
|
|
6
|
+
description: "Completed UE Shed runtime operations",
|
|
7
|
+
incremental: true
|
|
8
|
+
});
|
|
9
|
+
const operationErrors = Metric.counter("ue_shed_operation_error_total", {
|
|
10
|
+
description: "Failed UE Shed runtime operations",
|
|
11
|
+
incremental: true
|
|
12
|
+
});
|
|
13
|
+
const operationLatency = Metric.histogram("ue_shed_operation_duration_ms", {
|
|
14
|
+
boundaries: [1, 5, 10, 25, 50, 100, 250, 500, 1_000, 5_000, 30_000],
|
|
15
|
+
description: "UE Shed operation duration in milliseconds"
|
|
16
|
+
});
|
|
17
|
+
export const queueDepth = Metric.gauge("ue_shed_queue_depth", {
|
|
18
|
+
description: "Current bounded queue depth"
|
|
19
|
+
});
|
|
20
|
+
export const streamDrops = Metric.counter("ue_shed_stream_drop_total", {
|
|
21
|
+
description: "Dropped stream items",
|
|
22
|
+
incremental: true
|
|
23
|
+
});
|
|
24
|
+
export const streamGaps = Metric.counter("ue_shed_stream_gap_total", {
|
|
25
|
+
description: "Detected stream gaps",
|
|
26
|
+
incremental: true
|
|
27
|
+
});
|
|
28
|
+
export const cameraReplacements = Metric.counter("ue_shed_camera_replacement_total", {
|
|
29
|
+
description: "Camera frames replaced by bounded delivery",
|
|
30
|
+
incremental: true
|
|
31
|
+
});
|
|
32
|
+
export const authoringTransitions = Metric.frequency("ue_shed_authoring_transition_total", {
|
|
33
|
+
description: "Apply and Save authority transition outcomes"
|
|
34
|
+
});
|
|
35
|
+
export const coverage = Metric.gauge("ue_shed_coverage_ratio", {
|
|
36
|
+
description: "Domain coverage ratio from zero to one"
|
|
37
|
+
});
|
|
38
|
+
const observatoryCatalogDuration = Metric.histogram("ue_shed_observatory_catalog_duration_ms", {
|
|
39
|
+
boundaries: [1, 5, 10, 25, 50, 100, 250, 500, 1_000, 5_000],
|
|
40
|
+
description: "Unreal catalog collection duration in milliseconds"
|
|
41
|
+
});
|
|
42
|
+
const observatoryBoundsCalculations = Metric.counter("ue_shed_observatory_bounds_calculations_total", {
|
|
43
|
+
description: "Actor bounds calculations performed during catalog collection",
|
|
44
|
+
incremental: true
|
|
45
|
+
});
|
|
46
|
+
const observatoryActorsSampled = Metric.counter("ue_shed_observatory_actors_sampled_total", {
|
|
47
|
+
description: "Actors sampled by the Unreal transform producer",
|
|
48
|
+
incremental: true
|
|
49
|
+
});
|
|
50
|
+
const observatoryActorsChanged = Metric.counter("ue_shed_observatory_actors_changed_total", {
|
|
51
|
+
description: "Actors included in changed-transform packets",
|
|
52
|
+
incremental: true
|
|
53
|
+
});
|
|
54
|
+
const observatoryPackets = Metric.counter("ue_shed_observatory_packets_total", {
|
|
55
|
+
description: "Decoded Observatory transform packets",
|
|
56
|
+
incremental: true
|
|
57
|
+
});
|
|
58
|
+
const observatoryBytes = Metric.counter("ue_shed_observatory_bytes_total", {
|
|
59
|
+
description: "Bytes received on the Observatory actor stream",
|
|
60
|
+
incremental: true
|
|
61
|
+
});
|
|
62
|
+
const observatorySequenceGaps = Metric.counter("ue_shed_observatory_sequence_gap_total", {
|
|
63
|
+
description: "Detected Observatory transform sequence gaps",
|
|
64
|
+
incremental: true
|
|
65
|
+
});
|
|
66
|
+
const observatoryProducerReplacements = Metric.counter("ue_shed_observatory_producer_replacement_total", {
|
|
67
|
+
description: "Producer-side Observatory packet replacements",
|
|
68
|
+
incremental: true
|
|
69
|
+
});
|
|
70
|
+
const observatoryReceiverReplacements = Metric.counter("ue_shed_observatory_receiver_replacement_total", {
|
|
71
|
+
description: "Host receiver Observatory packet replacements",
|
|
72
|
+
incremental: true
|
|
73
|
+
});
|
|
74
|
+
const observatoryIpcReplacements = Metric.counter("ue_shed_observatory_ipc_replacement_total", {
|
|
75
|
+
description: "Workbench IPC Observatory event replacements",
|
|
76
|
+
incremental: true
|
|
77
|
+
});
|
|
78
|
+
const observatoryDecodeApplyDuration = Metric.histogram("ue_shed_observatory_decode_apply_duration_ms", {
|
|
79
|
+
boundaries: [0.1, 0.25, 0.5, 1, 2, 4, 8, 16.7, 33, 50, 100],
|
|
80
|
+
description: "Decode plus retained-state apply duration in milliseconds"
|
|
81
|
+
});
|
|
82
|
+
const observatoryPaintDuration = Metric.histogram("ue_shed_observatory_paint_duration_ms", {
|
|
83
|
+
boundaries: [0.1, 0.25, 0.5, 1, 2, 4, 8, 16.7, 33, 50, 100],
|
|
84
|
+
description: "World Scout Canvas paint duration in milliseconds"
|
|
85
|
+
});
|
|
86
|
+
const observatorySampleHz = Metric.gauge("ue_shed_observatory_sample_hz", {
|
|
87
|
+
description: "Effective Observatory transform sample cadence"
|
|
88
|
+
});
|
|
89
|
+
const observatoryPresentationHz = Metric.gauge("ue_shed_observatory_presentation_hz", {
|
|
90
|
+
description: "Effective World Scout presentation cadence"
|
|
91
|
+
});
|
|
92
|
+
const reviewAssessmentAttempts = Metric.counter("ue_shed_review_assessment_total", {
|
|
93
|
+
description: "Map Review visibility assessments with bounded producer evidence",
|
|
94
|
+
incremental: true
|
|
95
|
+
});
|
|
96
|
+
const reviewAssessmentFailures = Metric.counter("ue_shed_review_assessment_failure_total", {
|
|
97
|
+
description: "Map Review visibility assessments without usable raw evidence",
|
|
98
|
+
incremental: true
|
|
99
|
+
});
|
|
100
|
+
const reviewAssessmentDuration = Metric.histogram("ue_shed_review_assessment_duration_ms", {
|
|
101
|
+
boundaries: [0.1, 0.25, 0.5, 1, 2, 4, 8, 16, 33, 50, 100, 250, 500, 1_000, 5_000],
|
|
102
|
+
description: "Unreal auxiliary visibility assessment and readback duration in milliseconds"
|
|
103
|
+
});
|
|
104
|
+
const reviewAssessmentSamples = Metric.histogram("ue_shed_review_assessment_samples", {
|
|
105
|
+
boundaries: [0, 1, 9, 64, 256, 1_024, 4_096, 16_384, 57_600],
|
|
106
|
+
description: "Bounded image-space or collision samples in a Map Review visibility assessment"
|
|
107
|
+
});
|
|
108
|
+
export const observatoryMetrics = {
|
|
109
|
+
actorsChanged: observatoryActorsChanged,
|
|
110
|
+
actorsSampled: observatoryActorsSampled,
|
|
111
|
+
boundsCalculations: observatoryBoundsCalculations,
|
|
112
|
+
bytes: observatoryBytes,
|
|
113
|
+
catalogDuration: observatoryCatalogDuration,
|
|
114
|
+
decodeApplyDuration: observatoryDecodeApplyDuration,
|
|
115
|
+
ipcReplacements: observatoryIpcReplacements,
|
|
116
|
+
packets: observatoryPackets,
|
|
117
|
+
paintDuration: observatoryPaintDuration,
|
|
118
|
+
presentationHz: observatoryPresentationHz,
|
|
119
|
+
producerReplacements: observatoryProducerReplacements,
|
|
120
|
+
receiverReplacements: observatoryReceiverReplacements,
|
|
121
|
+
sampleHz: observatorySampleHz,
|
|
122
|
+
sequenceGaps: observatorySequenceGaps
|
|
123
|
+
};
|
|
124
|
+
export const reviewAssessmentMetrics = {
|
|
125
|
+
attempts: reviewAssessmentAttempts,
|
|
126
|
+
duration: reviewAssessmentDuration,
|
|
127
|
+
failures: reviewAssessmentFailures,
|
|
128
|
+
samples: reviewAssessmentSamples
|
|
129
|
+
};
|
|
130
|
+
export const operationMetrics = {
|
|
131
|
+
errors: operationErrors,
|
|
132
|
+
latency: operationLatency,
|
|
133
|
+
traffic: operationTraffic
|
|
134
|
+
};
|
|
135
|
+
export function recordStreamState(state) {
|
|
136
|
+
return Effect.all([
|
|
137
|
+
Metric.update(queueDepth, state.queueDepth),
|
|
138
|
+
Metric.update(streamDrops, state.drops),
|
|
139
|
+
Metric.update(streamGaps, state.gaps)
|
|
140
|
+
]).pipe(Effect.asVoid);
|
|
141
|
+
}
|
|
142
|
+
export const recordCameraReplacements = (count) => Metric.update(cameraReplacements, count);
|
|
143
|
+
export const recordAuthoringTransition = (transition) => Metric.update(authoringTransitions, transition);
|
|
144
|
+
export const recordCoverage = (ratio) => Metric.update(coverage, Math.max(0, Math.min(1, ratio)));
|
|
145
|
+
export function recordObservatoryCatalog(input) {
|
|
146
|
+
return Effect.all([
|
|
147
|
+
Metric.update(observatoryCatalogDuration, Math.max(0, input.durationMs)),
|
|
148
|
+
Metric.update(observatoryBoundsCalculations, Math.max(0, input.boundsCalculations))
|
|
149
|
+
]).pipe(Effect.asVoid);
|
|
150
|
+
}
|
|
151
|
+
export function recordObservatoryPacket(input) {
|
|
152
|
+
return Effect.all([
|
|
153
|
+
Metric.update(observatoryPackets, 1),
|
|
154
|
+
Metric.update(observatoryBytes, Math.max(0, input.bytes)),
|
|
155
|
+
Metric.update(observatoryActorsSampled, Math.max(0, input.actorsSampled)),
|
|
156
|
+
Metric.update(observatoryActorsChanged, Math.max(0, input.actorsChanged)),
|
|
157
|
+
Metric.update(observatoryDecodeApplyDuration, Math.max(0, input.decodeApplyMs)),
|
|
158
|
+
Metric.update(observatoryProducerReplacements, Math.max(0, input.producerReplacements ?? 0)),
|
|
159
|
+
Metric.update(observatorySequenceGaps, input.sequenceGap === true ? 1 : 0)
|
|
160
|
+
]).pipe(Effect.asVoid);
|
|
161
|
+
}
|
|
162
|
+
export const recordObservatoryReceiverReplacements = (count) => Metric.update(observatoryReceiverReplacements, Math.max(0, count));
|
|
163
|
+
export const recordObservatoryIpcReplacements = (count) => Metric.update(observatoryIpcReplacements, Math.max(0, count));
|
|
164
|
+
export const recordObservatoryPaintDuration = (durationMs) => Metric.update(observatoryPaintDuration, Math.max(0, durationMs));
|
|
165
|
+
export function recordObservatoryCadence(input) {
|
|
166
|
+
const updates = [];
|
|
167
|
+
if (input.sampleHz !== undefined) {
|
|
168
|
+
updates.push(Metric.update(observatorySampleHz, Math.max(0, input.sampleHz)));
|
|
169
|
+
}
|
|
170
|
+
if (input.presentationHz !== undefined) {
|
|
171
|
+
updates.push(Metric.update(observatoryPresentationHz, Math.max(0, input.presentationHz)));
|
|
172
|
+
}
|
|
173
|
+
return updates.length === 0 ? Effect.void : Effect.all(updates).pipe(Effect.asVoid);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Aggregates only bounded assessment facts. Callers must not attach actor, view, operation, map,
|
|
177
|
+
* artifact, or filesystem identity to these metrics.
|
|
178
|
+
*/
|
|
179
|
+
export function recordReviewAssessment(input) {
|
|
180
|
+
const updates = [Metric.update(reviewAssessmentAttempts, 1)];
|
|
181
|
+
if (input.status === "assessment_failed") {
|
|
182
|
+
updates.push(Metric.update(reviewAssessmentFailures, 1));
|
|
183
|
+
}
|
|
184
|
+
if (input.assessmentDurationMs !== undefined) {
|
|
185
|
+
updates.push(Metric.update(reviewAssessmentDuration, Math.max(0, input.assessmentDurationMs)));
|
|
186
|
+
}
|
|
187
|
+
if (input.sampleCount !== undefined) {
|
|
188
|
+
updates.push(Metric.update(reviewAssessmentSamples, Math.max(0, input.sampleCount)));
|
|
189
|
+
}
|
|
190
|
+
return Effect.all(updates).pipe(Effect.asVoid);
|
|
191
|
+
}
|
|
192
|
+
export function observeOperation(name, effect) {
|
|
193
|
+
return Effect.gen(function* () {
|
|
194
|
+
const started = yield* Effect.clockWith((clock) => clock.currentTimeMillis);
|
|
195
|
+
const exit = yield* Effect.exit(effect);
|
|
196
|
+
const finished = yield* Effect.clockWith((clock) => clock.currentTimeMillis);
|
|
197
|
+
yield* Metric.update(operationTraffic, 1);
|
|
198
|
+
yield* Metric.update(operationLatency, Math.max(0, finished - started));
|
|
199
|
+
if (Exit.isFailure(exit))
|
|
200
|
+
yield* Metric.update(operationErrors, 1);
|
|
201
|
+
return yield* exit;
|
|
202
|
+
}).pipe(Effect.withSpan(name), Effect.annotateSpans("operation", name));
|
|
203
|
+
}
|
|
204
|
+
const telemetryModeConfig = Config.literals(["disabled", "console"], "UE_SHED_TELEMETRY_MODE").pipe(Config.withDefault("disabled"));
|
|
205
|
+
export function runtimeObservabilityLayer(options) {
|
|
206
|
+
return Layer.unwrap(Effect.gen(function* () {
|
|
207
|
+
const mode = yield* telemetryModeConfig;
|
|
208
|
+
const health = runtimeHealthLayer({
|
|
209
|
+
...defaultHealthInput,
|
|
210
|
+
telemetry: mode === "disabled" ? "disabled" : "ready"
|
|
211
|
+
});
|
|
212
|
+
if (mode === "disabled" && options.spanProcessor === undefined) {
|
|
213
|
+
// Telemetry is fully disabled: no OpenTelemetry services are installed and the SDK
|
|
214
|
+
// modules are never loaded. Effect spans and metrics keep their in-memory behavior.
|
|
215
|
+
return Layer.merge(Layer.empty, health);
|
|
216
|
+
}
|
|
217
|
+
const { telemetrySdkLayer } = yield* Effect.promise(() => import("./telemetry-sdk.js"));
|
|
218
|
+
return Layer.merge(telemetrySdkLayer(options, mode), health);
|
|
219
|
+
}));
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAErE,cAAc,aAAa,CAAC;AAE5B,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;AAGtE,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,yBAAyB,EAAE;IAClE,WAAW,EAAE,sCAAsC;IACnD,WAAW,EAAE,IAAI;CACjB,CAAC,CAAC;AACH,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,+BAA+B,EAAE;IACvE,WAAW,EAAE,mCAAmC;IAChD,WAAW,EAAE,IAAI;CACjB,CAAC,CAAC;AACH,MAAM,gBAAgB,GAAG,MAAM,CAAC,SAAS,CAAC,+BAA+B,EAAE;IAC1E,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC;IACnE,WAAW,EAAE,4CAA4C;CACzD,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE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AG,CAAC,QAAQ,CAAC;QACnB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,mBAAmB,CAAC;QACxC,MAAM,MAAM,GAAG,kBAAkB,CAAC;YACjC,GAAG,kBAAkB;YACrB,SAAS,EAAE,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO;SACrD,CAAC,CAAC;QACH,IAAI,IAAI,KAAK,UAAU,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YAChE,mFAAmF;YACnF,oFAAoF;YACpF,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACzC,CAAC;QACD,MAAM,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC;QACxF,OAAO,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC,CAAC,CACF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RuntimeObservabilityOptions, TelemetryMode } from "./index.js";
|
|
2
|
+
/**
|
|
3
|
+
* OpenTelemetry SDK wiring for `runtimeObservabilityLayer`, isolated so runtimes with telemetry
|
|
4
|
+
* disabled never pay the SDK module-evaluation cost. `index.ts` imports this module lazily and
|
|
5
|
+
* only when telemetry is enabled or an explicit span processor is provided.
|
|
6
|
+
*/
|
|
7
|
+
export declare function telemetrySdkLayer(options: RuntimeObservabilityOptions, mode: TelemetryMode): import("effect/Layer").Layer<import("@effect/opentelemetry/Resource").Resource, never, never>;
|
|
8
|
+
//# sourceMappingURL=telemetry-sdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-sdk.d.ts","sourceRoot":"","sources":["../src/telemetry-sdk.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,2BAA2B,EAAE,IAAI,EAAE,aAAa,iGAuB1F"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { NodeSdk } from "@effect/opentelemetry";
|
|
2
|
+
import { ConsoleLogRecordExporter, SimpleLogRecordProcessor } from "@opentelemetry/sdk-logs";
|
|
3
|
+
import { ConsoleMetricExporter, PeriodicExportingMetricReader } from "@opentelemetry/sdk-metrics";
|
|
4
|
+
import { ConsoleSpanExporter, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
5
|
+
/**
|
|
6
|
+
* OpenTelemetry SDK wiring for `runtimeObservabilityLayer`, isolated so runtimes with telemetry
|
|
7
|
+
* disabled never pay the SDK module-evaluation cost. `index.ts` imports this module lazily and
|
|
8
|
+
* only when telemetry is enabled or an explicit span processor is provided.
|
|
9
|
+
*/
|
|
10
|
+
export function telemetrySdkLayer(options, mode) {
|
|
11
|
+
const spanProcessor = options.spanProcessor ?? new SimpleSpanProcessor(new ConsoleSpanExporter());
|
|
12
|
+
return NodeSdk.layer(() => ({
|
|
13
|
+
logRecordProcessor: mode === "console"
|
|
14
|
+
? new SimpleLogRecordProcessor(new ConsoleLogRecordExporter())
|
|
15
|
+
: undefined,
|
|
16
|
+
metricReader: mode === "console"
|
|
17
|
+
? new PeriodicExportingMetricReader({
|
|
18
|
+
exporter: new ConsoleMetricExporter(),
|
|
19
|
+
exportIntervalMillis: 30_000
|
|
20
|
+
})
|
|
21
|
+
: undefined,
|
|
22
|
+
resource: {
|
|
23
|
+
serviceName: options.serviceName,
|
|
24
|
+
...(options.serviceVersion === undefined
|
|
25
|
+
? {}
|
|
26
|
+
: { serviceVersion: options.serviceVersion })
|
|
27
|
+
},
|
|
28
|
+
spanProcessor
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=telemetry-sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-sdk.js","sourceRoot":"","sources":["../src/telemetry-sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGzF;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAoC,EAAE,IAAmB;IAC1F,MAAM,aAAa,GAClB,OAAO,CAAC,aAAa,IAAI,IAAI,mBAAmB,CAAC,IAAI,mBAAmB,EAAE,CAAC,CAAC;IAC7E,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;QAC3B,kBAAkB,EACjB,IAAI,KAAK,SAAS;YACjB,CAAC,CAAC,IAAI,wBAAwB,CAAC,IAAI,wBAAwB,EAAE,CAAC;YAC9D,CAAC,CAAC,SAAS;QACb,YAAY,EACX,IAAI,KAAK,SAAS;YACjB,CAAC,CAAC,IAAI,6BAA6B,CAAC;gBAClC,QAAQ,EAAE,IAAI,qBAAqB,EAAE;gBACrC,oBAAoB,EAAE,MAAM;aAC5B,CAAC;YACH,CAAC,CAAC,SAAS;QACb,QAAQ,EAAE;YACT,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,GAAG,CAAC,OAAO,CAAC,cAAc,KAAK,SAAS;gBACvC,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;SAC9C;QACD,aAAa;KACb,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ue-shed/observability",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Headless OpenTelemetry composition, bounded metrics, and runtime health for UE Shed hosts.",
|
|
5
|
+
"homepage": "https://github.com/ue-shed/ue-shed#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/ue-shed/ue-shed/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/ue-shed/ue-shed.git",
|
|
13
|
+
"directory": "packages/observability"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./health": {
|
|
30
|
+
"types": "./dist/health.d.ts",
|
|
31
|
+
"import": "./dist/health.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@effect/opentelemetry": "4.0.0-beta.98",
|
|
39
|
+
"@opentelemetry/api": "^1.9.0",
|
|
40
|
+
"@opentelemetry/api-logs": "^0.205.0",
|
|
41
|
+
"@opentelemetry/resources": "^2.2.0",
|
|
42
|
+
"@opentelemetry/sdk-logs": "^0.205.0",
|
|
43
|
+
"@opentelemetry/sdk-metrics": "^2.2.0",
|
|
44
|
+
"@opentelemetry/sdk-trace-base": "^2.2.0",
|
|
45
|
+
"@opentelemetry/sdk-trace-node": "^2.2.0",
|
|
46
|
+
"@opentelemetry/sdk-trace-web": "^2.2.0",
|
|
47
|
+
"@opentelemetry/semantic-conventions": "^1.38.0",
|
|
48
|
+
"effect": "4.0.0-beta.98"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@effect/vitest": "4.0.0-beta.98"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=22.14.0"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsc -p tsconfig.build.json",
|
|
58
|
+
"typecheck": "tsc --noEmit"
|
|
59
|
+
}
|
|
60
|
+
}
|