From 3fede0f1b6eac18c016aa0866c73c33aac72b214 Mon Sep 17 00:00:00 2001
From: Marian Steinbach
Date: Thu, 31 Oct 2024 08:59:07 +0100
Subject: [PATCH] Delete RUMActions and RUMActionTarget (#4633)
* Delete RUMActions and RUMActionTarget
* Delete athena service and RUM code (#4634)
---
.gitignore | 3 +
helm/happa/templates/configmap.yaml | 3 -
jest.config.ts | 1 -
package.json | 3 +-
scripts/getConfigurationValues.ts | 3 -
src/@types/global.d.ts | 1 -
.../AZSelection/AZSelectionCheckbox.tsx | 30 ++---
.../ClusterDetail/AddNodePool/AddNodePool.js | 3 +-
.../InstanceTypeSelector/InstanceTypeRow.tsx | 28 ++---
.../InstanceTypeSelector.tsx | 46 +++----
.../ClusterDetail/V5ClusterDetailTable.js | 16 +--
.../NewCluster/CreateNodePoolsCluster.js | 62 ++++-----
.../NewCluster/CreateRegularCluster.js | 32 ++---
.../NewCluster/ReleaseSelector/ReleaseRow.tsx | 77 +++++-------
.../ReleaseSelector/ReleaseSelector.tsx | 48 +++----
.../CreateClusterControlPlaneNodeAZs.tsx | 3 +-
.../CreateCluster/CreateClusterReleaseRow.tsx | 30 ++---
.../CreateClusterReleaseSelector.tsx | 40 +++---
...erNodesCreateNodePoolAvailabilityZones.tsx | 3 +-
src/components/RUM/RUMActionTarget.tsx | 27 ----
.../RUM/__tests__/RUMActionTarget.tsx | 29 -----
.../UI/Controls/Navigation/Navigation.js | 10 +-
.../AvailabilityZonesLabel.tsx | 28 ++---
src/components/index.tsx | 4 -
src/index.ejs | 1 -
src/model/clients/GraphQLClient.ts | 76 -----------
src/model/clients/GraphQLError.ts | 18 ---
src/model/constants/realUserMonitoring.ts | 38 ------
src/model/services/athena/analytics.ts | 18 ---
src/model/services/athena/index.ts | 2 -
.../mutations/CreateAnalyticsEvent.graphql | 10 --
src/model/services/athena/types.ts | 23 ----
src/utils/RUMService.ts | 119 ------------------
.../__tests__/realUserMonitoringUtils.ts | 16 ---
src/utils/realUserMonitoringUtils.ts | 5 -
webpack.dev.ts | 1 -
36 files changed, 190 insertions(+), 667 deletions(-)
delete mode 100644 src/components/RUM/RUMActionTarget.tsx
delete mode 100644 src/components/RUM/__tests__/RUMActionTarget.tsx
delete mode 100644 src/model/clients/GraphQLClient.ts
delete mode 100644 src/model/clients/GraphQLError.ts
delete mode 100644 src/model/constants/realUserMonitoring.ts
delete mode 100644 src/model/services/athena/analytics.ts
delete mode 100644 src/model/services/athena/index.ts
delete mode 100644 src/model/services/athena/mutations/CreateAnalyticsEvent.graphql
delete mode 100644 src/model/services/athena/types.ts
delete mode 100644 src/utils/RUMService.ts
delete mode 100644 src/utils/__tests__/realUserMonitoringUtils.ts
delete mode 100644 src/utils/realUserMonitoringUtils.ts
diff --git a/.gitignore b/.gitignore
index cf2604e28f..c11f7242d5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,3 +37,6 @@ tsconfig.tsbuildinfo
# app-test-suite
/ats/test_results*.xml
+
+# Python virtual environments
+/venv
diff --git a/helm/happa/templates/configmap.yaml b/helm/happa/templates/configmap.yaml
index 6f7e4535f1..ce2d259ead 100644
--- a/helm/happa/templates/configmap.yaml
+++ b/helm/happa/templates/configmap.yaml
@@ -46,9 +46,6 @@ data:
sentry-debug: false
sentry-sample-rate: 0.5
- # Enables real user monitoring (RUM)
- enable-rum: true
-
# Feature flags
feature-mapi-auth: {{ .Values.happa.featureFlags.mapiAuth }}
feature-mapi-clusters: {{ .Values.happa.featureFlags.mapiClusters }}
diff --git a/jest.config.ts b/jest.config.ts
index fee2a2c981..df3e8cce4a 100644
--- a/jest.config.ts
+++ b/jest.config.ts
@@ -68,7 +68,6 @@ const config: Config.InitialOptions = {
passageEndpoint: 'http://5.6.7.8',
environment: 'development',
ingressBaseDomain: 'k8s.sample.io',
- enableRealUserMonitoring: false,
defaultRequestTimeoutSeconds: 10,
awsCapabilitiesJSON:
'{"m4.xlarge":{"cpu_cores":4,"description":"M4 General Purpose Extra Large","memory_size_gb":16,"storage_size_gb":0},"m3.large":{"description":"M3 General Purpose Large","memory_size_gb":7.5,"cpu_cores":2,"storage_size_gb":32},"m3.xlarge":{"description":"M3 General Purpose Extra Large","memory_size_gb":15,"cpu_cores":4,"storage_size_gb":80},"m3.2xlarge":{"description":"M3 General Purpose Double Extra Large","memory_size_gb":30,"cpu_cores":8,"storage_size_gb":160}, "m5.xlarge":{"cpu_cores":4,"description":"M5 General Purpose Extra Large","memory_size_gb":16,"storage_size_gb":0}}',
diff --git a/package.json b/package.json
index 24b5451e2a..e263cd11bb 100644
--- a/package.json
+++ b/package.json
@@ -260,5 +260,6 @@
"yarn lint:staged",
"yarn format:staged"
]
- }
+ },
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
diff --git a/scripts/getConfigurationValues.ts b/scripts/getConfigurationValues.ts
index c71f7d9c51..208402e4d3 100644
--- a/scripts/getConfigurationValues.ts
+++ b/scripts/getConfigurationValues.ts
@@ -11,7 +11,6 @@ export interface IConfigurationValues {
defaultRequestTimeoutSeconds: number;
environment: string;
happaVersion: string;
- enableRealUserMonitoring: boolean;
awsCapabilitiesJSON: string;
azureCapabilitiesJSON: string;
@@ -80,7 +79,6 @@ export async function getConfigurationValues(
config.setDefault('mapi-audience', 'http://localhost:8000');
config.setDefault('passage-endpoint', 'http://localhost:8000');
config.setDefault('athena-endpoint', 'http://localhost:8000');
- config.setDefault('enable-rum', true);
config.setDefault('installation-name', 'development');
config.setDefault('default-request-timeout-seconds', 10);
config.setDefault('ingress-base-domain', 'k8s.sample.io');
@@ -119,7 +117,6 @@ export async function getConfigurationValues(
),
environment: config.getString('installation-name'),
happaVersion: config.getString('version'),
- enableRealUserMonitoring: config.getBoolean('enable-rum'),
awsCapabilitiesJSON: config.getString('aws-capabilities-json'),
azureCapabilitiesJSON: config.getString('azure-capabilities-json'),
diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts
index 09eb6386c5..1bd0c1b810 100644
--- a/src/@types/global.d.ts
+++ b/src/@types/global.d.ts
@@ -14,7 +14,6 @@ interface IGlobalConfig {
athenaEndpoint: string;
mapiAudience: string;
defaultRequestTimeoutSeconds: number;
- enableRealUserMonitoring: boolean;
environment: GlobalEnvironment;
happaVersion: string;
ingressBaseDomain: string;
diff --git a/src/components/Cluster/AZSelection/AZSelectionCheckbox.tsx b/src/components/Cluster/AZSelection/AZSelectionCheckbox.tsx
index 0f9089750a..f65a6cd519 100644
--- a/src/components/Cluster/AZSelection/AZSelectionCheckbox.tsx
+++ b/src/components/Cluster/AZSelection/AZSelectionCheckbox.tsx
@@ -1,8 +1,6 @@
import { Text } from 'grommet';
import * as React from 'react';
-import RUMActionTarget from 'RUM/RUMActionTarget';
import RadioInput from 'UI/Inputs/RadioInput';
-import { mergeActionNames } from 'utils/realUserMonitoringUtils';
import { AvailabilityZoneSelection } from './AZSelectionUtils';
@@ -34,21 +32,19 @@ const AZSelectionCheckbox: React.FC<
const id = `${uniqueIdentifier}-${typeName.toLowerCase()}`;
return (
-
- onChange(type!)}
- tabIndex={-1}
- label={
-
- {label}
-
- }
- {...rest}
- />
-
+ onChange(type!)}
+ tabIndex={-1}
+ label={
+
+ {label}
+
+ }
+ {...rest}
+ />
);
};
diff --git a/src/components/Cluster/ClusterDetail/AddNodePool/AddNodePool.js b/src/components/Cluster/ClusterDetail/AddNodePool/AddNodePool.js
index 00ed9c3b71..372675e644 100644
--- a/src/components/Cluster/ClusterDetail/AddNodePool/AddNodePool.js
+++ b/src/components/Cluster/ClusterDetail/AddNodePool/AddNodePool.js
@@ -8,7 +8,6 @@ import AddNodePoolSpotInstances from 'Cluster/ClusterDetail/AddNodePool/AddNodeP
import { Box } from 'grommet';
import produce from 'immer';
import { Constants, Providers } from 'model/constants';
-import { RUMActions } from 'model/constants/realUserMonitoring';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import NodeCountSelector from 'shared/NodeCountSelector';
@@ -445,7 +444,7 @@ class AddNodePool extends Component {
> = ({
aria-label={`${singular} ${name}`}
>
-
- selectInstanceType(name)}
- formFieldProps={{
- margin: 'none',
- }}
- tabIndex={-1}
- />
-
+ selectInstanceType(name)}
+ formFieldProps={{
+ margin: 'none',
+ }}
+ tabIndex={-1}
+ />
{name}
diff --git a/src/components/Cluster/ClusterDetail/InstanceTypeSelector/InstanceTypeSelector.tsx b/src/components/Cluster/ClusterDetail/InstanceTypeSelector/InstanceTypeSelector.tsx
index 6996f550c0..dbce7d7d69 100644
--- a/src/components/Cluster/ClusterDetail/InstanceTypeSelector/InstanceTypeSelector.tsx
+++ b/src/components/Cluster/ClusterDetail/InstanceTypeSelector/InstanceTypeSelector.tsx
@@ -1,7 +1,5 @@
import { Keyboard } from 'grommet';
-import { RUMActions } from 'model/constants/realUserMonitoring';
import React, { FC, useState } from 'react';
-import RUMActionTarget from 'RUM/RUMActionTarget';
import styled from 'styled-components';
import {
ListToggler,
@@ -94,33 +92,25 @@ const InstanceTypeSelector: FC = ({
)}
- setCollapsed(!collapsed)}
+ collapsible={true}
+ onKeyDown={handleTabSelect}
+ title={`Show/hide available ${plural}`}
>
- setCollapsed(!collapsed)}
- collapsible={true}
- onKeyDown={handleTabSelect}
- title={`Show/hide available ${plural}`}
- >
-
- Available {plural}
-
-
+
+ Available {plural}
+
{!collapsed && (
diff --git a/src/components/Cluster/ClusterDetail/V5ClusterDetailTable.js b/src/components/Cluster/ClusterDetail/V5ClusterDetailTable.js
index 79541ad1c1..f8ff5b0e59 100644
--- a/src/components/Cluster/ClusterDetail/V5ClusterDetailTable.js
+++ b/src/components/Cluster/ClusterDetail/V5ClusterDetailTable.js
@@ -6,7 +6,6 @@ import produce from 'immer';
import { CSSBreakpoints } from 'model/constants';
import { nodePoolsURL } from 'model/constants/docs';
import * as Providers from 'model/constants/providers';
-import { RUMActions } from 'model/constants/realUserMonitoring';
import * as clusterActions from 'model/stores/cluster/actions';
import { isClusterCreating } from 'model/stores/cluster/utils';
import { updateClusterLabels } from 'model/stores/clusterlabels/actions';
@@ -25,7 +24,6 @@ import React from 'react';
import { connect } from 'react-redux';
import ReactTimeout from 'react-timeout';
import { TransitionGroup } from 'react-transition-group';
-import RUMActionTarget from 'RUM/RUMActionTarget';
import { css } from 'styled-components';
import styled from 'styled-components';
import { FlexRowWithTwoBlocksOnEdges, mq, Row } from 'styles';
@@ -578,14 +576,12 @@ class V5ClusterDetailTable extends React.Component {
actually run workloads.
)}
-
- }
- >
- Add node pool
-
-
+ }
+ >
+ Add node pool
+
{nodePools && nodePools.length === 1 && (
With additional node pools, you can add different types of
diff --git a/src/components/Cluster/NewCluster/CreateNodePoolsCluster.js b/src/components/Cluster/NewCluster/CreateNodePoolsCluster.js
index 67bf3df1d7..7d009f3492 100644
--- a/src/components/Cluster/NewCluster/CreateNodePoolsCluster.js
+++ b/src/components/Cluster/NewCluster/CreateNodePoolsCluster.js
@@ -7,14 +7,12 @@ import MasterNodes from 'Cluster/NewCluster/MasterNodes';
import { Box } from 'grommet';
import produce from 'immer';
import { Constants } from 'model/constants';
-import { RUMActions } from 'model/constants/realUserMonitoring';
import { batchedClusterCreate } from 'model/stores/batchActions';
import { BATCHED_CLUSTER_CREATION_REQUEST } from 'model/stores/cluster/constants';
import { selectLoadingFlagByAction } from 'model/stores/loading/selectors';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { TransitionGroup } from 'react-transition-group';
-import RUMActionTarget from 'RUM/RUMActionTarget';
import styled from 'styled-components';
import SlideTransition from 'styles/transitions/SlideTransition';
import Button from 'UI/Controls/Button';
@@ -246,7 +244,7 @@ class CreateNodePoolsCluster extends Component {
-
- this.removeNodePoolForm(npId)}
- />
-
+ this.removeNodePoolForm(npId)}
+ />
);
})}
-
- }
- >
- Add node pool
-
-
+ }
+ >
+ Add node pool
+
-
+
+ {/* We want to hide cancel button when the Create NP button has been clicked */}
+ {!isClusterCreating && (
-
- {/* We want to hide cancel button when the Create NP button has been clicked */}
- {!isClusterCreating && (
-
-
-
)}
diff --git a/src/components/Cluster/NewCluster/CreateRegularCluster.js b/src/components/Cluster/NewCluster/CreateRegularCluster.js
index 5d75f26a86..e60318de92 100644
--- a/src/components/Cluster/NewCluster/CreateRegularCluster.js
+++ b/src/components/Cluster/NewCluster/CreateRegularCluster.js
@@ -1,13 +1,11 @@
import InstanceTypeSelector from 'Cluster/ClusterDetail/InstanceTypeSelector/InstanceTypeSelector';
import { Box } from 'grommet';
import { Constants, Providers } from 'model/constants';
-import { RUMActions } from 'model/constants/realUserMonitoring';
import { batchedClusterCreate } from 'model/stores/batchActions';
import { BATCHED_CLUSTER_CREATION_REQUEST } from 'model/stores/cluster/constants';
import { selectLoadingFlagByAction } from 'model/stores/loading/selectors';
import React from 'react';
import { connect } from 'react-redux';
-import RUMActionTarget from 'RUM/RUMActionTarget';
import NodeCountSelector from 'shared/NodeCountSelector';
import styled from 'styled-components';
import Button from 'UI/Controls/Button';
@@ -341,27 +339,23 @@ class CreateRegularCluster extends React.Component {
-
+
+ {!isClusterCreating && (
-
- {!isClusterCreating && (
-
-
-
)}
diff --git a/src/components/Cluster/NewCluster/ReleaseSelector/ReleaseRow.tsx b/src/components/Cluster/NewCluster/ReleaseSelector/ReleaseRow.tsx
index 152e03a00a..0b8c3484de 100644
--- a/src/components/Cluster/NewCluster/ReleaseSelector/ReleaseRow.tsx
+++ b/src/components/Cluster/NewCluster/ReleaseSelector/ReleaseRow.tsx
@@ -1,8 +1,6 @@
import { Box, Keyboard, Text } from 'grommet';
import { normalizeColor } from 'grommet/utils';
-import { RUMActions } from 'model/constants/realUserMonitoring';
import React, { FC, useState } from 'react';
-import RUMActionTarget from 'RUM/RUMActionTarget';
import styled from 'styled-components';
import Button from 'UI/Controls/Button';
import KubernetesVersionLabel from 'UI/Display/Cluster/KubernetesVersionLabel';
@@ -80,21 +78,19 @@ const ReleaseRow: FC> = ({
aria-label={`Release version ${version}`}
>
-
- selectRelease(version)}
- formFieldProps={{
- margin: 'none',
- tabIndex: -1,
- }}
- tabIndex={-1}
- />
-
+ selectRelease(version)}
+ formFieldProps={{
+ margin: 'none',
+ tabIndex: -1,
+ }}
+ tabIndex={-1}
+ />
{version}
@@ -117,36 +113,25 @@ const ReleaseRow: FC> = ({
e.stopPropagation()
}
>
-
-
+
-
+ {collapsed ? 'Show' : 'Hide'}
+
+
> = ({
/>
-
-
- {collapsible && (
-
- )}
- Available releases
-
-
+ {collapsible && (
+
+ )}
+ Available releases
+
{!collapsed && (
<>
diff --git a/src/components/MAPI/clusters/CreateCluster/CreateClusterControlPlaneNodeAZs.tsx b/src/components/MAPI/clusters/CreateCluster/CreateClusterControlPlaneNodeAZs.tsx
index 3921ccea8e..ed8c4c9115 100644
--- a/src/components/MAPI/clusters/CreateCluster/CreateClusterControlPlaneNodeAZs.tsx
+++ b/src/components/MAPI/clusters/CreateCluster/CreateClusterControlPlaneNodeAZs.tsx
@@ -6,7 +6,6 @@ import {
IUpdateZoneLabelsPayload,
} from 'Cluster/AZSelection/AZSelectionUtils';
import { determineRandomAZs, getSupportedAvailabilityZones } from 'MAPI/utils';
-import { RUMActions } from 'model/constants/realUserMonitoring';
import React, { useEffect, useMemo, useState } from 'react';
import InputGroup from 'UI/Inputs/InputGroup';
@@ -89,7 +88,7 @@ const CreateClusterControlPlaneNodeAZs: React.FC<
> = ({
>
{!isPreviewRelease && (
-
-
-
+
)}
diff --git a/src/components/MAPI/clusters/CreateCluster/CreateClusterReleaseSelector.tsx b/src/components/MAPI/clusters/CreateCluster/CreateClusterReleaseSelector.tsx
index 388d6d2015..517836a4ed 100644
--- a/src/components/MAPI/clusters/CreateCluster/CreateClusterReleaseSelector.tsx
+++ b/src/components/MAPI/clusters/CreateCluster/CreateClusterReleaseSelector.tsx
@@ -1,8 +1,6 @@
import { Accordion, AccordionPanel, Box, Keyboard, Text } from 'grommet';
-import { RUMActions } from 'model/constants/realUserMonitoring';
import { ReleaseState } from 'model/services/mapi/releasev1alpha1';
import React, { FC, useMemo, useState } from 'react';
-import RUMActionTarget from 'RUM/RUMActionTarget';
import styled from 'styled-components';
import { Dot } from 'styles';
import KubernetesVersionLabel from 'UI/Display/Cluster/KubernetesVersionLabel';
@@ -153,30 +151,22 @@ const CreateClusterReleaseSelector: FC<
-
-
- Available releases
-
-
+
+ Available releases
+
}
>
diff --git a/src/components/MAPI/workernodes/WorkerNodesCreateNodePoolAvailabilityZones.tsx b/src/components/MAPI/workernodes/WorkerNodesCreateNodePoolAvailabilityZones.tsx
index 9d7692b855..3226d5cbe8 100644
--- a/src/components/MAPI/workernodes/WorkerNodesCreateNodePoolAvailabilityZones.tsx
+++ b/src/components/MAPI/workernodes/WorkerNodesCreateNodePoolAvailabilityZones.tsx
@@ -16,7 +16,6 @@ import {
getSupportedAvailabilityZones,
} from 'MAPI/utils';
import { GenericResponseError } from 'model/clients/GenericResponseError';
-import { RUMActions } from 'model/constants/realUserMonitoring';
import React, { useEffect, useMemo, useState } from 'react';
import useSWR from 'swr';
import InputGroup from 'UI/Inputs/InputGroup';
@@ -147,7 +146,7 @@ const WorkerNodesCreateNodePoolAvailabilityZones: React.FC<
-> = ({ name, children }) => {
- if (!children.props) return children;
-
- const newChildren = Object.assign({}, children, {
- props: {
- ...children.props,
- 'data-dd-action-name': name.toUpperCase(),
- },
- });
-
- return React.Children.only(newChildren);
-};
-
-export default RUMActionTarget;
diff --git a/src/components/RUM/__tests__/RUMActionTarget.tsx b/src/components/RUM/__tests__/RUMActionTarget.tsx
deleted file mode 100644
index 3f1bbcd383..0000000000
--- a/src/components/RUM/__tests__/RUMActionTarget.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { render } from '@testing-library/react';
-import React from 'react';
-import RUMActionTarget from 'RUM/RUMActionTarget';
-
-describe('RUMActionTarget', () => {
- it('adds the correct properties to the nested component', () => {
- render(
-
- Hello
-
- );
-
- expect(
- document.querySelector(`[data-dd-action-name='EVENT_TARGET']`)
- ).toBeInTheDocument();
- });
-
- it('capitalizes action names', () => {
- render(
-
- Hello
-
- );
-
- expect(
- document.querySelector(`[data-dd-action-name='EVENT_TARGET']`)
- ).toBeInTheDocument();
- });
-});
diff --git a/src/components/UI/Controls/Navigation/Navigation.js b/src/components/UI/Controls/Navigation/Navigation.js
index 8011030927..a68a470ead 100644
--- a/src/components/UI/Controls/Navigation/Navigation.js
+++ b/src/components/UI/Controls/Navigation/Navigation.js
@@ -1,11 +1,9 @@
import { logo } from 'images';
import { CSSBreakpoints } from 'model/constants';
-import { RUMActions } from 'model/constants/realUserMonitoring';
import { MainRoutes } from 'model/constants/routes';
import React from 'react';
import { Breadcrumbs } from 'react-breadcrumbs';
import { Link } from 'react-router-dom';
-import RUMActionTarget from 'RUM/RUMActionTarget';
import styled from 'styled-components';
import { mq } from 'styles';
import { BODY_CLASS_MODIFIER } from 'UI/Layout/Modal';
@@ -119,11 +117,9 @@ class Navigation extends React.Component {
return (
-
-
-
-
-
+
+
+
= ({
};
return (
-
-
-
- {label}
-
-
-
+
+
+ {label}
+
+
);
};
diff --git a/src/components/index.tsx b/src/components/index.tsx
index 30ddcd6e31..f1bd04d397 100644
--- a/src/components/index.tsx
+++ b/src/components/index.tsx
@@ -17,7 +17,6 @@ import ErrorReporter from 'utils/errors/ErrorReporter';
import { SentryErrorNotifier } from 'utils/errors/SentryErrorNotifier';
import { makeDefaultConfig } from 'utils/MapiAuth/makeDefaultConfig';
import MapiAuth from 'utils/MapiAuth/MapiAuth';
-import { RUMService } from 'utils/RUMService';
import App from './App';
@@ -45,9 +44,6 @@ if (window.config.environment !== 'development') {
});
}
-const rumService = new RUMService(history);
-rumService.initEvents();
-
// Scroll to the top when we change the URL.
history.listen(() => {
window.scrollTo(0, 0);
diff --git a/src/index.ejs b/src/index.ejs
index 9ea3c24013..6f7c67a909 100644
--- a/src/index.ejs
+++ b/src/index.ejs
@@ -71,7 +71,6 @@
audience: '{!= audience !}',
mapiAudience: '{!= mapiAudience !}',
passageEndpoint: '{!= passageEndpoint !}',
- enableRealUserMonitoring: {!= enableRealUserMonitoring !},
environment: '{!= environment !}',
ingressBaseDomain: '{!= ingressBaseDomain !}',
awsCapabilitiesJSON: '{!- awsCapabilitiesJSON !}',
diff --git a/src/model/clients/GraphQLClient.ts b/src/model/clients/GraphQLClient.ts
deleted file mode 100644
index ee6d7bb37f..0000000000
--- a/src/model/clients/GraphQLClient.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-import { GraphQLError } from './GraphQLError';
-import { HttpClientImpl, HttpRequestMethods, IHttpClient } from './HttpClient';
-
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-export type GraphQLExtensions = Record;
-
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-export type GraphQLVariables = Record;
-
-export interface IGraphQLRequest {
- query: string;
- variables?: GraphQLVariables;
-}
-
-export interface IGraphQLErrorLocation {
- line: number;
- column: number;
-}
-
-export interface IGraphQLError {
- message: string;
- path?: string[];
- extensions?: GraphQLExtensions;
- locations?: IGraphQLErrorLocation[];
-}
-
-export interface IGraphQLResponse {
- status: number;
- data: T | null;
- errors?: IGraphQLError[];
- extensions?: GraphQLExtensions;
-}
-
-export interface IGraphQLClient {
- executeQuery(
- query: string,
- variables?: GraphQLVariables
- ): Promise;
-}
-
-export class GraphQLClientImpl implements IGraphQLClient {
- // eslint-disable-next-line no-useless-constructor
- public constructor(
- protected url: string,
- protected httpClient: IHttpClient = new HttpClientImpl()
- ) {}
-
- public async executeQuery(
- query: string,
- variables?: GraphQLVariables
- ): Promise {
- const req: IGraphQLRequest = { query, variables };
-
- this.httpClient.setRequestConfig({
- timeout: 10000,
- method: HttpRequestMethods.POST,
- url: this.url,
- headers: {
- 'Content-Type': 'application/json',
- },
- data: req,
- });
-
- const res = await this.httpClient.execute>();
-
- if (res.data.errors) {
- return Promise.reject(new GraphQLError(...res.data.errors));
- }
-
- if (!res.data.data) {
- return Promise.reject(new Error('Empty response.'));
- }
-
- return Promise.resolve(res.data.data);
- }
-}
diff --git a/src/model/clients/GraphQLError.ts b/src/model/clients/GraphQLError.ts
deleted file mode 100644
index b7b069cccf..0000000000
--- a/src/model/clients/GraphQLError.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { IGraphQLError } from './GraphQLClient';
-
-export class GraphQLError extends Error {
- public readonly entries: IGraphQLError[] = [];
-
- public constructor(...fromEntries: IGraphQLError[]) {
- super(GraphQLError.formatErrorMessage(fromEntries));
-
- this.entries = fromEntries;
- }
-
- private static formatErrorMessage(fromEntries: IGraphQLError[]): string {
- if (fromEntries.length < 1) return '';
- if (fromEntries.length === 1) return fromEntries[0].message;
-
- return `${fromEntries[0].message} (+ ${fromEntries.length - 1} more)`;
- }
-}
diff --git a/src/model/constants/realUserMonitoring.ts b/src/model/constants/realUserMonitoring.ts
deleted file mode 100644
index dd47e6b967..0000000000
--- a/src/model/constants/realUserMonitoring.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-export enum RUMActions {
- WindowResize = 'WINDOW_RESIZE',
- WindowLoad = 'WINDOW_LOAD',
- WebVitals = 'WEB_VITALS',
- URIChange = 'URI_CHANGE',
-
- ClickMainNavLogo = 'CLICK_MAINNAV_LOGO',
-
- SelectRelease = 'SELECT_RELEASE',
-
- ToggleAZ = 'TOGGLE_AZ',
-
- SelectAZSelection = 'SELECT_AZ_SELECTION',
-
- SelectMasterAZSelection = 'SELECT_MASTER_AZ_SELECTION',
-
- CreateClusterSubmit = 'CREATE_CLUSTER_SUBMIT',
- CreateClusterCancel = 'CREATE_CLUSTER_CANCEL',
-
- SelectInstanceType = 'SELECT_INSTANCE_TYPE',
-
- AddNodePool = 'ADD_NODEPOOL',
- RemoveNodePool = 'REMOVE_NODEPOOL_FORM',
-
- ExpandInstanceTypes = 'EXPAND_INSTANCE_TYPES',
- CollapseInstanceTypes = 'COLLAPSE_INSTANCE_TYPES',
-
- ShowReleaseDetails = 'SHOW_RELEASE_DETAILS',
- HideReleaseDetails = 'HIDE_RELEASE_DETAILS',
-
- ExpandReleases = 'EXPAND_RELEASES',
- CollapseReleases = 'COLLAPSE_RELEASES',
-
- IncrementNumber = 'INCREMENT_NUMBER',
- DecrementNumber = 'DECREMENT_NUMBER',
-
- SpotInstancesMaximumPrice = 'SPOT_INSTANCES_MAX_PRICE',
-}
diff --git a/src/model/services/athena/analytics.ts b/src/model/services/athena/analytics.ts
deleted file mode 100644
index bb268d536e..0000000000
--- a/src/model/services/athena/analytics.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { IGraphQLClient } from 'model/clients/GraphQLClient';
-
-import CreateAnalyticsEventMutation from './mutations/CreateAnalyticsEvent.graphql';
-import {
- AthenaAnalyticsPayload,
- IAthenaAnalyticsEvent,
- IAthenaAnalyticsEventInput,
-} from './types';
-
-export async function createAnalyticsEvent(
- client: IGraphQLClient,
- input: IAthenaAnalyticsEventInput
-): Promise>> {
- //eslint-disable-next-line @typescript-eslint/no-unsafe-argument
- return client.executeQuery(CreateAnalyticsEventMutation, {
- input: { ...input, payload: JSON.stringify(input.payload) },
- });
-}
diff --git a/src/model/services/athena/index.ts b/src/model/services/athena/index.ts
deleted file mode 100644
index 480fde3d26..0000000000
--- a/src/model/services/athena/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './types';
-export * from './analytics';
diff --git a/src/model/services/athena/mutations/CreateAnalyticsEvent.graphql b/src/model/services/athena/mutations/CreateAnalyticsEvent.graphql
deleted file mode 100644
index 4d84cefdf2..0000000000
--- a/src/model/services/athena/mutations/CreateAnalyticsEvent.graphql
+++ /dev/null
@@ -1,10 +0,0 @@
-mutation CreateAnalyticsEvent($input: AnalyticsEventInput!) {
- createAnalyticsEvent(event: $input) {
- appID
- sessionID
- payloadType
- payloadSchemaVersion
- payload
- uri
- }
-}
diff --git a/src/model/services/athena/types.ts b/src/model/services/athena/types.ts
deleted file mode 100644
index 764df478f8..0000000000
--- a/src/model/services/athena/types.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-export type AthenaAnalyticsPayload = Record;
-
-export interface IAthenaAnalyticsEventInput {
- appID: string;
- sessionID: string;
- payloadType: string;
- payloadSchemaVersion: number;
- uri: string;
- payload: T;
-}
-
-export interface IAthenaAnalyticsEvent {
- appID: string;
- sessionID: string;
- payloadType: string;
- payloadSchemaVersion: number;
- uri: string;
- payload: T;
- timestamp: string;
- installationID: string;
- environmentClass: string;
-}
diff --git a/src/utils/RUMService.ts b/src/utils/RUMService.ts
deleted file mode 100644
index 68682552b3..0000000000
--- a/src/utils/RUMService.ts
+++ /dev/null
@@ -1,119 +0,0 @@
-import Bowser from 'bowser';
-import { History } from 'history';
-import { GraphQLClientImpl } from 'model/clients/GraphQLClient';
-import { RUMActions } from 'model/constants/realUserMonitoring';
-import { AthenaAnalyticsPayload } from 'model/services/athena';
-import * as athena from 'model/services/athena';
-import { mergeActionNames } from 'utils/realUserMonitoringUtils';
-import { v4 as uuid } from 'uuid';
-import { getCLS, getFCP, getFID, getLCP, getTTFB, Metric } from 'web-vitals';
-
-import ErrorReporter from './errors/ErrorReporter';
-
-const RESIZE_DEBOUNCE_RATE = 1000; // In ms.
-
-export type RUMServicePayload = AthenaAnalyticsPayload;
-
-export class RUMService {
- public static isEnabled() {
- return window.config.enableRealUserMonitoring;
- }
-
- public constructor(
- protected history: History,
- protected athenaClient = new GraphQLClientImpl(
- `${window.config.athenaEndpoint}/graphql`
- )
- ) {
- this.reportWebVitals();
- }
-
- public async submitEvent(
- type: string,
- schemaVersion: number,
- payload: RUMServicePayload
- ) {
- if (!RUMService.isEnabled()) return;
-
- try {
- await athena.createAnalyticsEvent(this.athenaClient, {
- appID: 'happa',
- sessionID: this.sessionID,
- payloadType: type,
- payloadSchemaVersion: schemaVersion,
- payload,
- uri: location.pathname,
- });
- } catch (err) {
- ErrorReporter.getInstance().notify(err as Error);
- }
- }
-
- public initEvents() {
- window.addEventListener('resize', this.reportResizeEvents.bind(this));
- window.addEventListener('load', this.reportWindowLoad.bind(this));
-
- this.reportURIChanges();
- }
-
- protected async submitWebVital(metric: Metric) {
- const actionName = mergeActionNames(RUMActions.WebVitals, metric.name);
- const payload = { [metric.name.toLowerCase()]: metric.value };
-
- return this.submitEvent(actionName, 1, payload);
- }
-
- protected reportWebVitals() {
- const handleReport = this.submitWebVital.bind(this);
-
- getCLS(handleReport, false);
- getFID(handleReport);
- getFCP(handleReport);
- getLCP(handleReport, false);
- getTTFB(handleReport);
- }
-
- protected reportResizeEvents() {
- window.clearTimeout(this.resizeTimeout);
- this.resizeTimeout = window.setTimeout(() => {
- const windowSizes = RUMService.getWindowSizes();
- this.submitEvent(RUMActions.WindowResize, 1, windowSizes);
- }, RESIZE_DEBOUNCE_RATE);
- }
-
- protected reportWindowLoad() {
- const windowSizes = RUMService.getWindowSizes();
- const clientInfo = Bowser.parse(window.navigator.userAgent);
-
- this.submitEvent(RUMActions.WindowLoad, 2, {
- sizes: windowSizes,
- client: clientInfo,
- });
- }
-
- protected reportURIChanges() {
- this.history.listen((e) => {
- if (this.prevURI === e.pathname) return;
-
- this.prevURI = e.pathname;
- this.submitEvent(RUMActions.URIChange, 1, { pathname: this.prevURI });
- });
- }
-
- protected sessionID = uuid();
-
- protected resizeTimeout = 0;
-
- protected prevURI = '';
-
- protected static getWindowSizes() {
- return {
- windowInnerWidth: window.innerWidth,
- windowInnerHeight: window.innerHeight,
- screenHeight: window.screen.height,
- screenWidth: window.screen.width,
- screenAvailableHeight: window.screen.availHeight,
- screenAvailableWidth: window.screen.availWidth,
- };
- }
-}
diff --git a/src/utils/__tests__/realUserMonitoringUtils.ts b/src/utils/__tests__/realUserMonitoringUtils.ts
deleted file mode 100644
index 4369d73510..0000000000
--- a/src/utils/__tests__/realUserMonitoringUtils.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { mergeActionNames } from 'utils/realUserMonitoringUtils';
-
-describe('realUserMonitoringUtils', () => {
- describe('mergeActionNames', () => {
- it('merges given event parts into a single uppercase string', () => {
- expect(
- mergeActionNames(
- 'TEST_EVENT',
- 'WITH_OTHER_STUFF',
- 'seriously',
- 'OTHER_STUFF'
- )
- ).toEqual('TEST_EVENT_WITH_OTHER_STUFF_SERIOUSLY_OTHER_STUFF');
- });
- });
-});
diff --git a/src/utils/realUserMonitoringUtils.ts b/src/utils/realUserMonitoringUtils.ts
deleted file mode 100644
index db6aeaff63..0000000000
--- a/src/utils/realUserMonitoringUtils.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-const eventNameSeparator = '_';
-
-export function mergeActionNames(...parts: string[]): string {
- return parts.join(eventNameSeparator).toUpperCase();
-}
diff --git a/webpack.dev.ts b/webpack.dev.ts
index 8a4c75266b..f1f4255e93 100644
--- a/webpack.dev.ts
+++ b/webpack.dev.ts
@@ -70,7 +70,6 @@ const config: webpack.Configuration = merge(common, {
mapiAuthRedirectURL: 'http://localhost:7000',
environment: 'development',
happaVersion: 'development',
- enableRealUserMonitoring: false,
},
proxies: [
{