Skip to content

check-rules: PrometheusRule import names rules differently than operator/Terraform #182

Description

@mmanciop

Problem

When importing a PrometheusRule CRD as a check rule, the CLI names the resulting check rule after the alert only (rule.alert), whereas the Dash0 Kubernetes operator and the Terraform provider name it <group.name> - <rule.alert>. All three tools share the same dash0-api-client-go SDK, but the CLI's import path does not apply the group-name prefix that the other two apply.

Concretely, for a CRD with group ticketprovider-sapi-password-sweep-disabled and alert ticketprovider / ticketprovider-sb / Password Sweep Disabled:

  • CLI produces: ticketprovider / ticketprovider-sb / Password Sweep Disabled
  • Operator / Terraform produce: ticketprovider-sapi-password-sweep-disabled - ticketprovider / ticketprovider-sb / Password Sweep Disabled

Why it matters

Teams that mix delivery mechanisms (operator/Terraform in some environments, CLI in CI/CD) get inconsistent check-rule names for the same source CRD. This is confusing in the UI and breaks any tooling or alert routing that keys off the check-rule name. The CLI is the only one of the three tools that diverges.

Expected user-facing behavior

A PrometheusRule CRD imported via dash0 check-rules create, dash0 check-rules update, or dash0 apply should produce the same check-rule name as the operator and the Terraform provider for the same input.

Constraints to respect

  • Check-rule identity for upsert is the dash0.com/id / id, not the name, so for id-pinned GitOps workflows this is a non-destructive in-place rename (a one-line diff on the next apply).
  • It is a visible change for rules applied without a pinned id, and for any consumer that matches on the check-rule name. It must ship with a clear changelog note describing the rename and its impact.
  • Multi-group / multi-alert CRDs must continue to produce one check rule per alert.

Acceptance criteria

  • Importing a PrometheusRule via the CLI yields the same check-rule name as the operator and Terraform provider.
  • Multi-group / multi-alert CRDs still produce one check rule per alert.
  • Integration / roundtrip coverage asserts the composed name.
  • A changelog entry documents the rename and its impact.

Activity

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

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