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

use right signalfx unit when available #350

Merged
merged 1 commit into from
Nov 17, 2021
Merged
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
2 changes: 1 addition & 1 deletion modules/integration_aws-alb/conf/01-latency.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ id: latency
transformation: true
aggregation: true
filtering: "filter('namespace', 'AWS/ApplicationELB')"
value_unit: "s"
value_unit: "Second"

signals:
signal:
Expand Down
8 changes: 4 additions & 4 deletions modules/integration_aws-alb/detectors-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ resource "signalfx_detector" "latency" {
tags = compact(concat(local.common_tags, local.tags, var.extra_tags))

viz_options {
label = "signal"
value_suffix = "s"
label = "signal"
value_unit = "Second"
}

program_text = <<-EOF
Expand All @@ -47,7 +47,7 @@ resource "signalfx_detector" "latency" {
EOF

rule {
description = "is too high > ${var.latency_threshold_critical}s"
description = "is too high > ${var.latency_threshold_critical}Second"
severity = "Critical"
detect_label = "CRIT"
disabled = coalesce(var.latency_disabled_critical, var.latency_disabled, var.detectors_disabled)
Expand All @@ -59,7 +59,7 @@ EOF
}

rule {
description = "is too high > ${var.latency_threshold_major}s"
description = "is too high > ${var.latency_threshold_major}Second"
severity = "Major"
detect_label = "MAJOR"
disabled = coalesce(var.latency_disabled_major, var.latency_disabled, var.detectors_disabled)
Expand Down
4 changes: 2 additions & 2 deletions modules/integration_aws-alb/variables-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ variable "latency_disabled_major" {
}

variable "latency_threshold_critical" {
description = "Critical threshold for latency detector in s"
description = "Critical threshold for latency detector in Second"
type = number
default = 1
}
Expand All @@ -104,7 +104,7 @@ variable "latency_at_least_percentage_critical" {
default = 0.9
}
variable "latency_threshold_major" {
description = "Major threshold for latency detector in s"
description = "Major threshold for latency detector in Second"
type = number
default = 3
}
Expand Down
2 changes: 1 addition & 1 deletion modules/integration_aws-apigateway/conf/01-latency.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: latency
transformation: true
aggregation: true
filtering: "filter('namespace', 'AWS/ApiGateway') and filter('stat', 'mean') and (not filter('Stage', '*')) and (not filter('Method', '*')) and (not filter('Resource', '*'))"
value_unit: "ms"
value_unit: "Millisecond"

signals:
signal:
Expand Down
8 changes: 4 additions & 4 deletions modules/integration_aws-apigateway/detectors-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ resource "signalfx_detector" "latency" {
tags = compact(concat(local.common_tags, local.tags, var.extra_tags))

viz_options {
label = "signal"
value_suffix = "ms"
label = "signal"
value_unit = "Millisecond"
}

program_text = <<-EOF
Expand All @@ -18,7 +18,7 @@ resource "signalfx_detector" "latency" {
EOF

rule {
description = "is too high > ${var.latency_threshold_critical}ms"
description = "is too high > ${var.latency_threshold_critical}Millisecond"
severity = "Critical"
detect_label = "CRIT"
disabled = coalesce(var.latency_disabled_critical, var.latency_disabled, var.detectors_disabled)
Expand All @@ -30,7 +30,7 @@ EOF
}

rule {
description = "is too high > ${var.latency_threshold_major}ms"
description = "is too high > ${var.latency_threshold_major}Millisecond"
severity = "Major"
detect_label = "MAJOR"
disabled = coalesce(var.latency_disabled_major, var.latency_disabled, var.detectors_disabled)
Expand Down
4 changes: 2 additions & 2 deletions modules/integration_aws-apigateway/variables-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ variable "latency_disabled_major" {
}

variable "latency_threshold_critical" {
description = "Critical threshold for latency detector in ms"
description = "Critical threshold for latency detector in Millisecond"
type = number
default = 1000
}
Expand All @@ -66,7 +66,7 @@ variable "latency_at_least_percentage_critical" {
default = 0.9
}
variable "latency_threshold_major" {
description = "Major threshold for latency detector in ms"
description = "Major threshold for latency detector in Millisecond"
type = number
default = 3000
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: replication lag
transformation: true
aggregation: true
filtering: "filter('namespace', 'AWS/ElastiCache') and filter('stat', 'upper') and filter('CacheNodeId', '*')"
value_unit: s
value_unit: "Second"

signals:
signal:
Expand Down
8 changes: 4 additions & 4 deletions modules/integration_aws-elasticache-redis/detectors-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ resource "signalfx_detector" "replication_lag" {
tags = compact(concat(local.common_tags, local.tags, var.extra_tags))

viz_options {
label = "signal"
value_suffix = "s"
label = "signal"
value_unit = "Second"
}

program_text = <<-EOF
Expand All @@ -108,7 +108,7 @@ resource "signalfx_detector" "replication_lag" {
EOF

rule {
description = "is too high > ${var.replication_lag_threshold_critical}s"
description = "is too high > ${var.replication_lag_threshold_critical}Second"
severity = "Critical"
detect_label = "CRIT"
disabled = coalesce(var.replication_lag_disabled_critical, var.replication_lag_disabled, var.detectors_disabled)
Expand All @@ -120,7 +120,7 @@ EOF
}

rule {
description = "is too high > ${var.replication_lag_threshold_major}s"
description = "is too high > ${var.replication_lag_threshold_major}Second"
severity = "Major"
detect_label = "MAJOR"
disabled = coalesce(var.replication_lag_disabled_major, var.replication_lag_disabled, var.detectors_disabled)
Expand Down
4 changes: 2 additions & 2 deletions modules/integration_aws-elasticache-redis/variables-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ variable "replication_lag_disabled_major" {
}

variable "replication_lag_threshold_critical" {
description = "Critical threshold for replication_lag detector in s"
description = "Critical threshold for replication_lag detector in Second"
type = number
default = 180
}
Expand All @@ -234,7 +234,7 @@ variable "replication_lag_at_least_percentage_critical" {
default = 1
}
variable "replication_lag_threshold_major" {
description = "Major threshold for replication_lag detector in s"
description = "Major threshold for replication_lag detector in Second"
type = number
default = 90
}
Expand Down
2 changes: 1 addition & 1 deletion modules/integration_aws-elb/conf/01-latency.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: backend latency
transformation: true
aggregation: true
filtering: "filter('namespace', 'AWS/ApplicationELB')"
value_unit: "s"
value_unit: "Second"

signals:
signal:
Expand Down
8 changes: 4 additions & 4 deletions modules/integration_aws-elb/detectors-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ resource "signalfx_detector" "backend_latency" {
tags = compact(concat(local.common_tags, local.tags, var.extra_tags))

viz_options {
label = "signal"
value_suffix = "s"
label = "signal"
value_unit = "Second"
}

program_text = <<-EOF
Expand All @@ -47,7 +47,7 @@ resource "signalfx_detector" "backend_latency" {
EOF

rule {
description = "is too high > ${var.backend_latency_threshold_critical}s"
description = "is too high > ${var.backend_latency_threshold_critical}Second"
severity = "Critical"
detect_label = "CRIT"
disabled = coalesce(var.backend_latency_disabled_critical, var.backend_latency_disabled, var.detectors_disabled)
Expand All @@ -59,7 +59,7 @@ EOF
}

rule {
description = "is too high > ${var.backend_latency_threshold_major}s"
description = "is too high > ${var.backend_latency_threshold_major}Second"
severity = "Major"
detect_label = "MAJOR"
disabled = coalesce(var.backend_latency_disabled_major, var.backend_latency_disabled, var.detectors_disabled)
Expand Down
4 changes: 2 additions & 2 deletions modules/integration_aws-elb/variables-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ variable "backend_latency_disabled_major" {
}

variable "backend_latency_threshold_critical" {
description = "Critical threshold for backend_latency detector in s"
description = "Critical threshold for backend_latency detector in Second"
type = number
default = 1
}
Expand All @@ -104,7 +104,7 @@ variable "backend_latency_at_least_percentage_critical" {
default = 0.9
}
variable "backend_latency_threshold_major" {
description = "Major threshold for backend_latency detector in s"
description = "Major threshold for backend_latency detector in Second"
type = number
default = 3
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ module: "Azure DataFactory"
name: "Available Memory"
filtering: "filter('resource_type', 'Microsoft.DataFactory/factories') and filter('primary_aggregation_type', 'true')"
aggregation: ".sum(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"
value_unit: "MB"
value_unit: "Mebibyte"
transformation: ".min(over='15m')"
signals:
memory:
metric: "IntegrationRuntimeAvailableMemory"
signal:
formula:
memory.scale(0.000000953674316) # Scale to MB unit
memory.scale(1/1024**2) # Scale to MiB unit
rules:
critical:
threshold: 256
comparator: "<"
major:
threshold: 512
comparator: "<"
dependency: critical
dependency: critical
10 changes: 5 additions & 5 deletions modules/integration_azure-datafactory/detectors-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,20 @@ resource "signalfx_detector" "available_memory" {
tags = compact(concat(local.common_tags, local.tags, var.extra_tags))

viz_options {
label = "signal"
value_suffix = "MB"
label = "signal"
value_unit = "Mebibyte"
}

program_text = <<-EOF
base_filtering = filter('resource_type', 'Microsoft.DataFactory/factories') and filter('primary_aggregation_type', 'true')
memory = data('IntegrationRuntimeAvailableMemory', filter=base_filtering and ${module.filtering.signalflow})${var.available_memory_aggregation_function}${var.available_memory_transformation_function}
signal = memory.scale(0.000000953674316).publish('signal')
signal = memory.scale(1/1024**2).publish('signal')
detect(when(signal < ${var.available_memory_threshold_critical}, lasting=%{if var.available_memory_lasting_duration_critical == null}None%{else}'${var.available_memory_lasting_duration_critical}'%{endif}, at_least=${var.available_memory_at_least_percentage_critical})).publish('CRIT')
detect(when(signal < ${var.available_memory_threshold_major}, lasting=%{if var.available_memory_lasting_duration_major == null}None%{else}'${var.available_memory_lasting_duration_major}'%{endif}, at_least=${var.available_memory_at_least_percentage_major}) and (not when(signal < ${var.available_memory_threshold_critical}, lasting=%{if var.available_memory_lasting_duration_critical == null}None%{else}'${var.available_memory_lasting_duration_critical}'%{endif}, at_least=${var.available_memory_at_least_percentage_critical}))).publish('MAJOR')
EOF

rule {
description = "is too low < ${var.available_memory_threshold_critical}MB"
description = "is too low < ${var.available_memory_threshold_critical}Mebibyte"
severity = "Critical"
detect_label = "CRIT"
disabled = coalesce(var.available_memory_disabled_critical, var.available_memory_disabled, var.detectors_disabled)
Expand All @@ -164,7 +164,7 @@ EOF
}

rule {
description = "is too low < ${var.available_memory_threshold_major}MB"
description = "is too low < ${var.available_memory_threshold_major}Mebibyte"
severity = "Major"
detect_label = "MAJOR"
disabled = coalesce(var.available_memory_disabled_major, var.available_memory_disabled, var.detectors_disabled)
Expand Down
4 changes: 2 additions & 2 deletions modules/integration_azure-datafactory/variables-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ variable "available_memory_disabled_major" {
}

variable "available_memory_threshold_critical" {
description = "Critical threshold for available_memory detector in MB"
description = "Critical threshold for available_memory detector in Mebibyte"
type = number
default = 256
}
Expand All @@ -318,7 +318,7 @@ variable "available_memory_at_least_percentage_critical" {
default = 1
}
variable "available_memory_threshold_major" {
description = "Major threshold for available_memory detector in MB"
description = "Major threshold for available_memory detector in Mebibyte"
type = number
default = 512
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ filtering: "filter('resource_type', 'Microsoft.Storage/storageAccounts') and fil
aggregation: ".sum(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"
transformation: ".min(over='15m')"
disabled: true
value_unit: "s"
value_unit: "Second"
signals:
latency:
metric: "SuccessE2ELatency"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ resource "signalfx_detector" "latency_e2e" {
tags = compact(concat(local.common_tags, local.tags, var.extra_tags))

viz_options {
label = "signal"
value_suffix = "s"
label = "signal"
value_unit = "Second"
}

program_text = <<-EOF
Expand All @@ -65,7 +65,7 @@ resource "signalfx_detector" "latency_e2e" {
EOF

rule {
description = "is too high > ${var.latency_e2e_threshold_critical}s"
description = "is too high > ${var.latency_e2e_threshold_critical}Second"
severity = "Critical"
detect_label = "CRIT"
disabled = coalesce(var.latency_e2e_disabled_critical, var.latency_e2e_disabled, var.detectors_disabled)
Expand All @@ -77,7 +77,7 @@ EOF
}

rule {
description = "is too high > ${var.latency_e2e_threshold_major}s"
description = "is too high > ${var.latency_e2e_threshold_major}Second"
severity = "Major"
detect_label = "MAJOR"
disabled = coalesce(var.latency_e2e_disabled_major, var.latency_e2e_disabled, var.detectors_disabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ variable "latency_e2e_disabled_major" {
}

variable "latency_e2e_threshold_critical" {
description = "Critical threshold for latency_e2e detector in s"
description = "Critical threshold for latency_e2e detector in Second"
type = number
default = 20
}
Expand All @@ -150,7 +150,7 @@ variable "latency_e2e_at_least_percentage_critical" {
default = 1
}
variable "latency_e2e_threshold_major" {
description = "Major threshold for latency_e2e detector in s"
description = "Major threshold for latency_e2e detector in Second"
type = number
default = 10
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: "capacity"
filtering: "filter('resource_type', 'Microsoft.Storage/storageAccounts') and filter('primary_aggregation_type', 'true')"
aggregation: ".fill(None, duration='1d').sum(by=['azure_resource_name', 'azure_resource_group_name', 'azure_region'])"
transformation: ".min(over='1d')"
value_unit: PiB
value_unit: "Pebibyte"
signals:
capacity:
metric: "UsedCapacity"
signal:
formula:
capacity.scale(0.0000000000000008881784197001252) # Scale to PiB unit
capacity.scale(1/1024**5) # Scale to PiB unit
rules:
critical:
threshold: 4.8
Expand Down
Loading