Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Logs UI] Improve log threshold alert factory argument order #106532

Merged
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 @@ -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