-
-
- {!isSidebarClosed && (
-
+
+ (
+
+
+
+
+
+
+
+ {!isSidebarClosed && (
+
+ )}
+ onSideBarClick()}
+ data-test-subj="collapseSideBarButton"
+ aria-controls="discover-sidebar"
+ aria-expanded={isSidebarClosed ? 'false' : 'true'}
+ aria-label="Toggle sidebar"
+ className="dscCollapsibleSidebar__collapseButton"
+ />
+
+
+
+ {selectedMetrics.length > 0 ? (
+
+ ) : (
+
)}
- onSideBarClick()}
- data-test-subj="collapseSideBarButton"
- aria-controls="discover-sidebar"
- aria-expanded={isSidebarClosed ? 'false' : 'true'}
- aria-label="Toggle sidebar"
- className="dscCollapsibleSidebar__collapseButton"
- />
-
- {selectedMetrics.length > 0 ? (
-
- ) : (
-
- )}
-
-
-
-
-
- )}
- />
+
+
+
+ )}
+ />
+
>
);
};
diff --git a/public/components/notebooks/components/main.tsx b/public/components/notebooks/components/main.tsx
index cd70332d28..7e19dbdd2a 100644
--- a/public/components/notebooks/components/main.tsx
+++ b/public/components/notebooks/components/main.tsx
@@ -2,7 +2,6 @@
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
-/* eslint-disable no-console */
import { EuiGlobalToastList, EuiLink } from '@elastic/eui';
import { Toast } from '@elastic/eui/src/components/toast/global_toast_list';
@@ -95,7 +94,7 @@ export class Main extends React.Component
{
createNotebook = (newNoteName: string) => {
if (newNoteName.length >= 50 || newNoteName.length === 0) {
this.setToast('Invalid notebook name', 'danger');
- window.location.assign('#/notebooks');
+ window.location.assign('#/');
return;
}
const newNoteObject = {
@@ -108,7 +107,7 @@ export class Main extends React.Component {
})
.then(async (res) => {
this.setToast(`Notebook "${newNoteName}" successfully created!`);
- window.location.assign(`#/notebooks/${res}`);
+ window.location.assign(`#/${res}`);
})
.catch((err) => {
this.setToast(
@@ -310,28 +309,26 @@ export class Main extends React.Component {
(
-
-
-
+
)}
/>
(
{
cloneNotebook={this.cloneNotebook}
deleteNotebook={this.deleteNotebook}
setToast={this.setToast}
- location={this.props.location}
- history={this.props.history}
+ location={props.location}
+ history={props.history}
/>
)}
/>
diff --git a/public/components/notebooks/components/note_table.tsx b/public/components/notebooks/components/note_table.tsx
index ee6a3eef53..5624b4601d 100644
--- a/public/components/notebooks/components/note_table.tsx
+++ b/public/components/notebooks/components/note_table.tsx
@@ -84,7 +84,7 @@ export function NoteTable({
parentBreadcrumb,
{
text: 'Notebooks',
- href: '#/notebooks',
+ href: '#/',
},
]);
fetchNotebooks();
@@ -120,9 +120,8 @@ export function NoteTable({
};
const onDelete = async () => {
- const toastMessage = `Notebook${
- selectedNotebooks.length > 1 ? 's' : ' "' + selectedNotebooks[0].path + '"'
- } successfully deleted!`;
+ const toastMessage = `Notebook${selectedNotebooks.length > 1 ? 's' : ' "' + selectedNotebooks[0].path + '"'
+ } successfully deleted!`;
await deleteNotebook(
selectedNotebooks.map((note) => note.id),
toastMessage
@@ -263,7 +262,7 @@ export function NoteTable({
sortable: true,
truncateText: true,
render: (value, record) => (
- {_.truncate(value, { length: 100 })}
+ {_.truncate(value, { length: 100 })}
),
},
{
@@ -329,7 +328,7 @@ export function NoteTable({
-
+
Create notebook
@@ -351,8 +350,8 @@ export function NoteTable({
items={
searchQuery
? notebooks.filter((notebook) =>
- notebook.path.toLowerCase().includes(searchQuery.toLowerCase())
- )
+ notebook.path.toLowerCase().includes(searchQuery.toLowerCase())
+ )
: notebooks
}
itemId="id"
diff --git a/public/components/notebooks/components/notebook.tsx b/public/components/notebooks/components/notebook.tsx
index fc124588df..ad9729c0f5 100644
--- a/public/components/notebooks/components/notebook.tsx
+++ b/public/components/notebooks/components/notebook.tsx
@@ -621,11 +621,11 @@ export class Notebook extends Component {
this.props.parentBreadcrumb,
{
text: 'Notebooks',
- href: '#/notebooks',
+ href: '#/',
},
{
text: path,
- href: `#/notebooks/${this.props.openedNoteId}`,
+ href: `#/${this.props.openedNoteId}`,
},
]);
}
diff --git a/public/components/trace_analytics/components/dashboard/dashboard_content.tsx b/public/components/trace_analytics/components/dashboard/dashboard_content.tsx
index 2cc0af94bd..a67f0b12c6 100644
--- a/public/components/trace_analytics/components/dashboard/dashboard_content.tsx
+++ b/public/components/trace_analytics/components/dashboard/dashboard_content.tsx
@@ -73,13 +73,17 @@ export function DashboardContent(props: DashboardProps) {
useEffect(() => {
if (showTimeoutToast === true && toasts.length === 0) {
- setToast!('Query took too long to execute.', 'danger', 'Reduce time range or filter your data. If issue persists, consider increasing your cluster size.')
+ setToast!(
+ 'Query took too long to execute.',
+ 'danger',
+ 'Reduce time range or filter your data. If issue persists, consider increasing your cluster size.'
+ );
}
setShowTimeoutToast(false);
- }, [showTimeoutToast])
+ }, [showTimeoutToast]);
useEffect(() => {
- chrome.setBreadcrumbs([...parentBreadcrumbs, ...childBreadcrumbs]);
+ // chrome.setBreadcrumbs([...parentBreadcrumbs, ...childBreadcrumbs]);
const validFilters = getValidFilterFields(mode, page);
setFilters([
...filters.map((filter) => ({
@@ -93,7 +97,7 @@ export function DashboardContent(props: DashboardProps) {
useEffect(() => {
let newFilteredService = '';
for (const filter of filters) {
- if (mode === 'data_prepper') {
+ if (mode === 'data_prepper') {
if (filter.field === 'serviceName') {
newFilteredService = filter.value;
break;
@@ -106,8 +110,22 @@ export function DashboardContent(props: DashboardProps) {
}
}
setFilteredService(newFilteredService);
- if (!redirect && ((mode === 'data_prepper' && dataPrepperIndicesExist) || (mode === 'jaeger' && jaegerIndicesExist))) refresh(newFilteredService);
- }, [filters, startTime, endTime, appConfigs, redirect, mode, dataPrepperIndicesExist, jaegerIndicesExist]);
+ if (
+ !redirect &&
+ ((mode === 'data_prepper' && dataPrepperIndicesExist) ||
+ (mode === 'jaeger' && jaegerIndicesExist))
+ )
+ refresh(newFilteredService);
+ }, [
+ filters,
+ startTime,
+ endTime,
+ appConfigs,
+ redirect,
+ mode,
+ dataPrepperIndicesExist,
+ jaegerIndicesExist,
+ ]);
const refresh = async (currService?: string) => {
setLoading(true);
@@ -154,12 +172,12 @@ export function DashboardContent(props: DashboardProps) {
mode,
() => setShowTimeoutToast(true),
// () => {
- // if (toasts.length === 0) {
+ // if (toasts.length === 0) {
// setToast!('Query took too long to execute.', 'danger', 'Reduce time range or filter your data. If issue persists, consider increasing your cluster size.');
// }
// },
setPercentileMap
- ).finally(() => setLoading(false))
+ ).finally(() => setLoading(false));
handleJaegerErrorDashboardRequest(
http,
DSL,
@@ -170,7 +188,7 @@ export function DashboardContent(props: DashboardProps) {
mode,
() => setShowTimeoutToast(true),
// () => {
- // if (toasts.length === 0) {
+ // if (toasts.length === 0) {
// setToast!('Query took too long to execute.', 'danger', 'Reduce time range or filter your data. If issue persists, consider increasing your cluster size.');
// }
// },
@@ -295,7 +313,8 @@ export function DashboardContent(props: DashboardProps) {
mode={mode}
/>
- {((mode === 'data_prepper' && dataPrepperIndicesExist) || mode === 'jaeger' && jaegerIndicesExist) ? (
+ {(mode === 'data_prepper' && dataPrepperIndicesExist) ||
+ (mode === 'jaeger' && jaegerIndicesExist) ? (
{mode === 'data_prepper' ? (
<>
@@ -359,7 +378,7 @@ export function DashboardContent(props: DashboardProps) {
)}
) : (
-
+
)}
>
);
diff --git a/public/embeddable/observability_embeddable_factory.tsx b/public/embeddable/observability_embeddable_factory.tsx
index 53e7b7859f..5392881567 100644
--- a/public/embeddable/observability_embeddable_factory.tsx
+++ b/public/embeddable/observability_embeddable_factory.tsx
@@ -20,7 +20,7 @@ import {
OnSaveProps,
SavedObjectMetaData,
} from '../../../../src/plugins/saved_objects/public';
-import { observabilityID } from '../../common/constants/shared';
+import { observabilityID, observabilityLogsID } from '../../common/constants/shared';
import {
VisualizationSavedObjectAttributes,
VISUALIZATION_SAVED_OBJECT,
@@ -63,8 +63,8 @@ export class ObservabilityEmbeddableFactoryDefinition
input: SavedObjectEmbeddableInput,
parent?: IContainer
) {
- const editPath = `#/event_analytics/explorer/${VISUALIZATION_SAVED_OBJECT}:${savedObjectId}`;
- const editUrl = `/app/${observabilityID}${editPath}`;
+ const editPath = `#/explorer/${VISUALIZATION_SAVED_OBJECT}:${savedObjectId}`;
+ const editUrl = `/app/${observabilityLogsID}${editPath}`;
return new ObservabilityEmbeddable(
{
editUrl,
diff --git a/public/index.ts b/public/index.ts
index 97037a9f7d..a43ed0e205 100644
--- a/public/index.ts
+++ b/public/index.ts
@@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
+import './variables.scss';
import './components/trace_analytics/index.scss';
import './components/notebooks/index.scss'
diff --git a/public/plugin.ts b/public/plugin.ts
index 1c8ce67e05..901a4fa393 100644
--- a/public/plugin.ts
+++ b/public/plugin.ts
@@ -5,12 +5,35 @@
import './index.scss';
-import { AppMountParameters, CoreSetup, CoreStart, Plugin } from '../../../src/core/public';
+import { i18n } from '@osd/i18n';
+import {
+ AppCategory,
+ AppMountParameters,
+ CoreSetup,
+ CoreStart,
+ Plugin,
+} from '../../../src/core/public';
import { CREATE_TAB_PARAM, CREATE_TAB_PARAM_KEY, TAB_CHART_ID } from '../common/constants/explorer';
+
import {
- observabilityID,
- observabilityPluginOrder,
- observabilityTitle,
+ observabilityApplicationsID,
+ observabilityApplicationsPluginOrder,
+ observabilityApplicationsTitle,
+ observabilityTracesTitle,
+ observabilityMetricsID,
+ observabilityMetricsPluginOrder,
+ observabilityMetricsTitle,
+ observabilityNotebookID,
+ observabilityNotebookPluginOrder,
+ observabilityNotebookTitle,
+ observabilityTracesID,
+ observabilityTracesPluginOrder,
+ observabilityPanelsID,
+ observabilityPanelsTitle,
+ observabilityPanelsPluginOrder,
+ observabilityLogsID,
+ observabilityLogsTitle,
+ observabilityLogsPluginOrder,
} from '../common/constants/shared';
import { QueryManager } from '../common/query_manager';
import { VISUALIZATION_SAVED_OBJECT } from '../common/types/observability_saved_object_attributes';
@@ -45,6 +68,7 @@ import DSLService from './services/requests/dsl';
import PPLService from './services/requests/ppl';
import SavedObjects from './services/saved_objects/event_analytics/saved_objects';
import TimestampUtils from './services/timestamp/timestamp';
+import { observabilityID } from '../common/constants/shared';
import {
AppPluginStartDependencies,
ObservabilitySetup,
@@ -79,47 +103,101 @@ export class ObservabilityPlugin
window.location.assign(convertLegacyTraceAnalyticsUrl(window.location));
}
+ // // redirect legacy notebooks URL to current URL under observability
+ // if (window.location.pathname.includes('application_analytics')) {
+ // window.location.assign(convertLegacyAppAnalyticsUrl(window.location));
+ // }
+
setupDeps.dashboard.registerDashboardProvider({
appId: 'observability-panel',
savedObjectsType: 'observability-panel',
savedObjectsName: 'Observability Panel',
- editUrlPathFn: (obj: SavedObject) =>
- `/app/observability-dashboards#/operational_panels/${obj.id}/edit`,
- viewUrlPathFn: (obj: SavedObject) =>
- `/app/observability-dashboards#/operational_panels/${obj.id}`,
+ editUrlPathFn: (obj: SavedObject) => `/app/observability-dashboards#/${obj.id}/edit`,
+ viewUrlPathFn: (obj: SavedObject) => `/app/observability-dashboards#/${obj.id}`,
createLinkText: 'Observability Panel',
createSortText: 'Observability Panel',
- createUrl: '/app/observability-dashboards#/operational_panels/create',
+ createUrl: '/app/observability-dashboards#/create',
});
- core.application.register({
- id: observabilityID,
- title: observabilityTitle,
- category: {
- id: 'opensearch',
- label: 'OpenSearch Plugins',
- order: 2000,
- },
- order: observabilityPluginOrder,
- async mount(params: AppMountParameters) {
- const { Observability } = await import('./components/index');
- const [coreStart, depsStart] = await core.getStartServices();
- const dslService = new DSLService(coreStart.http);
- const savedObjects = new SavedObjects(coreStart.http);
- const timestampUtils = new TimestampUtils(dslService, pplService);
- return Observability(
- coreStart,
- depsStart,
- params,
- pplService,
- dslService,
- savedObjects,
- timestampUtils,
- qm
- );
+ const OBSERVABILITY_APP_CATEGORIES: Record = Object.freeze({
+ observability: {
+ id: 'observability',
+ label: i18n.translate('core.ui.observabilityNavList.label', {
+ defaultMessage: 'Observability',
+ }),
+ order: 3000,
},
});
+ const appMountWithStartPage = (startPage: string) => async (params: AppMountParameters) => {
+ console.log('start page: ', startPage);
+ const { Observability } = await import('./components/index');
+ const [coreStart, depsStart] = await core.getStartServices();
+ const dslService = new DSLService(coreStart.http);
+ const savedObjects = new SavedObjects(coreStart.http);
+ const timestampUtils = new TimestampUtils(dslService, pplService);
+
+ return Observability(
+ coreStart,
+ depsStart as AppPluginStartDependencies,
+ params,
+ pplService,
+ dslService,
+ savedObjects,
+ timestampUtils,
+ qm,
+ startPage
+ );
+ };
+
+ core.application.register({
+ id: observabilityApplicationsID,
+ title: observabilityApplicationsTitle,
+ category: OBSERVABILITY_APP_CATEGORIES.observability,
+ order: observabilityApplicationsPluginOrder,
+ mount: appMountWithStartPage('applications'),
+ });
+
+ core.application.register({
+ id: observabilityLogsID,
+ title: observabilityLogsTitle,
+ category: OBSERVABILITY_APP_CATEGORIES.observability,
+ order: observabilityLogsPluginOrder,
+ mount: appMountWithStartPage('logs'),
+ });
+
+ core.application.register({
+ id: observabilityMetricsID,
+ title: observabilityMetricsTitle,
+ category: OBSERVABILITY_APP_CATEGORIES.observability,
+ order: observabilityMetricsPluginOrder,
+ mount: appMountWithStartPage('metrics'),
+ });
+
+ core.application.register({
+ id: observabilityTracesID,
+ title: observabilityTracesTitle,
+ category: OBSERVABILITY_APP_CATEGORIES.observability,
+ order: observabilityTracesPluginOrder,
+ mount: appMountWithStartPage('traces'),
+ });
+
+ core.application.register({
+ id: observabilityNotebookID,
+ title: observabilityNotebookTitle,
+ category: OBSERVABILITY_APP_CATEGORIES.observability,
+ order: observabilityNotebookPluginOrder,
+ mount: appMountWithStartPage('notebooks'),
+ });
+
+ core.application.register({
+ id: observabilityPanelsID,
+ title: observabilityPanelsTitle,
+ category: OBSERVABILITY_APP_CATEGORIES.observability,
+ order: observabilityPanelsPluginOrder,
+ mount: appMountWithStartPage('dashboards'),
+ });
+
const embeddableFactory = new ObservabilityEmbeddableFactoryDefinition(async () => ({
getAttributeService: (await core.getStartServices())[1].dashboard.getAttributeService,
savedObjectsClient: (await core.getStartServices())[0].savedObjects.client,
@@ -132,16 +210,16 @@ export class ObservabilityPlugin
title: OBSERVABILITY_EMBEDDABLE_DISPLAY_NAME,
description: OBSERVABILITY_EMBEDDABLE_DESCRIPTION,
icon: OBSERVABILITY_EMBEDDABLE_ICON,
- aliasApp: observabilityID,
- aliasPath: `#/event_analytics/explorer/?${CREATE_TAB_PARAM_KEY}=${CREATE_TAB_PARAM[TAB_CHART_ID]}`,
+ aliasApp: observabilityLogsID,
+ aliasPath: `#/explorer/?${CREATE_TAB_PARAM_KEY}=${CREATE_TAB_PARAM[TAB_CHART_ID]}`,
stage: 'production',
appExtensions: {
visualizations: {
docTypes: [VISUALIZATION_SAVED_OBJECT],
toListItem: ({ id, attributes, updated_at: updatedAt }) => ({
description: attributes?.description,
- editApp: observabilityID,
- editUrl: `#/event_analytics/explorer/${id}`,
+ editApp: observabilityLogsID,
+ editUrl: `#/explorer/${id}`,
icon: OBSERVABILITY_EMBEDDABLE_ICON,
id,
savedObjectType: VISUALIZATION_SAVED_OBJECT,
diff --git a/server/saved_objects/observability_saved_object.ts b/server/saved_objects/observability_saved_object.ts
index 5c47a0c223..d8f8ca32d0 100644
--- a/server/saved_objects/observability_saved_object.ts
+++ b/server/saved_objects/observability_saved_object.ts
@@ -4,7 +4,7 @@
*/
import { SavedObjectsType } from '../../../../src/core/server';
-import { observabilityID } from '../../common/constants/shared';
+import { observabilityID, observabilityLogsID } from '../../common/constants/shared';
import { VISUALIZATION_SAVED_OBJECT } from '../../common/types/observability_saved_object_attributes';
export const visualizationSavedObject: SavedObjectsType = {
@@ -19,8 +19,8 @@ export const visualizationSavedObject: SavedObjectsType = {
return obj.attributes.title;
},
getInAppUrl(obj) {
- const editPath = `#/event_analytics/explorer/${VISUALIZATION_SAVED_OBJECT}:${obj.id}`;
- const editUrl = `/app/${observabilityID}${editPath}`;
+ const editPath = `#/explorer/${VISUALIZATION_SAVED_OBJECT}:${obj.id}`;
+ const editUrl = `/app/${observabilityLogsID}${editPath}`;
return {
path: editUrl,
uiCapabilitiesPath: 'observability.show',