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 Cost Alert to Datadog Monitor Types #2675

Open
OgonnaO opened this issue Nov 14, 2024 · 0 comments
Open

Add Cost Alert to Datadog Monitor Types #2675

OgonnaO opened this issue Nov 14, 2024 · 0 comments

Comments

@OgonnaO
Copy link

OgonnaO commented Nov 14, 2024

What resources or data sources are affected?

resource "datadog_monitor" 

Feature Request

Requesting the addition of a cost alert monitor type in Datadog's Terraform provider. This would simplify setting up cost-related alerts directly through Terraform.

Use Case: Monitoring cloud spending is important for budget management. A dedicated cost alert type in Terraform would streamline the process, making it easier to set thresholds and detect anomalies.

Benefits:

  • Easier configuration for cost-related alerts using terraform.
resource "datadog_monitor" "cost_alert" {
  name    = "Monthly Cost Alert"
  type    = "cost alert"
  query   = formula("sum:gcp.cost.amortized{*}.rollup(sum, 86400)").last("30d").change("absolute") > 10000
  message = <<EOT
Alert: Monthly cost threshold exceeded for project {{project_name}}.

{{#is_alert}}
- Investigate recent changes in resource usage or configurations.
- The total cost has exceeded $5000 in the last 30 days.
- Current Cost: {{value}}
{{/is_alert}}

{{#is_no_data}}
Cost data is missing.
- Check if the billing export is functioning correctly.
- Verify if there are any service disruptions in GCP or Datadog.
- Ensure that the monitor's query is still valid.
{{/is_no_data}}
EOT
  thresholds {
    critical = 5000
  }
}

Conclusion: Adding a cost alert monitor type to Datadog's Terraform provider would enhance cloud cost management, making it easier to set up and manage cost-related alerts within IaC workflows.

References

Image

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

No branches or pull requests

1 participant