BrowseDashboards: Add tracking for renaming folders (#75160)

* feat: add tracking events

* feat: add error code to tracking data
This commit is contained in:
Laura Benz 2023-09-21 11:36:09 +02:00 committed by GitHub
parent 7fca1bde54
commit e84599bd51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ import React, { memo, useEffect, useMemo } from 'react';
import AutoSizer from 'react-virtualized-auto-sizer';
import { GrafanaTheme2 } from '@grafana/data';
import { reportInteraction } from '@grafana/runtime';
import { FilterInput, useStyles2 } from '@grafana/ui';
import { Page } from 'app/core/components/Page/Page';
import { GrafanaRouteComponentProps } from 'app/core/navigation/types';
@ -89,8 +90,16 @@ const BrowseDashboardsPage = memo(({ match }: Props) => {
title: newValue,
});
if ('error' in result) {
reportInteraction('grafana_browse_dashboards_page_edit_folder_name', {
status: 'failed_with_error',
error: result.error,
});
throw result.error;
} else {
reportInteraction('grafana_browse_dashboards_page_edit_folder_name', { status: 'success' });
}
} else {
reportInteraction('grafana_browse_dashboards_page_edit_folder_name', { status: 'failed_no_folderDTO' });
}
};