feat(cli): emit render_preflight_rejected telemetry for P1-3 pre-flight saves (#1856)

The P1-3 aspect/alpha/HDR pre-flight (#1843) aborts an incompatible render before any browser/ffmpeg work, but that "save" was invisible on dashboard 1783183 — indistinguishable from a deep failure or a user giving up.

checkRenderResolutionPreflight now returns { message, kind } (kind = the existing low-cardinality OutputResolutionIssueKind), and the render command emits render_preflight_rejected { kind } before exiting. No parsers change — the helper already carried kind. trackRenderPreflightRejected is typed to the union so the metric can't carry free text.

Tests: preflight tests assert kind for all five kinds; an events test locks the emit.

Further follow-up (still log-only): encoder-frame-0-exit counter and a P1-4 doctor cli_env_check event.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
James Russo
2026-07-01 22:10:37 -07:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 438474c968
commit 9b41891f3a
4 changed files with 63 additions and 15 deletions
@@ -12,6 +12,7 @@ const {
trackCommandFailure,
trackCliError,
trackRenderFeedback,
trackRenderPreflightRejected,
} = await import("./events.js");
describe("render telemetry events", () => {
@@ -39,6 +40,13 @@ describe("render telemetry events", () => {
);
});
it("emits render_preflight_rejected with the low-cardinality issue kind", () => {
trackRenderPreflightRejected({ kind: "aspect-mismatch" });
expect(trackEvent).toHaveBeenCalledWith("render_preflight_rejected", {
kind: "aspect-mismatch",
});
});
it("forwards distinctId to trackEvent so studio renders attribute to the browser user", () => {
trackRenderError({
fps: 30,
+10 -1
View File
@@ -1,4 +1,4 @@
import { redactTelemetryString } from "@hyperframes/core";
import { redactTelemetryString, type OutputResolutionIssueKind } from "@hyperframes/core";
import { trackEvent } from "./client.js";
export interface RenderObservabilityTelemetryPayload {
@@ -308,6 +308,15 @@ export function trackBrowserInstall(): void {
trackEvent("browser_install", {});
}
// A render was rejected by the output-resolution/alpha/HDR pre-flight (P1-3)
// before any browser/ffmpeg work. Counts the "caught early" saves on dashboard
// 1783183, distinct from deep render failures. `kind` is the low-cardinality
// `OutputResolutionIssueKind` (aspect-mismatch / alpha-incompatible / etc.),
// typed to the union so the metric can never carry free text.
export function trackRenderPreflightRejected(props: { kind: OutputResolutionIssueKind }): void {
trackEvent("render_preflight_rejected", { kind: props.kind });
}
export function trackCliError(props: {
error_name: string;
error_message: string;