forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APM][ECO] Service name and trace id links on Logs Explorer and Disco…
…ver (elastic#192349) closes elastic#192164 This PR adds links to the **logs explorer** and **discover** service.name fields and trace.id field. - service.name link points to `/link-to/entity/{serviceName}`. - trace.id link points to `/link-to/trace/{traceId}`. ### Logs explorer https://github.com/user-attachments/assets/4b2ec665-8968-4b19-822d-f06ba7d1978a #### When EEM setting is disabled: <img width="1763" alt="Screenshot 2024-09-09 at 15 00 28" src="https://github.com/user-attachments/assets/a8b4ca60-b835-43d1-a0fc-cdb5ae25452f"> --- ### Discover https://github.com/user-attachments/assets/563e91c2-0e54-4ef3-9f98-d5c83573e513 #### When EEM setting is disabled: <img width="1869" alt="Screenshot 2024-09-09 at 15 00 51" src="https://github.com/user-attachments/assets/30257e85-5b2d-42d7-a3a7-a34b1591e50b"> ### EEM callout <img width="1504" alt="Screenshot 2024-09-10 at 16 44 39" src="https://github.com/user-attachments/assets/7cb67172-671a-4fed-b5bb-72a3295b905f"> --- ### Remove links when APM is not enabled <img width="1422" alt="Screenshot 2024-09-11 at 10 13 25" src="https://github.com/user-attachments/assets/022406a1-e9c1-4763-9d8b-625551cdabd9"> <img width="1568" alt="Screenshot 2024-09-11 at 10 13 40" src="https://github.com/user-attachments/assets/aa65acc3-4a8f-4f0d-9544-95bd0adec3cf"> --------- Co-authored-by: Kate Patticha <[email protected]> Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
6a3adf7
commit 6221afa
Showing
31 changed files
with
958 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/plugins/discover/public/components/data_types/logs/service_name_chip_with_popover.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import React from 'react'; | ||
import { getRouterLinkProps } from '@kbn/router-utils'; | ||
import { EuiLink } from '@elastic/eui'; | ||
import { OBSERVABILITY_ENTITY_CENTRIC_EXPERIENCE } from '@kbn/management-settings-ids'; | ||
import { type ChipWithPopoverProps, ChipWithPopover } from './popover_chip'; | ||
import { useDiscoverServices } from '../../../hooks/use_discover_services'; | ||
|
||
const SERVICE_ENTITY_LOCATOR = 'SERVICE_ENTITY_LOCATOR'; | ||
|
||
export function ServiceNameChipWithPopover(props: ChipWithPopoverProps) { | ||
const { share, core } = useDiscoverServices(); | ||
const canViewApm = core.application.capabilities.apm?.show || false; | ||
const isEntityCentricExperienceSettingEnabled = canViewApm | ||
? core.uiSettings.get(OBSERVABILITY_ENTITY_CENTRIC_EXPERIENCE) | ||
: false; | ||
const urlService = share?.url; | ||
|
||
const apmLinkToServiceEntityLocator = urlService?.locators.get<{ serviceName: string }>( | ||
SERVICE_ENTITY_LOCATOR | ||
); | ||
const href = apmLinkToServiceEntityLocator?.getRedirectUrl({ | ||
serviceName: props.text, | ||
}); | ||
|
||
const routeLinkProps = href | ||
? getRouterLinkProps({ | ||
href, | ||
onClick: () => apmLinkToServiceEntityLocator?.navigate({ serviceName: props.text }), | ||
}) | ||
: undefined; | ||
|
||
return ( | ||
<ChipWithPopover {...props}> | ||
{canViewApm && isEntityCentricExperienceSettingEnabled && routeLinkProps | ||
? ({ content }) => <EuiLink {...routeLinkProps}>{content}</EuiLink> | ||
: undefined} | ||
</ChipWithPopover> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.