From 7293d65d34ca9fe367402958a8cf8fc12e818b1a Mon Sep 17 00:00:00 2001 From: Lyon <88232613+pikasTech@users.noreply.github.com> Date: Mon, 22 Jun 2026 15:22:19 +0800 Subject: [PATCH] fix: show hwlab phase attrs in otel summary (#662) Co-authored-by: Codex --- scripts/src/platform-infra-observability.ts | 35 ++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/scripts/src/platform-infra-observability.ts b/scripts/src/platform-infra-observability.ts index db676555..4e101795 100644 --- a/scripts/src/platform-infra-observability.ts +++ b/scripts/src/platform-infra-observability.ts @@ -1061,6 +1061,14 @@ function spanDetail(span: Record, maxLength: number): string { attrPart(attrs, "commandFingerprint"), attrPart(attrs, "http.route"), attrPart(attrs, "http.response.status_code"), + attrPart(attrs, "hwlab.http.stage"), + attrPart(attrs, "hwlab.http.phase"), + attrPart(attrs, "hwlab.http.phase.outcome"), + attrPart(attrs, "hwlab.live_builds.service_id"), + attrPart(attrs, "hwlab.live_builds.service_kind"), + attrPart(attrs, "hwlab.live_builds.external"), + attrPart(attrs, "hwlab.live_builds.deploy_manifest_status"), + attrPart(attrs, "hwlab.live_builds.artifact_catalog_status"), attrPart(attrs, "db.system"), attrPart(attrs, "db.operation.name"), attrPart(attrs, "db.sql.table"), @@ -1376,7 +1384,7 @@ function compactSpanList(value: unknown, limit: number): unknown[] { return { name: span.name ?? null, service: span.service ?? null, - attributes: compactRecord(attrs, ["failureKind", "terminalStatus", "status", "eventType", "idleMs", "waitingFor", "lastEventLabel", "http.route", "http.status_code", "http.response.status_code"]), + attributes: compactRecord(attrs, ["failureKind", "terminalStatus", "status", "eventType", "idleMs", "waitingFor", "lastEventLabel", "http.route", "http.status_code", "http.response.status_code", "hwlab.http.stage", "hwlab.http.phase", "hwlab.http.phase.outcome", "hwlab.live_builds.service_id", "hwlab.live_builds.service_kind", "hwlab.live_builds.external", "hwlab.live_builds.deploy_manifest_status", "hwlab.live_builds.artifact_catalog_status"]), }; }); } @@ -2044,7 +2052,12 @@ IMPORTANT_ATTRS = [ "db.pool.in_use", "db.pool.idle", "db.pool.wait_count", "db.pool.wait_duration_ms", "db.pool.max_idle_closed", "db.pool.max_lifetime_closed", - "hwlab.runtime.stage", "error.code", "error.category", "error.layer", + "hwlab.runtime.stage", "hwlab.http.stage", "hwlab.http.phase", + "hwlab.http.phase.outcome", "hwlab.live_builds.service_id", + "hwlab.live_builds.service_kind", "hwlab.live_builds.external", + "hwlab.live_builds.deploy_manifest_status", + "hwlab.live_builds.artifact_catalog_status", + "error.code", "error.category", "error.layer", "stage", "causeStage", "causeCode", "eventType", "runnerId", "attemptId", "backendProfile", "sourceCommit", "jobName", "podName", "logPath", @@ -2316,7 +2329,12 @@ IMPORTANT_ATTRS = [ "db.pool.in_use", "db.pool.idle", "db.pool.wait_count", "db.pool.wait_duration_ms", "db.pool.max_idle_closed", "db.pool.max_lifetime_closed", - "hwlab.runtime.stage", "error.code", "error.category", "error.layer", + "hwlab.runtime.stage", "hwlab.http.stage", "hwlab.http.phase", + "hwlab.http.phase.outcome", "hwlab.live_builds.service_id", + "hwlab.live_builds.service_kind", "hwlab.live_builds.external", + "hwlab.live_builds.deploy_manifest_status", + "hwlab.live_builds.artifact_catalog_status", + "error.code", "error.category", "error.layer", "stage", "causeStage", "causeCode", "eventType", "runnerId", "attemptId", "backendProfile", "sourceCommit", "jobName", "podName", "logPath", @@ -2719,7 +2737,12 @@ IMPORTANT_ATTRS = [ "db.pool.in_use", "db.pool.idle", "db.pool.wait_count", "db.pool.wait_duration_ms", "db.pool.max_idle_closed", "db.pool.max_lifetime_closed", - "hwlab.runtime.stage", "error.code", "error.category", "error.layer", + "hwlab.runtime.stage", "hwlab.http.stage", "hwlab.http.phase", + "hwlab.http.phase.outcome", "hwlab.live_builds.service_id", + "hwlab.live_builds.service_kind", "hwlab.live_builds.external", + "hwlab.live_builds.deploy_manifest_status", + "hwlab.live_builds.artifact_catalog_status", + "error.code", "error.category", "error.layer", "stage", "causeStage", "causeCode", "eventType", "runnerId", "attemptId", "backendProfile", "sourceCommit", "jobName", "podName", "logPath", @@ -2947,6 +2970,10 @@ def tiny_span(item): "toolName", "type", "itemType", "itemId", "status", "exitCode", "durationMs", "cwd", "processId", "command", "commandFingerprint", "outputSummary", "outputBytes", "outputTruncated", + "hwlab.http.stage", "hwlab.http.phase", "hwlab.http.phase.outcome", + "hwlab.live_builds.service_id", "hwlab.live_builds.service_kind", + "hwlab.live_builds.external", "hwlab.live_builds.deploy_manifest_status", + "hwlab.live_builds.artifact_catalog_status", ): if key in attrs: keep_attrs[key] = attrs[key]