Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ export const Expressions: React.FC<Props> = (props) => {
[onFilterChange]
);

const groupByPreviewDisplayName = useMemo(() => {
if (Array.isArray(alertParams.groupBy)) return alertParams.groupBy.join(', ');
return alertParams.groupBy;
}, [alertParams.groupBy]);

return (
<>
<EuiSpacer size={'m'} />
Expand Down Expand Up @@ -400,7 +405,7 @@ export const Expressions: React.FC<Props> = (props) => {
showNoDataResults={alertParams.alertOnNoData}
validate={validateMetricThreshold}
fetch={alertsContext.http.fetch}
groupByDisplayName={alertParams.groupBy}
groupByDisplayName={groupByPreviewDisplayName}
/>
<EuiSpacer size={'m'} />
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ interface Props {
derivedIndexPattern: IIndexPattern;
source: InfraSource | null;
filterQuery?: string;
groupBy?: string;
groupBy?: string | string[];
}

const tooltipProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const useMetricsExplorerChartData = (
derivedIndexPattern: IIndexPattern,
source: InfraSource | null,
filterQuery?: string,
groupBy?: string
groupBy?: string | string[]
) => {
const { timeSize, timeUnit } = expression || { timeSize: 1, timeUnit: 'm' };
const options: MetricsExplorerOptions = useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface ExpressionChartData {

export interface AlertParams {
criteria: MetricExpression[];
groupBy?: string;
groupBy?: string[];
filterQuery?: string;
sourceId?: string;
filterQueryText?: string;
Expand Down