Skip to content

feat: add KMS etcd encryption SLI observability stack - #5690

Merged
openshift-merge-bot[bot] merged 1 commit into
Azure:mainfrom
wanghaoran1988:worktree-kms-sli-ksm-config
Aug 1, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
Azure:mainfrom
wanghaoran1988:worktree-kms-sli-ksm-config

Conversation

@wanghaoran1988

@wanghaoran1988 Haoran Wang (wanghaoran1988) commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Expose the ValidAzureKMSConfig HostedCluster condition as a Prometheus gauge via kube-state-metrics custom resource state config (ARO-25913).

This is the metrics collection foundation for the KMS etcd encryption user journey. It ships only the KSM metric — recording rules, alerts, and a Grafana dashboard will follow in a separate PR after metrics have soaked in production.

What this PR adds

Component File Purpose
KSM metric observability/prometheus/values-mgmt.yaml Exposes ValidAzureKMSConfig condition as hostedClusterAPI_valid_azure_kms_config Prometheus gauge (StateSet: True/False/Unknown)

What's deferred (follow-up PR)

Deferred Why
KMS availability recording rules Need production data soak before setting alert thresholds
KMS alerts (availability + errors + latency + saturation) Need soak + alert-tester validation
Envelope recording rules (apiserver_envelope_encryption_*) Raw KAS pod metrics not scraped — blocked by HyperShift ServiceMonitor bug
Grafana dashboard Depends on recording rules + envelope metrics

E2E verification

  • KSM metric verified on personal dev mgmt cluster (pers-usw3haow-mgmt-1)
  • Metric hostedClusterAPI_valid_azure_kms_config{status="True"} confirmed flowing to Azure Monitor Workspace
  • Helm fixture tests regenerated and passing

Test plan

  • make test passes (helm template fixtures updated)
  • KSM metric produces correct StateSet values for haowang test HCP cluster

Copilot AI review requested due to automatic review settings June 17, 2026 01:49
@wanghaoran1988

Haoran Wang (wanghaoran1988) commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Dashboard Screenshots

image image

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.

⚠️ Not ready to approve

The KAS SRE metrics allow-list change would drop apiserver_request_sli_duration_seconds_{bucket,count} (breaking existing HCP latency SLIs), and the new dashboard’s histogram p99 queries are currently incorrect without rate(...[5m]).

Pull request overview

Adds an observability stack (metrics, recording rules, alerts, and a Grafana dashboard) to monitor the customer-managed etcd encryption (Azure KMS) user journey across HCPs.

Changes:

  • Exposes new HostedCluster condition metrics via kube-state-metrics (ValidAzureKMSConfig, EtcdAvailable) and adds new KMS-focused recording rules.
  • Introduces multi-window/multi-burn-rate alerting for KMS availability and KMS operation error budget burn, plus threshold alerts for latency/saturation/freshness.
  • Adds an SRE “user journey” Grafana dashboard for KMS/etcd encryption SLIs.
File summaries
File Description
observability/recording-rules-hcps.yaml Registers new KMS recording rule groups into the HCP recording-rules bundle.
observability/prometheus/values-mgmt.yaml Adds KSM customResourceState metrics for ValidAzureKMSConfig and EtcdAvailable HostedCluster conditions.
observability/prometheus/testdata/zz_fixture_TestHelmTemplate_helmtest_mgmt_resources.yaml Updates Helm golden fixture for the new KSM condition metrics.
observability/prometheus/testdata/zz_fixture_TestHelmTemplate_helmtest_mgmt_resources_unset.yaml Updates Helm golden fixture for the new KSM condition metrics (unset variant).
observability/grafana-dashboards/sre/user-journey/kms-etcd-encryption.json Adds the new SRE user-journey dashboard (11 panels) for KMS SLIs.
observability/alerts/HCPkmsMonitor-prometheusRule.yaml Adds KMS alert rules (availability burn-rate tiers, errors burn-rate tiers, and threshold alerts).
observability/alerts/HCPkmsMonitor-prometheusRule_test.yaml Adds promtool tests for the KMS alert rules.
observability/alerts/HCPkasRecord-prometheusRule-kms.yaml Adds recording rules for KSM-based KMS availability SLI windows.
observability/alerts/HCPkasRecord-prometheusRule-kms-envelope.yaml Adds recording rules for envelope-encryption KMS errors/latency/saturation SLIs.
observability/alerts/HCPkasRecord-prometheusRule-kms-envelope_test.yaml Adds promtool tests for the envelope-encryption KMS recording rules.
observability/alerts/HCPkasRecord-prometheusRule-kms_test.yaml Adds promtool tests for the KSM-based KMS recording rules.
observability/alerts-rp-services.yaml Registers the new KMS alert rule file into the RP lane bundle.
hypershiftoperator/deploy/templates/sre-metrics-set.configmap.yaml Updates the HyperShift SRE metrics-set allow-list for KAS metrics (now a restrictive regex).
hypershiftoperator/zz_fixture_TestHelmTemplate_dev_westus3_mgmt_1_hypershift.yaml Updates the HyperShiftOperator Helm fixture to reflect the new metrics-set allow-list.
dev-infrastructure/zz_fixture_TestHelmTemplate_dev_westus3_mgmt_1_arohcp_monitor.yaml Updates monitor Helm fixture for the new KSM condition metrics (rendered config).
dev-infrastructure/modules/metrics/rules/generatedRPPrometheusAlertingRules.bicep Regenerates RP alerting rule groups to include the new KMS alerts.
dev-infrastructure/modules/metrics/rules/generatedHCPRecordingRules.bicep Regenerates HCP recording rule groups to include the new KMS recording rules.

Copilot's findings

  • Files reviewed: 17/17 changed files
  • Comments generated: 4

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

Comment thread hypershiftoperator/deploy/templates/sre-metrics-set.configmap.yaml
Comment thread observability/grafana-dashboards/sre/user-journey/kms-etcd-encryption.json Outdated
Comment thread observability/grafana-dashboards/sre/user-journey/kms-etcd-encryption.json Outdated
Copilot AI review requested due to automatic review settings June 17, 2026 02:28

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.

⚠️ Not ready to approve

The generated RP alerting rules Bicep appears to have dropped existing nodepool rule groups and the new dashboard contains PromQL bugs (histogram_quantile without rate and NaN-on-idle error-rate expressions).

Copilot's findings
  • Files reviewed: 15/15 changed files
  • Comments generated: 6

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

Comment thread dev-infrastructure/modules/metrics/rules/generatedRPPrometheusAlertingRules.bicep Outdated
Comment thread observability/grafana-dashboards/sre/user-journey/kms-etcd-encryption.json Outdated
Comment thread observability/grafana-dashboards/sre/user-journey/kms-etcd-encryption.json Outdated
Comment thread observability/grafana-dashboards/sre/user-journey/kms-etcd-encryption.json Outdated
Comment thread observability/grafana-dashboards/sre/user-journey/kms-etcd-encryption.json Outdated
Comment thread observability/grafana-dashboards/sre/user-journey/kms-etcd-encryption.json Outdated

@swiencki Simon Wiencki (swiencki) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed in detail against the alerting ADR (openshift-online/architecture#79), the existing KAS availability pattern (#5527), and current prod metric availability. The KMS observability stack is well-constructed: the availability SLI uses the correct stateless kube-state-metrics pattern with deleted-cluster gating and full label preservation, the burn-rate math is right, promtool tests pass, and the dashboard is in the correct SRE user-journey location and registered.

The one blocking issue is wiring: the alerts are deployed to the services Azure Monitor Workspace while the recording rules they consume are produced in the HCP workspace, so as wired the alerts cannot fire. There are also several ADR-conformance and metric-availability gaps noted inline. Details below.

Comment thread observability/alerts-rp-services.yaml Outdated
Comment thread observability/alerts/HCPkmsMonitor-prometheusRule.yaml Outdated
Comment thread observability/alerts/HCPkmsMonitor-prometheusRule.yaml Outdated
Comment thread observability/alerts/HCPkmsMonitor-prometheusRule.yaml Outdated
Comment thread observability/alerts/HCPkmsMonitor-prometheusRule.yaml Outdated
Comment thread observability/alerts/HCPkasRecord-prometheusRule-kms-envelope.yaml Outdated
Comment thread observability/alerts/HCPkasRecord-prometheusRule-kms-envelope.yaml Outdated
Comment thread observability/alerts/HCPkasRecord-prometheusRule-kms.yaml Outdated
Comment thread observability/alerts/HCPkasRecord-prometheusRule-kms.yaml Outdated
Comment thread observability/prometheus/values-mgmt.yaml Outdated
Copilot AI review requested due to automatic review settings June 18, 2026 00:52

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.

⚠️ Not ready to approve

The KMS envelope recording rules drop the _id label on the error-series, which prevents the error-rate alert expressions from matching errors/total and will stop KMS error alerts from firing.

Copilot's findings
  • Files reviewed: 15/15 changed files
  • Comments generated: 2

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

Comment thread observability/alerts/HCPkasRecord-prometheusRule-kms-envelope.yaml Outdated
Comment thread observability/prometheus/values-mgmt.yaml
Copilot AI review requested due to automatic review settings June 18, 2026 23:42

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.

⚠️ Not ready to approve

There are correctness issues in the new PromQL recording/alerting setup (label-set mismatch risk) and the implemented kube-state-metrics conditions don’t match the PR description (missing EtcdAvailable).

Copilot's findings
  • Files reviewed: 17/17 changed files
  • Comments generated: 2

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

Comment thread observability/alerts/HCPkasRecord-prometheusRule-kms-envelope.yaml Outdated
Comment thread observability/prometheus/values-mgmt.yaml
Comment thread observability/alerts/HCPkmsMonitor-prometheusRule.yaml Outdated
@swiencki

Copy link
Copy Markdown
Collaborator

Was there a historical metrics report ran on the alerts that I can review? If not you will want to reach out to Mariusz Mazur (@mmazur) on what that looks like.

Copilot AI review requested due to automatic review settings June 23, 2026 00:56

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 22, 2026 05:41

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Comment thread observability/grafana-dashboards/sre/user-journey/kms-etcd-encryption.json Outdated
Comment thread observability/grafana-dashboards/sre/user-journey/kms-etcd-encryption.json Outdated
Comment thread observability/alerts/HCPkasRecord-prometheusRule-kms.yaml Outdated
Comment thread observability/alerts/HCPkasRecord-prometheusRule-kms_test.yaml Outdated
Copilot AI review requested due to automatic review settings July 22, 2026 05:59

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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread observability/grafana-dashboards/sre/user-journey/kms-etcd-encryption.json Outdated
Comment thread observability/grafana-dashboards/sre/user-journey/kms-etcd-encryption.json Outdated
Add KSM custom resource state config to expose the ValidAzureKMSConfig
HostedCluster condition as hostedClusterAPI_valid_azure_kms_config gauge.

This is the metrics collection foundation for the KMS etcd encryption
user journey (ARO-25913). Recording rules, alerts, and a Grafana
dashboard will follow in a separate PR after metrics have soaked in
production and thresholds can be validated.
Copilot AI review requested due to automatic review settings July 22, 2026 07:16

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread observability/prometheus/values-mgmt.yaml
@wanghaoran1988

Copy link
Copy Markdown
Contributor Author

/retest e2e-parallel

@wanghaoran1988

Copy link
Copy Markdown
Contributor Author

/test e2e-parallel

@wanghaoran1988

Copy link
Copy Markdown
Contributor Author

/retest e2e-parallel

@swiencki

Copy link
Copy Markdown
Collaborator

/lgtm
/approve

@mmazur

Copy link
Copy Markdown
Collaborator

/approve

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mmazur, swiencki, wanghaoran1988

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:

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

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD e671079 and 2 for PR HEAD 7bee246 in total

@openshift-ci

openshift-ci Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Haoran Wang (@wanghaoran1988): The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/api-validation a819220 link true /test api-validation
ci/prow/baseimage-generator-go-smoke-test a819220 link true /test baseimage-generator-go-smoke-test
ci/prow/baseimage-generator-images a819220 link true /test baseimage-generator-images
ci/prow/secrets-validation a819220 link true /test secrets-validation

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD ea29c43 and 1 for PR HEAD 7bee246 in total

@openshift-merge-bot
openshift-merge-bot Bot merged commit 93889dd into Azure:main Aug 1, 2026
19 checks passed
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.

4 participants