feat(telemetry): Sentry + PostHog quality pass (#546)

Comprehensive telemetry quality improvements across Sentry and PostHog, grounded in an audit of the live data plus current best-practice research.

Sentry: job_id/instance_id tags, operational fingerprinting, PII-safe settings context on bug events, web tag population + extension-noise filtering, an early-crash buffer, http status/method kept on breadcrumbs, and a gated-off-by-default performance-tracing re-enable (tracesSampler that zeroes db/redis/queue-poll root spans + drops the Redis integration) with worker job spans and canonical-host cron monitors.

PostHog: history_change SPA pageviews, instance_id super property for fleet rollups, enriched tool_used (formats, byte sizes, is_batch, execution_hint, real error_kind taxonomy), the previously-dead result_saved/batch_processed/ai_bundle_prompted events fired, search click-through, editor + Automate authoring + auth instrumentation, a before_send PII boundary, and minimal opt-in landing-site pageviews.
This commit is contained in:
SnapOtter
2026-07-17 01:51:48 +00:00
committed by GitHub
parent 9247947704
commit 86251434b5
36 changed files with 936 additions and 54 deletions
+39 -2
View File
@@ -14,6 +14,15 @@ export const ANALYTICS_EVENTS = {
FEEDBACK_SUBMITTED: "feedback_submitted",
SPONSOR_CLICKED: "sponsor_clicked",
INSTANCE_STARTED: "instance_started",
EDITOR_OPENED: "editor_opened",
EDITOR_TOOL_USED: "editor_tool_used",
EDITOR_EXPORTED: "editor_exported",
PIPELINE_OPENED: "pipeline_opened",
PIPELINE_STEP_ADDED: "pipeline_step_added",
PIPELINE_SAVED: "pipeline_saved",
PIPELINE_TEMPLATE_SELECTED: "pipeline_template_selected",
AUTH_LOGIN: "auth_login",
AUTH_LOGIN_FAILED: "auth_login_failed",
} as const;
export type AnalyticsEvent = (typeof ANALYTICS_EVENTS)[keyof typeof ANALYTICS_EVENTS];
@@ -24,9 +33,16 @@ export interface ToolUsedProperties {
duration_ms: number;
category: string;
is_ai_tool: boolean;
params?: Record<string, string | number | boolean>;
is_batch: boolean;
/** Safe input extension (never the filename), e.g. "heic"; "unknown" if none. */
input_format: string;
execution_hint: "fast" | "long";
output_format?: string;
bytes_in?: number;
bytes_out?: number;
error_code?: string;
error_message?: string;
/** Coarse failure reason so "why do tools fail" is answerable without messages. */
error_kind?: "input" | "operational" | "bug" | "timeout" | "cancelled";
}
export interface SearchProperties {
@@ -55,3 +71,24 @@ export interface InstanceStartedProperties {
deploy_mode: "embedded" | "external" | "native";
gpu_present: boolean;
}
export interface EditorToolUsedProperties {
/** The editor tool selected (move, brush, crop, ...); a fixed low-cardinality set. */
editor_tool: string;
}
export interface EditorExportedProperties {
output_format?: string;
}
export interface PipelineStepAddedProperties {
tool_id: string;
}
export interface PipelineSavedProperties {
step_count: number;
}
export interface PipelineTemplateSelectedProperties {
template_id: string;
}