From be8cf75fb324b2151302c6ed9b39c334d68d4f65 Mon Sep 17 00:00:00 2001 From: Alex Tugarev Date: Tue, 22 Feb 2022 13:46:23 +0000 Subject: [PATCH] [admin] (temp) disable telemetry for gitpod.io --- components/dashboard/src/admin/Settings.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/dashboard/src/admin/Settings.tsx b/components/dashboard/src/admin/Settings.tsx index d571f887254d62..f97d8cf4be065f 100644 --- a/components/dashboard/src/admin/Settings.tsx +++ b/components/dashboard/src/admin/Settings.tsx @@ -22,11 +22,14 @@ export default function Settings() { const { user } = useContext(UserContext); useEffect(() => { + if (isGitpodIo()) { + return; // temporarily disable to avoid hight CPU on the DB + } (async () => { const data = await getGitpodService().server.adminGetTelemetryData(); setTelemetryData(data) })(); - }); + }, []); if (!user || !user?.rolesOrPermissions?.includes('admin')) { return @@ -53,3 +56,7 @@ export default function Settings() { ) } + +function isGitpodIo() { + return window.location.hostname === 'gitpod.io' || window.location.hostname === 'gitpod-staging.com'; +} \ No newline at end of file