feat: expose v02 webui performance metrics

This commit is contained in:
Codex Agent
2026-06-05 11:13:45 +08:00
parent 48e3d24ad6
commit ab7d79c69a
15 changed files with 901 additions and 28 deletions
+5
View File
@@ -242,6 +242,11 @@ test("v02 render follows TypeScript runtime checks and does not self-patch boots
assert.match(workload.spec.template.metadata.annotations["hwlab.pikastech.local/metrics-sidecar-sha256"], /^[a-f0-9]{64}$/u);
assert.ok(sidecar.env.some((entry) => entry.name === "HWLAB_METRICS_SERVICE_ID" && entry.value === serviceId));
assert.ok(sidecar.ports.some((port) => port.name === "metrics" && port.containerPort === 9100));
if (serviceId === "hwlab-cloud-api") {
assert.ok(sidecar.env.some((entry) => entry.name === "HWLAB_METRICS_EXTRA_URL" && /\/v1\/web-performance\/metrics$/u.test(entry.value)), "cloud-api sidecar should scrape WebUI performance metrics from loopback");
} else {
assert.equal(sidecar.env.some((entry) => entry.name === "HWLAB_METRICS_EXTRA_URL"), false, `unexpected extra metrics target for ${serviceId}`);
}
}
const deepseekService = deepseekProxy.items.find((item) => item.kind === "Service" && item.metadata?.name === "hwlab-deepseek-proxy");
assert.equal(deepseekService.metadata.labels["hwlab.pikastech.local/monitoring"], "enabled");