From f6240a2db8d4d3484b2fa2caeb3da15d1f92f9b5 Mon Sep 17 00:00:00 2001 From: Greg Richardson Date: Mon, 31 Jul 2023 15:04:55 -0500 Subject: [PATCH] feat(sql-editor): telemetry for ai suggestion create events --- .../interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx b/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx index 9a35c2b366a..7542641a3ce 100644 --- a/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx +++ b/studio/components/interfaces/SQLEditor/SQLTemplates/SQLTemplates.tsx @@ -182,6 +182,16 @@ const SQLTemplates = observer(() => { }) await handleNewQuery(formattedSql, title) + + Telemetry.sendEvent( + { + category: 'sql_editor', + action: 'ai_suggestion_created', + label: 'create_snippet', + }, + telemetryProps, + router + ) } catch (error: unknown) { if (isError(error)) { ui.setNotification({