Skip to content

Add Grafana Cloud Integrations provider#2635

Open
Dasomeone wants to merge 32 commits intomainfrom
dasomeone/feat/gcloud-integrations-client
Open

Add Grafana Cloud Integrations provider#2635
Dasomeone wants to merge 32 commits intomainfrom
dasomeone/feat/gcloud-integrations-client

Conversation

@Dasomeone
Copy link
Copy Markdown
Member

What is this PR and why do we need it?

This PR introduces a new grafana_cloud_integrations provider to perform simple management of Grafana Cloud Integrations

Cloud Integrations a bit of an anti-pattern currently, as the API doesn't manage much of the actual lifecycle, and so control and configuration options are a bit more limited than normally expected.

Either way, this PR introduces this new provider based on the newer Plugin Framework, and supports the following operations:

  • Installing Integrations
  • Uninstalling Integrations
  • Importing Integrations
  • Reinstalling the integration on configuration change
  • Support for both Mimir and Grafana Alerting (controlled via the integration itself, not user-selectable)

please note, this provider does not supply an update/upgrade functionality as Cloud Integrations are "updated" by a reinstall to ensure getting a clean set of dashboards and alerts

Unit tests have been added for some internals, alongside client interaction tests.

Heavily inspired by original work in this direction by @clementduveau in #2191 (thank you! 🙏)

CC: @aditya-konarde @mariaalons @Alex3k

@Dasomeone Dasomeone requested a review from a team as a code owner March 27, 2026 10:42
@github-actions
Copy link
Copy Markdown
Contributor

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.

@Dasomeone Dasomeone force-pushed the dasomeone/feat/gcloud-integrations-client branch from 02dd357 to 5b2990b Compare March 27, 2026 11:26
Flattens the existing configuration block by removing the unused `logs_disabled` field and only allowing toggling alerts
Copy link
Copy Markdown

@mariaalons mariaalons left a comment

Choose a reason for hiding this comment

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

Nice work! Test it locally works as expected 👏
Left only two comments that are related

for i, dashboard := range dashboardsResponse.Data {
err = c.CreateDashboard(ctx, dashboard, folderUID)
if err != nil {
_ = c.DeleteFolder(ctx, folderUID)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if this folder pre-existed before installlation, deleting it here on dashboard failure would destroy data. we may want to track whether the folder was newly created vs already present before deciding to delete on rollback

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is on purpose to mirror the exact behaviour taken by Grafana Cloud Integrations. These folders will be, hopefully, created as readonly in the future.

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