feat(telemetry): add canonical VPS host monitoring

This commit is contained in:
DCCONSTRUCTIONS
2026-08-22 17:29:30 +03:00
parent a3e7a015de
commit 23ea96fbb2
33 changed files with 2541 additions and 51 deletions
@@ -14,6 +14,9 @@ import {
normalizeAdapterMessage,
normalizeDiscoverySignal,
} from "../../../packages/device-protocol-contract/src/index.mjs";
import {
normalizeHostTelemetrySnapshot,
} from "../../../packages/infrastructure-telemetry-contract/src/index.mjs";
const CHANNEL_TRACKER_SESSION_ID = "channel:control";
const CHANNEL_PROFILE_REF = "channel.control.v1";
@@ -195,6 +198,20 @@ export function createDeviceEdgeChannelServer(options = {}) {
}
return Object.freeze({ status: "recorded" });
},
async submitHostTelemetry(snapshot) {
const normalized = normalizeHostTelemetrySnapshot(snapshot);
const result = await submitEvent("host.telemetry.observed", {
snapshot: normalized,
}, {
trackerSessionId: `host-telemetry:${normalized.hostKey}`,
adapterProfileRef: normalized.profile,
eventAt: normalized.observedAt,
});
if (result?.status !== "recorded") {
throw new Error("device_edge_channel_host_telemetry_invalid");
}
return Object.freeze({ status: "recorded" });
},
status() {
return Object.freeze({
listening: started,