Skip to content

Commit

Permalink
chore: Removing Agent Tracing Backend (#3466)
Browse files Browse the repository at this point in the history
* chore: Removing Agent Tracing Backend

* fixes
  • Loading branch information
xoscar committed Dec 20, 2023
1 parent 534cd42 commit a1d45f5
Show file tree
Hide file tree
Showing 16 changed files with 9 additions and 165 deletions.
1 change: 0 additions & 1 deletion api/dataStores.yaml
Expand Up @@ -193,7 +193,6 @@ components:
type: string
enum:
[
agent,
jaeger,
opensearch,
tempo,
Expand Down
2 changes: 0 additions & 2 deletions web/src/components/DataStoreIcon/DataStoreIcon.tsx
@@ -1,6 +1,5 @@
import {useTheme} from 'styled-components';
import {SupportedDataStores} from 'types/DataStore.types';
import Agent from './Icons/Agent';
import Elastic from './Icons/Elastic';
import Jaeger from './Icons/Jaeger';
import Lightstep from './Icons/Lightstep';
Expand All @@ -18,7 +17,6 @@ import Dynatrace from './Icons/Dynatrace';
import SumoLogic from './Icons/SumoLogic';

const iconMap = {
[SupportedDataStores.Agent]: Agent,
[SupportedDataStores.JAEGER]: Jaeger,
[SupportedDataStores.SignalFX]: SignalFx,
[SupportedDataStores.ElasticApm]: Elastic,
Expand Down
14 changes: 0 additions & 14 deletions web/src/components/DataStoreIcon/Icons/Agent.tsx

This file was deleted.

@@ -1,6 +1,6 @@
import {CheckCircleOutlined} from '@ant-design/icons';
import {Tabs, Typography} from 'antd';
import styled, {css} from 'styled-components';
import styled from 'styled-components';

const defaultHeight = '100vh - 106px - 60px - 40px';

Expand All @@ -23,19 +23,12 @@ export const DataStoreListContainer = styled(Tabs)`
}
`;

export const DataStoreItemContainer = styled.div<{$isDisabled: boolean; $isSelected: boolean}>`
export const DataStoreItemContainer = styled.div<{$isSelected: boolean}>`
display: flex;
align-items: center;
gap: 10px;
padding: 12px 22px;
cursor: pointer;
${({$isDisabled}) =>
$isDisabled &&
css`
cursor: not-allowed;
opacity: 0.5;
`}
`;

export const DataStoreName = styled(Typography.Text)<{$isSelected: boolean}>`
Expand Down
@@ -1,10 +1,8 @@
import {Popover, Tabs} from 'antd';
import {useCallback} from 'react';
import {noop} from 'lodash';
import {useTheme} from 'styled-components';
import {ConfigMode, SupportedDataStores} from 'types/DataStore.types';
import {SupportedDataStoresToName} from 'constants/DataStore.constants';
import {Flag, useCustomization} from 'providers/Customization';
import {useSettingsValues} from 'providers/SettingsValues/SettingsValues.provider';

import DataStoreIcon from '../../DataStoreIcon/DataStoreIcon';
Expand All @@ -18,57 +16,25 @@ interface IProps {
const supportedDataStoreList = Object.values(SupportedDataStores);

const DataStoreSelection = ({onChange = noop, value = SupportedDataStores.JAEGER}: IProps) => {
const {getFlag} = useCustomization();
const isLocalModeEnabled = getFlag(Flag.IsLocalModeEnabled);
const {
color: {text, primary},
} = useTheme();
const {dataStoreConfig} = useSettingsValues();
const configuredDataStoreType = dataStoreConfig.defaultDataStore.type;

const handleChange = useCallback(
dataStore => {
const isDisabled = isLocalModeEnabled && dataStore !== SupportedDataStores.Agent;

if (!isDisabled) onChange(dataStore);
},
[isLocalModeEnabled, onChange]
);

return (
<S.DataStoreListContainer tabPosition="left" onChange={handleChange}>
<S.DataStoreListContainer tabPosition="left" onChange={dataStore => onChange(dataStore as SupportedDataStores)}>
{supportedDataStoreList.map(dataStore => {
if (dataStore === SupportedDataStores.Agent && !getFlag(Flag.IsAgentDataStoreEnabled)) {
return null;
}

const isSelected = value === dataStore;
const isConfigured = configuredDataStoreType === dataStore && dataStoreConfig.mode === ConfigMode.READY;
const isDisabled = isLocalModeEnabled && dataStore !== SupportedDataStores.Agent;

return (
<Tabs.TabPane
key={dataStore}
tab={
<S.DataStoreItemContainer $isDisabled={isDisabled} $isSelected={isSelected} key={dataStore}>
<S.DataStoreItemContainer $isSelected={isSelected} key={dataStore}>
<DataStoreIcon dataStoreType={dataStore} color={isSelected ? primary : text} width="22" height="22" />

{isDisabled ? (
<Popover
content={
<div>
In localMode only the Agent Tracing Backend can be used. <br /> If you want to connect to a
different Tracing Backend <br /> please create a new environment
</div>
}
placement="right"
>
<S.DataStoreName $isSelected={isSelected}>{SupportedDataStoresToName[dataStore]}</S.DataStoreName>
</Popover>
) : (
<S.DataStoreName $isSelected={isSelected}>{SupportedDataStoresToName[dataStore]}</S.DataStoreName>
)}

<S.DataStoreName $isSelected={isSelected}>{SupportedDataStoresToName[dataStore]}</S.DataStoreName>
{isConfigured && (
<Popover content="This data source is currently configured" placement="right">
<S.InfoIcon />
Expand Down
Expand Up @@ -6,7 +6,7 @@ interface IProps {
}

const DataStoreComponentFactory = ({dataStoreType = SupportedDataStores.JAEGER}: IProps) => {
const FormComponent = DataStorePlugin[dataStoreType];
const FormComponent = DataStorePlugin[dataStoreType] || DataStorePlugin[SupportedDataStores.OtelCollector];

return <FormComponent />;
};
Expand Down
@@ -1,5 +1,4 @@
import {IDataStorePluginMap, SupportedDataStores} from 'types/DataStore.types';
import Agent from './forms/Agent';
import GrpcClient from './forms/GrpcClient';
import ElasticSearch from './forms/ElasticSearch';
import OpenTelemetryCollector from './forms/OpenTelemetryCollector';
Expand All @@ -10,7 +9,6 @@ import AzureAppInsights from './forms/AzureAppInsights/AzureAppInsights';
import SumoLogic from './forms/SumoLogic';

export const DataStoreComponentMap: IDataStorePluginMap = {
[SupportedDataStores.Agent]: Agent,
[SupportedDataStores.JAEGER]: GrpcClient,
[SupportedDataStores.TEMPO]: BaseClient,
[SupportedDataStores.SignalFX]: SignalFx,
Expand Down

This file was deleted.

20 changes: 0 additions & 20 deletions web/src/components/Settings/DataStorePlugin/forms/Agent/Agent.tsx

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions web/src/constants/CollectorConfig.constants.ts
Expand Up @@ -268,7 +268,6 @@ export const CollectorConfigMap = {
[SupportedDataStores.AzureAppInsights]: AzureAppInsights(tracetest),
[SupportedDataStores.Signoz]: Signoz(tracetest),
[SupportedDataStores.Dynatrace]: Dynatrace(tracetest),
[SupportedDataStores.Agent]: OtelCollector(tracetest),
} as const;

export const CollectorConfigFunctionMap = {
Expand All @@ -280,5 +279,4 @@ export const CollectorConfigFunctionMap = {
[SupportedDataStores.AzureAppInsights]: AzureAppInsights,
[SupportedDataStores.Signoz]: Signoz,
[SupportedDataStores.Dynatrace]: Dynatrace,
[SupportedDataStores.Agent]: OtelCollector,
} as const;
3 changes: 0 additions & 3 deletions web/src/constants/DataStore.constants.tsx
@@ -1,7 +1,6 @@
import {SupportedDataStores} from '../types/DataStore.types';

export const SupportedDataStoresToName = {
[SupportedDataStores.Agent]: 'Agent',
[SupportedDataStores.JAEGER]: 'Jaeger',
[SupportedDataStores.OpenSearch]: 'OpenSearch',
[SupportedDataStores.SignalFX]: 'SignalFX',
Expand All @@ -20,7 +19,6 @@ export const SupportedDataStoresToName = {
} as const;

export const SupportedDataStoresToDocsLink = {
[SupportedDataStores.Agent]: 'https://docs.tracetest.io/configuration/agent',
[SupportedDataStores.JAEGER]: 'https://docs.tracetest.io/configuration/connecting-to-data-stores/jaeger',
[SupportedDataStores.OpenSearch]: 'https://docs.tracetest.io/configuration/connecting-to-data-stores/opensearch',
[SupportedDataStores.ElasticApm]: 'https://docs.tracetest.io/configuration/connecting-to-data-stores/elasticapm',
Expand All @@ -41,7 +39,6 @@ export const SupportedDataStoresToDocsLink = {
} as const;

export const SupportedDataStoresToDefaultEndpoint = {
[SupportedDataStores.Agent]: '',
[SupportedDataStores.JAEGER]: 'jaeger:16685',
[SupportedDataStores.OpenSearch]: 'http://opensearch:9200',
[SupportedDataStores.SignalFX]: '',
Expand Down
3 changes: 1 addition & 2 deletions web/src/services/DataStore.service.ts
Expand Up @@ -11,7 +11,6 @@ import AzureAppInsightsService from './DataStores/AzureAppInsights.service';
import SumoLogicService from './DataStores/SumoLogic.service';

const dataStoreServiceMap = {
[SupportedDataStores.Agent]: OtelCollectorService,
[SupportedDataStores.JAEGER]: JaegerService,
[SupportedDataStores.TEMPO]: BaseClientService,
[SupportedDataStores.OpenSearch]: ElasticSearchService,
Expand Down Expand Up @@ -39,7 +38,7 @@ interface IDataStoreService {

const DataStoreService = (): IDataStoreService => ({
_getDataStore(type = SupportedDataStores.JAEGER) {
return dataStoreServiceMap[type];
return dataStoreServiceMap[type] || OtelCollectorService;
},
async getRequest(draft, defaultDataStore) {
const dataStoreType = draft.dataStoreType || SupportedDataStores.JAEGER;
Expand Down
6 changes: 2 additions & 4 deletions web/src/types/DataStore.types.ts
Expand Up @@ -16,10 +16,9 @@ export enum ConnectionTypes {
}

export enum SupportedDataStores {
Agent = 'agent',
OtelCollector = 'otlp',
JAEGER = 'jaeger',
TEMPO = 'tempo',
OtelCollector = 'otlp',
NewRelic = 'newrelic',
Lightstep = 'lightstep',
OpenSearch = 'opensearch',
Expand All @@ -45,8 +44,7 @@ export type TCollectorDataStores =
| SupportedDataStores.Lightstep
| SupportedDataStores.Datadog
| SupportedDataStores.Signoz
| SupportedDataStores.Dynatrace
| SupportedDataStores.Agent;
| SupportedDataStores.Dynatrace;

export type TRawGRPCClientSettings = TDataStoreSchemas['GRPCClientSettings'];
export type TRawElasticSearch = TDataStoreSchemas['ElasticSearch'];
Expand Down
1 change: 0 additions & 1 deletion web/src/types/Generated.types.ts
Expand Up @@ -1423,7 +1423,6 @@ export interface external {
};
/** @enum {string} */
SupportedDataStores:
| "agent"
| "jaeger"
| "opensearch"
| "tempo"
Expand Down

0 comments on commit a1d45f5

Please sign in to comment.