Skip to content

Commit

Permalink
feat(crons): Add mark_unknown clock task (#340)
Browse files Browse the repository at this point in the history
This task will be triggered when we detect an anomaly in check-in
volume during a clock tick. When this happens we are unable to know that
all check-ins before that tick have been received and will need to mark
all in-progress monitors as resulting in a 'unknown' state.

Part of getsentry/sentry#79328
  • Loading branch information
evanpurkhiser authored Oct 25, 2024
1 parent a025a99 commit 3ff937b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/monitors-clock-tasks/1/mark_unknown.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "mark_unknown",
"ts": 1714072962,
"monitor_environment_id": 1,
"checkin_id": 1
}
28 changes: 28 additions & 0 deletions schemas/monitors-clock-tasks.v1.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
{
"$ref": "#/definitions/MonitorsMarkTimeout"
},
{
"$ref": "#/definitions/MonitorsMarkUnknown"
},
{
"$ref": "#/definitions/MonitorsMarkMissing"
}
Expand Down Expand Up @@ -35,6 +38,31 @@
},
"required": ["type", "ts", "monitor_environment_id", "checkin_id"]
},
"MonitorsMarkUnknown": {
"type": "object",
"title": "mark_unknown",
"description": "Indicates this monitor was in-progress when an anomolys click-tick was processed, meaning we are unable to know if a check-in may have been lost for this monitor.",
"additionalProperties": false,
"properties": {
"type": {
"description": "Discriminant marker identifying the task.",
"enum": ["mark_unknown"]
},
"ts": {
"description": "The timestamp the clock ticked at.",
"type": "number"
},
"monitor_environment_id": {
"description": "The monitor environment ID to generate a missed check-in for.",
"type": "number"
},
"checkin_id": {
"description": "The check-in ID to mark as unknown.",
"type": "number"
}
},
"required": ["type", "ts", "monitor_environment_id", "checkin_id"]
},
"MonitorsMarkMissing": {
"type": "object",
"title": "mark_missing",
Expand Down

0 comments on commit 3ff937b

Please sign in to comment.