Skip to content

feat: add Grafana dashboard for operator observability - #265

Open
ibm-adarsh wants to merge 3 commits into
kubernetes-sigs:mainfrom
ibm-adarsh:feat/grafana-dashboard
Open

feat: add Grafana dashboard for operator observability#265
ibm-adarsh wants to merge 3 commits into
kubernetes-sigs:mainfrom
ibm-adarsh:feat/grafana-dashboard

Conversation

@ibm-adarsh

@ibm-adarsh ibm-adarsh commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Status: — seeking early feedback on approach and panel layout before marking ready for review.

Adds a Grafana dashboard for the MCP Lifecycle Operator as a distributable artifact, addressing #102. Builds on the custom mcpserver_* metrics from #100 (PR #122) and the metrics documentation from #101 (PR #138).

  • Adds config/grafana/mcp-lifecycle-operator.json — importable dashboard with 5 rows and 19 PromQL panels
  • Adds optional config/grafana/kustomization.yaml for Grafana Helm sidecar provisioning (grafana_dashboard: "1")
  • Adds config/grafana/dashboard_test.go and hack/verify-grafana-dashboard.sh to guard JSON validity and metric references
  • Wires make verify-grafana-dashboard into make test
  • Documents import and sidecar provisioning in site-src/operating/metrics.md
image image image image image image

Why this approach

Before implementing, I surveyed how kubernetes-sigs and adjacent operator projects distribute Grafana dashboards:

Project Pattern Takeaway
node-feature-discovery examples/grafana-dashboard.json + raw URL import in docs Primary pattern adopted — lowest friction for users
kubebuilder Grafana plugin grafana/*.json + manual UI import Confirms config/grafana/ placement
kro #1114 config/grafana/dashboard.json Emerging kubebuilder-adjacent convention
cluster-api hack/observability/grafana/dashboards/ (Tilt dev only) Not suitable for end-user distribution
Strimzi / kube-prometheus-stack ConfigMap with grafana_dashboard: "1" sidecar label Optional overlay for kube-prometheus-stack users
cert-manager / external-dns No bundled dashboard (community mixin or Grafana.com) Confirms raw JSON in-repo is the norm for kubebuilder operators

Decision: Ship raw JSON at config/grafana/ (NFD/kubebuilder pattern) with an optional Kustomize overlay for Grafana sidecar users (Strimzi/kube-prometheus-stack pattern). This avoids coupling the operator install to a specific monitoring stack while still supporting auto-provisioning for users who want it.

What is included vs. excluded from the original #102 spec

#102 panel Status Reason
MCPServer count by namespace Included mcpserver_condition_info
Reconciliation success/error rate, P95 latency Included controller_runtime_reconcile_*
Reconciliation duration heatmap, rate, requeue Included controller_runtime_reconcile_time_seconds_bucket
MCPServers by Accepted/Ready status Included mcpserver_condition_info
Deployment/Service/NetworkPolicy failure rates Included mcpserver_*_failures_total
Validation failures by reason Included mcpserver_validation_failures_total
Operator CPU/memory, API request rate Included process_*, rest_client_requests_total
ConfigMap/Secret watch events Excluded Metrics never implemented
Reconciliation queue depth Excluded controller-runtime v0.24 does not expose classic workqueue_* series
referenced_resources_count Excluded Mentioned in #100 but not delivered in PR #122

Dashboard design notes

  • Controller filter uses controller="mcpserver" (matches Named("mcpserver") in the reconciler)
  • Template variable $mcpserver_namespace is sourced from mcpserver_condition_info labels
  • Performance panels (process_*, rest_client_*) omit namespace label filters because the raw /metrics endpoint does not include Kubernetes labels — these are added by Prometheus relabeling if configured
  • Failure counter panels return empty series when no failures have occurred (standard Prometheus counter behavior)

Test plan

  • make build — binary builds successfully
  • make test — all unit tests pass (controller coverage 91.4%), includes verify-grafana-dashboard
  • go test ./config/grafana/... — JSON validity, required metric references, no unimplemented metrics
  • E2E TestMetricsEndpoint — metrics endpoint returns HTTP 200 via authenticated port-forward
  • E2E TestManagerPodRunning — controller-manager pod is Running
  • Live metrics scrape — mcpserver_condition_info, controller_runtime_reconcile_total, process_* series present after reconciling MCPServers
  • Prometheus integration — 19/19 dashboard PromQL expressions execute successfully against a live Prometheus instance scraping the operator (0-series for failure counters when no failures occurred, as expected)
  • kustomize build config/grafana/ — produces ConfigMap with grafana_dashboard: "1" label

Closes #102

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Shipped a new Grafana dashboard covering MCP server reconciliation, resource health, validation, and operator performance.
    • Added optional Kubernetes provisioning to import the dashboard via the Grafana sidecar workflow.
  • Bug Fixes

    • Added automated checks to validate the dashboard JSON and ensure dashboard PromQL references only supported metrics (with optional live Prometheus query warnings when configured).
  • Documentation

    • Added a “Grafana dashboard” section under operating metrics, including import and provisioning instructions.
    • Updated the metrics documentation links to reference the Prometheus metrics reference and Grafana dashboard.

Ship an importable Grafana dashboard and optional sidecar provisioning
overlay so cluster operators can visualize mcpserver_* and
controller-runtime metrics introduced in kubernetes-sigs#100.
@kubernetes-prow kubernetes-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 15, 2026
@netlify

netlify Bot commented Jul 15, 2026

Copy link
Copy Markdown

Deploy Preview for mcp-lifecycle-operator ready!

Name Link
🔨 Latest commit e8a2db3
🔍 Latest deploy log https://app.netlify.com/projects/mcp-lifecycle-operator/deploys/6a572a51267e5d00080bf1c7
😎 Deploy Preview https://deploy-preview-265--mcp-lifecycle-operator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ibm-adarsh
Once this PR has been reviewed and has the lgtm label, please assign soltysh for approval. For more information see the Code Review Process.

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

Details Needs approval from an approver in each of these files:

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

@kubernetes-prow
kubernetes-prow Bot requested review from matzew and soltysh July 15, 2026 05:33
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a Prometheus-backed Grafana dashboard with MCP lifecycle visualizations, Kustomize sidecar provisioning, automated JSON and metric validation, optional live Prometheus checks, and documentation for importing or deploying it.

Changes

Grafana dashboard

Layer / File(s) Summary
Dashboard panels and PromQL configuration
config/grafana/mcp-lifecycle-operator.json
Defines overview, reconciliation, resource health, validation, and performance panels using Prometheus metrics and a namespace variable.
Dashboard validation tests
config/grafana/dashboard_test.go, go.mod
Validates dashboard JSON, required fields, referenced metrics, PromQL expressions, Kustomize output, and supporting dependency requirements.
Kustomize provisioning and verification
config/grafana/kustomization.yaml, hack/verify-grafana-dashboard.sh, Makefile
Generates a labeled Grafana ConfigMap and runs local dashboard checks, Go tests, and optional Prometheus queries through the test workflow.
Dashboard documentation and references
README.md, site-src/operating/metrics.md
Documents dashboard coverage, supported metrics, Grafana import, and sidecar provisioning.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Makefile
  participant VerifyScript as verify-grafana-dashboard.sh
  participant Grafana as Grafana sidecar
  participant Prometheus
  Makefile->>VerifyScript: Run dashboard verification
  VerifyScript->>VerifyScript: Validate JSON and run Go tests
  Grafana->>Grafana: Load generated dashboard ConfigMap
  Grafana->>Prometheus: Execute dashboard PromQL queries
  Prometheus-->>Grafana: Return metric series
Loading

Suggested labels: do-not-merge/work-in-progress

Suggested reviewers: matzew, soltysh

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR covers a dashboard and related tests/docs, but it omits requested panels for queue depth and ConfigMap/Secret events and errors, so #102 is not fully met. Add the missing dashboard panels and metric coverage for queue depth, ConfigMap/Secret events/errors, condition transitions, and failed deployments, or revise the issue scope.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The changes stay focused on Grafana dashboard delivery, validation, documentation, and test integration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a Grafana dashboard for operator observability.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ibm-adarsh
ibm-adarsh marked this pull request as draft July 15, 2026 05:36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 10

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config/grafana/dashboard_test.go`:
- Around line 137-142: Update TestDashboardKustomizationBuilds to invoke the
Kustomize build/render process for config/grafana instead of only checking
dashboardFile exists. Assert that rendering succeeds and inspect the generated
ConfigMap contents, including the dashboard data and labels, so malformed YAML
or generated metadata causes the test to fail.
- Around line 90-123: Update the metric extraction logic in the selector
validation test to parse each expression with the PromQL parser and inspect all
vector selectors, including bare metric references such as function arguments.
Populate `seen` from the parsed selector names and validate them against
`knownMetrics`, replacing the regex-only approach while preserving existing
allowlist and unimplemented-metric checks.

In `@config/grafana/kustomization.yaml`:
- Around line 1-3: Update the Grafana provisioning documentation in the
kustomization.yaml comments to state that grafana_folder requires
sidecar.dashboards.folderAnnotation set to grafana_folder and
sidecar.dashboards.provider.foldersFromFilesStructure enabled, or remove the
grafana_folder annotation if those chart settings are not guaranteed.

In `@config/grafana/mcp-lifecycle-operator.json`:
- Around line 893-896: Update the Grafana panel query configuration’s
legendFormat to reference the grouped reason label instead of the absent status
label, so each pie slice is labeled by its failure reason.
- Line 991: Update the unit settings for the Performance panels at the entries
around lines 991, 1047, and 1103: use a CPU/core unit for CPU usage, bytes for
RSS, and a count unit for active workers instead of ops. Preserve the existing
panel configuration and change only the metric-specific unit values.
- Line 1018: Update the process metric queries near the referenced dashboard
panels, including process_cpu_seconds_total, process_resident_memory_bytes, and
rest_client_requests_total, to include the existing operator label filter used
elsewhere in the dashboard. Preserve each query’s current aggregation and rate
behavior while scoping all series to the operator target.
- Around line 2-10: Replace the import-only DS_PROMETHEUS reference throughout
the dashboard with a datasource UID supported by provisioning, or configure a
runtime datasource variable that resolves during dashboard execution. Update all
panels and the mcpserver_namespace variable to use the same resolvable
datasource reference, and remove reliance on the __inputs placeholder.

In `@hack/verify-grafana-dashboard.sh`:
- Around line 34-37: Update the curl invocation in the query loop of
hack/verify-grafana-dashboard.sh to include both --connect-timeout and
--max-time with appropriate bounded durations, while preserving the existing
silent/fail behavior and Prometheus query URL.

In `@site-src/operating/metrics.md`:
- Line 154: Update the metrics sentence in the dashboard documentation to
include process metrics process_cpu_seconds_total and
process_resident_memory_bytes, plus the REST client metric
rest_client_requests_total, alongside the existing mcpserver_* and
controller_runtime_* series. State that these metrics must also be available in
Prometheus, while retaining the note that unimplemented ConfigMap/Secret watch
metrics are excluded.
- Around line 169-171: Add repository checkout prerequisites before the kubectl
apply command in the metrics documentation: instruct readers to clone the
repository and change to its root directory, or replace the local Kustomize path
with a valid remote Kustomize URL.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1ef6899e-f83d-46a0-9bb6-08324437ac2a

📥 Commits

Reviewing files that changed from the base of the PR and between eb4f33c and f7184e4.

📒 Files selected for processing (7)
  • Makefile
  • README.md
  • config/grafana/dashboard_test.go
  • config/grafana/kustomization.yaml
  • config/grafana/mcp-lifecycle-operator.json
  • hack/verify-grafana-dashboard.sh
  • site-src/operating/metrics.md

Comment thread config/grafana/dashboard_test.go
Comment thread config/grafana/dashboard_test.go
Comment thread config/grafana/kustomization.yaml Outdated
Comment thread config/grafana/mcp-lifecycle-operator.json Outdated
Comment thread config/grafana/mcp-lifecycle-operator.json Outdated
Comment thread config/grafana/mcp-lifecycle-operator.json Outdated
Comment thread config/grafana/mcp-lifecycle-operator.json Outdated
Comment thread hack/verify-grafana-dashboard.sh
Comment thread site-src/operating/metrics.md Outdated
Comment thread site-src/operating/metrics.md
Use PromQL parser validation, real kustomize build tests, datasource
template variables, corrected panel units/legends, operator namespace
scoping, curl timeouts, and expanded metrics documentation.
Use strings.SplitSeq for modernize lint compliance and ensure kustomize
is installed before verify-grafana-dashboard runs in CI.
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@d29a3ce). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #265   +/-   ##
=======================================
  Coverage        ?   85.36%           
=======================================
  Files           ?       14           
  Lines           ?     1578           
  Branches        ?        0           
=======================================
  Hits            ?     1347           
  Misses          ?      188           
  Partials        ?       43           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ibm-adarsh
ibm-adarsh marked this pull request as ready for review July 16, 2026 06:16
@kubernetes-prow
kubernetes-prow Bot requested review from aliok and jaideepr97 July 16, 2026 06:16
@ibm-adarsh

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jul 16, 2026
@ibm-adarsh ibm-adarsh changed the title WIP: feat: add Grafana dashboard for operator observability feat: add Grafana dashboard for operator observability Jul 16, 2026
@kubernetes-prow kubernetes-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 16, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config/grafana/dashboard_test.go`:
- Around line 147-149: Remove the t.Helper() call from the top-level
TestDashboardKustomizationBuilds function, leaving the rest of the test
unchanged so failures report the correct test source location.

In `@go.mod`:
- Line 12: Update the github.com/prometheus/prometheus dependency in go.mod from
v0.303.0 to the latest patched version, refreshing go.sum as needed. Preserve
its existing test-only usage and avoid unrelated dependency changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a526de1e-0466-4947-85f0-236c57677545

📥 Commits

Reviewing files that changed from the base of the PR and between f7184e4 and e8a2db3.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (7)
  • Makefile
  • config/grafana/dashboard_test.go
  • config/grafana/kustomization.yaml
  • config/grafana/mcp-lifecycle-operator.json
  • go.mod
  • hack/verify-grafana-dashboard.sh
  • site-src/operating/metrics.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • config/grafana/kustomization.yaml
  • Makefile
  • site-src/operating/metrics.md
  • hack/verify-grafana-dashboard.sh

Comment on lines +147 to +149
func TestDashboardKustomizationBuilds(t *testing.T) {
t.Helper()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove t.Helper() from the top-level test function.

Calling t.Helper() inside a TestXxx function marks the test itself as a helper. If a failure occurs (e.g., t.Fatalf), the testing framework will skip this function in the call stack and report the failure's location as being inside the Go standard library's internal testing.go runner. This makes it difficult to pinpoint the exact line that failed in the test.

♻️ Proposed fix
 func TestDashboardKustomizationBuilds(t *testing.T) {
-	t.Helper()
-
 	kustomize := filepath.Join("..", "..", "bin", "kustomize")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func TestDashboardKustomizationBuilds(t *testing.T) {
t.Helper()
func TestDashboardKustomizationBuilds(t *testing.T) {
kustomize := filepath.Join("..", "..", "bin", "kustomize")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config/grafana/dashboard_test.go` around lines 147 - 149, Remove the
t.Helper() call from the top-level TestDashboardKustomizationBuilds function,
leaving the rest of the test unchanged so failures report the correct test
source location.

Comment thread go.mod
github.com/onsi/ginkgo/v2 v2.31.0
github.com/onsi/gomega v1.42.0
github.com/prometheus/client_golang v1.23.2
github.com/prometheus/prometheus v0.303.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Update the Prometheus dependency to address high-severity vulnerabilities.

OSV Scanner identified multiple high-severity vulnerabilities (e.g., GHSA-8rm2-7qqf-34qm, GHSA-fw8g-cg8f-9j28) in github.com/prometheus/prometheus v0.303.0. Although this dependency is only used for unit testing and may not be exploitable in production, having vulnerable packages in go.mod can trigger security scanner alerts and fail CI/compliance pipelines.

Please update github.com/prometheus/prometheus to the latest patched version (e.g., by running go get github.com/prometheus/prometheus@latest).

🧰 Tools
🪛 OSV Scanner (2.4.0)

[HIGH] 12-12: github.com/prometheus/prometheus 0.303.0: Prometheus: Remote read endpoint allows denial of service via crafted snappy payload in github.com/prometheus/prometheus

(GO-2026-5264)


[HIGH] 12-12: github.com/prometheus/prometheus 0.303.0: Prometheus vulnerable to stored XSS via crafted histogram bucket label values in the old web UI heatmap display in github.com/prometheus/prometheus

(GO-2026-5381)


[HIGH] 12-12: github.com/prometheus/prometheus 0.303.0: Prometheus has Stored XSS via metric names and label values in Prometheus web UI in github.com/prometheus/prometheus

(GO-2026-5662)


[HIGH] 12-12: github.com/prometheus/prometheus 0.303.0: Prometheus Azure AD remote write OAuth client secret exposed via config API in github.com/prometheus/prometheus

(GO-2026-5710)


[HIGH] 12-12: github.com/prometheus/prometheus 0.303.0: Prometheus: Remote read endpoint allows denial of service via crafted snappy payload

(GHSA-8rm2-7qqf-34qm)


[HIGH] 12-12: github.com/prometheus/prometheus 0.303.0: Prometheus vulnerable to stored XSS via crafted histogram bucket label values in the old web UI heatmap display

(GHSA-fw8g-cg8f-9j28)


[HIGH] 12-12: github.com/prometheus/prometheus 0.303.0: Prometheus has Stored XSS via metric names and label values in Prometheus web UI tooltips and metrics explorer

(GHSA-vffh-x6r8-xx99)


[HIGH] 12-12: github.com/prometheus/prometheus 0.303.0: Prometheus Azure AD remote write OAuth client secret exposed via config API

(GHSA-wg65-39gg-5wfj)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@go.mod` at line 12, Update the github.com/prometheus/prometheus dependency in
go.mod from v0.303.0 to the latest patched version, refreshing go.sum as needed.
Preserve its existing test-only usage and avoid unrelated dependency changes.

Source: Linters/SAST tools

@ArangoGutierrez ArangoGutierrez 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.

Found 2 issues.

  1. Eight queries filter on namespace=~"$mcpserver_namespace", but templating.list only defines datasource and operator_namespace - Grafana passes an undefined variable through as a literal, so these panels (MCPServer count, Accepted/Ready breakdowns, failure and validation rates) render no data on import. Adding the mcpserver_namespace query variable the PR description already mentions (sourced from mcpserver_condition_info) fixes all eight. (config/grafana/mcp-lifecycle-operator.json:91)
  2. This checks the raw JSON text, so a metric name lingering in a panel title or legend keeps the test green even after its query is deleted. The seen set computed below already holds the selectors actually parsed from every expr - checking required against seen instead closes the gap. (config/grafana/dashboard_test.go:109)

"uid": "${datasource}"
},
"editorMode": "code",
"expr": "count(mcpserver_condition_info{type=\"Ready\", namespace=~\"$mcpserver_namespace\"})",

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.

Eight queries filter on namespace=~"$mcpserver_namespace", but templating.list only defines datasource and operator_namespace - Grafana passes an undefined variable through as a literal, so these panels (MCPServer count, Accepted/Ready breakdowns, failure and validation rates) render no data on import. Adding the mcpserver_namespace query variable the PR description already mentions (sourced from mcpserver_condition_info) fixes all eight.

"controller_runtime_reconcile_time_seconds",
}
for _, metric := range required {
if !strings.Contains(content, metric) {

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.

This checks the raw JSON text, so a metric name lingering in a panel title or legend keeps the test green even after its query is deleted. The seen set computed below already holds the selectors actually parsed from every expr - checking required against seen instead closes the gap.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grafana dashboards for the operator

2 participants