mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Cloudwatch: Add monitoring badge for metric insights (#89956)
This commit is contained in:
@@ -347,7 +347,7 @@ describe('QueryEditor should render right editor', () => {
|
|||||||
config.featureToggles.cloudwatchMetricInsightsCrossAccount = true;
|
config.featureToggles.cloudwatchMetricInsightsCrossAccount = true;
|
||||||
props.datasource.resources.getAccounts = jest.fn().mockResolvedValue(['account123']);
|
props.datasource.resources.getAccounts = jest.fn().mockResolvedValue(['account123']);
|
||||||
render(<QueryEditor {...props} query={validMetricQueryBuilderQuery} />);
|
render(<QueryEditor {...props} query={validMetricQueryBuilderQuery} />);
|
||||||
await screen.findByText('Metric Query');
|
await screen.findByText('Metric Insights');
|
||||||
expect(await screen.findByText('Account')).toBeInTheDocument();
|
expect(await screen.findByText('Account')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -58,12 +58,16 @@ const QueryHeader = ({
|
|||||||
onChange({ ...query, region });
|
onChange({ ...query, region });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const metricInsightsCrossAccountEnabled = config.featureToggles.cloudwatchMetricInsightsCrossAccount;
|
||||||
|
|
||||||
const shouldDisplayMonitoringBadge =
|
const shouldDisplayMonitoringBadge =
|
||||||
config.featureToggles.cloudWatchCrossAccountQuerying &&
|
config.featureToggles.cloudWatchCrossAccountQuerying &&
|
||||||
isMonitoringAccount &&
|
isMonitoringAccount &&
|
||||||
(query.queryMode === 'Logs' ||
|
(query.queryMode === 'Logs' ||
|
||||||
(isCloudWatchMetricsQuery(query) && query.metricQueryType === MetricQueryType.Search));
|
(isCloudWatchMetricsQuery(query) && query.metricQueryType === MetricQueryType.Search) ||
|
||||||
|
(metricInsightsCrossAccountEnabled &&
|
||||||
|
isCloudWatchMetricsQuery(query) &&
|
||||||
|
query.metricQueryType === MetricQueryType.Insights));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user