[ObsUX] Change the Agent Explorer link to open the new Metrics page (#170099)

closes https://github.com/elastic/kibana/issues/169919
## Summary

This PR changes the link destination from the APM Settings / Agent
Explorer to the Services Metrics tab



38c2e8b3-910c-4b78-9565-5471abbb2af2


When redirecting to an agent language different than Java, this is what
it looks like


| Then      | Now |
| ----------- | ----------- |
|![image
(1)](8dc4be2c-860d-4398-a547-b827639d3304)
|![image
(2)](6bbb8143-c5f9-43ac-a500-56f1d948c581)
|



### How to test
- Setup local Kibana pointing to an oblt-cli cluster
-  Navigate to `Settings` in APM
- Navigate to `Agente Explorer` tab, select `Java` on the `Agent
Language`
- Open the flyout and click on the instance name

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Carlos Crespo 2023-11-02 16:40:55 +01:00 committed by GitHub
parent 527c2f8b82
commit c056b93d98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,6 +15,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import React from 'react';
import { ValuesType } from 'utility-types';
import { MetricOverviewLink } from '../../../../../shared/links/apm/metric_overview_link';
import { AgentExplorerFieldName } from '../../../../../../../common/agent_explorer';
import { isOpenTelemetryAgentName } from '../../../../../../../common/agent_name';
import {
@ -26,7 +27,6 @@ import { APIReturnType } from '../../../../../../services/rest/create_call_apm_a
import { unit } from '../../../../../../utils/style';
import { EnvironmentBadge } from '../../../../../shared/environment_badge';
import { ItemsBadge } from '../../../../../shared/item_badge';
import { ServiceNodeMetricOverviewLink } from '../../../../../shared/links/apm/service_node_metric_overview_link';
import { PopoverTooltip } from '../../../../../shared/popover_tooltip';
import { TimestampTooltip } from '../../../../../shared/timestamp_tooltip';
import { TruncateWithTooltip } from '../../../../../shared/truncate_with_tooltip';
@ -108,12 +108,15 @@ export function getInstanceColumns(
content={
<>
{serviceNode ? (
<ServiceNodeMetricOverviewLink
<MetricOverviewLink
serviceName={serviceName}
serviceNodeName={serviceNode}
mergeQuery={(query) => ({
...query,
kuery: `service.node.name:"${displayedName}"`,
})}
>
<span className="eui-textTruncate">{displayedName}</span>
</ServiceNodeMetricOverviewLink>
{displayedName}
</MetricOverviewLink>
) : (
<span className="eui-textTruncate">{displayedName}</span>
)}