Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
c415cb0
[Log Explorer] Add Explorer app locator
mohamedhamed-ahmed Sep 7, 2023
9f0e80a
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 7, 2023
7bb6f03
Resolve Conflicts
mohamedhamed-ahmed Sep 7, 2023
48695ba
Resolve Conflicts
mohamedhamed-ahmed Sep 7, 2023
d752b46
Fix Tests
mohamedhamed-ahmed Sep 7, 2023
6b6f186
Fix Tests
mohamedhamed-ahmed Sep 7, 2023
5cbd788
Merge branch 'main' of https://github.com/elastic/kibana into 164995-…
mohamedhamed-ahmed Sep 7, 2023
b2c9fcc
Implemented Log Explorer Locator
mohamedhamed-ahmed Sep 9, 2023
c2ee770
Merge branch 'main' of https://github.com/elastic/kibana into 164995-…
mohamedhamed-ahmed Sep 9, 2023
39d4d7a
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 9, 2023
f0e2b45
Merge branch 'main' of https://github.com/elastic/kibana into 164995-…
mohamedhamed-ahmed Sep 11, 2023
c1f48dc
Merge branch '164995-add-log-explorer-app-locator' of https://github.…
mohamedhamed-ahmed Sep 11, 2023
252fa99
Use Observability Log Explorer Locators in APM
mohamedhamed-ahmed Sep 11, 2023
4c04b5a
Merge branch 'main' of https://github.com/elastic/kibana into 164995-…
mohamedhamed-ahmed Sep 11, 2023
fceacf4
Merge branch 'main' of https://github.com/elastic/kibana into 164995-…
mohamedhamed-ahmed Sep 12, 2023
b10b306
Fix Tests
mohamedhamed-ahmed Sep 12, 2023
ab69079
Fix Merge Conflicts
mohamedhamed-ahmed Sep 12, 2023
45339bd
Merge branch 'main' of https://github.com/elastic/kibana into 164995-…
mohamedhamed-ahmed Sep 12, 2023
79bbb38
Added Tests
mohamedhamed-ahmed Sep 12, 2023
e9acb2b
Fix Merge Conflicts
mohamedhamed-ahmed Sep 12, 2023
8745638
Merge branch 'main' of https://github.com/elastic/kibana into 164995-…
mohamedhamed-ahmed Sep 13, 2023
4d45a11
Remove observabilityLogExplorer dependency
mohamedhamed-ahmed Sep 13, 2023
02ac041
Merge branch 'main' of https://github.com/elastic/kibana into 164995-…
mohamedhamed-ahmed Sep 13, 2023
ca737b4
Fix APM Links
mohamedhamed-ahmed Sep 14, 2023
d763075
Fix Merge Conflicts
mohamedhamed-ahmed Sep 14, 2023
a402c3f
Fix Merge Conflicts
mohamedhamed-ahmed Sep 18, 2023
24ed36d
refactor(log-explorer): add locator lookup for unresolved dataset sel…
Sep 18, 2023
f903a99
refactor(log-explorer): fix conflicts
Sep 18, 2023
acc521d
refactor(log-explorer): fix conflicts
Sep 18, 2023
8971da8
Merge branch '164995-add-log-explorer-app-locator' into pr/165962
tonyghiani Sep 18, 2023
e2e6f89
Merge pull request #2 from tonyghiani/pr/165962
mohamedhamed-ahmed Sep 18, 2023
800ce7d
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 18, 2023
b230e3f
Merge branch 'main' of https://github.com/elastic/kibana into 164995-…
mohamedhamed-ahmed Sep 18, 2023
d7713f6
Merge branch '164995-add-log-explorer-app-locator' of https://github.…
mohamedhamed-ahmed Sep 18, 2023
38119b6
Code Cleanup
mohamedhamed-ahmed Sep 18, 2023
76ba013
Update Obs serverless landing to log explorer
mohamedhamed-ahmed Sep 18, 2023
d772796
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 18, 2023
3c004c2
Code Refactor
mohamedhamed-ahmed Sep 18, 2023
fb127a9
Merge branch '164995-add-log-explorer-app-locator' of https://github.…
mohamedhamed-ahmed Sep 18, 2023
f5d0b91
Updating plugin references
mohamedhamed-ahmed Sep 18, 2023
0cbf2d9
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 18, 2023
6e20b2b
Updating plugin references
mohamedhamed-ahmed Sep 18, 2023
4ca0ee0
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 18, 2023
69bf34e
Fix Tests
mohamedhamed-ahmed Sep 18, 2023
fd233d6
Move locator param definitions into a package
mohamedhamed-ahmed Sep 18, 2023
90b80e4
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 18, 2023
b66cdfc
Merge branch 'main' into 164995-add-log-explorer-app-locator
mohamedhamed-ahmed Sep 19, 2023
ef5b398
Add log explorer tests
mohamedhamed-ahmed Sep 19, 2023
ff8f345
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Sep 19, 2023
1a6c3ed
Reference Updates
mohamedhamed-ahmed Sep 19, 2023
0daa9ce
Reference Updates
mohamedhamed-ahmed Sep 19, 2023
a072a06
Merge branch 'main' into 164995-add-log-explorer-app-locator
mohamedhamed-ahmed Sep 19, 2023
2d2133a
Merge branch 'main' into 164995-add-log-explorer-app-locator
mohamedhamed-ahmed Sep 20, 2023
a3a7994
Bug Fix
mohamedhamed-ahmed Sep 20, 2023
93a25e2
Merge branch 'main' of https://github.com/elastic/kibana into 164995-…
mohamedhamed-ahmed Sep 20, 2023
14d8d49
Coder Refactor
mohamedhamed-ahmed Sep 20, 2023
d12e57c
Fix Tests
mohamedhamed-ahmed Sep 20, 2023
aacebaf
Fix Tests
mohamedhamed-ahmed Sep 20, 2023
276e575
Merge branch 'main' of https://github.com/elastic/kibana into 164995-…
mohamedhamed-ahmed Sep 20, 2023
94c89c6
Merge branch 'main' into 164995-add-log-explorer-app-locator
mohamedhamed-ahmed Sep 20, 2023
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
2 changes: 2 additions & 0 deletions packages/deeplinks/observability/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
export { OBSERVABILITY_ONBOARDING_APP_ID } from './constants';

export type { AppId, DeepLinkId } from './deep_links';

export * from './locators';
11 changes: 11 additions & 0 deletions packages/deeplinks/observability/locators/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export * from './log_explorer';
export * from './observability_log_explorer';
export * from './observability_onboarding';
51 changes: 51 additions & 0 deletions packages/deeplinks/observability/locators/log_explorer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import type { SerializableRecord } from '@kbn/utility-types';
import type { Filter, TimeRange, Query, AggregateQuery } from '@kbn/es-query';

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export type RefreshInterval = {
pause: boolean;
value: number;
};

export const LOG_EXPLORER_LOCATOR_ID = 'LOG_EXPLORER_LOCATOR';

export interface LogExplorerNavigationParams extends SerializableRecord {
/**
* Optionally set the time range in the time picker.
*/
timeRange?: TimeRange;
/**
* Optionally set the refresh interval.
*/
refreshInterval?: RefreshInterval;
/**
* Optionally set a query.
*/
query?: Query | AggregateQuery;
/**
* Columns displayed in the table
*/
columns?: string[];
/**
* Array of the used sorting [[field,direction],...]
*/
sort?: string[][];
/**
* Optionally apply filters.
*/
filters?: Filter[];
}

export interface LogExplorerLocatorParams extends LogExplorerNavigationParams {
/**
* Dataset name to be selected.
*/
dataset?: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { LogExplorerNavigationParams } from './log_explorer';

export type DatasetLocatorParams = LogExplorerNavigationParams;

// All datasets locator
export const ALL_DATASETS_LOCATOR_ID = 'ALL_DATASETS_LOCATOR';

export type AllDatasetsLocatorParams = DatasetLocatorParams;

// Single dataset locator
export const SINGLE_DATASET_LOCATOR_ID = 'SINGLE_DATASET_LOCATOR';

export interface SingleDatasetLocatorParams extends DatasetLocatorParams {
/**
* Integration name to be selected.
*/
integration?: string;
/**
* Dataset name to be selected.
* ex: system.syslog
*/
dataset: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { SerializableRecord } from '@kbn/utility-types';

export const OBSERVABILITY_ONBOARDING_LOCATOR = 'OBSERVABILITY_ONBOARDING_LOCATOR' as const;

export interface ObservabilityOnboardingLocatorParams extends SerializableRecord {
/** If given, it will load the given map else will load the create a new map page. */
source?: 'customLogs' | 'systemLogs';
}
2 changes: 2 additions & 0 deletions packages/deeplinks/observability/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@
"target/**/*"
],
"kbn_references": [
"@kbn/utility-types",
"@kbn/es-query",
]
}
1 change: 1 addition & 0 deletions x-pack/plugins/apm/public/application/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const renderApp = ({
lens: pluginsStart.lens,
uiActions: pluginsStart.uiActions,
observabilityAIAssistant: pluginsStart.observabilityAIAssistant,
share: pluginsSetup.share,
};

// render APM feedback link in global help menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import {
SectionSubtitle,
SectionTitle,
} from '@kbn/observability-shared-plugin/public';
import {
AllDatasetsLocatorParams,
ALL_DATASETS_LOCATOR_ID,
} from '@kbn/deeplinks-observability/locators';
import { isJavaAgentName } from '../../../../../../common/agent_name';
import { SERVICE_NODE_NAME } from '../../../../../../common/es_fields/apm';
import { useApmPluginContext } from '../../../../../context/apm_plugin/use_apm_plugin_context';
Expand All @@ -40,7 +44,7 @@ export function InstanceActionsMenu({
kuery,
onClose,
}: Props) {
const { core, infra } = useApmPluginContext();
const { core, infra, share } = useApmPluginContext();
const { data, status } = useInstanceDetailsFetcher({
serviceName,
serviceNodeName,
Expand All @@ -52,6 +56,10 @@ export function InstanceActionsMenu({
const metricOverviewHref = useMetricOverviewHref(serviceName);
const history = useHistory();

const allDatasetsLocator = share.url.locators.get<AllDatasetsLocatorParams>(
ALL_DATASETS_LOCATOR_ID
)!;

if (isPending(status)) {
return (
<div
Expand Down Expand Up @@ -90,6 +98,7 @@ export function InstanceActionsMenu({
onFilterByInstanceClick: handleFilterByInstanceClick,
metricsHref,
infraLocators: infra?.locators,
allDatasetsLocator,
});

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import { i18n } from '@kbn/i18n';
import { IBasePath } from '@kbn/core/public';
import moment from 'moment';
import type { InfraLocators } from '@kbn/infra-plugin/common/locators';
import type { LocatorPublic } from '@kbn/share-plugin/public';
import { AllDatasetsLocatorParams } from '@kbn/deeplinks-observability/locators';
import { getNodeLogsHref } from '../../../../shared/links/observability_logs_link';
import { APIReturnType } from '../../../../../services/rest/create_call_apm_api';
import { getInfraHref } from '../../../../shared/links/infra_link';
import {
Expand Down Expand Up @@ -39,12 +42,14 @@ export function getMenuSections({
onFilterByInstanceClick,
metricsHref,
infraLocators,
allDatasetsLocator,
}: {
instanceDetails: InstaceDetails;
basePath: IBasePath;
onFilterByInstanceClick: () => void;
metricsHref: string;
infraLocators: InfraLocators;
infraLocators?: InfraLocators;
allDatasetsLocator: LocatorPublic<AllDatasetsLocatorParams>;
}) {
const podId = instanceDetails.kubernetes?.pod?.uid;
const containerId = instanceDetails.container?.id;
Expand All @@ -54,69 +59,72 @@ export function getMenuSections({
const infraMetricsQuery = getInfraMetricsQuery(instanceDetails['@timestamp']);
const infraNodeLocator = infraLocators?.nodeLogsLocator;

const podActions: Action[] = infraNodeLocator
? [
{
key: 'podLogs',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.podLogs',
{ defaultMessage: 'Pod logs' }
),
href: infraNodeLocator?.getRedirectUrl({
nodeId: podId!,
nodeType: 'pod',
time,
}),
condition: !!podId,
},
{
key: 'podMetrics',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.podMetrics',
{ defaultMessage: 'Pod metrics' }
),
href: getInfraHref({
app: 'metrics',
basePath,
path: `/link-to/pod-detail/${podId}`,
query: infraMetricsQuery,
}),
condition: !!podId,
},
]
: [];
const podLogsHref = getNodeLogsHref(
'pod',
podId!,
time,
allDatasetsLocator,
infraNodeLocator
);
const containerLogsHref = getNodeLogsHref(
'container',
containerId!,
time,
allDatasetsLocator,
infraNodeLocator
);

const containerActions: Action[] = infraNodeLocator
? [
{
key: 'containerLogs',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.containerLogs',
{ defaultMessage: 'Container logs' }
),
href: infraNodeLocator?.getRedirectUrl({
nodeId: containerId!,
nodeType: 'container',
time,
}),
condition: !!containerId,
},
{
key: 'containerMetrics',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.containerMetrics',
{ defaultMessage: 'Container metrics' }
),
href: getInfraHref({
app: 'metrics',
basePath,
path: `/link-to/container-detail/${containerId}`,
query: infraMetricsQuery,
}),
condition: !!containerId,
},
]
: [];
const podActions: Action[] = [
{
key: 'podLogs',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.podLogs',
{ defaultMessage: 'Pod logs' }
),
href: podLogsHref,
condition: !!podId,
},
{
key: 'podMetrics',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.podMetrics',
{ defaultMessage: 'Pod metrics' }
),
href: getInfraHref({
app: 'metrics',
basePath,
path: `/link-to/pod-detail/${podId}`,
query: infraMetricsQuery,
}),
condition: !!podId && !!infraLocators,
},
];

const containerActions: Action[] = [
{
key: 'containerLogs',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.containerLogs',
{ defaultMessage: 'Container logs' }
),
href: containerLogsHref,
condition: !!containerId,
},
{
key: 'containerMetrics',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.containerMetrics',
{ defaultMessage: 'Container metrics' }
),
href: getInfraHref({
app: 'metrics',
basePath,
path: `/link-to/container-detail/${containerId}`,
query: infraMetricsQuery,
}),
condition: !!containerId && !!infraLocators,
},
];

const apmActions: Action[] = [
{
Expand Down
Loading