Skip to content

Cryptic error when a recording rule doesn't pass the check enforced by strict_recording_rule_check #24

@mlcdf

Description

@mlcdf

Hi there,

Terraform Version

1.2.6

Affected Resource(s)

  • mimirtool_ruler_namespace

Terraform Configuration Files

resource "mimirtool_ruler_namespace" "rules" {
 namespace                   = "rules"
 config_yaml                 = file("rules/rules.yaml")
 strict_recording_rule_check = true
}
    - record: http_request_duration_seconds_count:rate5m
      expr: sum by (job, code) (http_request_duration_seconds_count)

Expected Behavior

What should have happened?

A detailed error message like this log line: https://github.com/grafana/mimir/blob/b85cdae798f0da739497ef04c34497bb99e4a760/pkg/mimirtool/rules/rules.go#L99

And a suggestion that this check can be disable by removing strict_recording_rule_check = true.

Actual Behavior

Only this error message in terraform:

╷
│ Error: namespace contains 1 rules that don't match the requirements
│ 
│   with mimirtool_ruler_namespace.rules,
│   on main.tf line 16, in resource "mimirtool_ruler_namespace" "rules":
│   16: resource "mimirtool_ruler_namespace" "rules" {
│ 
╵
Executing post-apply hook...
Operation failed: failed running terraform apply (exit 1)�

Which is pretty cryptic.

Steps to Reproduce

cf the configuration file above and then, run terraform apply

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions