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

add condition type to alert type FLKR-3067 #66

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
73 changes: 30 additions & 43 deletions com/coralogixapis/alerts/v3/alert_def.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,38 @@ syntax = "proto3";

package com.coralogixapis.alerts.v3;

import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
import "com/coralogixapis/alerts/v3/alert_def_scheduling.proto";
import "com/coralogixapis/alerts/v3/alert_def_notification_group.proto";
import "com/coralogixapis/alerts/v3/alert_def_priority.proto";
import "com/coralogixapis/alerts/v3/alert_def_scheduling.proto";
import "com/coralogixapis/alerts/v3/alert_def_type.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/flow/flow_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_less_than_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_less_than_usual_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/new_value/logs_new_value_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/ratio/logs_ratio_less_than_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/standard/logs_immediate_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/standard/logs_more_than_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/standard/logs_less_than_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/standard/logs_more_than_usual_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/standard/logs_less_than_usual_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/ratio/logs_ratio_more_than_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/ratio/logs_ratio_less_than_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/new_value/logs_new_value_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/unique_count/unique_count_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/time_relative/logs_time_relative_more_than_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/time_relative/logs_time_relative_less_than_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_more_than_eq_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_less_than_eq_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_less_than_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_more_than_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_more_than_usual_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_less_than_usual_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/tracing/tracing_immediate_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/tracing/tracing_more_than_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/flow/flow_type_definition.proto";
import "com/coralogixapis/alerts/v3/alert_def_type.proto";
import "com/coralogixapis/alerts/v3/alert_def_priority.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/unique_count/unique_count_type_definition.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";

/**
* Represents An Existing or Created Alert Definition
* Represents An Existing or Created Alert Definition
*/
message AlertDef {
AlertDefProperties alert_def_properties = 1;
google.protobuf.StringValue id = 2; // This is the Alert Definition's Persistent ID (does not change on replace) , AKA UniqueIdentifier
google.protobuf.StringValue alert_version_id = 20; // the old alertId
google.protobuf.Timestamp created_time = 3;
google.protobuf.Timestamp updated_time = 4;
}

/**
* Represents The non generated alert definition properties (the ones that are set by the user)
* Represents The non generated alert definition properties (the ones that are set by the user)
*/
message AlertDefProperties {
google.protobuf.StringValue name = 1;
Expand All @@ -50,31 +43,25 @@ message AlertDefProperties {
oneof schedule {
ActivitySchedule active_on = 5;
}
AlertDefType alert_def_type = 6;
AlertDefType type = 6;
oneof type_definition {
LogsImmediateTypeDefinition logs_immediate = 100;
LogsMoreThanTypeDefinition logs_more_than = 101;
LogsLessThanTypeDefinition logs_less_than = 102;
LogsMoreThanUsualTypeDefinition logs_more_than_usual = 103;
LogsRatioMoreThanTypeDefinition logs_ratio_more_than = 104;
LogsRatioLessThanTypeDefinition logs_ratio_less_than = 105;
LogsNewValueTypeDefinition logs_new_value = 106;
LogsUniqueCountTypeDefinition logs_unique_count = 107;
LogsTimeRelativeMoreThanTypeDefinition logs_time_relative_more_than = 108;
LogsTimeRelativeLessThanTypeDefinition logs_time_relative_less_than = 109;
MetricMoreThanTypeDefinition metric_more_than = 112;
MetricLessThanTypeDefinition metric_less_than = 113;
MetricMoreThanUsualTypeDefinition metric_more_than_usual = 114;
TracingImmediateTypeDefinition tracing_immediate = 115;
TracingMoreThanTypeDefinition tracing_more_than = 116;
FlowTypeDefinition flow = 117;
MetricLessThanUsualTypeDefinition metric_less_than_usual = 118;
MetricMoreThanOrEqualsTypeDefinition metric_more_than_or_equals = 119;
MetricLessThanOrEqualsTypeDefinition metric_less_than_or_equals = 120;
};
LogsImmediateType logs_immediate = 101;
TracingImmediateType tracing_immediate = 102;
LogsThresholdType logs_threshold = 103;
LogsRatioThresholdType logs_ratio_threshold = 104;
LogsTimeRelativeThresholdType logs_time_relative_threshold = 105;
MetricThresholdType metric_threshold = 106;
TracingThresholdType tracing_threshold = 107;
FlowType flow = 108;
LogsUnusualType logs_unusual = 109;
MetricUnusualType metric_unusual = 110;
LogsNewValueType logs_new_value = 111;
LogsUniqueCountType logs_unique_count = 112;
}
repeated google.protobuf.StringValue group_by = 7;
AlertDefIncidentSettings incidents_settings = 8;
AlertDefNotificationGroup notification_group = 9;
map<string,string> labels = 10;
map<string, string> labels = 10;
google.protobuf.BoolValue phantom_mode = 11;
google.protobuf.BoolValue deleted = 12;
}
21 changes: 7 additions & 14 deletions com/coralogixapis/alerts/v3/alert_def_type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,15 @@ package com.coralogixapis.alerts.v3;

enum AlertDefType {
ALERT_DEF_TYPE_LOGS_IMMEDIATE_OR_UNSPECIFIED = 0;
ALERT_DEF_TYPE_LOGS_MORE_THAN = 1;
ALERT_DEF_TYPE_LOGS_LESS_THAN = 2;
ALERT_DEF_TYPE_LOGS_MORE_THAN_USUAL = 3;
ALERT_DEF_TYPE_LOGS_RATIO_MORE_THAN = 4;
ALERT_DEF_TYPE_LOGS_RATIO_LESS_THAN = 5;
ALERT_DEF_TYPE_LOGS_THRESHOLD = 1;
ALERT_DEF_TYPE_LOGS_UNUSUAL = 3;
ALERT_DEF_TYPE_LOGS_RATIO_THRESHOLD = 4;
ALERT_DEF_TYPE_LOGS_NEW_VALUE = 6;
ALERT_DEF_TYPE_LOGS_UNIQUE_COUNT = 7;
ALERT_DEF_TYPE_LOGS_TIME_RELATIVE_MORE_THAN = 8;
ALERT_DEF_TYPE_LOGS_TIME_RELATIVE_LESS_THAN = 9;
ALERT_DEF_TYPE_METRIC_MORE_THAN = 10;
ALERT_DEF_TYPE_METRIC_LESS_THAN = 11;
ALERT_DEF_TYPE_METRIC_MORE_THAN_USUAL = 14;
ALERT_DEF_TYPE_LOGS_TIME_RELATIVE_THRESHOLD = 8;
ALERT_DEF_TYPE_METRIC_THRESHOLD = 10;
ALERT_DEF_TYPE_METRIC_UNUSUAL = 14;
ALERT_DEF_TYPE_TRACING_IMMEDIATE = 15;
ALERT_DEF_TYPE_TRACING_MORE_THAN = 16;
ALERT_DEF_TYPE_TRACING_THRESHOLD = 16;
ALERT_DEF_TYPE_FLOW = 17;
ALERT_DEF_TYPE_METRIC_MORE_THAN_OR_EQUALS = 18;
ALERT_DEF_TYPE_METRIC_LESS_THAN_OR_EQUALS = 19;
ALERT_DEF_TYPE_METRIC_LESS_THAN_USUAL = 21;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package com.coralogixapis.alerts.v3;

import "google/protobuf/wrappers.proto";

message FlowTypeDefinition {
message FlowType {
repeated FlowStages stages = 1 ;
google.protobuf.BoolValue enforce_suppression = 2;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
syntax = "proto3";

package com.coralogixapis.alerts.v3;


enum LogsConditionType {
LOGS_CONDITION_TYPE_MORE_THAN_OR_UNSPECIFIED = 0;
LOGS_CONDITION_TYPE_LESS_THAN = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import "google/protobuf/wrappers.proto";

message LogsFilter {
oneof filter_type {
LuceneFilter lucene_filter = 1;
LogsSimpleFilter simple_filter = 1;
// DPXL will be added here in the future
//google.protobuf.StringValue dpxl = 2;
// google.protobuf.StringValue dpxl = 2;
}
}
message LuceneFilter {
message LogsSimpleFilter {
google.protobuf.StringValue lucene_query = 1;
LabelFilters label_filters = 2;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
syntax = "proto3";

package com.coralogixapis.alerts.v3;

enum LogsUnusualConditionType {
LOGS_UNUSUAL_CONDITION_TYPE_MORE_THAN_USUAL_OR_UNSPECIFIED = 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
syntax = "proto3";

package com.coralogixapis.alerts.v3;

enum MetricConditionType {
METRIC_CONDITION_TYPE_MORE_THAN_OR_UNSPECIFIED = 0;
METRIC_CONDITION_TYPE_LESS_THAN = 1;
METRIC_CONDITION_TYPE_MORE_THAN_OR_EQUALS = 2;
METRIC_CONDITION_TYPE_LESS_THAN_OR_EQUALS = 3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,23 @@ import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_time
import "com/coralogixapis/alerts/v3/alert_def_type_definition/undetected_values_management.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_missing_values.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metrics_filter.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_condition_type.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/overrides.proto";

message MetricLessThanTypeDefinition {
message MetricThresholdType {
MetricFilter metric_filter = 1;
google.protobuf.FloatValue threshold = 2;
google.protobuf.UInt32Value for_over_pct = 3;
MetricTimeWindow of_the_last = 4;
MetricMissingValues missing_values =5;
optional UndetectedValuesManagement undetected_values_management = 6;
repeated MetricThresholdRule rules = 2;
UndetectedValuesManagement undetected_values_management = 3;
}

message MetricThresholdRule {
MetricThresholdCondition condition = 1;
AlertDefOverride override = 2;
}
message MetricThresholdCondition {
google.protobuf.DoubleValue threshold = 1;
google.protobuf.UInt32Value for_over_pct = 2;
MetricTimeWindow of_the_last = 3;
MetricMissingValues missing_values = 4;
MetricConditionType condition = 5;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@ package com.coralogixapis.alerts.v3;
import "google/protobuf/wrappers.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_timewindow.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metrics_filter.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/metric/metric_unsual_condition_type.proto";

message MetricLessThanUsualTypeDefinition {
message MetricUnusualType {
MetricFilter metric_filter = 1;
google.protobuf.UInt32Value threshold = 2;
google.protobuf.UInt32Value for_over_pct = 3;
MetricTimeWindow of_the_last = 4;
google.protobuf.UInt32Value min_non_null_values_pct = 5;
MetricUnusualRule rule = 2;
}
message MetricUnusualRule{
MetricUnusualCondition condition = 1;
}

message MetricUnusualCondition{
google.protobuf.DoubleValue threshold = 1;
google.protobuf.UInt32Value for_over_pct = 2;
MetricTimeWindow of_the_last = 3;
google.protobuf.UInt32Value min_non_null_values_pct = 4;
MetricUnusualConditionType unusual_condition = 5;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
syntax = "proto3";

package com.coralogixapis.alerts.v3;

enum MetricUnusualConditionType {
METRIC_UNUSUAL_CONDITION_TYPE_MORE_THAN_USUAL_OR_UNSPECIFIED = 0;
METRIC_UNUSUAL_CONDITION_TYPE_LESS_THAN_USUAL= 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ import "google/protobuf/wrappers.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/new_value/logs_new_value_timewindow.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/logs_filter.proto";

message LogsNewValueTypeDefinition {
message LogsNewValueType {
LogsFilter logs_filter = 1;
google.protobuf.StringValue keypath_to_track = 3;
LogsNewValueTimeWindow time_window = 4;
repeated google.protobuf.StringValue notification_payload_filter = 5;
LogsNewValueRule rule = 2;
repeated google.protobuf.StringValue notification_payload_filter = 3;
}
message LogsNewValueRule {
LogsNewValueCondition condition = 1;
}
message LogsNewValueCondition {
google.protobuf.StringValue keypath_to_track = 1;
LogsNewValueTimeWindow time_window = 2;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
syntax = "proto3";

package com.coralogixapis.alerts.v3;

import "com/coralogixapis/alerts/v3/alert_def_priority.proto";

message AlertDefOverride {
AlertDefPriority priority = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,27 @@ import "com/coralogixapis/alerts/v3/alert_def_type_definition/logs_filter.proto"
import "com/coralogixapis/alerts/v3/alert_def_type_definition/ratio/logs_ratio_timewindow.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/undetected_values_management.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/ratio/logs_ratio_group_by_for.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/logs_condition_type.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/overrides.proto";

message LogsRatioLessThanTypeDefinition {
LogsFilter numerator_logs_filter = 1;
message LogsRatioThresholdType {
LogsFilter numerator = 1;
google.protobuf.StringValue numerator_alias =2;
LogsFilter denominator_logs_filter = 3;
LogsFilter denominator = 3;
google.protobuf.StringValue denominator_alias = 4;
google.protobuf.UInt32Value threshold = 5;
LogsRatioTimeWindow time_window = 6;
google.protobuf.BoolValue ignore_infinity = 7;
repeated LogsRatioRules rules = 5;
repeated google.protobuf.StringValue notification_payload_filter = 6;
LogsRatioGroupByFor group_by_for = 7;
UndetectedValuesManagement undetected_values_management = 8;
repeated google.protobuf.StringValue notification_payload_filter = 9;
LogsRatioGroupByFor group_by_for = 10;
}
message LogsRatioRules {
LogsRatioCondition condition = 1;
AlertDefOverride override = 2;
}

message LogsRatioCondition {
google.protobuf.DoubleValue threshold = 1;
LogsRatioTimeWindow time_window = 2;
google.protobuf.BoolValue ignore_infinity = 3;
LogsConditionType condition_type = 4;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "google/protobuf/wrappers.proto";

package com.coralogixapis.alerts.v3;

message LogsImmediateTypeDefinition {
message LogsImmediateType {
LogsFilter logs_filter = 1;
repeated google.protobuf.StringValue notification_payload_filter = 2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,24 @@ import "google/protobuf/wrappers.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/logs_filter.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/undetected_values_management.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/standard/logs_timewindow.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/logs_condition_type.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/overrides.proto";

message LogsLessThanTypeDefinition {
message LogsThresholdType {
LogsFilter logs_filter = 1;
google.protobuf.UInt32Value threshold = 2;
LogsTimeWindow time_window = 3;
UndetectedValuesManagement undetected_values_management = 4;
repeated google.protobuf.StringValue notification_payload_filter = 5;
}
// is now common for both more than and less than (maybe its relevant for more than somehow? not, then will validate it out if no less then is specified)
UndetectedValuesManagement undetected_values_management = 2;
// set of rules -> the first one to match will be used
repeated LogsThresholdRule rules = 3;
repeated google.protobuf.StringValue notification_payload_filter = 4;
}
message LogsThresholdRule {
LogsThresholdCondition condition = 1;
AlertDefOverride override = 2;
}

message LogsThresholdCondition {
google.protobuf.DoubleValue threshold = 1;
LogsTimeWindow time_window = 2;
LogsConditionType condition_type = 3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@ package com.coralogixapis.alerts.v3;
import "com/coralogixapis/alerts/v3/alert_def_type_definition/logs_filter.proto";
import "google/protobuf/wrappers.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/standard/logs_timewindow.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/logs_unsual_condition_type.proto";
import "com/coralogixapis/alerts/v3/alert_def_type_definition/overrides.proto";

message LogsMoreThanUsualTypeDefinition {
message LogsUnusualType {
LogsFilter logs_filter = 1;
google.protobuf.UInt32Value minimum_threshold = 2;
LogsTimeWindow time_window = 3;
repeated google.protobuf.StringValue notification_payload_filter = 4;
LogsUnusualRule rule = 2;
repeated google.protobuf.StringValue notification_payload_filter = 3;
}
message LogsUnusualRule {
LogsUnusualCondition condition = 1;
AlertDefOverride override = 2;
}

message LogsUnusualCondition {
google.protobuf.DoubleValue minimum_threshold = 1;
LogsTimeWindow time_window = 2;
LogsUnusualConditionType logs_unusual_condition_type = 3;
}
Loading