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

Hard to compare changes in an alert condition #29

Open
sandnabba opened this issue Dec 11, 2019 · 2 comments
Open

Hard to compare changes in an alert condition #29

sandnabba opened this issue Dec 11, 2019 · 2 comments

Comments

@sandnabba
Copy link

If something has changed in an alert condition, either in Terraform or if someone has altered the alert in the web interface, the output of a plan will look like this:

Terraform will perform the following actions:

  ~ module.staging-goalert-processingEvent.appoptics_alert.sqs_age_of_oldest_message
      condition.1259187324.detect_reset:     "false" => "false"
      condition.1259187324.duration:         "60" => "0"
      condition.1259187324.metric_name:      "AWS.SQS.ApproximateAgeOfOldestMessage" => ""
      condition.1259187324.summary_function: "average" => ""
      condition.1259187324.tag.#:            "2" => "0"
      condition.1259187324.tag.0.grouped:    "true" => "false"
      condition.1259187324.tag.0.name:       "queuename" => ""
      condition.1259187324.tag.0.values.#:   "1" => "0"
      condition.1259187324.tag.0.values.0:   "*tm-loggly-alerts-sqs*" => ""
      condition.1259187324.tag.1.grouped:    "true" => "false"
      condition.1259187324.tag.1.name:       "awsaccount" => ""
      condition.1259187324.tag.1.values.#:   "1" => "0"
      condition.1259187324.tag.1.values.0:   "tm-prod" => ""
      condition.1259187324.threshold:        "1" => "0"
      condition.1259187324.type:             "above" => ""
      condition.230406147.detect_reset:      "" => ""
      condition.230406147.duration:          "" => "60"
      condition.230406147.metric_name:       "" => "AWS.SQS.ApproximateAgeOfOldestMessage"
      condition.230406147.summary_function:  "" => "sum"
      condition.230406147.tag.#:             "0" => "2"
      condition.230406147.tag.0.grouped:     "" => "true"
      condition.230406147.tag.0.name:        "" => "queuename"
      condition.230406147.tag.0.values.#:    "0" => "1"
      condition.230406147.tag.0.values.0:    "" => "*tm-loggly-alerts-sqs*"
      condition.230406147.tag.1.grouped:     "" => "true"
      condition.230406147.tag.1.name:        "" => "awsaccount"
      condition.230406147.tag.1.values.#:    "0" => "1"
      condition.230406147.tag.1.values.0:    "" => "tm-prod"
      condition.230406147.threshold:         "" => "1"
      condition.230406147.type:              "" => "above"


Plan: 0 to add, 1 to change, 0 to destroy.

By just having a quick look at this output, it's very hard to tell which settings that have changed. (It's the summary_function).
The problem here is that the condition have got a new id, which is causing this behavior.

The strange thing however is that if I then change the summary_function in the GUI, Terraform will detect that change:

emil@DvorakWork: ~/git/ops/sre-metrocard/estate/threatmonitor/terraform-templates/appoptics $> terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

appoptics_alert.sqs_age_of_oldest_message: Refreshing state... (ID: 61327598)
appoptics_alert.sqs_incorrect_format: Refreshing state... (ID: 61161139)

------------------------------------------------------------------------

No changes. Infrastructure is up-to-date.

So I guess it would be possible to get a nicer output from a plan.

Expected result

Terraform will perform the following actions:

  ~ module.staging-goalert-processingEvent.appoptics_alert.sqs_age_of_oldest_message
      condition.1259187324.summary_function: "average" => "sum"

Plan: 0 to add, 1 to change, 0 to destroy.
@solarchad
Copy link
Contributor

Thanks for the details. Let me follow up with the AO team to see if conditions can be modified in place or if doing so creates a whole new condition object within the alert.

@solarchad
Copy link
Contributor

@petercable do you know off-hand if we change an attribute in an alert condition, if we have to create a whole new condition or are we able to modify the existing condition? In other words, will changing a condition create a new condition ID?

@trevrosen trevrosen added bug Something isn't working and removed bug Something isn't working labels Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants