terraform-provider-signalform

Detector

A detector is a collection of rules that define who should be notified when certain detect functions within SignalFlow fire alerts. Each rule maps a detect label to a severity and a list of notifications. When the conditions within the given detect function are fulfilled, notifications will be sent to the destinations defined in the rule for that detect function.

Detector

Example Usage

resource "signalform_detector" "application_delay" {
    provider = "signalform"
    count = "${length(var.clusters)}"
    name = " max average delay - ${var.clusters[count.index]}"
    description = "your application is slow - ${var.clusters[count.index]}"
    max_delay = 30
    program_text = <<-EOF
        signal = data('app.delay', filter('cluster','${var.clusters[count.index]}'), extrapolation='last_value', maxExtrapolations=5).max()
        detect(when(signal > 60, '5m')).publish('Processing old messages 5m')
        detect(when(signal > 60, '30m')).publish('Processing old messages 30m')
    EOF
 rule {
        description = "maximum > 60 for 5m"
        severity = "Warning"
        detect_label = "Processing old messages 5m"
        notifications = ["Email,foo-alerts@bar.com"]
    }
    rule {
        description = "maximum > 60 for 30m"
        severity = "Critical"
        detect_label = "Processing old messages 30m"
        notifications = ["Email,foo-alerts@bar.com"]
    }
}

provider "signalform" {}

variable "clusters" {
    default = ["clusterA", "clusterB"]
}

Argument Reference

Notes

It is highly recommended that you use both max_delay in your detector configuration and an extrapolation policy in your program text to reduce false positives/negatives.

max_delay allows SignalFx to continue with computation if there is a lag in receiving data points.

extrapolation allows you to specify how to handle missing data. An extrapolation policy can be added to individual signals by updating the data block in your program_text.

See https://signalfx-product-docs.readthedocs-hosted.com/en/latest/charts/chart-builder.html#delayed-datapoints for more info.