Skip to content

Commit

Permalink
[Logs UI] Improve log threshold alert factory argument order (#106532) (
Browse files Browse the repository at this point in the history
#106720)

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Felix Stürmer <[email protected]>
  • Loading branch information
kibanamachine and weltenwort authored Jul 26, 2021
1 parent 1b92b79 commit c59111a
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ type LogThresholdAlertInstance = AlertInstance<
type LogThresholdAlertInstanceFactory = (
id: string,
reason: string,
threshold: number,
value: number
value: number,
threshold: number
) => LogThresholdAlertInstance;

const COMPOSITE_GROUP_SIZE = 2000;
Expand Down Expand Up @@ -96,7 +96,7 @@ export const createLogThresholdExecutor = (libs: InfraBackendLibs) =>
>(async ({ services, params }) => {
const { alertWithLifecycle, savedObjectsClient, scopedClusterClient } = services;
const { sources } = libs;
const alertInstanceFactory: LogThresholdAlertInstanceFactory = (id, reason, threshold, value) =>
const alertInstanceFactory: LogThresholdAlertInstanceFactory = (id, reason, value, threshold) =>
alertWithLifecycle({
id,
fields: {
Expand Down Expand Up @@ -251,8 +251,8 @@ export const processUngroupedResults = (
const alertInstance = alertInstanceFactory(
UNGROUPED_FACTORY_KEY,
getReasonMessageForUngroupedCountAlert(documentCount, count.value, count.comparator),
count.value,
documentCount
documentCount,
count.value
);
alertInstaceUpdater(alertInstance, AlertStates.ALERT, [
{
Expand Down Expand Up @@ -285,8 +285,8 @@ export const processUngroupedRatioResults = (
const alertInstance = alertInstanceFactory(
UNGROUPED_FACTORY_KEY,
getReasonMessageForUngroupedRatioAlert(ratio, count.value, count.comparator),
count.value,
ratio
ratio,
count.value
);
alertInstaceUpdater(alertInstance, AlertStates.ALERT, [
{
Expand Down Expand Up @@ -364,8 +364,8 @@ export const processGroupByResults = (
count.comparator,
group.name
),
count.value,
documentCount
documentCount,
count.value
);
alertInstaceUpdater(alertInstance, AlertStates.ALERT, [
{
Expand Down Expand Up @@ -415,8 +415,8 @@ export const processGroupByRatioResults = (
count.comparator,
numeratorGroup.name
),
count.value,
ratio
ratio,
count.value
);
alertInstaceUpdater(alertInstance, AlertStates.ALERT, [
{
Expand Down

0 comments on commit c59111a

Please sign in to comment.