mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
This commit is contained in:
parent
a30dc7dae2
commit
2215c019a3
4 changed files with 7 additions and 7 deletions
|
@ -17,7 +17,7 @@ interface Props {
|
|||
transactionTypes: string[];
|
||||
urlParams: IUrlParams;
|
||||
isRumAgent?: boolean;
|
||||
agentName: string;
|
||||
agentName?: string;
|
||||
}
|
||||
|
||||
export function ServiceDetailTabs({
|
||||
|
|
|
@ -13,7 +13,7 @@ import { MetricsChart } from './MetricsChart';
|
|||
|
||||
interface ServiceMetricsProps {
|
||||
urlParams: IUrlParams;
|
||||
agentName: string;
|
||||
agentName?: string;
|
||||
}
|
||||
|
||||
export function ServiceMetrics({ urlParams, agentName }: ServiceMetricsProps) {
|
||||
|
|
|
@ -16,7 +16,7 @@ const INITIAL_DATA: MetricsChartsByAgentAPIResponse = {
|
|||
|
||||
export function useServiceMetricCharts(
|
||||
urlParams: IUrlParams,
|
||||
agentName: string
|
||||
agentName?: string
|
||||
) {
|
||||
const { serviceName, start, end } = urlParams;
|
||||
const uiFilters = useUiFilters(urlParams);
|
||||
|
@ -24,17 +24,17 @@ export function useServiceMetricCharts(
|
|||
MetricsChartsByAgentAPIResponse
|
||||
>(
|
||||
() => {
|
||||
if (serviceName && start && end) {
|
||||
if (serviceName && start && end && agentName) {
|
||||
return loadMetricsChartData({
|
||||
serviceName,
|
||||
agentName,
|
||||
start,
|
||||
end,
|
||||
agentName,
|
||||
uiFilters
|
||||
});
|
||||
}
|
||||
},
|
||||
[serviceName, start, end, uiFilters]
|
||||
[serviceName, start, end, agentName, uiFilters]
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
@ -60,7 +60,7 @@ export async function getService(serviceName: string, setup: Setup) {
|
|||
const { aggregations } = await client<void, Aggs>('search', params);
|
||||
const buckets = idx(aggregations, _ => _.types.buckets) || [];
|
||||
const types = buckets.map(bucket => bucket.key);
|
||||
const agentName = idx(aggregations, _ => _.agents.buckets[0].key) || '';
|
||||
const agentName = idx(aggregations, _ => _.agents.buckets[0].key);
|
||||
return {
|
||||
serviceName,
|
||||
types,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue