Skip to content

Commit

Permalink
Refactor constants and remove unused trace analytics components
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Li <[email protected]>
  • Loading branch information
joshuali925 committed Sep 1, 2021
1 parent d060a6a commit 74ba9ad
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 350 deletions.
23 changes: 23 additions & 0 deletions common/constants/trace_analytics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

export const DATA_PREPPER_INDEX_NAME = 'otel-v1-apm-span-*';
export const DATA_PREPPER_SERVICE_INDEX_NAME = 'otel-v1-apm-service-map*';
export const TRACE_ANALYTICS_DATE_FORMAT = 'MM/DD/YYYY HH:mm:ss';
export const TRACE_ANALYTICS_PLOTS_DATE_FORMAT = 'MMM D, YYYY HH:mm:ss';
export const SERVICE_MAP_MAX_NODES = 500;
// size limit when requesting edge related queries, not necessarily the number of edges
export const SERVICE_MAP_MAX_EDGES = 1000;
export const TRACES_MAX_NUM = 3000;
export const TRACE_ANALYTICS_DOCUMENTATION_LINK = 'https://docs-beta.opensearch.org/monitoring-plugins/trace/';

export const TRACE_ANALYTICS_INDICES_ROUTE = '/api/observability/trace_analytics/indices';
export const TRACE_ANALYTICS_DSL_ROUTE = '/api/observability/trace_analytics/query';
158 changes: 0 additions & 158 deletions public/components/trace_analytics/components/app.tsx

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ import dateMath from '@elastic/datemath';
import { EuiButton, EuiEmptyPrompt, EuiSpacer, EuiText } from '@elastic/eui';
import { SpacerSize } from '@elastic/eui/src/components/spacer/spacer';
import React from 'react';
import { DOCUMENTATION_LINK, RAW_INDEX_NAME, SERVICE_MAP_INDEX_NAME } from '.';
import {
DATA_PREPPER_INDEX_NAME,
DATA_PREPPER_SERVICE_INDEX_NAME,
TRACE_ANALYTICS_DOCUMENTATION_LINK,
} from '../../../../../common/constants/trace_analytics';
import { serviceMapColorPalette } from './color_palette';
import { FilterType } from './filters/filters';
import { ServiceObject } from './plots/service_map';
Expand Down Expand Up @@ -69,15 +73,15 @@ export function MissingConfigurationMessage() {
title={<h2>Trace Analytics not set up</h2>}
body={
<EuiText>
{`The indices required for trace analytics (${RAW_INDEX_NAME} and ${SERVICE_MAP_INDEX_NAME}) do not exist or you do not have permission to access them.`}
{`The indices required for trace analytics (${DATA_PREPPER_INDEX_NAME} and ${DATA_PREPPER_SERVICE_INDEX_NAME}) do not exist or you do not have permission to access them.`}
</EuiText>
}
actions={
<EuiButton
color="primary"
iconSide="right"
iconType="popout"
onClick={() => window.open(DOCUMENTATION_LINK, '_blank')}
onClick={() => window.open(TRACE_ANALYTICS_DOCUMENTATION_LINK, '_blank')}
>
Learn more
</EuiButton>
Expand Down
42 changes: 0 additions & 42 deletions public/components/trace_analytics/components/common/index.ts

This file was deleted.

71 changes: 0 additions & 71 deletions public/components/trace_analytics/components/common/side_nav.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export function ServiceView(props: ServiceViewProps) {
{fields.connected_services
? fields.connected_services
.map((service: string) => (
<EuiLink href={`#/services/${service}`} key={service}>
<EuiLink href={`#/trace_analytics/services/${service}`} key={service}>
{service}
</EuiLink>
))
Expand Down Expand Up @@ -195,7 +195,7 @@ export function ServiceView(props: ServiceViewProps) {
inverted: false,
disabled: false,
});
location.assign('#/traces');
location.assign('#/trace_analytics/traces');
}}
>
<EuiI18nNumber value={fields.traces} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { handleServicesRequest } from '../../requests/services_request_handler';
import { FilterType } from '../common/filters/filters';
import { getValidFilterFields } from '../common/filters/filter_helpers';
import { filtersToDsl } from '../common/helper_functions';
import { ServiceObject } from '../common/plots/service_map';
import { SearchBar } from '../common/search_bar';
import { ServicesTable } from './services_table';

Expand Down
Loading

0 comments on commit 74ba9ad

Please sign in to comment.