Skip to content

Commit

Permalink
RW-8474 Create an alert policy when the number of gsuite users exceed…
Browse files Browse the repository at this point in the history
… a certain threshold (#52)
  • Loading branch information
tarekmamdouh authored Jan 29, 2024
1 parent 52f9fbe commit ed5ac8f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"combiner": "OR",
"conditions": [
{
"displayName": "GSuite User Count",
"conditionThreshold": {
"filter": "resource.type = \"generic_node\" AND metric.type = \"custom.googleapis.com/gsuite_user_count\"",
"aggregations": [
{
"alignmentPeriod": "300s",
"crossSeriesReducer": "REDUCE_NONE",
"perSeriesAligner": "ALIGN_MEAN"
}
],
"comparison": "COMPARISON_GT",
"duration": "0s",
"trigger": {
"count": 1
},
"thresholdValue": "${alert_thresholds.gsuite_users_count}"
}
}
],
"displayName": "Number of users in GSuite",
"documentation": {
"content": "When the number of gsuite users exceeds ${alert_thresholds.gsuite_users_count}, this is a sign that we need to address the issue of having more licences. The number of licences is currently set to 100k in prod, however we'll need to increase it when this alert is fired. Related jira ticket is RW-8474",
"mimeType": "text/markdown",
"subject": "Number of Gsuite users exceeded ${alert_thresholds.gsuite_users_count}"
},
"alertStrategy": {
"autoClose": "604800s"
},
"enabled": true,
"notificationChannels": [
"projects/${project_id}/notificationChannels/${notification_channel_id}"
],
"severity": "CRITICAL"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ variable alert_thresholds {
min_buffer_projects_registered = number
min_buffer_projects_controlled = number
max_buffer_errors_per_minute = number
gsuite_users_count = number
})
}
1 change: 1 addition & 0 deletions modules/workbench/modules/monitoring/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ variable alert_thresholds {
min_buffer_projects_registered = number
min_buffer_projects_controlled = number
max_buffer_errors_per_minute = number
gsuite_users_count = number
})
}
1 change: 1 addition & 0 deletions modules/workbench/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ variable alert_thresholds {
min_buffer_projects_registered = number
min_buffer_projects_controlled = number
max_buffer_errors_per_minute = number
gsuite_users_count = number
})
}

Expand Down

0 comments on commit ed5ac8f

Please sign in to comment.