-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Affected Resource(s)
coralogix_events2metric
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
locals {
only_count_aggregation = merge({ for agg in ["min", "max", "avg", "sum"] : agg => { enable = false } }, {
samples = { type = "Max", enable = false }
})
}
resource "coralogix_events2metric" "pass" {
name = "checkly_check_pass"
description = "Count of passed Checkly synthetics checks"
spans_query = {
lucene = "tags.checkly.check.status:\"PASSED\""
applications = ["checkly-browser-check", "checkly-multistep-check"]
}
metric_fields = {
checkly_check_pass = {
source_field = "duration"
aggregations = local.only_count_aggregation
},
}
metric_labels = {
check_name = "tags.checkly.check.name"
}
permutations = {
limit = 1000
}
}Expected Behavior
Terraform creates new events2metrics.
Actual Behavior
Terraform tries to override existing internal events2metrics:
# module.synthetics[0].coralogix_events2metric.pass must be replaced
-/+ resource "coralogix_events2metric" "pass" {
~ description = "faas executions" -> "Count of passed Checkly synthetics checks"
~ id = "47f71b88-42e3-4e99-879c-c62324fa07bc" -> (known after apply)
- logs_query = {
- lucene = "platform_event_type:\"runtime_done\" AND _exists_:cx_metadata.faas_id" -> null
- severities = [
- "Error",
- "Info",
] -> null
} -> null
+ metric_fields = {
+ "checkly_check_pass" = {
+ aggregations = {
+ avg = {
+ enable = false
+ target_metric_name = (known after apply)
}
+ count = (known after apply)
+ histogram = (known after apply)
+ max = {
+ enable = false
+ target_metric_name = (known after apply)
}
+ min = {
+ enable = false
+ target_metric_name = (known after apply)
}
+ samples = {
+ enable = false
+ target_metric_name = (known after apply)
+ type = "Max"
}
+ sum = {
+ enable = false
+ target_metric_name = (known after apply)
}
}
+ source_field = "duration"
},
}
~ metric_labels = {
+ "check_name" = "tags.checkly.check.name"
- "faas_id" = "cx_metadata.faas_id" -> null
}
~ name = "cx_serverless_runtime_done" -> "checkly_check_pass"
~ permutations = {
~ has_exceed_limit = false -> (known after apply)
~ limit = 5000 -> 1000
}
+ spans_query = {
+ applications = [
+ "checkly-browser-check",
+ "checkly-multistep-check",
]
+ lucene = "tags.checkly.check.status:\"PASSED\""
}
}Steps to Reproduce
- Modify the provided example by changing
metric_fieldskey fromcheckly_check_durationto any existing metric (non internal) terraform apply- it will fail withError creating Events2Metric- subsequent
terraform applywill show an attempt to override existing events2metrics
It looks like during failed apply "random" resource somehow get imported in the state.
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Metadata
Metadata
Assignees
Labels
No labels