Skip to content

Commit

Permalink
Merge pull request #5 from weglot/4-migrate-monitors-from-locked-to-r…
Browse files Browse the repository at this point in the history
…estricted-roles

[1.1.0] Migrate monitors from locked to restricted roles
  • Loading branch information
mlebee authored Jul 3, 2024
2 parents 9995fe1 + fb98259 commit e342878
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 20 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,16 @@ avg(last_30m):sum:nginx.net.request_per_s{tag:xxx} >

## Module Variables

| variable | default | required | description |
|----------------------|----------|----------|--------------|
| filter_str | | Yes | |
| env | | Yes | |
| service | | Yes | |
| service_display_name | None | No | |
| notification_channel | | Yes | |
| additional_tags | [] | No | |
| name_prefix | "" | No | |
| name_suffix | "" | No | |
| variable | default | required | description |
|----------------------|----------|----------|-----------------------------------------------------------------------------------------|
| filter_str | | Yes | |
| env | | Yes | |
| service | | Yes | |
| service_display_name | None | No | |
| notification_channel | | Yes | |
| additional_tags | [] | No | |
| name_prefix | "" | No | |
| name_suffix | "" | No | |
| restricted_roles | [] | No | A list of unique role identifiers to define which roles are allowed to edit the monitor |


5 changes: 3 additions & 2 deletions connection-active.tf.ignored
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ locals {
}

module "connection-active" {
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"
source = "weglot/generic-monitor/datadog"
version = "1.1.0"

name = "Nginx - Connection active"
query = "avg(${var.connection_active_evaluation_period}):sum:nginx.net.connections{${local.connection_active_filter}} by {service} > ${var.connection_active_critical}"
Expand All @@ -22,6 +22,7 @@ module "connection-active" {
additional_tags = var.additional_tags
name_prefix = var.name_prefix
name_suffix = var.name_suffix
restricted_roles = var.restricted_roles

# monitor level vars
enabled = var.connection_active_enabled
Expand Down
5 changes: 3 additions & 2 deletions connection-dropped.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ locals {
}

module "connection-dropped" {
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"
source = "weglot/generic-monitor/datadog"
version = "1.1.0"

name = "Nginx - Connection dropped"
query = "avg(${var.connection_dropped_evaluation_period}):max:nginx.net.conn_dropped_per_s{${local.connection_dropped_filter}} by {service} > ${var.connection_dropped_critical}"
Expand All @@ -22,6 +22,7 @@ module "connection-dropped" {
additional_tags = var.additional_tags
name_prefix = var.name_prefix
name_suffix = var.name_suffix
restricted_roles = var.restricted_roles

# monitor level vars
enabled = var.connection_dropped_enabled
Expand Down
5 changes: 3 additions & 2 deletions requests-rate.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ locals {
}

module "requests-rate" {
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"
source = "weglot/generic-monitor/datadog"
version = "1.1.0"

name = "Nginx - Requests performed"
query = "avg(${var.requests_rate_evaluation_period}):sum:nginx.net.request_per_s{${local.requests_rate_filter}} > ${var.requests_rate_critical}"
Expand All @@ -23,6 +23,7 @@ module "requests-rate" {
additional_tags = var.additional_tags
name_prefix = var.name_prefix
name_suffix = var.name_suffix
restricted_roles = var.restricted_roles

# monitor level vars
enabled = var.requests_rate_enabled
Expand Down
5 changes: 3 additions & 2 deletions status-check.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "status-check" {
source = "kabisa/service-check-monitor/datadog"
version = "2.0.0"
source = "weglot/service-check-monitor/datadog"
version = "2.1.0"

name = "Nginx - Status check"
metric_name = "nginx.can_connect"
Expand All @@ -23,6 +23,7 @@ module "status-check" {
additional_tags = var.additional_tags
name_prefix = var.name_prefix
name_suffix = var.name_suffix
restricted_roles = var.restricted_roles

# monitor level vars
enabled = var.status_check_enabled
Expand Down
4 changes: 2 additions & 2 deletions terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ terraform {
required_providers {
datadog = {
source = "DataDog/datadog"
version = "~> 3.32"
version = "~> 3.39"
}
}

required_version = ">= 1.4.0"
required_version = ">= 1.7.0"

}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ variable "name_suffix" {
type = string
default = ""
}

variable "restricted_roles" {
description = "A list of unique role identifiers to define which roles are allowed to edit the monitor"
type = list(string)
default = []
}

0 comments on commit e342878

Please sign in to comment.