forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show blank lines instead of N/A on service map popovers (elastic#57014)…
… (elastic#58569) * Show blank lines instead of N/A on service map popovers Because RUM agents never show CPU or memory usage, we don't want to always show the metric with N/A. If a metric is null, just hide the lines. Break up the display and fetching components and update the popover stories to show the list. Update some types. * Fix metric typings
- Loading branch information
Showing
6 changed files
with
147 additions
and
116 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
41 changes: 41 additions & 0 deletions
41
x-pack/legacy/plugins/apm/public/components/app/ServiceMap/Popover/ServiceMetricFetcher.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,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { ServiceNodeMetrics } from '../../../../../../../../plugins/apm/common/service_map'; | ||
import { useFetcher } from '../../../../hooks/useFetcher'; | ||
import { useUrlParams } from '../../../../hooks/useUrlParams'; | ||
import { ServiceMetricList } from './ServiceMetricList'; | ||
|
||
interface ServiceMetricFetcherProps { | ||
serviceName: string; | ||
} | ||
|
||
export function ServiceMetricFetcher({ | ||
serviceName | ||
}: ServiceMetricFetcherProps) { | ||
const { | ||
urlParams: { start, end, environment } | ||
} = useUrlParams(); | ||
|
||
const { data = {} as ServiceNodeMetrics, status } = useFetcher( | ||
callApmApi => { | ||
if (serviceName && start && end) { | ||
return callApmApi({ | ||
pathname: '/api/apm/service-map/service/{serviceName}', | ||
params: { path: { serviceName }, query: { start, end, environment } } | ||
}); | ||
} | ||
}, | ||
[serviceName, start, end, environment], | ||
{ | ||
preservePreviousData: false | ||
} | ||
); | ||
const isLoading = status === 'loading'; | ||
|
||
return <ServiceMetricList {...data} isLoading={isLoading} />; | ||
} |
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.