From 54d52d0bf91be2a6184e7bd8d5189fe7b4e81759 Mon Sep 17 00:00:00 2001 From: Josh Hunt Date: Wed, 25 Sep 2024 10:23:31 +0100 Subject: [PATCH] E2C: Add rudderstack reporting for cloud-side token generation (#93334) --- .../cloud/MigrationTokenPane/MigrationTokenPane.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public/app/features/migrate-to-cloud/cloud/MigrationTokenPane/MigrationTokenPane.tsx b/public/app/features/migrate-to-cloud/cloud/MigrationTokenPane/MigrationTokenPane.tsx index 16c7fa004f5..609d9e654e7 100644 --- a/public/app/features/migrate-to-cloud/cloud/MigrationTokenPane/MigrationTokenPane.tsx +++ b/public/app/features/migrate-to-cloud/cloud/MigrationTokenPane/MigrationTokenPane.tsx @@ -1,6 +1,6 @@ import { useCallback, useState } from 'react'; -import { isFetchError } from '@grafana/runtime'; +import { isFetchError, reportInteraction } from '@grafana/runtime'; import { Box, Button, Text } from '@grafana/ui'; import { t, Trans } from 'app/core/internationalization'; @@ -51,6 +51,8 @@ export const MigrationTokenPane = () => { const isLoading = getTokenQuery.isFetching || createTokenResponse.isLoading; const handleGenerateToken = useCallback(async () => { + reportInteraction('grafana_e2c_generate_token_clicked'); + const resp = await createTokenMutation(); if (!('error' in resp)) { @@ -63,6 +65,7 @@ export const MigrationTokenPane = () => { return; } + reportInteraction('grafana_e2c_delete_token_clicked'); const resp = await deleteTokenMutation({ uid: getTokenQuery.data.id }); if (!('error' in resp)) { setShowDeleteModal(false); @@ -98,7 +101,10 @@ export const MigrationTokenPane = () => { setShowCreateModal(false)} + hideModal={() => { + reportInteraction('grafana_e2c_generated_token_modal_dismissed'); + setShowCreateModal(false); + }} migrationToken={createTokenResponse.data?.token} />