Skip to content

feat: hardcode ETCD_METRICS=extensive in etcd StatefulSet template - #9192

Open
shaheen0b111 wants to merge 1 commit into
openshift:mainfrom
shaheen0b111:etcd-metrics
Open

feat: hardcode ETCD_METRICS=extensive in etcd StatefulSet template#9192
shaheen0b111 wants to merge 1 commit into
openshift:mainfrom
shaheen0b111:etcd-metrics

Conversation

@shaheen0b111

@shaheen0b111 shaheen0b111 commented Jul 31, 2026

Copy link
Copy Markdown

Summary

Enable grpc_server_handling_seconds histogram metrics on all HCP etcd pods by setting ETCD_METRICS=extensive unconditionally in the etcd StatefulSet template.

This exposes gRPC latency histograms needed for P99/P95 SLO alerting without requiring any annotation plumbing or controller logic.

Jira: ARO-26896

What changed

Single file: control-plane-operator/controllers/hostedcontrolplane/v2/assets/etcd/statefulset.yaml

Added ETCD_METRICS=extensive env var to the etcd container, after the existing ETCD_ENABLE_PPROF entry.

Why

  • etcd defaults to basic metrics mode which only emits counters (grpc_server_started_total, grpc_server_handled_total)
  • extensive mode additionally emits grpc_server_handling_seconds histograms (bucket/count/sum), which are required for computing P99/P95 gRPC request latency SLOs
  • There is no downside to enabling extensive mode unconditionally — the additional histogram metrics have minimal overhead

Testing

Tested on ARO-HCP personal dev environment:

  1. Built custom CPO image from this branch and deployed via CPO image override
  2. Created an HCP cluster via e2e test
  3. Verified ETCD_METRICS=extensive is set on all 3 etcd pods:
$ kubectl exec etcd-0 -c etcd -- env | grep ETCD_METRICS
ETCD_METRICS=extensive
  1. All 3 etcd pods running healthy (4/4 containers ready)
etcd-0   4/4   Running   0   3m
etcd-1   4/4   Running   0   3m
etcd-2   4/4   Running   0   3m

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Expanded etcd metrics collection for improved monitoring visibility.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: shaheen0b111
Once this PR has been reviewed and has the lgtm label, please assign enxebre 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

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 2d3807d3-ee80-4cae-915a-25d4dde51ae0

📥 Commits

Reviewing files that changed from the base of the PR and between 02c29c7 and 2b64afe.

⛔ Files ignored due to path filters (6)
  • control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/AROSwift/zz_fixture_TestControlPlaneComponents_etcd_statefulset.yaml is excluded by !**/testdata/**
  • control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/GCP/zz_fixture_TestControlPlaneComponents_etcd_statefulset.yaml is excluded by !**/testdata/**
  • control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/IBMCloud/zz_fixture_TestControlPlaneComponents_etcd_statefulset.yaml is excluded by !**/testdata/**
  • control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/ModernTLS/zz_fixture_TestControlPlaneComponents_etcd_statefulset.yaml is excluded by !**/testdata/**
  • control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/TechPreviewNoUpgrade/zz_fixture_TestControlPlaneComponents_etcd_statefulset.yaml is excluded by !**/testdata/**
  • control-plane-operator/controllers/hostedcontrolplane/testdata/etcd/zz_fixture_TestControlPlaneComponents_etcd_statefulset.yaml is excluded by !**/testdata/**
📒 Files selected for processing (1)
  • control-plane-operator/controllers/hostedcontrolplane/v2/assets/etcd/statefulset.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • control-plane-operator/controllers/hostedcontrolplane/v2/assets/etcd/statefulset.yaml

📝 Walkthrough

Walkthrough

The etcd container in the hosted control plane StatefulSet now sets ETCD_METRICS to extensive.

Suggested reviewers: ironcladlou, cblecker

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: setting ETCD_METRICS=extensive in the etcd StatefulSet template.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The pull request changes only seven YAML template/fixture files; the patch adds ETCD_METRICS entries and contains no Ginkgo test-title declarations or dynamic title values.
Test Structure And Quality ✅ Passed The PR changes one StatefulSet template and six generated YAML fixtures; it adds no Ginkgo test code, so the listed test-structure requirements are not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The PR adds only ETCD_METRICS=extensive; the StatefulSet template adds no affinity, spread, selector, toleration, replica, or disruption scheduling constraints.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The commit adds only ETCD_METRICS YAML entries and updates fixtures; it adds no Ginkgo e2e tests or networking/external-connectivity code.
No-Weak-Crypto ✅ Passed The parent-to-HEAD diff adds only ETCD_METRICS=extensive entries in the StatefulSet and fixtures; no added line uses MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The commit adds only ETCD_METRICS=extensive; no changed file adds privileged, hostPID/hostNetwork/hostIPC, SYS_ADMIN, root, or allowPrivilegeEscalation:true settings.
No-Sensitive-Data-In-Logs ✅ Passed The commit adds only ETCD_METRICS=extensive in the template and fixtures; it adds no logging commands or sensitive data.
✨ 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.

@openshift-ci openshift-ci Bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release and removed do-not-merge/needs-area labels Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.77%. Comparing base (fe62283) to head (2b64afe).
⚠️ Report is 72 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9192      +/-   ##
==========================================
+ Coverage   44.56%   44.77%   +0.21%     
==========================================
  Files         774      775       +1     
  Lines       97003    97210     +207     
==========================================
+ Hits        43228    43528     +300     
+ Misses      50783    50681     -102     
- Partials     2992     3001       +9     

see 28 files with indirect coverage changes

Flag Coverage Δ
cmd-support 38.42% <ø> (+0.02%) ⬆️
cpo-hostedcontrolplane 47.25% <ø> (+0.03%) ⬆️
cpo-other 45.45% <ø> (+0.20%) ⬆️
hypershift-operator 54.63% <ø> (+0.17%) ⬆️
other 34.32% <ø> (+1.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Enable grpc_server_handling_seconds histogram metrics on all HCP etcd
pods by setting ETCD_METRICS=extensive unconditionally. This exposes
gRPC latency histograms needed for P99/P95 SLO alerting.

Ref: ARO-26896
@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@shaheen0b111: all tests passed!

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.

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

Labels

area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant