Skip to content

Allow grafana discovery tag to be passed in via commandline - #330

Merged
openshift-merge-bot[bot] merged 1 commit into
mainfrom
rawo/fixingAMWDiscoveryForClassic
Sep 9, 2026
Merged

Allow grafana discovery tag to be passed in via commandline#330
openshift-merge-bot[bot] merged 1 commit into
mainfrom
rawo/fixingAMWDiscoveryForClassic

Conversation

@rachelvweber

Copy link
Copy Markdown
Collaborator

Allow grafana discovery tag to be passed in via commandline.

The requirement of the aro-hcp specific tag broke AMW discovery for ARO Classic.

Copilot AI left a comment

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.

🟢 Approval recommended

The change is narrowly scoped, updates all known call sites, and includes validation plus a targeted test for the new CLI surface.

Pull request overview

This PR restores cross-subscription Azure Monitor Workspace discovery for ARO Classic by making the Resource Graph discovery tag key configurable via grafanactl (instead of being implicitly tied to the ARO-HCP-specific tag).

Changes:

  • Add --discovery-tag-key base flag (default aroHCPPurpose) with input validation and a unit test.
  • Thread the configured tag key into the Resource Graph discovery query used by clean, manage reconcile, and modify datasource reconcile.
  • Extend pipeline types + JSON schema to allow discoveryTagKey to be specified for Grafana-related steps, and document the new behavior.
File summaries
File Description
tools/grafanactl/README.md Documents discovery-by-tag behavior and the new --discovery-tag-key flag.
tools/grafanactl/internal/azure/monitor.go Adds a tag key field to Resource Graph discovery and uses it in the KQL query.
tools/grafanactl/cmd/modify/options.go Passes the validated discovery tag key into the Resource Graph discovery client.
tools/grafanactl/cmd/manage/options.go Passes the validated discovery tag key into the Resource Graph discovery client.
tools/grafanactl/cmd/clean/options.go Passes the validated discovery tag key into the Resource Graph discovery client.
tools/grafanactl/cmd/base/options.go Introduces DiscoveryTagKey, binds --discovery-tag-key, and validates it to prevent KQL injection.
tools/grafanactl/cmd/base/options_test.go Adds coverage to ensure invalid tag keys are rejected.
pipelines/types/pipeline.schema.v1.json Adds discoveryTagKey fields to Grafana step schemas.
pipelines/types/common.go Adds DiscoveryTagKey to Grafana pipeline step structs and required-input discovery.
Review details
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/grafanactl/internal/azure/monitor.go
@abiduke612

Copy link
Copy Markdown
Collaborator

/lgtm

@openshift-ci

openshift-ci Bot commented Sep 9, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abiduke612, rachelvweber

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [abiduke612,rachelvweber]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit 3cbd84c into main Sep 9, 2026
4 checks passed
@openshift-merge-bot
openshift-merge-bot Bot deleted the rawo/fixingAMWDiscoveryForClassic branch September 9, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants