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

[BUG-Fixed] #1466 - create observability dashboard after invalid name #1

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
616b2e3
[BUG-Fixed] #1466 - create observability dashboard after creating wit…
Mahima081 Apr 19, 2024
44727c3
Enhance Explorer to use describe command (#1736)
paulstn Apr 25, 2024
d131d99
Refactor integrations setup for easier separation of different setup …
Swiddis Apr 25, 2024
3dbe5c8
Add multi-checkpoint support to integrations (#1742)
Swiddis Apr 25, 2024
947385f
add saved queries to vpc flow (#1744)
YANG-DB Apr 26, 2024
685aeaf
Add skipping indices for all integrations that have sample queries (#…
Swiddis Apr 29, 2024
57ae4e3
Cloud trails saved queries integration (#1737)
YANG-DB Apr 29, 2024
afc8f4a
[Integrations] Add skipping index and saved queries for WAF integrati…
RyanL1997 Apr 29, 2024
914d6f2
[Bug fix] Add conditional rendering for data connection page's tabs (…
RyanL1997 Apr 29, 2024
6a230ba
fix issue https://github.com/opensearch-project/dashboards-observabil…
YANG-DB Apr 30, 2024
9aee128
Otel services observability integration (#1729)
YANG-DB Apr 30, 2024
dda72c0
Fix OTEL Services integration (#1770)
Swiddis Apr 30, 2024
552d720
[Explorer] Data selector enhancement and refactoring adoptions (#1759)
mengweieric Apr 30, 2024
23cca62
[Backport main] 2.14 release notes (#1773)
opensearch-trigger-bot[bot] Apr 30, 2024
cb845f2
removed update button from explorer (#1755)
paulstn Apr 30, 2024
da7d54e
MDS Support for trace analytics (#1752)
sumukhswamy May 1, 2024
868ddcb
added fix for jobs and cache Support for workbench ,MDS support (#1739)
sumukhswamy May 1, 2024
cda380f
Renaming all the integrations with Amazon branding instead of AWS (#1…
RyanL1997 May 1, 2024
4450b23
Fix metrics single data-point visability (#1781)
YANG-DB May 1, 2024
f1b920c
Fix all the tests (#1792)
Swiddis May 1, 2024
3ec4e78
Adding test for clear cache on logout (#1794)
ps48 May 1, 2024
6368b63
Fix S3_DATASOURCE_TYPE naming typo in plugin.tsx (#1799)
RyanL1997 May 1, 2024
d3ab3cd
remove defaulting to query assist time range (#1805) (#1807)
opensearch-trigger-bot[bot] May 1, 2024
9532b7d
Add JSON5 parsing capabilities for integration configs (#1732)
devesh-2002 May 2, 2024
2fd7ba1
fix api 404 error (#1810) (#1812)
opensearch-trigger-bot[bot] May 2, 2024
55841f2
update OTEL metrics queries with the correct ss40 metrics schema (#1818)
YANG-DB May 3, 2024
0632d4a
fix window start backtick issue (#1823)
ps48 May 6, 2024
a8ea52d
Refactor away integrations adaptor class (#1825)
Swiddis May 7, 2024
d1235d9
Merge branch 'main' into fix-create-dashboard-bug1466
Mahima081 May 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
7 changes: 4 additions & 3 deletions common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export const PPL_INDEX_INSERT_POINT_REGEX = /(search source|source|index)\s*=\s*
export const PPL_INDEX_REGEX = /(search source|source|index)\s*=\s*([^|\s]+)/i;
export const PPL_WHERE_CLAUSE_REGEX = /\s*where\s+/i;
export const PPL_NEWLINE_REGEX = /[\n\r]+/g;
export const PPL_DESCRIBE_INDEX_REGEX = /(describe)\s+([^|\s]+)/i;

// Observability plugin URI
const BASE_OBSERVABILITY_URI = '/_plugins/_observability';
Expand Down Expand Up @@ -215,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 @@ -257,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
19 changes: 16 additions & 3 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,6 +63,10 @@ export const App = ({
queryManager,
startPage,
dataSourcePluggables,
dataSourceManagement,
setActionMenu,
dataSourceEnabled,
savedObjectsMDSClient,
}: ObservabilityAppDeps) => {
const { chrome, http, notifications, savedObjects: coreSavedObjects } = CoreStartProp;
const parentBreadcrumb = {
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 @@ -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 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
9 changes: 9 additions & 0 deletions public/components/common/query_utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
OTEL_DATE_FORMAT,
OTEL_METRIC_SUBTYPE,
PROMQL_METRIC_SUBTYPE,
PPL_DESCRIBE_INDEX_REGEX,
} from '../../../../common/constants/shared';
import { IExplorerFields, IQuery } from '../../../../common/types/explorer';
import { SPAN_RESOLUTION_REGEX } from '../../../../common/constants/metrics';
Expand Down Expand Up @@ -219,6 +220,14 @@ export const getIndexPatternFromRawQuery = (query: string): string => {
return getPromQLIndex(query) || getPPLIndex(query);
};

export const getDescribeQueryIndexFromRawQuery = (query: string): string | undefined => {
const matches = query.match(PPL_DESCRIBE_INDEX_REGEX);
if (matches) {
return matches[2];
}
return undefined;
};

function extractSpanAndResolution(query: string) {
if (!query) return;

Expand Down
Loading