From 0f00064bac2ed0a321572bf238b66a8f544970b5 Mon Sep 17 00:00:00 2001 From: Mukul Tayal Date: Mon, 12 Feb 2024 18:13:20 +0530 Subject: [PATCH 1/2] send terminal close events to sentry --- .env | 1 + src/components/ClusterNodes/ClusterTerminal.tsx | 2 +- src/components/terminal/TerminalWrapper.tsx | 5 ++++- .../nodeDetail/NodeDetailTabs/terminal/Terminal.tsx | 3 +++ src/index.tsx | 2 ++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.env b/.env index ec662a5312..90454ae4f6 100644 --- a/.env +++ b/.env @@ -41,3 +41,4 @@ GLOBAL_API_TIMEOUT=60000 TRIGGER_API_TIMEOUT=60000 LOGIN_DT_LOGO= SIDEBAR_DT_LOGO= +LOG_TERMINAL_EVENTS_TO_SENTRY=false diff --git a/src/components/ClusterNodes/ClusterTerminal.tsx b/src/components/ClusterNodes/ClusterTerminal.tsx index 046883b3c9..6bad5619b5 100644 --- a/src/components/ClusterNodes/ClusterTerminal.tsx +++ b/src/components/ClusterNodes/ClusterTerminal.tsx @@ -343,7 +343,7 @@ export default function ClusterTerminal({ `user/terminal/get?namespace=${selectedNamespace.value}&shellName=${ selectedTerminalType.value }&terminalAccessId=${terminalAccessIdRef.current}&containerName=${ - resourceData.containers?.[0].containerName || '' + resourceData?.containers?.[0].containerName || '' }`, terminalAccessIdRef.current, window?._env_?.CLUSTER_TERMINAL_CONNECTION_RETRY_COUNT || 7, diff --git a/src/components/terminal/TerminalWrapper.tsx b/src/components/terminal/TerminalWrapper.tsx index 8fe8c49487..0dca344a57 100644 --- a/src/components/terminal/TerminalWrapper.tsx +++ b/src/components/terminal/TerminalWrapper.tsx @@ -12,6 +12,8 @@ import ReactGA from 'react-ga4'; import './terminal.scss'; import { Scroller } from '../app/details/cicdHistory/History.components'; import { SocketConnectionType } from '../app/details/appDetails/appDetails.type'; +import { logExceptionToSentry } from '@devtron-labs/devtron-fe-common-lib' + interface TerminalViewProps { appDetails: AppDetails; @@ -256,7 +258,8 @@ export class TerminalView extends Component Date: Mon, 12 Feb 2024 22:19:39 +0530 Subject: [PATCH 2/2] ignore normal close events of terminal --- src/components/terminal/TerminalWrapper.tsx | 2 +- .../k8Resource/nodeDetail/NodeDetailTabs/terminal/Terminal.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/terminal/TerminalWrapper.tsx b/src/components/terminal/TerminalWrapper.tsx index 0dca344a57..5a142a9628 100644 --- a/src/components/terminal/TerminalWrapper.tsx +++ b/src/components/terminal/TerminalWrapper.tsx @@ -258,7 +258,7 @@ export class TerminalView extends Component