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

Add support for 'unknown' monitor threshold field #45

Merged
merged 5 commits into from
Jul 9, 2018
Merged

Add support for 'unknown' monitor threshold field #45

merged 5 commits into from
Jul 9, 2018

Conversation

visciang
Copy link
Contributor

@visciang visciang commented Jan 17, 2018

This PR adds support for Datadog monitor threshold unknown field.

IE:

resource "datadog_monitor" "xxx" {
    name = "XXX"
    type = "service check"
    message = "{{check_message}}. ${var.notify-to}"
    query = "..."
    no_data_timeframe = "..."
    notify_no_data = true

    thresholds {
        unknown = 2
        critical = 2
        warning = 1
        ok = 1
    }

    tags = ["..."]
}

The support for this field has been added in zorkian/go-datadog-api v2.8 (ref: zorkian/go-datadog-api#139). More details here zorkian/go-datadog-api#139 (comment)

Thank you,
Giovanni

@entropiae
Copy link
Contributor

Hi all, there's something we can do to ease the merge?

Thank you,
Riccardo

@entropiae
Copy link
Contributor

Hi there, sorry to bother but... there's no way to get this PR merged? This feature (or lack thereof) is causing us a bit of manual work every day :(

Thx
Riccardo

@entropiae
Copy link
Contributor

Hi there, no news on this? Should we consider the provider still maintained?

Thx
Riccardo

@masci masci added this to the 1.1.0 milestone Jul 5, 2018
@masci
Copy link
Contributor

masci commented Jul 9, 2018

@visciang sorry for my late response.
Can you please rebase on master? I'll then merge right ahead.

@visciang
Copy link
Contributor Author

visciang commented Jul 9, 2018

@masci conflict fixed

@masci masci merged commit cfdfbcc into DataDog:master Jul 9, 2018
@masci
Copy link
Contributor

masci commented Jul 9, 2018

Thanks!

@kevinahlstrom
Copy link

kevinahlstrom commented Jul 27, 2018

Hi,
Is this feature working for any of you? It looks good at first as it detects the unknown threshold.

Terraform will perform the following actions:

  ~ datadog_monitor.service-blah
      query:                       "\"windows_service.state\".over(\"role:product\",\"service:blah\").by(\"host\",\"service\").last(4).count_by_status()" => "'windows_service.state'.over('role:product','service:blah').by('host','service').last(4).count_by_status()"
      thresholds.%:                "5" => "7"
      thresholds.unknown:          "" => "3"
      thresholds.unknown_recovery: "" => "1"


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

BUT when I apply the change, it doesn’t work. In fact, I manually changed the monitor to add unknown to the thresholds in the monitor and when I ran another tf apply it reverted the monitor to not include the unknown threshold.

I kind of wonder if it’s because the unknown threshold there is a drop down selection required to select notify. The others don’t have this requirement.

@entropiae
Copy link
Contributor

Hi @kevinahlstrom, we tested the feature on our monitors before opening the pr.
Have you compiled the plugin from source? I think there isn't a releasing including the merged code yet.

(I take the opportunity to ask @masci if he can release the new version, so we can dismiss our internal fork 😄 )

@kevinahlstrom
Copy link

kevinahlstrom commented Jul 27, 2018

Hi @entropiae Thanks for the quick response! Yes I compiled the plugin from source. Good to know and thanks for confirming.

I'll also take this opportunity to ask @masci if he can release the new version. Eagerly awaiting for it to be included 😄

@kevinahlstrom
Copy link

kevinahlstrom commented Jul 27, 2018

@entropiae this was a terraform rookie mistake. I was unaware where terraform was pulling my newly compiled plugin. I thought it was in my ~/.terraform.d/plugins directory, but I was unaware there was also a plugins subdirectory in my working directory where it was pulling it from. So once I replaced the plugin in my working directory the changes worked!

But obviously this is just a workaround for now and I'm eagerly waiting for v.1.1 to be release 😄

@masci
Copy link
Contributor

masci commented Jul 30, 2018

Right back from vacation, going to release today, thanks for your patience!

nitrocode pushed a commit to nitrocode/terraform-provider-datadog that referenced this pull request Nov 3, 2018
Add support for 'unknown' monitor threshold field
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

Successfully merging this pull request may close these issues.

4 participants