From 51ca71bb7af81c1a53a8b5c8419d9dc8600f6c2b Mon Sep 17 00:00:00 2001 From: Richard Ortenberg Date: Mon, 11 Dec 2023 15:57:54 -0800 Subject: [PATCH 1/5] feat(crons): Add thresholds to monitor config payload --- relay-monitors/src/lib.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/relay-monitors/src/lib.rs b/relay-monitors/src/lib.rs index f7b24d69ab3..6f96f3b52de 100644 --- a/relay-monitors/src/lib.rs +++ b/relay-monitors/src/lib.rs @@ -97,7 +97,7 @@ pub struct MonitorConfig { #[serde(default, skip_serializing_if = "Option::is_none")] checkin_margin: Option, - /// How long (in minutes) is the checkin allowed to run for in in_rogress before it is + /// How long (in minutes) is the checkin allowed to run for in in_progress before it is /// considered failed. #[serde(default, skip_serializing_if = "Option::is_none")] max_runtime: Option, @@ -105,6 +105,14 @@ pub struct MonitorConfig { /// tz database style timezone string #[serde(default, skip_serializing_if = "Option::is_none")] timezone: Option, + + /// How many consecutive failed check-ins it takes to create an issue + #[serde(default, skip_serializing_if = "Option::is_none")] + failure_issue_threshold: Option, + + /// How many consecutive OK check-ins it takes to resolve an issue + #[serde(default, skip_serializing_if = "Option::is_none")] + recovery_threshold: Option, } /// The trace context sent with a check-in. @@ -289,7 +297,9 @@ mod tests { }, "checkin_margin": 5, "max_runtime": 10, - "timezone": "America/Los_Angles" + "timezone": "America/Los_Angles", + "failure_issue_threshold": 3, + "recovery_threshold": 1 } }"#; @@ -312,7 +322,9 @@ mod tests { }, "checkin_margin": 5, "max_runtime": 10, - "timezone": "America/Los_Angles" + "timezone": "America/Los_Angles", + "failure_issue_threshold": 3, + "recovery_threshold": 1 } }"#; From cc1e4611f06e907fb7704b775bc9ed53124b2c1c Mon Sep 17 00:00:00 2001 From: Richard Ortenberg Date: Tue, 12 Dec 2023 14:00:00 -0800 Subject: [PATCH 2/5] added changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67e32cae457..d23e7d0099f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Allow to ingest measurements on a span. ([#2792](https://github.com/getsentry/relay/pull/2792)) - Extract size metrics for all resource spans when permitted. ([#2805](https://github.com/getsentry/relay/pull/2805)) - Allow access to more fields in dynamic sampling and metric extraction. ([#2820](https://github.com/getsentry/relay/pull/2820)) +- Support issue thresholds for Cron Monitor configurations ([#2842](https://github.com/getsentry/relay/pull/2842)) **Bug Fixes**: From d3bd3e639acdee81699b3ac88a4ddff48b8a770f Mon Sep 17 00:00:00 2001 From: Richard Ortenberg Date: Tue, 12 Dec 2023 14:01:41 -0800 Subject: [PATCH 3/5] Update relay-monitors/src/lib.rs Co-authored-by: Joris Bayer --- relay-monitors/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay-monitors/src/lib.rs b/relay-monitors/src/lib.rs index 6f96f3b52de..908b028e436 100644 --- a/relay-monitors/src/lib.rs +++ b/relay-monitors/src/lib.rs @@ -110,7 +110,7 @@ pub struct MonitorConfig { #[serde(default, skip_serializing_if = "Option::is_none")] failure_issue_threshold: Option, - /// How many consecutive OK check-ins it takes to resolve an issue + /// How many consecutive OK check-ins it takes to resolve an issue. #[serde(default, skip_serializing_if = "Option::is_none")] recovery_threshold: Option, } From 5b7f78a8a2729487e1bb1196f0f4b0b13e5e4c6f Mon Sep 17 00:00:00 2001 From: Richard Ortenberg Date: Tue, 12 Dec 2023 14:01:51 -0800 Subject: [PATCH 4/5] Update relay-monitors/src/lib.rs Co-authored-by: Oleksandr <1931331+olksdr@users.noreply.github.com> --- relay-monitors/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay-monitors/src/lib.rs b/relay-monitors/src/lib.rs index 908b028e436..cab63bd9e59 100644 --- a/relay-monitors/src/lib.rs +++ b/relay-monitors/src/lib.rs @@ -97,7 +97,7 @@ pub struct MonitorConfig { #[serde(default, skip_serializing_if = "Option::is_none")] checkin_margin: Option, - /// How long (in minutes) is the checkin allowed to run for in in_progress before it is + /// How long (in minutes) is the check-in allowed to run for in in_progress before it is /// considered failed. #[serde(default, skip_serializing_if = "Option::is_none")] max_runtime: Option, From ecc8196f05b503f7a805cc161179df12504e971c Mon Sep 17 00:00:00 2001 From: Richard Ortenberg Date: Tue, 12 Dec 2023 14:01:57 -0800 Subject: [PATCH 5/5] Update relay-monitors/src/lib.rs Co-authored-by: Joris Bayer --- relay-monitors/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay-monitors/src/lib.rs b/relay-monitors/src/lib.rs index cab63bd9e59..e463ca56566 100644 --- a/relay-monitors/src/lib.rs +++ b/relay-monitors/src/lib.rs @@ -106,7 +106,7 @@ pub struct MonitorConfig { #[serde(default, skip_serializing_if = "Option::is_none")] timezone: Option, - /// How many consecutive failed check-ins it takes to create an issue + /// How many consecutive failed check-ins it takes to create an issue. #[serde(default, skip_serializing_if = "Option::is_none")] failure_issue_threshold: Option,