Skip to content

Commit

Permalink
added changes for datasourcemds- ids
Browse files Browse the repository at this point in the history
Signed-off-by: sumukhswamy <[email protected]>
  • Loading branch information
sumukhswamy committed Apr 29, 2024
1 parent 3dbe5c8 commit 4e0a088
Show file tree
Hide file tree
Showing 25 changed files with 614 additions and 246 deletions.
6 changes: 3 additions & 3 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "observabilityDashboards",
"version": "3.0.0.0",
"opensearchDashboardsVersion": "3.0.0",
"version": "2.12.0.0",
"opensearchDashboardsVersion": "2.12.0",
"server": true,
"ui": true,
"requiredPlugins": [
Expand All @@ -18,6 +18,6 @@
"urlForwarding",
"visualizations"
],
"optionalPlugins": ["managementOverview", "assistantDashboards", "securityDashboards"],
"optionalPlugins": ["managementOverview", "assistantDashboards", "securityDashboards", "dataSource", "dataSourceManagement"],
"configPath": ["observability"]
}
21 changes: 17 additions & 4 deletions public/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ import { I18nProvider } from '@osd/i18n/react';
import { QueryManager } from 'common/query_manager';
import React from 'react';
import { Provider } from 'react-redux';
import { CoreStart } from '../../../../src/core/public';
import { CoreStart, MountPoint } from '../../../../src/core/public';
import { DataSourceManagementPluginSetup } from '../../../../src/plugins/data_source_management/public';
import { observabilityID, observabilityTitle } from '../../common/constants/shared';
import { store } from '../framework/redux/store';
import { AppPluginStartDependencies } from '../types';
import { Home as ApplicationAnalyticsHome } from './application_analytics/home';
import { Home as IntegrationsHome } from './integrations/home';
import { MetricsListener } from './common/metrics_listener';
import { Home as CustomPanelsHome } from './custom_panels/home';
import { Home as DataConnectionsHome } from './datasources/home';
import { EventAnalytics } from './event_analytics';
import { Home as IntegrationsHome } from './integrations/home';
import { Home as MetricsHome } from './metrics/index';
import { Main as NotebooksHome } from './notebooks/components/main';
import { Home as TraceAnalyticsHome } from './trace_analytics/home';
import { Home as DataConnectionsHome } from './datasources/home';

interface ObservabilityAppDeps {
CoreStartProp: CoreStart;
Expand All @@ -30,6 +31,10 @@ interface ObservabilityAppDeps {
timestampUtils: any;
queryManager: QueryManager;
startPage: string;
dataSourceEnabled: boolean;
dataSourceManagement: DataSourceManagementPluginSetup;
setActionMenu: (menuMount: MountPoint | undefined) => void;
savedObjectsMDSClient: CoreStart['savedObjects']
}

// for cypress to test redux store
Expand Down Expand Up @@ -58,8 +63,12 @@ export const App = ({
queryManager,
startPage,
dataSourcePluggables,
dataSourceManagement,
setActionMenu,
dataSourceEnabled,
savedObjectsMDSClient
}: ObservabilityAppDeps) => {
const { chrome, http, notifications, savedObjects: coreSavedObjects } = CoreStartProp;
const { chrome, http, notifications } = CoreStartProp;
const parentBreadcrumb = {
text: observabilityTitle,
href: `${observabilityID}#/`,
Expand Down Expand Up @@ -89,6 +98,10 @@ export const App = ({
parentBreadcrumbs={[parentBreadcrumb]}
setBreadcrumbs={chrome.setBreadcrumbs}
dataSourcePluggables={dataSourcePluggables}
dataSourceManagement={dataSourceManagement}
dataSourceEnabled={dataSourceEnabled}
setActionMenu={setActionMenu}
savedObjectsMDSClient={savedObjectsMDSClient}
/>
</MetricsListener>
</I18nProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ import {
EuiText,
} from '@elastic/eui';
import DSLService from 'public/services/requests/dsl';
import React, { useState } from 'react';
import { useEffect } from 'react';
import React, { useEffect, useState } from 'react';
import { OptionType } from '../../../../../common/types/application_analytics';
import { FilterType } from '../../../trace_analytics/components/common/filters/filters';
import { ServiceObject } from '../../../trace_analytics/components/common/plots/service_map';
import { ServiceMap } from '../../../trace_analytics/components/services';
import { handleServiceMapRequest } from '../../../trace_analytics/requests/services_request_handler';
import { AppAnalyticsComponentDeps } from '../../home';
import { OptionType } from '../../../../../common/types/application_analytics';
import { getClearModal } from '../../helpers/modal_containers';
import { AppAnalyticsComponentDeps } from '../../home';

interface ServiceConfigProps extends AppAnalyticsComponentDeps {
dslService: DSLService;
Expand All @@ -50,7 +49,7 @@ export const ServiceConfig = (props: ServiceConfigProps) => {
const [modalLayout, setModalLayout] = useState(<EuiOverlayMask />);

useEffect(() => {
handleServiceMapRequest(http, dslService, mode, setServiceMap);
handleServiceMapRequest(http, dslService, mode, '', setServiceMap);
}, []);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/
/* eslint-disable react-hooks/exhaustive-deps */

import _ from 'lodash';
import {
EuiFlyout,
EuiFlyoutBody,
Expand All @@ -14,19 +13,20 @@ import {
EuiText,
EuiTitle,
} from '@elastic/eui';
import _ from 'lodash';
import React, { useEffect, useMemo, useState } from 'react';
import {
handleServiceMapRequest,
handleServiceViewRequest,
} from '../../../../../public/components/trace_analytics/requests/services_request_handler';
import {
filtersToDsl,
processTimeStamp,
} from '../../../../../public/components/trace_analytics/components/common/helper_functions';
import { ServiceMap } from '../../../../../public/components/trace_analytics/components/services';
import { ServiceObject } from '../../../../../public/components/trace_analytics/components/common/plots/service_map';
import { ServiceMap } from '../../../../../public/components/trace_analytics/components/services';
import { SpanDetailTable } from '../../../../../public/components/trace_analytics/components/traces/span_detail_table';
import { TraceAnalyticsComponentDeps } from '../../../../../public/components/trace_analytics/home';
import {
handleServiceMapRequest,
handleServiceViewRequest,
} from '../../../../../public/components/trace_analytics/requests/services_request_handler';
import { getListItem } from '../../helpers/utils';

interface ServiceFlyoutProps extends TraceAnalyticsComponentDeps {
Expand Down Expand Up @@ -131,7 +131,7 @@ export function ServiceDetailFlyout(props: ServiceFlyoutProps) {
appConfigs
);
handleServiceViewRequest(serviceName, http, serviceDSL, setFields, mode);
handleServiceMapRequest(http, serviceDSL, mode, setServiceMap, serviceName);
handleServiceMapRequest(http, serviceDSL, mode, '', setServiceMap, serviceName);
const spanDSL = filtersToDsl(mode, filters, query, startTime, endTime, 'app', appConfigs);
spanDSL.query.bool.must.push({
term: {
Expand Down
16 changes: 13 additions & 3 deletions public/components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { QueryManager } from 'common/query_manager';
import React from 'react';
import ReactDOM from 'react-dom';
import { QueryManager } from 'common/query_manager';
import { AppMountParameters, CoreStart } from '../../../../src/core/public';
import { AppPluginStartDependencies, SetupDependencies } from '../types';
import { DataSourceManagementPluginSetup } from '../../../../src/plugins/data_source_management/public';
import { AppPluginStartDependencies } from '../types';
import { App } from './app';


export const Observability = (
CoreStartProp: CoreStart,
DepsStart: AppPluginStartDependencies,
Expand All @@ -20,8 +22,12 @@ export const Observability = (
timestampUtils: any,
queryManager: QueryManager,
startPage: string,
dataSourcePluggables
dataSourcePluggables,
dataSourceManagement: DataSourceManagementPluginSetup,
savedObjectsMDSClient: CoreStart['savedObjects']
) => {
const { setHeaderActionMenu } = AppMountParametersProp
const { dataSource } = DepsStart;
ReactDOM.render(
<App
CoreStartProp={CoreStartProp}
Expand All @@ -33,6 +39,10 @@ export const Observability = (
queryManager={queryManager}
startPage={startPage}
dataSourcePluggables={dataSourcePluggables}
dataSourceManagement={dataSourceManagement}
setActionMenu={setHeaderActionMenu}
dataSourceEnabled={!!dataSource}
savedObjectsMDSClient={savedObjectsMDSClient}
/>,
AppMountParametersProp.element
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import { EuiBreadcrumb, EuiTitle } from '@elastic/eui';
import { Toast } from '@elastic/eui/src/components/toast/global_toast_list';
import React from 'react';
import { TraceAnalyticsComponentDeps, TraceAnalyticsMode } from '../../home';
import { DataSourceOption } from '../../../../../../../src/plugins/data_source_management/public/components/data_source_menu/types';
import { TraceAnalyticsComponentDeps } from '../../home';
import { DashboardContent } from './dashboard_content';
import { DataSourcePicker } from './mode_picker';

Expand All @@ -20,6 +21,7 @@ export interface DashboardProps extends TraceAnalyticsComponentDeps {
text?: React.ReactChild | undefined,
side?: string | undefined
) => void;
dataSourceMDSId: DataSourceOption[]
}

export function Dashboard(props: DashboardProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,29 @@ import dateMath from '@elastic/datemath';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
import _ from 'lodash';
import React, { useEffect, useState } from 'react';
import { useToast } from '../../../../../public/components/common/toast';
import {
handleDashboardErrorRatePltRequest,
handleDashboardRequest,
handleDashboardThroughputPltRequest,
handleJaegerDashboardRequest,
handleJaegerErrorDashboardRequest,
} from '../../requests/dashboard_request_handler';
import { handleServiceMapRequest } from '../../requests/services_request_handler';
import { FilterType } from '../common/filters/filters';
import { getValidFilterFields } from '../common/filters/filter_helpers';
import { FilterType } from '../common/filters/filters';
import {
MissingConfigurationMessage,
filtersToDsl,
getPercentileFilter,
milliToNanoSec,
minFixedInterval,
MissingConfigurationMessage,
processTimeStamp,
} from '../common/helper_functions';
import { ErrorRatePlt } from '../common/plots/error_rate_plt';
import { ServiceMap, ServiceObject } from '../common/plots/service_map';
import { ThroughputPlt } from '../common/plots/throughput_plt';
import { SearchBar } from '../common/search_bar';
import { DashboardProps } from './dashboard';
import { DashboardTable } from './dashboard_table';
import { TopGroupsPage } from './top_groups_page';
import { useToast } from '../../../../../public/components/common/toast';

export function DashboardContent(props: DashboardProps) {
const {
Expand All @@ -55,6 +52,7 @@ export function DashboardContent(props: DashboardProps) {
dataPrepperIndicesExist,
jaegerIndicesExist,
toasts,
dataSourceMDSId,
} = props;
const [tableItems, setTableItems] = useState([]);
const [jaegerTableItems, setJaegerTableItems] = useState([]);
Expand Down Expand Up @@ -173,6 +171,7 @@ export function DashboardContent(props: DashboardProps) {
// setToast!('Query took too long to execute.', 'danger', 'Reduce time range or filter your data. If issue persists, consider increasing your cluster size.');
// }
// },
dataSourceMDSId[0].id,
setPercentileMap
).finally(() => setLoading(false));
handleJaegerErrorDashboardRequest(
Expand All @@ -189,6 +188,7 @@ export function DashboardContent(props: DashboardProps) {
// setToast!('Query took too long to execute.', 'danger', 'Reduce time range or filter your data. If issue persists, consider increasing your cluster size.');
// }
// },
dataSourceMDSId[0].id,
setPercentileMap
).finally(() => setLoading(false));
} else if (mode === 'data_prepper') {
Expand All @@ -201,6 +201,7 @@ export function DashboardContent(props: DashboardProps) {
setTableItems,
mode,
() => setShowTimeoutToast(true),
dataSourceMDSId[0].id,
setPercentileMap
).then(() => setLoading(false));
// service map should not be filtered by service name (https://github.com/opensearch-project/observability/issues/442)
Expand All @@ -216,7 +217,8 @@ export function DashboardContent(props: DashboardProps) {
fixedInterval,
throughputPltItems,
setThroughputPltItems,
mode
mode,
dataSourceMDSId[0].id
);

handleDashboardErrorRatePltRequest(
Expand All @@ -225,7 +227,8 @@ export function DashboardContent(props: DashboardProps) {
fixedInterval,
errorRatePltItems,
setErrorRatePltItems,
mode
mode,
dataSourceMDSId[0].id
);
};

Expand Down
Loading

0 comments on commit 4e0a088

Please sign in to comment.