Skip to content

USHIFT-7407: Wire prometheus receiver scrape.d drop-ins for metrics exporters#7068

Open
copejon wants to merge 6 commits into
openshift:mainfrom
copejon:ushift-7407-otel-col-metrics
Open

USHIFT-7407: Wire prometheus receiver scrape.d drop-ins for metrics exporters#7068
copejon wants to merge 6 commits into
openshift:mainfrom
copejon:ushift-7407-otel-col-metrics

Conversation

@copejon

@copejon copejon commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds scrape_config_files: ["/etc/microshift/observability/scrape.d/*.yaml"] to all three otel-col profiles (small/medium/large), enabling prometheus receiver to auto-discover drop-in scrape configs
  • Ships three drop-in configs (kube-state-metrics.yaml, node-exporter.yaml, metrics-server.yaml) that use kubernetes_sd_configs with role: endpoints and mTLS to scrape each exporter's kube-rbac-proxy sidecar
  • Each metrics RPM subpackage (microshift-observability-metrics-server, -metrics-kube-state, -metrics-node-exporter) owns its drop-in file with %config(noreplace), so installing the metrics package automatically enables scraping when observability is present
  • Grants endpoints list/watch to the openshift-observability-client ClusterRole for kubernetes_sd endpoint discovery
  • Adds Robot Framework test cases that verify each exporter's characteristic metric appears in the otel-col prometheus export endpoint

Design

The scrape.d directory uses a glob-based drop-in pattern: the otel-col prometheus receiver watches /etc/microshift/observability/scrape.d/*.yaml and picks up any file placed there. Each metrics RPM subpackage installs its own scrape config, so the set of active scrape targets is determined entirely by which packages are installed — no manual configuration needed.

All three exporters are scraped over HTTPS using the observability-client certificate (mTLS through kube-rbac-proxy) and discovered via kubernetes_sd role: endpoints in the openshift-monitoring namespace.

Test plan

  • test/suites/optional/observability.robot — three new test cases verify characteristic metrics from each exporter (kube_node_info, node_cpu_seconds_total, metrics_server_kubelet_request_total)
  • test/suites/optional/metrics.robot — existing metrics test suite validates exporter deployment and service wiring
  • Manual verification on ushift-devel-el98: confirmed all three exporters scraped successfully with live mTLS

JIRA

https://issues.redhat.com/browse/USHIFT-7407

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added Prometheus metric scraping for metrics-server, node-exporter, and kube-state-metrics.
    • Added support for configurable scrape drop-ins across all OpenTelemetry Collector deployment sizes.
    • Enabled observability receivers to discover Kubernetes endpoints and access required metrics.
  • Bug Fixes

    • Improved endpoint address resolution for metrics collection tests.
  • Tests

    • Added coverage validating metrics from the newly supported observability components.

@openshift-ci-robot

openshift-ci-robot commented Jul 17, 2026

Copy link
Copy Markdown

@copejon: This pull request references USHIFT-7407 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Adds scrape_config_files: ["/etc/microshift/observability/scrape.d/*.yaml"] to all three otel-col profiles (small/medium/large), enabling prometheus receiver to auto-discover drop-in scrape configs
  • Ships three drop-in configs (kube-state-metrics.yaml, node-exporter.yaml, metrics-server.yaml) that use kubernetes_sd_configs with role: endpoints and mTLS to scrape each exporter's kube-rbac-proxy sidecar
  • Each metrics RPM subpackage (microshift-observability-metrics-server, -metrics-kube-state, -metrics-node-exporter) owns its drop-in file with %config(noreplace), so installing the metrics package automatically enables scraping when observability is present
  • Grants endpoints list/watch to the openshift-observability-client ClusterRole for kubernetes_sd endpoint discovery
  • Adds Robot Framework test cases that verify each exporter's characteristic metric appears in the otel-col prometheus export endpoint

Design

The scrape.d directory uses a glob-based drop-in pattern: the otel-col prometheus receiver watches /etc/microshift/observability/scrape.d/*.yaml and picks up any file placed there. Each metrics RPM subpackage installs its own scrape config, so the set of active scrape targets is determined entirely by which packages are installed — no manual configuration needed.

All three exporters are scraped over HTTPS using the observability-client certificate (mTLS through kube-rbac-proxy) and discovered via kubernetes_sd role: endpoints in the openshift-monitoring namespace.

Test plan

  • test/suites/optional/observability.robot — three new test cases verify characteristic metrics from each exporter (kube_node_info, node_cpu_seconds_total, metrics_server_kubelet_request_total)
  • test/suites/optional/metrics.robot — existing metrics test suite validates exporter deployment and service wiring
  • Manual verification on ushift-devel-el98: confirmed all three exporters scraped successfully with live mTLS

JIRA

https://issues.redhat.com/browse/USHIFT-7407

🤖 Generated with Claude Code

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: Enterprise

Run ID: fe8e7a01-bf62-49f6-a0e6-2a5ad8454823

📥 Commits

Reviewing files that changed from the base of the PR and between 87f768f and 20912ff.

📒 Files selected for processing (11)
  • assets/optional/observability/02-cluster-role.yaml
  • packaging/observability/opentelemetry-collector-large.yaml
  • packaging/observability/opentelemetry-collector-medium.yaml
  • packaging/observability/opentelemetry-collector-small.yaml
  • packaging/observability/scrape.d/kube-state-metrics.yaml
  • packaging/observability/scrape.d/metrics-server.yaml
  • packaging/observability/scrape.d/node-exporter.yaml
  • packaging/rpm/microshift.spec
  • test/assets/observability/otel_config.yaml
  • test/suites/optional/metrics.robot
  • test/suites/optional/observability.robot
🚧 Files skipped from review as they are similar to previous changes (8)
  • packaging/observability/scrape.d/metrics-server.yaml
  • packaging/observability/scrape.d/node-exporter.yaml
  • assets/optional/observability/02-cluster-role.yaml
  • packaging/observability/opentelemetry-collector-medium.yaml
  • test/suites/optional/observability.robot
  • test/assets/observability/otel_config.yaml
  • packaging/observability/opentelemetry-collector-small.yaml
  • packaging/observability/scrape.d/kube-state-metrics.yaml

Walkthrough

The observability configuration now loads Prometheus scrape drop-ins for optional workloads. RBAC permits endpoint discovery and metrics access, RPM packaging installs the fragments, collector pipelines export scraped metrics, and Robot Framework tests verify kube-state-metrics, node-exporter, and metrics-server data.

Changes

Observability scrape drop-ins

Layer / File(s) Summary
Endpoint discovery and metrics access
assets/optional/observability/02-cluster-role.yaml
RBAC now permits endpoint discovery and GET access to the kube-rbac-proxy /metrics URL.
Collector scrape pipeline
packaging/observability/opentelemetry-collector-*.yaml, test/assets/observability/otel_config.yaml
Collector configurations load /etc/microshift/observability/scrape.d/*.yaml and route Prometheus metrics through scrape pipelines.
Optional workload scrape fragments
packaging/observability/scrape.d/*, packaging/rpm/microshift.spec
HTTPS endpoint scrape jobs are added for metrics-server, node-exporter, and kube-state-metrics, then packaged under the shared drop-in directory.
Observability integration validation
test/suites/optional/metrics.robot, test/suites/optional/observability.robot
Tests enable the optional workloads, resolve endpoint addresses directly, and verify the corresponding exported metrics.

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

Sequence Diagram(s)

sequenceDiagram
  participant OptionalWorkloads
  participant KubernetesEndpoints
  participant PrometheusReceiver
  participant OTLPExporter
  OptionalWorkloads->>KubernetesEndpoints: Expose HTTPS service endpoints
  PrometheusReceiver->>KubernetesEndpoints: Discover endpoint targets
  PrometheusReceiver->>OptionalWorkloads: Scrape configured metrics
  PrometheusReceiver->>OTLPExporter: Export scraped metrics
Loading

Possibly related PRs

  • openshift/microshift#6809: Introduces kube-state-metrics manifests and kube-rbac-proxy behavior consumed by the new scrape configuration and RBAC.

Suggested labels: ready-for-human-review

Suggested reviewers: pmtk, jerpeter1


✅ Pre-merge checks override applied

The pre-merge checks have been overridden successfully. You can now proceed with the merge.

Overridden by @copejon via checkbox on 2026-07-17T18:47:13.045Z.

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding Prometheus scrape.d drop-ins for metrics exporters.
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 No Ginkgo tests were changed; the added Robot test titles are static and contain no dynamic names, timestamps, IPs, or generated identifiers.
Test Structure And Quality ✅ Passed PASS — The PR only adds Robot Framework tests; no Ginkgo It/BeforeEach/Eventually code was changed, so this Ginkgo-specific check is not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the diff only changes YAML/RPM/Robot files and no It/Describe/Context/When markers appear in changed tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR changes Robot Framework/tests and regular Go code only, so the SNO-specific check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PASS: The PR only changes observability configs, RBAC, packaging, and tests; no node selectors, affinity, spread constraints, replica logic, or PDBs were introduced.
Ote Binary Stdout Contract ✅ Passed Diff only adds klog logging and helper wiring in run.go/metrics helpers; no new fmt.Print*, os.Stdout, or setup-time stdout writes in main/TestMain/BeforeSuite.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the new Robot tests use internal cluster services and already bracket IPv6 hosts.
No-Weak-Crypto ✅ Passed PASS: Changed files only add scrape configs/tests/RBAC; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret comparisons appear in the touched files.
Container-Privileges ✅ Passed The only changed file in this checkout is a Robot test; no manifest privilege settings were added.
No-Sensitive-Data-In-Logs ✅ Passed No added logs/echoes expose secrets; new messages are limited to Loki errors and non-sensitive test/config output.
✨ 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 requested review from jerpeter1 and pmtk July 17, 2026 04:21
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 17, 2026
@copejon

copejon commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

This is a follow-up PR to #6809 and should not be merged until that PR is merged.

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 17, 2026
@copejon
copejon force-pushed the ushift-7407-otel-col-metrics branch from 3939bed to 71ccb68 Compare July 17, 2026 04:25

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 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 `@assets/optional/kube-state-metrics/02-custom-resource-state-configmap.yaml`:
- Around line 417-490: Update the HELP descriptions for the maxAllowed CPU and
memory metrics in the source bundle from “Minimum” to “Maximum,” while keeping
their extraction paths and names unchanged. Regenerate the rebase-managed custom
resource state ConfigMap so the generated manifest reflects both corrected
descriptions.
🪄 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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: fce4f36a-9f76-42ea-9610-573c978d761c

📥 Commits

Reviewing files that changed from the base of the PR and between c9062c6 and 71ccb68.

📒 Files selected for processing (43)
  • assets/optional/kube-state-metrics/00-namespace.yaml
  • assets/optional/kube-state-metrics/01-cluster-role-binding.yaml
  • assets/optional/kube-state-metrics/01-cluster-role.yaml
  • assets/optional/kube-state-metrics/01-service-account.yaml
  • assets/optional/kube-state-metrics/02-custom-resource-state-configmap.yaml
  • assets/optional/kube-state-metrics/02-kube-rbac-proxy-secret.yaml
  • assets/optional/kube-state-metrics/03-deployment.yaml
  • assets/optional/kube-state-metrics/04-service.yaml
  • assets/optional/kube-state-metrics/kustomization.aarch64.yaml
  • assets/optional/kube-state-metrics/kustomization.x86_64.yaml
  • assets/optional/kube-state-metrics/kustomization.yaml
  • assets/optional/kube-state-metrics/release-kube-state-metrics-aarch64.json
  • assets/optional/kube-state-metrics/release-kube-state-metrics-x86_64.json
  • assets/optional/node-exporter/00-namespace.yaml
  • assets/optional/node-exporter/01-cluster-role-binding.yaml
  • assets/optional/node-exporter/01-cluster-role.yaml
  • assets/optional/node-exporter/01-security-context-constraints.yaml
  • assets/optional/node-exporter/01-service-account.yaml
  • assets/optional/node-exporter/02-accelerators-collector-configmap.yaml
  • assets/optional/node-exporter/02-kube-rbac-proxy-secret.yaml
  • assets/optional/node-exporter/03-daemonset.yaml
  • assets/optional/node-exporter/04-service.yaml
  • assets/optional/node-exporter/kustomization.aarch64.yaml
  • assets/optional/node-exporter/kustomization.x86_64.yaml
  • assets/optional/node-exporter/kustomization.yaml
  • assets/optional/node-exporter/release-node-exporter-aarch64.json
  • assets/optional/node-exporter/release-node-exporter-x86_64.json
  • assets/optional/observability/02-cluster-role.yaml
  • packaging/observability/opentelemetry-collector-large.yaml
  • packaging/observability/opentelemetry-collector-medium.yaml
  • packaging/observability/opentelemetry-collector-small.yaml
  • packaging/observability/scrape.d/kube-state-metrics.yaml
  • packaging/observability/scrape.d/metrics-server.yaml
  • packaging/observability/scrape.d/node-exporter.yaml
  • packaging/rpm/microshift.spec
  • pkg/cmd/run.go
  • pkg/components/metrics.go
  • pkg/healthcheck/microshift_optional_workloads.go
  • scripts/auto-rebase/assets_cluster_monitoring_operator.yaml
  • test/assets/observability/otel_config.yaml
  • test/bin/common.sh
  • test/suites/optional/metrics.robot
  • test/suites/optional/observability.robot

processors: [ resourcedetection/system ]
exporters: [ otlp ]
metrics/pods:
metrics/scrape:

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.

Can this name change break something in an upgrade from 4.22?

@copejon copejon Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No it affects internal logs only

Comment thread test/assets/observability/otel_config.yaml
@copejon
copejon force-pushed the ushift-7407-otel-col-metrics branch from 71ccb68 to 7aa09ac Compare July 17, 2026 14:29

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 5

🤖 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 `@assets/optional/node-exporter/03-daemonset.yaml`:
- Line 32: Update the automountServiceAccountToken setting in the node-exporter
DaemonSet to false, since this workload does not require an automatically
mounted service account token.
- Line 33: Update the container definition under containers to add both
livenessProbe and readinessProbe for every container, using the required probe
paths and settings from the repository’s deployment instructions.
- Around line 148-150: Update the DaemonSet container securityContext to remove
privileged execution and root access by eliminating privileged: true and
runAsUser: 0. Retain only the minimum required security settings, and add an
explicit justification only if either setting is genuinely necessary.
- Around line 132-133: Remove hostNetwork and hostPID from the node-exporter
DaemonSet unless the deployment includes explicit, documented justification for
requiring host namespaces; preserve the DaemonSet’s other settings unchanged.
- Line 69: Update the container securityContext currently set to `{}` in the
node-exporter DaemonSet to disable privilege escalation, enforce a read-only
root filesystem, require a non-root user, and drop all Linux capabilities.
🪄 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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: b9108772-37fe-4401-a04f-1a94eac4a4b3

📥 Commits

Reviewing files that changed from the base of the PR and between 71ccb68 and 7aa09ac.

📒 Files selected for processing (43)
  • assets/optional/kube-state-metrics/00-namespace.yaml
  • assets/optional/kube-state-metrics/01-cluster-role-binding.yaml
  • assets/optional/kube-state-metrics/01-cluster-role.yaml
  • assets/optional/kube-state-metrics/01-service-account.yaml
  • assets/optional/kube-state-metrics/02-custom-resource-state-configmap.yaml
  • assets/optional/kube-state-metrics/02-kube-rbac-proxy-secret.yaml
  • assets/optional/kube-state-metrics/03-deployment.yaml
  • assets/optional/kube-state-metrics/04-service.yaml
  • assets/optional/kube-state-metrics/kustomization.aarch64.yaml
  • assets/optional/kube-state-metrics/kustomization.x86_64.yaml
  • assets/optional/kube-state-metrics/kustomization.yaml
  • assets/optional/kube-state-metrics/release-kube-state-metrics-aarch64.json
  • assets/optional/kube-state-metrics/release-kube-state-metrics-x86_64.json
  • assets/optional/node-exporter/00-namespace.yaml
  • assets/optional/node-exporter/01-cluster-role-binding.yaml
  • assets/optional/node-exporter/01-cluster-role.yaml
  • assets/optional/node-exporter/01-security-context-constraints.yaml
  • assets/optional/node-exporter/01-service-account.yaml
  • assets/optional/node-exporter/02-accelerators-collector-configmap.yaml
  • assets/optional/node-exporter/02-kube-rbac-proxy-secret.yaml
  • assets/optional/node-exporter/03-daemonset.yaml
  • assets/optional/node-exporter/04-service.yaml
  • assets/optional/node-exporter/kustomization.aarch64.yaml
  • assets/optional/node-exporter/kustomization.x86_64.yaml
  • assets/optional/node-exporter/kustomization.yaml
  • assets/optional/node-exporter/release-node-exporter-aarch64.json
  • assets/optional/node-exporter/release-node-exporter-x86_64.json
  • assets/optional/observability/02-cluster-role.yaml
  • packaging/observability/opentelemetry-collector-large.yaml
  • packaging/observability/opentelemetry-collector-medium.yaml
  • packaging/observability/opentelemetry-collector-small.yaml
  • packaging/observability/scrape.d/kube-state-metrics.yaml
  • packaging/observability/scrape.d/metrics-server.yaml
  • packaging/observability/scrape.d/node-exporter.yaml
  • packaging/rpm/microshift.spec
  • pkg/cmd/run.go
  • pkg/components/metrics.go
  • pkg/healthcheck/microshift_optional_workloads.go
  • scripts/auto-rebase/assets_cluster_monitoring_operator.yaml
  • test/assets/observability/otel_config.yaml
  • test/bin/common.sh
  • test/suites/optional/metrics.robot
  • test/suites/optional/observability.robot
🚧 Files skipped from review as they are similar to previous changes (40)
  • assets/optional/kube-state-metrics/kustomization.x86_64.yaml
  • assets/optional/kube-state-metrics/kustomization.yaml
  • assets/optional/node-exporter/release-node-exporter-aarch64.json
  • assets/optional/node-exporter/00-namespace.yaml
  • assets/optional/node-exporter/01-security-context-constraints.yaml
  • assets/optional/kube-state-metrics/01-cluster-role-binding.yaml
  • assets/optional/node-exporter/01-service-account.yaml
  • assets/optional/node-exporter/02-kube-rbac-proxy-secret.yaml
  • assets/optional/kube-state-metrics/release-kube-state-metrics-x86_64.json
  • assets/optional/kube-state-metrics/00-namespace.yaml
  • assets/optional/node-exporter/kustomization.yaml
  • assets/optional/node-exporter/01-cluster-role.yaml
  • assets/optional/node-exporter/04-service.yaml
  • assets/optional/kube-state-metrics/01-service-account.yaml
  • assets/optional/node-exporter/01-cluster-role-binding.yaml
  • assets/optional/kube-state-metrics/04-service.yaml
  • packaging/observability/scrape.d/node-exporter.yaml
  • test/suites/optional/observability.robot
  • assets/optional/kube-state-metrics/02-kube-rbac-proxy-secret.yaml
  • assets/optional/node-exporter/release-node-exporter-x86_64.json
  • packaging/observability/opentelemetry-collector-small.yaml
  • scripts/auto-rebase/assets_cluster_monitoring_operator.yaml
  • pkg/healthcheck/microshift_optional_workloads.go
  • packaging/observability/scrape.d/kube-state-metrics.yaml
  • assets/optional/kube-state-metrics/release-kube-state-metrics-aarch64.json
  • assets/optional/node-exporter/kustomization.aarch64.yaml
  • packaging/observability/scrape.d/metrics-server.yaml
  • assets/optional/node-exporter/kustomization.x86_64.yaml
  • test/assets/observability/otel_config.yaml
  • assets/optional/kube-state-metrics/01-cluster-role.yaml
  • assets/optional/kube-state-metrics/kustomization.aarch64.yaml
  • assets/optional/observability/02-cluster-role.yaml
  • pkg/cmd/run.go
  • packaging/observability/opentelemetry-collector-large.yaml
  • packaging/observability/opentelemetry-collector-medium.yaml
  • assets/optional/node-exporter/02-accelerators-collector-configmap.yaml
  • assets/optional/kube-state-metrics/02-custom-resource-state-configmap.yaml
  • assets/optional/kube-state-metrics/03-deployment.yaml
  • packaging/rpm/microshift.spec
  • test/suites/optional/metrics.robot

Comment thread assets/optional/node-exporter/03-daemonset.yaml
Comment thread assets/optional/node-exporter/03-daemonset.yaml
Comment thread assets/optional/node-exporter/03-daemonset.yaml
Comment thread assets/optional/node-exporter/03-daemonset.yaml
Comment thread assets/optional/node-exporter/03-daemonset.yaml
@copejon

copejon commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Addressed CodeRabbit summary pre-merge check findings:

  • Container-Privileges (error): Won't fix — duplicate of inline findings on assets/optional/node-exporter/03-daemonset.yaml. Rebase-managed manifest from upstream cluster-monitoring-operator; hostNetwork/hostPID/privileged/root are required by node-exporter.
  • Docstring Coverage (warning): Won't fix — coverage threshold is a style guideline, not a correctness issue.
  • Topology-Aware Scheduling (warning): Won't fix — rebase-managed manifest. Wildcard toleration matches upstream CMO deployment.
  • IPv6 Test Compatibility (warning): Applied — removed IPv4-only regex from Scrape Metrics From keyword in test/suites/optional/metrics.robot. Fixed in ec70660.

@pmtk

pmtk commented Jul 17, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 17, 2026
@copejon

copejon commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests-periodic-arm

@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 17, 2026
@copejon
copejon force-pushed the ushift-7407-otel-col-metrics branch from ec70660 to b42ae8c Compare July 17, 2026 16:41
@pmtk

pmtk commented Jul 17, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 17, 2026
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 17, 2026
@coderabbitai coderabbitai Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Jul 17, 2026
@pmtk

pmtk commented Jul 17, 2026

Copy link
Copy Markdown
Member

/lgtm
/retest

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 17, 2026
@openshift-ci

openshift-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: copejon, pmtk

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

@copejon

copejon commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

/unhold

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 18, 2026
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 18, 2026
@copejon
copejon force-pushed the ushift-7407-otel-col-metrics branch from 87f768f to e02b025 Compare July 18, 2026 14:24
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 18, 2026
@openshift-ci

openshift-ci Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

@copejon
copejon force-pushed the ushift-7407-otel-col-metrics branch from e02b025 to 644a3db Compare July 18, 2026 14:25
copejon and others added 6 commits July 18, 2026 09:36
…e name

The prometheus receiver's kubernetes_sd role:endpoints requires the
observability-client service account to list/watch endpoints. Without
this permission all scrape.d drop-in configs fail with a 403.

Also fixes a misleading comment on the nonResourceURLs /metrics rule,
renames the large profile pipeline from metrics/pods to metrics/scrape
for consistency with the other profiles, and adds missing blank lines
between RPM spec sections.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lone

Metrics subpackages use Recommends (not Requires) for
microshift-observability, so they can be installed without it. Without
owning the parent /etc/microshift/observability directory, rpm -e leaves
an empty orphaned directory behind. Add %dir ownership so the full tree
is cleaned up on removal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Scrape Metrics From keyword validated the endpoint IP with an
IPv4-only regex, which would reject IPv6 addresses and break IPv6-only
CI. The jsonpath already returns a valid IP string from the Kubernetes
API; the regex was unnecessary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  Run With Kubeconfig merges stderr into stdout. In Kubernetes 1.33+,
  oc get endpoints emits a deprecation warning to stderr that gets
  prepended to the IP address, breaking the curl --resolve argument.
  Switch to Command Should Work which separates stdout from stderr.
@copejon
copejon force-pushed the ushift-7407-otel-col-metrics branch from 644a3db to 20912ff Compare July 18, 2026 14:36
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 18, 2026
@copejon

copejon commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

/verified by ci

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 18, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@copejon: This PR has been marked as verified by ci.

Details

In response to this:

/verified by ci

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot

openshift-ci-robot commented Jul 18, 2026

Copy link
Copy Markdown

@copejon: This pull request references USHIFT-7407 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Adds scrape_config_files: ["/etc/microshift/observability/scrape.d/*.yaml"] to all three otel-col profiles (small/medium/large), enabling prometheus receiver to auto-discover drop-in scrape configs
  • Ships three drop-in configs (kube-state-metrics.yaml, node-exporter.yaml, metrics-server.yaml) that use kubernetes_sd_configs with role: endpoints and mTLS to scrape each exporter's kube-rbac-proxy sidecar
  • Each metrics RPM subpackage (microshift-observability-metrics-server, -metrics-kube-state, -metrics-node-exporter) owns its drop-in file with %config(noreplace), so installing the metrics package automatically enables scraping when observability is present
  • Grants endpoints list/watch to the openshift-observability-client ClusterRole for kubernetes_sd endpoint discovery
  • Adds Robot Framework test cases that verify each exporter's characteristic metric appears in the otel-col prometheus export endpoint

Design

The scrape.d directory uses a glob-based drop-in pattern: the otel-col prometheus receiver watches /etc/microshift/observability/scrape.d/*.yaml and picks up any file placed there. Each metrics RPM subpackage installs its own scrape config, so the set of active scrape targets is determined entirely by which packages are installed — no manual configuration needed.

All three exporters are scraped over HTTPS using the observability-client certificate (mTLS through kube-rbac-proxy) and discovered via kubernetes_sd role: endpoints in the openshift-monitoring namespace.

Test plan

  • test/suites/optional/observability.robot — three new test cases verify characteristic metrics from each exporter (kube_node_info, node_cpu_seconds_total, metrics_server_kubelet_request_total)
  • test/suites/optional/metrics.robot — existing metrics test suite validates exporter deployment and service wiring
  • Manual verification on ushift-devel-el98: confirmed all three exporters scraped successfully with live mTLS

JIRA

https://issues.redhat.com/browse/USHIFT-7407

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

  • Added Prometheus metric scraping for metrics-server, node-exporter, and kube-state-metrics.

  • Added support for configurable scrape drop-ins across all OpenTelemetry Collector deployment sizes.

  • Enabled observability receivers to discover Kubernetes endpoints and access required metrics.

  • Bug Fixes

  • Improved endpoint address resolution for metrics collection tests.

  • Tests

  • Added coverage validating metrics from the newly supported observability components.

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 openshift-eng/jira-lifecycle-plugin repository.

@copejon

copejon commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests
/test e2e-aws-tests-arm
/test e2e-aws-tests-bootc-arm-el9
/test test-rebase
/test verify-deps

@copejon

copejon commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

/test test-rebase

@copejon

copejon commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests
/test e2e-aws-tests-arm
/test test-rebase

@openshift-ci

openshift-ci Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

@copejon: 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/e2e-aws-tests-bootc-periodic-el9 644a3db link true /test e2e-aws-tests-bootc-periodic-el9
ci/prow/e2e-aws-tests-bootc-periodic-arm-el9 644a3db link true /test e2e-aws-tests-bootc-periodic-arm-el9
ci/prow/test-rebase 20912ff link false /test test-rebase
ci/prow/e2e-aws-tests-bootc-c2cc-arm 644a3db link true /test e2e-aws-tests-bootc-c2cc-arm
ci/prow/e2e-aws-tests-bootc-periodic-arm-el10 644a3db link true /test e2e-aws-tests-bootc-periodic-arm-el10
ci/prow/e2e-aws-tests-periodic 644a3db link true /test e2e-aws-tests-periodic
ci/prow/e2e-aws-tests-bootc-c2cc 644a3db link true /test e2e-aws-tests-bootc-c2cc
ci/prow/e2e-aws-tests-periodic-arm 644a3db link true /test e2e-aws-tests-periodic-arm
ci/prow/e2e-aws-tests-bootc-periodic-el10 644a3db link true /test e2e-aws-tests-bootc-periodic-el10

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants