From 2f2544e96216c66cec4e02802bf3032201a92ec8 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Fri, 18 Oct 2024 16:39:26 +0700 Subject: [PATCH] improv: telemetry --- core/config/validation.ts | 15 ++++++++++++++- gui/src/components/PosthogPageView.ts | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/core/config/validation.ts b/core/config/validation.ts index e6c4d4c0709..9da86c6efdf 100644 --- a/core/config/validation.ts +++ b/core/config/validation.ts @@ -1,4 +1,5 @@ import { SerializedContinueConfig } from "../"; +import { Telemetry } from "../util/posthog"; export interface ConfigValidationError { fatal: boolean; @@ -116,5 +117,17 @@ export function validateConfig(config: SerializedContinueConfig) { } }); - return errors.length > 0 ? errors : undefined; + if (errors.length > 0) { + void Telemetry.capture( + "configValidationError", + { + errors, + }, + true, + ); + + return errors; + } + + return undefined; } diff --git a/gui/src/components/PosthogPageView.ts b/gui/src/components/PosthogPageView.ts index 3a9445d1d8d..fb93930906c 100644 --- a/gui/src/components/PosthogPageView.ts +++ b/gui/src/components/PosthogPageView.ts @@ -22,6 +22,7 @@ export default function PostHogPageView() { posthog.capture("$pageview", { $current_url: url, + pathname, }); } }, [pathname, searchParams, posthog]);