From c689175bfc7138eca94d0434434ce1e21ceb100f Mon Sep 17 00:00:00 2001 From: Eugene Lee Date: Mon, 24 Jan 2022 09:56:41 -0800 Subject: [PATCH] Connected Application Analytics (#379) * Update tests, builds and doc (#318) * rebased with bwc tests Signed-off-by: Shenoy Pratik * updated bwc tests Signed-off-by: Shenoy Pratik * added release notes Signed-off-by: Shenoy Pratik * Rename trace-analytics to observability (#341) Signed-off-by: Joshua Li * Event analytics unit tests (#342) * tests Signed-off-by: Eric Wei * updated some snapshots Signed-off-by: Eric Wei * resolved few failing tests Signed-off-by: Eric Wei * few modifications Signed-off-by: Eric Wei * Update service map parsing results for testing (#345) Signed-off-by: Joshua Li * bumping version to 1.2.2 (#346) * bumping version to 1.2.2 Signed-off-by: Shenoy Pratik * update PR in release notes Signed-off-by: Shenoy Pratik * updating readme and badges (#352) Signed-off-by: Shenoy Pratik * Application Analytics (#299) * Add database schema for application Signed-off-by: Eugene Lee * Finished front end for Application overview Signed-off-by: Eugene Lee * Finished application detail page tabs Signed-off-by: Eugene Lee * WIP: Overview Page Signed-off-by: Eugene Lee * Rough sketch of App Analytics UI Signed-off-by: Eugene Lee * Create dummy page Signed-off-by: Eugene Lee * Create app complete. Stabilizing dashboard component. Signed-off-by: Eugene Lee * Update to 1.2 Observability Signed-off-by: Eugene Lee * notebooks internal error Signed-off-by: Eugene Lee * Address comments on PR: copyright headers, indentation, unnecessary render props Signed-off-by: Eugene Lee * Set max width of app and event Signed-off-by: Eugene Lee * Remove optional after description Signed-off-by: Eugene Lee * Change to singular Signed-off-by: Eugene Lee * Remove count badge for log source Signed-off-by: Eugene Lee * #290: Change form row label to ppl base query Signed-off-by: Eugene Lee * #291: Change description and help text for log source Signed-off-by: Eugene Lee * Pass down proper props Signed-off-by: Eugene Lee * Resolve gradle error and module not found error Signed-off-by: Eugene Lee * Resolve kotlin errors Signed-off-by: Eugene Lee * Fix parsers Signed-off-by: Eugene Lee * Add praseItemList Signed-off-by: Eugene Lee * Camelcase fields Signed-off-by: Eugene Lee * Remove whitespace, add copyright Signed-off-by: Eugene Lee * #292: Add autocomplete to Log Source accordion Signed-off-by: Eugene Lee * Lexicographic kotlin import Signed-off-by: Eugene Lee * Add newline at end of files Signed-off-by: Eugene Lee * #293: Add service map to create page Signed-off-by: Eugene Lee * #304: Activate Clear All button for services Signed-off-by: Eugene Lee * #305: Add button to clear base query Signed-off-by: Eugene Lee * opensearch-project#295: Add eui combo box for trace groups Signed-off-by: Eugene Lee * Separate out configuration renders Signed-off-by: Eugene Lee * debug adding filters traces Signed-off-by: Eugene Lee * #296: Add traces table to config Signed-off-by: Eugene Lee * Change from tsx to ts Signed-off-by: Eugene Lee * opensearch-project#309: Add page props and add app specific filters Signed-off-by: Eugene Lee * #308: Add button to clear trace groups Signed-off-by: Eugene Lee * #311: Allow services and traces to be selected Signed-off-by: Eugene Lee * Remove link to traces on table Signed-off-by: Eugene Lee * Disable clear all if nothing selected Signed-off-by: Eugene Lee * disable clear all when no log source Signed-off-by: Eugene Lee * Remove comment, add style to constant, temporarily remove availability Signed-off-by: Eugene Lee * Address PR comments Signed-off-by: Eugene Lee * Revert type assignment Signed-off-by: Eugene Lee * Update tests, builds and doc (#318) * rebased with bwc tests Signed-off-by: Shenoy Pratik * updated bwc tests Signed-off-by: Shenoy Pratik * added release notes Signed-off-by: Shenoy Pratik * Fix errors and address comments Signed-off-by: Eugene Lee * #319: Disable create until required fields are filled out Signed-off-by: Eugene Lee * #329: Add missing field tool tip Signed-off-by: Eugene Lee * Remove unnecessary imports Signed-off-by: Eugene Lee * #320: Add clear modal for friction Signed-off-by: Eugene Lee Co-authored-by: Shenoy Pratik * Fix merge conflict Signed-off-by: Eugene Lee * Update Workflow (#360) * updated snapshot in workflow to 1.2.3 Signed-off-by: Shenoy Pratik * replaced variable with 1.2.3-snapshot Signed-off-by: Shenoy Pratik * revert string to variable Signed-off-by: Shenoy Pratik * Application Analytics (#299) * Add database schema for application Signed-off-by: Eugene Lee * Finished front end for Application overview Signed-off-by: Eugene Lee * Finished application detail page tabs Signed-off-by: Eugene Lee * WIP: Overview Page Signed-off-by: Eugene Lee * Rough sketch of App Analytics UI Signed-off-by: Eugene Lee * Create dummy page Signed-off-by: Eugene Lee * Create app complete. Stabilizing dashboard component. Signed-off-by: Eugene Lee * Update to 1.2 Observability Signed-off-by: Eugene Lee * notebooks internal error Signed-off-by: Eugene Lee * Address comments on PR: copyright headers, indentation, unnecessary render props Signed-off-by: Eugene Lee * Set max width of app and event Signed-off-by: Eugene Lee * Remove optional after description Signed-off-by: Eugene Lee * Change to singular Signed-off-by: Eugene Lee * Remove count badge for log source Signed-off-by: Eugene Lee * #290: Change form row label to ppl base query Signed-off-by: Eugene Lee * #291: Change description and help text for log source Signed-off-by: Eugene Lee * Pass down proper props Signed-off-by: Eugene Lee * Resolve gradle error and module not found error Signed-off-by: Eugene Lee * Resolve kotlin errors Signed-off-by: Eugene Lee * Fix parsers Signed-off-by: Eugene Lee * Add praseItemList Signed-off-by: Eugene Lee * Camelcase fields Signed-off-by: Eugene Lee * Remove whitespace, add copyright Signed-off-by: Eugene Lee * #292: Add autocomplete to Log Source accordion Signed-off-by: Eugene Lee * Lexicographic kotlin import Signed-off-by: Eugene Lee * Add newline at end of files Signed-off-by: Eugene Lee * #293: Add service map to create page Signed-off-by: Eugene Lee * #304: Activate Clear All button for services Signed-off-by: Eugene Lee * #305: Add button to clear base query Signed-off-by: Eugene Lee * opensearch-project#295: Add eui combo box for trace groups Signed-off-by: Eugene Lee * Separate out configuration renders Signed-off-by: Eugene Lee * debug adding filters traces Signed-off-by: Eugene Lee * #296: Add traces table to config Signed-off-by: Eugene Lee * Change from tsx to ts Signed-off-by: Eugene Lee * opensearch-project#309: Add page props and add app specific filters Signed-off-by: Eugene Lee * #308: Add button to clear trace groups Signed-off-by: Eugene Lee * #311: Allow services and traces to be selected Signed-off-by: Eugene Lee * Remove link to traces on table Signed-off-by: Eugene Lee * Disable clear all if nothing selected Signed-off-by: Eugene Lee * disable clear all when no log source Signed-off-by: Eugene Lee * Remove comment, add style to constant, temporarily remove availability Signed-off-by: Eugene Lee * Address PR comments Signed-off-by: Eugene Lee * Revert type assignment Signed-off-by: Eugene Lee * Update tests, builds and doc (#318) * rebased with bwc tests Signed-off-by: Shenoy Pratik * updated bwc tests Signed-off-by: Shenoy Pratik * added release notes Signed-off-by: Shenoy Pratik * Fix errors and address comments Signed-off-by: Eugene Lee * #319: Disable create until required fields are filled out Signed-off-by: Eugene Lee * #329: Add missing field tool tip Signed-off-by: Eugene Lee * Remove unnecessary imports Signed-off-by: Eugene Lee * #320: Add clear modal for friction Signed-off-by: Eugene Lee Co-authored-by: Shenoy Pratik * Application Analytics (#299) * Add database schema for application Signed-off-by: Eugene Lee * Finished front end for Application overview Signed-off-by: Eugene Lee * Finished application detail page tabs Signed-off-by: Eugene Lee * WIP: Overview Page Signed-off-by: Eugene Lee * Rough sketch of App Analytics UI Signed-off-by: Eugene Lee * Create dummy page Signed-off-by: Eugene Lee * Create app complete. Stabilizing dashboard component. Signed-off-by: Eugene Lee * Update to 1.2 Observability Signed-off-by: Eugene Lee * notebooks internal error Signed-off-by: Eugene Lee * Address comments on PR: copyright headers, indentation, unnecessary render props Signed-off-by: Eugene Lee * Set max width of app and event Signed-off-by: Eugene Lee * Remove optional after description Signed-off-by: Eugene Lee * Change to singular Signed-off-by: Eugene Lee * Remove count badge for log source Signed-off-by: Eugene Lee * #290: Change form row label to ppl base query Signed-off-by: Eugene Lee * #291: Change description and help text for log source Signed-off-by: Eugene Lee * Pass down proper props Signed-off-by: Eugene Lee * Resolve gradle error and module not found error Signed-off-by: Eugene Lee * Resolve kotlin errors Signed-off-by: Eugene Lee * Fix parsers Signed-off-by: Eugene Lee * Add praseItemList Signed-off-by: Eugene Lee * Camelcase fields Signed-off-by: Eugene Lee * Remove whitespace, add copyright Signed-off-by: Eugene Lee * #292: Add autocomplete to Log Source accordion Signed-off-by: Eugene Lee * Lexicographic kotlin import Signed-off-by: Eugene Lee * Add newline at end of files Signed-off-by: Eugene Lee * #293: Add service map to create page Signed-off-by: Eugene Lee * #304: Activate Clear All button for services Signed-off-by: Eugene Lee * #305: Add button to clear base query Signed-off-by: Eugene Lee * opensearch-project#295: Add eui combo box for trace groups Signed-off-by: Eugene Lee * Separate out configuration renders Signed-off-by: Eugene Lee * debug adding filters traces Signed-off-by: Eugene Lee * #296: Add traces table to config Signed-off-by: Eugene Lee * Change from tsx to ts Signed-off-by: Eugene Lee * opensearch-project#309: Add page props and add app specific filters Signed-off-by: Eugene Lee * #308: Add button to clear trace groups Signed-off-by: Eugene Lee * #311: Allow services and traces to be selected Signed-off-by: Eugene Lee * Remove link to traces on table Signed-off-by: Eugene Lee * Disable clear all if nothing selected Signed-off-by: Eugene Lee * disable clear all when no log source Signed-off-by: Eugene Lee * Remove comment, add style to constant, temporarily remove availability Signed-off-by: Eugene Lee * Address PR comments Signed-off-by: Eugene Lee * Revert type assignment Signed-off-by: Eugene Lee * Update tests, builds and doc (#318) * rebased with bwc tests Signed-off-by: Shenoy Pratik * updated bwc tests Signed-off-by: Shenoy Pratik * added release notes Signed-off-by: Shenoy Pratik * Fix errors and address comments Signed-off-by: Eugene Lee * #319: Disable create until required fields are filled out Signed-off-by: Eugene Lee * #329: Add missing field tool tip Signed-off-by: Eugene Lee * Remove unnecessary imports Signed-off-by: Eugene Lee * #320: Add clear modal for friction Signed-off-by: Eugene Lee Co-authored-by: Shenoy Pratik * Fix merge conflict Signed-off-by: Eugene Lee * #321: Add clear modal for services (#355) Signed-off-by: Eugene Lee * #322: Add clear modal for traces (#356) Signed-off-by: Eugene Lee * Adds tests for application creation (#357) * Remove unnecessary memoization Signed-off-by: Eugene Lee * Add tests for create page Signed-off-by: Eugene Lee * Remove conflict Signed-off-by: Eugene Lee * Add create route for app analytics Signed-off-by: Eugene Lee * #325: Return to app table on cancel Signed-off-by: Eugene Lee * Remove unnecessary import Signed-off-by: Eugene Lee * #340: Apps selectable, actions correctly disabled Signed-off-by: Eugene Lee * Fix mapping update Signed-off-by: Eugene Lee * #327: Rename application Signed-off-by: Eugene Lee * #376: Fetch all applications for home page Signed-off-by: Eugene Lee * Add exception catch Signed-off-by: Eugene Lee * More specific exception : Signed-off-by: Eugene Lee * Log error instead of warn Signed-off-by: Eugene Lee * Remove generic exception Signed-off-by: Eugene Lee * Debug assert Signed-off-by: Eugene Lee * Fix type Signed-off-by: Eugene Lee * Fix Lint Signed-off-by: Eugene Lee * Address comments Signed-off-by: Eugene Lee * Move types to type file Signed-off-by: Eugene Lee Co-authored-by: Shenoy Pratik Co-authored-by: Joshua Li Co-authored-by: Eric Wei --- .../common/constants/application_analytics.ts | 19 --------- .../common/types/app_analytics.ts | 23 +++++++++++ .../components/app_table.tsx | 2 +- .../config_components/service_config.tsx | 2 +- .../config_components/trace_config.tsx | 2 +- .../components/create.tsx | 2 +- .../components/helpers/modal_containers.tsx | 40 ------------------- .../components/application_analytics/home.tsx | 3 +- .../app_analytics_adaptor.ts | 2 +- .../application_adaptor.ts | 0 .../app_analytics_router.ts | 3 +- 11 files changed, 32 insertions(+), 66 deletions(-) create mode 100644 dashboards-observability/common/types/app_analytics.ts delete mode 100644 dashboards-observability/public/components/application_analytics/components/helpers/modal_containers.tsx delete mode 100644 dashboards-observability/server/adaptors/application_analytics/application_adaptor.ts diff --git a/dashboards-observability/common/constants/application_analytics.ts b/dashboards-observability/common/constants/application_analytics.ts index 12fdb6b36..ed56a64a9 100644 --- a/dashboards-observability/common/constants/application_analytics.ts +++ b/dashboards-observability/common/constants/application_analytics.ts @@ -15,22 +15,3 @@ export const TAB_LOG_TITLE = 'Log Events'; export const TAB_CONFIG_TITLE = 'Configuration'; export const APP_ANALYTICS_API_PREFIX = '/api/observability/application' - -export interface optionType { - label: string; -} - -export type ApplicationListType = { - name: string; - id: string; - dateCreated: string; - dateModified: string; -}; - -export type ApplicationType = { - name: string; - description: string; - query: string; - selectedServices: Array; - selectedTraces: Array; -} diff --git a/dashboards-observability/common/types/app_analytics.ts b/dashboards-observability/common/types/app_analytics.ts new file mode 100644 index 000000000..9e18aa766 --- /dev/null +++ b/dashboards-observability/common/types/app_analytics.ts @@ -0,0 +1,23 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export interface optionType { + label: string; +} + +export type ApplicationListType = { + name: string; + id: string; + dateCreated: string; + dateModified: string; +}; + +export type ApplicationType = { + name: string; + description: string; + query: string; + selectedServices: Array; + selectedTraces: Array; +} diff --git a/dashboards-observability/public/components/application_analytics/components/app_table.tsx b/dashboards-observability/public/components/application_analytics/components/app_table.tsx index 0308634bf..bc6452828 100644 --- a/dashboards-observability/public/components/application_analytics/components/app_table.tsx +++ b/dashboards-observability/public/components/application_analytics/components/app_table.tsx @@ -32,7 +32,7 @@ import { AppAnalyticsComponentDeps } from '../home'; import { getCustomModal } from '../../custom_panels/helpers/modal_containers'; import { getClearModal } from '../helpers/modal_containers'; import { pageStyles } from '../../../../common/constants/shared'; -import { ApplicationListType } from '../../../../common/constants/application_analytics'; +import { ApplicationListType } from '../../../../common/types/app_analytics'; interface AppTableProps extends AppAnalyticsComponentDeps { loading: boolean; diff --git a/dashboards-observability/public/components/application_analytics/components/config_components/service_config.tsx b/dashboards-observability/public/components/application_analytics/components/config_components/service_config.tsx index bdb6d380c..aa1e9a920 100644 --- a/dashboards-observability/public/components/application_analytics/components/config_components/service_config.tsx +++ b/dashboards-observability/public/components/application_analytics/components/config_components/service_config.tsx @@ -12,7 +12,7 @@ import DSLService from "public/services/requests/dsl"; import React, { useState } from "react"; import { useEffect } from "react"; import { AppAnalyticsComponentDeps } from "../../home"; -import { optionType } from "../../../../../common/constants/application_analytics"; +import { optionType } from "../../../../../common/types/app_analytics"; import { getClearModal } from "../../helpers/modal_containers"; interface ServiceConfigProps extends AppAnalyticsComponentDeps { diff --git a/dashboards-observability/public/components/application_analytics/components/config_components/trace_config.tsx b/dashboards-observability/public/components/application_analytics/components/config_components/trace_config.tsx index a31728000..7ef19c8ac 100644 --- a/dashboards-observability/public/components/application_analytics/components/config_components/trace_config.tsx +++ b/dashboards-observability/public/components/application_analytics/components/config_components/trace_config.tsx @@ -5,7 +5,7 @@ import dateMath from '@elastic/datemath'; import { EuiAccordion, EuiBadge, EuiButton, EuiComboBox, EuiFormRow, EuiOverlayMask, EuiSpacer, EuiText } from "@elastic/eui"; -import { optionType } from "../../../../../common/constants/application_analytics"; +import { optionType } from "../../../../../common/types/app_analytics"; import { filtersToDsl } from "../../../trace_analytics/components/common/helper_functions"; import { handleDashboardRequest } from "../../../trace_analytics/requests/dashboard_request_handler"; import DSLService from "public/services/requests/dsl"; diff --git a/dashboards-observability/public/components/application_analytics/components/create.tsx b/dashboards-observability/public/components/application_analytics/components/create.tsx index 5069b7538..17f21e7cd 100644 --- a/dashboards-observability/public/components/application_analytics/components/create.tsx +++ b/dashboards-observability/public/components/application_analytics/components/create.tsx @@ -30,7 +30,7 @@ import { TraceConfig } from './config_components/trace_config'; import { ServiceConfig } from "./config_components/service_config"; import { LogConfig } from "./config_components/log_config"; import { PPLReferenceFlyout } from "../../../components/common/helpers"; -import { optionType } from "../../../../common/constants/application_analytics"; +import { optionType } from "../../../../common/types/app_analytics"; interface CreateAppProps extends AppAnalyticsComponentDeps { dslService: DSLService; diff --git a/dashboards-observability/public/components/application_analytics/components/helpers/modal_containers.tsx b/dashboards-observability/public/components/application_analytics/components/helpers/modal_containers.tsx deleted file mode 100644 index c9d54f9c2..000000000 --- a/dashboards-observability/public/components/application_analytics/components/helpers/modal_containers.tsx +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import React from 'react'; -import { - EuiOverlayMask, - EuiConfirmModal, -} from '@elastic/eui'; - -/* The file contains helper functions for modal layouts - * getDeleteModal - returns a confirm-modal with clear option - */ - -export const getClearModal = ( - onCancel: ( - event?: React.KeyboardEvent | React.MouseEvent - ) => void, - onConfirm: (event?: React.MouseEvent) => void, - title: string, - message: string, - confirmMessage?: string -) => { - return ( - - - {message} - - - ); -}; \ No newline at end of file diff --git a/dashboards-observability/public/components/application_analytics/home.tsx b/dashboards-observability/public/components/application_analytics/home.tsx index bd567c313..5f847406f 100644 --- a/dashboards-observability/public/components/application_analytics/home.tsx +++ b/dashboards-observability/public/components/application_analytics/home.tsx @@ -17,7 +17,8 @@ import TimestampUtils from 'public/services/timestamp/timestamp'; import { handleIndicesExistRequest } from '../trace_analytics/requests/request_handler'; import { ObservabilitySideBar } from '../common/side_nav'; import { NotificationsStart } from '../../../../../src/core/public'; -import { optionType, APP_ANALYTICS_API_PREFIX, ApplicationListType } from '../../../common/constants/application_analytics'; +import { APP_ANALYTICS_API_PREFIX } from '../../../common/constants/application_analytics'; +import { optionType, ApplicationListType } from '../../../common/types/app_analytics'; import { isNameValid } from './helpers/utils'; import { EuiGlobalToastList } from '@elastic/eui'; import { Toast } from '@elastic/eui/src/components/toast/global_toast_list'; diff --git a/dashboards-observability/server/adaptors/application_analytics/app_analytics_adaptor.ts b/dashboards-observability/server/adaptors/application_analytics/app_analytics_adaptor.ts index 5c37ed0ac..8adaa6370 100644 --- a/dashboards-observability/server/adaptors/application_analytics/app_analytics_adaptor.ts +++ b/dashboards-observability/server/adaptors/application_analytics/app_analytics_adaptor.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { ApplicationType } from "common/constants/application_analytics"; +import { ApplicationType } from "../../../common/types/app_analytics"; import { ILegacyScopedClusterClient } from "../../../../../src/core/server"; export class AppAnalyticsAdaptor { diff --git a/dashboards-observability/server/adaptors/application_analytics/application_adaptor.ts b/dashboards-observability/server/adaptors/application_analytics/application_adaptor.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/dashboards-observability/server/routes/application_analytics/app_analytics_router.ts b/dashboards-observability/server/routes/application_analytics/app_analytics_router.ts index abe23aa76..18a0523a3 100644 --- a/dashboards-observability/server/routes/application_analytics/app_analytics_router.ts +++ b/dashboards-observability/server/routes/application_analytics/app_analytics_router.ts @@ -10,7 +10,8 @@ import { ResponseError, ILegacyScopedClusterClient, } from '../../../../../src/core/server'; -import { APP_ANALYTICS_API_PREFIX as API_PREFIX, ApplicationListType } from '../../../common/constants/application_analytics'; +import { APP_ANALYTICS_API_PREFIX as API_PREFIX } from '../../../common/constants/application_analytics'; +import { ApplicationListType } from '../../../common/types/app_analytics'; import { AppAnalyticsAdaptor } from '../../../server/adaptors/application_analytics/app_analytics_adaptor'; export function registerAppAnalyticsRouter(router: IRouter) {