Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Removing Agent Tracing Backend #3466

Merged
merged 4 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion api/dataStores.yaml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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.

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we removing the disabled datastores for localMode? how is this going to look for localMode?


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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,6 @@ export interface external {
};
/** @enum {string} */
SupportedDataStores:
| "agent"
| "jaeger"
| "opensearch"
| "tempo"
Expand Down