mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
parent
0bc8cf7f49
commit
5faf880aa5
3 changed files with 17 additions and 10 deletions
|
@ -7,7 +7,7 @@ exports[`IntegrationGroup will not display APM links when APM is unavailable 1`]
|
|||
<EuiFlexItem>
|
||||
<IntegrationLink
|
||||
ariaLabel="Search APM for this monitor"
|
||||
href="/app/apm#/services?kuery=url.domain:%20%22undefined%22&rangeFrom=now-15m&rangeTo=now"
|
||||
href="/app/apm/services?kuery=url.domain:%20%22undefined%22&rangeFrom=now-15m&rangeTo=now"
|
||||
iconType="apmApp"
|
||||
message="Show APM Data"
|
||||
tooltipContent="Click here to check APM for the domain \\"\\" or explicitly defined \\"service name\\"."
|
||||
|
@ -71,7 +71,7 @@ exports[`IntegrationGroup will not display infra links when infra is unavailable
|
|||
<EuiFlexItem>
|
||||
<IntegrationLink
|
||||
ariaLabel="Search APM for this monitor"
|
||||
href="/app/apm#/services?kuery=url.domain:%20%22undefined%22&rangeFrom=now-15m&rangeTo=now"
|
||||
href="/app/apm/services?kuery=url.domain:%20%22undefined%22&rangeFrom=now-15m&rangeTo=now"
|
||||
iconType="apmApp"
|
||||
message="Show APM Data"
|
||||
tooltipContent="Click here to check APM for the domain \\"\\" or explicitly defined \\"service name\\"."
|
||||
|
@ -135,7 +135,7 @@ exports[`IntegrationGroup will not display logging links when logging is unavail
|
|||
<EuiFlexItem>
|
||||
<IntegrationLink
|
||||
ariaLabel="Search APM for this monitor"
|
||||
href="/app/apm#/services?kuery=url.domain:%20%22undefined%22&rangeFrom=now-15m&rangeTo=now"
|
||||
href="/app/apm/services?kuery=url.domain:%20%22undefined%22&rangeFrom=now-15m&rangeTo=now"
|
||||
iconType="apmApp"
|
||||
message="Show APM Data"
|
||||
tooltipContent="Click here to check APM for the domain \\"\\" or explicitly defined \\"service name\\"."
|
||||
|
|
|
@ -39,14 +39,14 @@ describe('getLegacyApmHref', () => {
|
|||
it('creates href with base path when present', () => {
|
||||
const result = getLegacyApmHref(summary, 'foo', 'now-15m', 'now');
|
||||
expect(result).toMatchInlineSnapshot(
|
||||
`"foo/app/apm#/services?kuery=url.domain:%20%22www.elastic.co%22&rangeFrom=now-15m&rangeTo=now"`
|
||||
`"foo/app/apm/services?kuery=url.domain:%20%22www.elastic.co%22&rangeFrom=now-15m&rangeTo=now"`
|
||||
);
|
||||
});
|
||||
|
||||
it('does not add a base path or extra slash when base path is empty string', () => {
|
||||
const result = getLegacyApmHref(summary, '', 'now-15m', 'now');
|
||||
expect(result).toMatchInlineSnapshot(
|
||||
`"/app/apm#/services?kuery=url.domain:%20%22www.elastic.co%22&rangeFrom=now-15m&rangeTo=now"`
|
||||
`"/app/apm/services?kuery=url.domain:%20%22www.elastic.co%22&rangeFrom=now-15m&rangeTo=now"`
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -59,7 +59,7 @@ describe('getLegacyApmHref', () => {
|
|||
it('links to the named service', () => {
|
||||
const result = getLegacyApmHref(summary, 'foo', 'now-15m', 'now');
|
||||
expect(result).toMatchInlineSnapshot(
|
||||
`"foo/app/apm#/services?kuery=service.name:%20%22${serviceName}%22&rangeFrom=now-15m&rangeTo=now"`
|
||||
`"foo/app/apm/services/MyServiceName/overview/?rangeFrom=now-15m&rangeTo=now"`
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -14,13 +14,20 @@ export const getLegacyApmHref = (
|
|||
dateRangeStart: string,
|
||||
dateRangeEnd: string
|
||||
) => {
|
||||
const clause = summary?.state?.service?.name
|
||||
? `service.name: "${summary.state.service.name}"`
|
||||
: `url.domain: "${summary.state.url?.domain}"`;
|
||||
const serviceName = summary?.state?.service?.name;
|
||||
|
||||
if (serviceName) {
|
||||
return addBasePath(
|
||||
basePath,
|
||||
`/app/apm/services/${serviceName}/overview/?rangeFrom=${dateRangeStart}&rangeTo=${dateRangeEnd}`
|
||||
);
|
||||
}
|
||||
|
||||
const clause = `url.domain: "${summary.state.url?.domain}"`;
|
||||
|
||||
return addBasePath(
|
||||
basePath,
|
||||
`/app/apm#/services?kuery=${encodeURI(
|
||||
`/app/apm/services?kuery=${encodeURI(
|
||||
clause
|
||||
)}&rangeFrom=${dateRangeStart}&rangeTo=${dateRangeEnd}`
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue