Skip to content

Conversation

alexander-akhmetov
Copy link
Contributor

@alexander-akhmetov alexander-akhmetov commented Sep 4, 2025

Adds new grafana_apps_alertenrichment_alertenrichment_v1beta1 resource with a single enrichment step for now: assign.

Example

resource "grafana_apps_alertenrichment_alertenrichment_v1beta1" "test_enrichment_1" {
  metadata {
    uid = "test_enrichment"
  }

  spec {
    title       = "test enrichment"
    description = "some description"

    alert_rule_uids = ["high-cpu-alert"]

    receivers = ["critical-alerts"]

    label_matchers = [
      {
        type  = "="
        name  = "severity"
        value = "critical"
      },
    ]

    annotation_matchers = [
      {
        type  = "!~"
        name  = "runbook_url"
        value = "^http://grafana.com$"
      }
    ]

    step {
      assign {
        annotations = {
          enrichment_team   = "alerting-team"
          runbook_url       = "https://runbooks.grafana.com/critical-alerts"
          contact_slack     = "#alerts-critical"
          incident_severity = "high"
        }
        timeout = "30s"
      }
    }

   step {
     ...
   }
  }
}

Copy link
Contributor

github-actions bot commented Sep 4, 2025

In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically.
To do so, a Grafana Labs employee must trigger the cloud acceptance tests workflow manually.

@alexander-akhmetov alexander-akhmetov force-pushed the alexander-akhmetov/alerting-enrichment branch 10 times, most recently from 6844aae to 8b9d2c6 Compare September 5, 2025 11:47
@alexander-akhmetov alexander-akhmetov force-pushed the alexander-akhmetov/alerting-enrichment branch from 8b9d2c6 to e214044 Compare September 5, 2025 11:49
@alexander-akhmetov alexander-akhmetov marked this pull request as ready for review September 5, 2025 12:07
@alexander-akhmetov alexander-akhmetov requested review from a team as code owners September 5, 2025 12:07
@alexander-akhmetov alexander-akhmetov requested review from radiohead, konsalex and a team and removed request for a team September 5, 2025 12:07
Copy link
Contributor

@stevesg stevesg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from my side, but we may want someone more familiar with the provider to give it a check over.

// AlertEnrichment creates a new Grafana Alert Enrichment resource.
func AlertEnrichment() NamedResource {
return NewNamedResource[*v1beta1.AlertEnrichment, *v1beta1.AlertEnrichmentList](
common.CategoryGrafanaApps,
Copy link
Contributor Author

@alexander-akhmetov alexander-akhmetov Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this from other app platform resources, but now I'm thinking this should be common.CategoryAlerting so that it's in the Alerting section here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated: 5fcdbe8

@alexander-akhmetov alexander-akhmetov force-pushed the alexander-akhmetov/alerting-enrichment branch 2 times, most recently from 18cccfb to cc87ab8 Compare September 8, 2025 21:12
@alexander-akhmetov alexander-akhmetov force-pushed the alexander-akhmetov/alerting-enrichment branch from cc87ab8 to fdd3fc4 Compare September 8, 2025 21:16
@alexander-akhmetov alexander-akhmetov enabled auto-merge (squash) September 9, 2025 13:37
@alexander-akhmetov alexander-akhmetov merged commit 790e07b into main Sep 9, 2025
30 checks passed
@alexander-akhmetov alexander-akhmetov deleted the alexander-akhmetov/alerting-enrichment branch September 9, 2025 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants