Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ds-observability into feature/multitenancy
  • Loading branch information
JulianQuispel committed May 2, 2024
2 parents 20c2749 + 2fd7ba1 commit cb1496a
Show file tree
Hide file tree
Showing 225 changed files with 5,259 additions and 947 deletions.
5 changes: 5 additions & 0 deletions common/constants/data_sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,8 @@ export const ACCELERATION_AGGREGRATION_FUNCTIONS = [
];

export const SPARK_PARTITION_INFO = `# Partition Information`;
export const OBS_DEFAULT_CLUSTER = 'observability-default'; // prefix key for generating data source id for default cluster in data selector
export const OBS_S3_DATA_SOURCE = 'observability-s3'; // prefix key for generating data source id for s3 data sources in data selector
export const S3_DATA_SOURCE_GROUP_DISPLAY_NAME = 'Amazon S3'; // display group name for Amazon-managed-s3 data sources in data selector
export const S3_DATA_SOURCE_GROUP_SPARK_DISPLAY_NAME = 'Spark'; // display group name for OpenSearch-spark-s3 data sources in data selector
export const SECURITY_DASHBOARDS_LOGOUT_URL = '/logout';
6 changes: 3 additions & 3 deletions common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ export interface DefaultChartStylesProps {
}

export const DEFAULT_CHART_STYLES: DefaultChartStylesProps = {
DefaultModeLine: 'lines',
DefaultModeLine: 'lines+markers',
Interpolation: 'spline',
LineWidth: 0,
FillOpacity: 100,
MarkerSize: 5,
MarkerSize: 25,
ShowLegend: 'show',
LegendPosition: 'v',
LabelAngle: 0,
Expand Down Expand Up @@ -258,7 +258,7 @@ export const VISUALIZATION_ERROR = {
NO_METRIC: 'Invalid Metric MetaData',
};

export const S3_DATASOURCE_TYPE = 'S3_DATASOURCE';
export const S3_DATA_SOURCE_TYPE = 's3glue';

export const ASYNC_QUERY_SESSION_ID = 'async-query-session-id';
export const ASYNC_QUERY_DATASOURCE_CACHE = 'async-query-catalog-cache';
Expand Down
11 changes: 10 additions & 1 deletion common/types/data_connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export interface CachedDataSource {
lastUpdated: string; // date string in UTC format
status: CachedDataSourceStatus;
databases: CachedDatabase[];
dataSourceMDSId?: string;
}

export interface DataSourceCacheData {
Expand All @@ -143,6 +144,7 @@ export interface CachedAccelerationByDataSource {
accelerations: CachedAcceleration[];
lastUpdated: string; // date string in UTC format
status: CachedDataSourceStatus;
dataSourceMDSId?: string;
}

export interface AccelerationsCacheData {
Expand Down Expand Up @@ -240,6 +242,13 @@ export interface CreateAccelerationForm {

export interface LoadCachehookOutput {
loadStatus: DirectQueryLoadingStatus;
startLoading: (dataSourceName: string, databaseName?: string, tableName?: string) => void;
startLoading: (params: StartLoadingParams) => void;
stopLoading: () => void;
}

export interface StartLoadingParams {
dataSourceName: string;
dataSourceMDSId?: string;
databaseName?: string;
tableName?: string;
}
3 changes: 3 additions & 0 deletions common/utils/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export function get<T = unknown>(obj: Record<string, any>, path: string, default
}

export function addBackticksIfNeeded(input: string): string {
if (input === undefined) {
return '';
}
// Check if the string already has backticks
if (input.startsWith('`') && input.endsWith('`')) {
return input; // Return the string as it is
Expand Down
2 changes: 1 addition & 1 deletion opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"urlForwarding",
"visualizations"
],
"optionalPlugins": ["managementOverview", "assistantDashboards", "securityDashboards"],
"optionalPlugins": ["managementOverview", "assistantDashboards", "securityDashboards", "dataSource", "dataSourceManagement"],
"configPath": ["observability"]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"antlr4ts": "^0.5.0-alpha.4",
"cypress-multi-reporters": "^1.6.3",
"cypress-parallel": "^0.13.0",
"json5": "^2.2.3",
"mime": "^3.0.0",
"mocha": "10.1.0",
"performance-now": "^2.1.0",
Expand Down
20 changes: 16 additions & 4 deletions public/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +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';
import { PublicConfig } from '../plugin';

interface ObservabilityAppDeps {
CoreStartProp: CoreStart;
Expand All @@ -32,6 +32,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 @@ -61,6 +65,10 @@ export const App = ({
queryManager,
startPage,
dataSourcePluggables,
dataSourceManagement,
setActionMenu,
dataSourceEnabled,
savedObjectsMDSClient,
}: ObservabilityAppDeps) => {
const { chrome, http, notifications } = CoreStartProp;
const parentBreadcrumb = {
Expand Down Expand Up @@ -93,6 +101,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 @@ -1059,6 +1059,14 @@ exports[`Trace Detail Render Flyout component render trace detail 1`] = `
"barmode": "stack",
"height": 60,
"hovermode": "closest",
"layout": Object {
"annotations": Array [
Object {
"showarrow": true,
"xanchor": "right",
},
],
},
"legend": Object {
"orientation": "h",
"traceorder": "normal",
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 Down Expand Up @@ -51,7 +50,7 @@ export const ServiceConfig = (props: ServiceConfigProps) => {
const [modalLayout, setModalLayout] = useState(<EuiOverlayMask />);

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

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 @@ -132,7 +132,7 @@ export function ServiceDetailFlyout(props: ServiceFlyoutProps) {
appConfigs
);
handleServiceViewRequest(serviceName, http, serviceDSL, setFields, mode);
handleServiceMapRequest(http, serviceDSL, mode, setServiceMap, serviceName, tenant);
handleServiceMapRequest(http, serviceDSL, mode, '', setServiceMap, serviceName, tenant);
const spanDSL = filtersToDsl(mode, filters, query, startTime, endTime, 'app', appConfigs);
spanDSL.query.bool.must.push({
term: {
Expand Down
Loading

0 comments on commit cb1496a

Please sign in to comment.