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

[datadog_monitor] Add cost alert monitors #2769

Merged
merged 16 commits into from
Jan 31, 2025

Conversation

klara-kr
Copy link
Contributor

@klara-kr klara-kr commented Jan 15, 2025

Adding terraform support for the cost alert monitors

I did have an example in https://github.com/DataDog/terraform-provider-datadog/blob/6fe11d82a1ca55992e511236236577c9f31af879/docs/guides/monitors.md but it was removed when I ran make docs -- let me know if I should add it back

## Cost Monitors

```terraform
resource "datadog_monitor" "process_alert_example" {
  name    = "Cost Alert Monitor"
  type    = "cost alert"
  message = "Cost Change increased more than 50$ in the last 30 days"
  query   = "formula('query').last('30d').change('absolute') > 50"
  monitor_thresholds {
    critical = 50
  }
  
  variables = [
    {
      name  = "query"
      value = "sum:aws.cost.amortized{*} by {service}.rollup(sum, daily)"
      aggregator = "sum"
      data_source = "cloud_cost"
    }
  ]
  renotify_interval = 60
}

@klara-kr klara-kr force-pushed the kara/add-cost-alert-monitors branch 2 times, most recently from a5a1379 to ef8089a Compare January 20, 2025 09:54
kayayarai
kayayarai previously approved these changes Jan 20, 2025
Copy link

@darnellshumpert darnellshumpert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM... I'm not sure this is needed but adding a test for this might be good here datadog/tests/resource_datadog_monitor_test.go?

@klara-kr klara-kr dismissed stale reviews from darnellshumpert and kayayarai via fe1454e January 28, 2025 14:46
@klara-kr klara-kr force-pushed the kara/add-cost-alert-monitors branch from ef8089a to fe1454e Compare January 28, 2025 14:46
@klara-kr klara-kr requested a review from a team as a code owner January 30, 2025 10:03
@klara-kr
Copy link
Contributor Author

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jan 31, 2025

Devflow running: /merge

View all feedbacks in Devflow UI.


2025-01-31 09:37:24 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-01-31 10:55:11 UTC ℹ️ MergeQueue: merge request added to the queue

The median merge time in master is 1m.


2025-01-31 10:59:06 UTC ℹ️ MergeQueue: This merge request was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants