Skip to content

Commit

Permalink
[RCA] Fix equation for rule condition chart (#193689)
Browse files Browse the repository at this point in the history
Resolves #193688
  • Loading branch information
benakansara authored Sep 24, 2024
1 parent 37af730 commit 913b6fe
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ const AggMappingForLens: Record<string, string> = {
const genLensEqForCustomThresholdRule = (criterion: MetricExpression) => {
const metricNameResolver: Record<string, string> = {};

criterion.metrics.forEach(
(metric: CustomThresholdExpressionMetric) =>
(metricNameResolver[metric.name] = `${
AggMappingForLens[metric.aggType] ? AggMappingForLens[metric.aggType] : metric.aggType
}(${metric.field ? metric.field : metric.filter ? metric.filter : ''})`)
);
criterion.metrics.forEach((metric: CustomThresholdExpressionMetric) => {
const metricFilter = metric.filter ? `kql='${metric.filter}'` : '';
metricNameResolver[metric.name] = `${
AggMappingForLens[metric.aggType] ? AggMappingForLens[metric.aggType] : metric.aggType
}(${metric.field ? metric.field : metricFilter})`;
});

let equation = criterion.equation
? criterion.equation
Expand Down

0 comments on commit 913b6fe

Please sign in to comment.