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

mongodbatlas_alert_configuration failing to be created on apply due to METRIC_TYPE_UNSUPPORTED for DISK_PARTITION_ alerts 400 error #1716

Closed
NicBelley opened this issue Dec 6, 2023 · 3 comments
Labels

Comments

@NicBelley
Copy link

We used to have alerts configured for disk metrics (DISK_PARTITION_SPACE_USED_DATA) and it seems either they are not supported anymore or they have changed names.

According to the documentation, they are still available:
https://www.mongodb.com/docs/mongocli/v1.16/reference/atlas/alerts-list/

This docs shows:
DISK_PARTITION_SPACE_USED_DATA
DISK_PARTITION_SPACE_USED_INDEX
DISK_PARTITION_SPACE_USED_JOURNAL
DISK_PARTITION_UTILIZATION_DATA
DISK_PARTITION_UTILIZATION_INDEX
DISK_PARTITION_UTILIZATION_JOURNAL

This is my terraform script, that worked before:
resource "mongodbatlas_alert_configuration" "disk-space" {
project_id = var.project_id
event_type = "OUTSIDE_METRIC_THRESHOLD"
enabled = true

metric_threshold_config {
metric_name = "DISK_PARTITION_SPACE_USED_DATA"
mode = "AVERAGE"
operator = "GREATER_THAN"
threshold = 90
units = "RAW"
}

notification {
type_name = "PAGER_DUTY"
delay_min = 10
service_key = var.alerts.resources_usage_service_key
}
}

The error in the pipeline is:

Error: error getting Alert Configuration information: PUT https://cloud.mongodb.com/api/atlas/v1.0/groups/602428316c23fa47a1739058/alertConfigs/602428316c23fa47a173905f: 400 (request "METRIC_TYPE_UNSUPPORTED") The metric type DISK_PARTITION_UTILIZATION_DATA is not supported. on mongodb.tf line 580, in resource "mongodbatlas_alert_configuration" "disk-space": 580: resource "mongodbatlas_alert_configuration" "disk-space"

Copy link
Contributor

github-actions bot commented Dec 6, 2023

Thanks for opening this issue! Please make sure you've followed our guidelines when opening the issue. In short, to help us reproduce the issue we need:

  • Terraform configuration file used to reproduce the issue
  • Terraform log files from the run where the issue occurred
  • Terraform Atlas provider version used to reproduce the issue
  • Terraform version used to reproduce the issue
  • Confirmation if Terraform OSS, Terraform Cloud, or Terraform Enterprise deployment

The ticket CLOUDP-216234 was created for internal tracking.

@andreaangiolillo
Copy link
Collaborator

Hello @NicBelley
Thanks for opening the issue. Your terraform configuration file contains metric_name = "DISK_PARTITION_SPACE_USED_DATA" but then the error says (request "METRIC_TYPE_UNSUPPORTED") The metric type DISK_PARTITION_UTILIZATION_DATA is not supported.

Is the provided tf configuration the correct one? Could you also share the Atlas provider version and the Terraform version used to reproduce the issue? Thanks

@NicBelley
Copy link
Author

@andreaangiolillo

We just update our version to terraformVersion: '0.15.5' and the provider "registry.terraform.io/mongodb/mongodbatlas" to version "1.13.1" and now it works!

So... I guess we can close the issue?

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

No branches or pull requests

2 participants