Skip to content

Commit

Permalink
fix - [BUG] Splunk changed Gigibyte to Gibibyte #474
Browse files Browse the repository at this point in the history
  • Loading branch information
haedri committed Jul 3, 2023
1 parent 16943f0 commit b14481b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion modules/integration_aws-efs/conf/01-used-space.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module: "AWS EFS"
name: "Used Space"
filtering: "filter('namespace', 'AWS/EFS')"
value_unit: "Gigibyte"
value_unit: "Gibibyte"
transformation: ".max(over='15m')"
signals:
used_space:
Expand Down
6 changes: 3 additions & 3 deletions modules/integration_aws-efs/detectors-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "signalfx_detector" "used_space" {

viz_options {
label = "signal"
value_unit = "Gigibyte"
value_unit = "Gibibyte"
}

program_text = <<-EOF
Expand All @@ -19,7 +19,7 @@ resource "signalfx_detector" "used_space" {
EOF

rule {
description = "is too high > ${var.used_space_threshold_critical}Gigibyte"
description = "is too high > ${var.used_space_threshold_critical}Gibibyte"
severity = "Critical"
detect_label = "CRIT"
disabled = coalesce(var.used_space_disabled_critical, var.used_space_disabled, var.detectors_disabled)
Expand All @@ -31,7 +31,7 @@ EOF
}

rule {
description = "is too high > ${var.used_space_threshold_major}Gigibyte"
description = "is too high > ${var.used_space_threshold_major}Gibibyte"
severity = "Major"
detect_label = "MAJOR"
disabled = coalesce(var.used_space_disabled_major, var.used_space_disabled, var.detectors_disabled)
Expand Down
4 changes: 2 additions & 2 deletions modules/integration_aws-efs/variables-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ variable "used_space_disabled_major" {
}

variable "used_space_threshold_critical" {
description = "Critical threshold for used_space detector in Gigibyte"
description = "Critical threshold for used_space detector in Gibibyte"
type = number
}

Expand All @@ -71,7 +71,7 @@ variable "used_space_at_least_percentage_critical" {
default = 1
}
variable "used_space_threshold_major" {
description = "Major threshold for used_space detector in Gigibyte"
description = "Major threshold for used_space detector in Gibibyte"
type = number
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ resource "signalfx_detector" "free_space" {

viz_options {
label = "signal"
value_unit = "Gigibyte"
value_unit = "Gibibyte"
}

program_text = <<-EOF
Expand Down Expand Up @@ -121,7 +121,7 @@ resource "signalfx_detector" "ultrawarm_free_space" {

viz_options {
label = "signal"
value_unit = "Gigibyte"
value_unit = "Gibibyte"
}

program_text = <<-EOF
Expand Down
4 changes: 2 additions & 2 deletions modules/integration_aws-rds-common/detectors-rds-common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ resource "signalfx_detector" "free_space_low" {

viz_options {
label = "signal"
value_unit = "Gigibyte"
value_unit = "Gibibyte"
}

program_text = <<-EOF
free = data('FreeStorageSpace', filter=filter('namespace', 'AWS/RDS') and filter('stat', 'mean') and filter('DBInstanceIdentifier', '*') and ${module.filtering.signalflow})${var.free_space_low_aggregation_function}${var.free_space_low_transformation_function}
signal = free.scale(1/1024**3).publish('signal') # Bytes to Gigibytes
signal = free.scale(1/1024**3).publish('signal') # Bytes to Gibibytes
detect(when(signal < ${var.free_space_low_threshold_critical})).publish('CRIT')
detect(when(signal < ${var.free_space_low_threshold_major}) and (not when(signal < ${var.free_space_low_threshold_critical}))).publish('MAJOR')
EOF
Expand Down
5 changes: 5 additions & 0 deletions modules/smart-agent_system-common/detectors-system.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ resource "signalfx_detector" "disk_running_out" {
countdown.hours_left_stream_incr_detector(stream=signal, maximum_capacity=${var.disk_running_out_maximum_capacity}, lower_threshold=${var.disk_running_out_hours_till_full}, fire_lasting=lasting('${var.disk_running_out_fire_lasting_time}', ${var.disk_running_out_fire_lasting_time_percent}), clear_threshold=${var.disk_running_out_clear_hours_remaining}, clear_lasting=lasting('${var.disk_running_out_clear_lasting_time}', ${var.disk_running_out_clear_lasting_time_percent}), use_double_ewma=${var.disk_running_out_use_ewma}).publish('MAJOR')
EOF

viz_options {
label = "signal"
value_unit = "Gibibyte"
}

rule {
description = "in ${var.disk_running_out_hours_till_full}"
severity = "Major"
Expand Down
2 changes: 1 addition & 1 deletion scripts/templates/detector.tf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "signalfx_detector" "{{ id }}" {
{%- if value_unit is defined %}

viz_options {
{%- if value_unit in ['Bit', 'Kilobit', 'Megabit', 'Gigabit', 'Terabit', 'Petabit', 'Exabit', 'Zettabit', 'Yottabit', 'Byte', 'Kibibyte','Mebibyte', 'Gigibyte', 'Tebibyte', 'Pebibyte', 'Exbibyte', 'Zebibyte', 'Yobibyte', 'Nanosecond', 'Microsecond', 'Millisecond', 'Second','Minute', 'Hour', 'Day', 'Week'] %}
{%- if value_unit in ['Bit', 'Kilobit', 'Megabit', 'Gigabit', 'Terabit', 'Petabit', 'Exabit', 'Zettabit', 'Yottabit', 'Byte', 'Kibibyte','Mebibyte', 'Gibibyte', 'Tebibyte', 'Pebibyte', 'Exbibyte', 'Zebibyte', 'Yobibyte', 'Nanosecond', 'Microsecond', 'Millisecond', 'Second','Minute', 'Hour', 'Day', 'Week'] %}
label = "{{ key }}"
value_unit = "{{ value_unit }}"
{%- else %}
Expand Down

0 comments on commit b14481b

Please sign in to comment.