OSAC-7788: scrape the fulfillment and operator metrics #2488
All Vouch review confidence checks passed
Residual risk 0.29 = Change Risk (0.55) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.55 · 589 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.382
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #2488"
general
weight: 0.35
dcritch
The six fulfillment services, osac-operator and the BMF operator all serve Prometheus metrics, and no chart shipped a monitor for any of them, so on OpenShift nothing scraped them. The prometheus.io/scrape annotations on the fulfillment Services are the legacy discovery convention, which the OpenShift monitoring stack ignores: it selects targets only through ServiceMonitor and PodMonitor.
One ServiceMonitor covers all six fulfillment endpoints, selected by a new osac.openshift.io/metrics label rather than one monitor per component, because the components are gated inconsistently (consoleProxy.disabled is negated, eventPublisher.enabled is positive, the rest are ungated). An unrendered Service is simply not selected, and Prometheus still derives a job label per Service, so nothing is lost. fulfillment-ingress-proxy-metrics had no labels at all; its two siblings select the same pods but expose no metrics port, so they stay unlabelled and unscraped.
Both operators serve controller-runtime secure metrics on 8443, not plain HTTP on 8002 as the issue states, so their monitors scrape over HTTPS and skip verification of the self-signed certificate controller-runtime generates. The token cannot come from bearerTokenFile, the obvious choice and the one the kubebuilder scaffolding suggests: OpenShift's user-workload Prometheus runs with arbitraryFSAccessThroughSMs.deny and drops any ServiceMonitor in a workload namespace that reads a token off the filesystem. So each operator chart now creates a scrape identity -- a ServiceAccount bound to nothing but GET on /metrics, and a service-account-token Secret the endpoint's authorization.credentials names.
All of it is opt-out and guarded on the ServiceMonitor CRD, so a Kind cluster with no Prometheus operator still renders and installs the charts. The Envoy proxy returns 2647 series per scrape; a metricRelabeling drops the per-worker-thread breakdowns, about 640 of them, and is a no-op for the five Go services.
osac-ui is out of scope despite the issue's summary: it exposes no metrics port, only http on 80.
The prometheus.io annotations are kept for Prometheus installations that scrape on annotations, with a comment recording that they are inert on OpenShift.
Also drops a duplicate control-plane label key from the BMF metrics Service. The labels helper already emits it; Helm tolerated the repeat, a strict YAML parser does not, and the rendered output is unchanged.
Verified on a 3-node OCP 4.22 cluster with user-workload monitoring enabled: all eight targets report up with no scrape error, and inbound_unary_request_count, db_operation_duration_bucket, envoy_cluster_upstream_rq_total and controller_runtime_reconcile_total are queryable. The ingress proxy retains 2015 of its 2647 series and no envoy_listener_worker_ or envoy_server_worker_watchdog_ series.
The ten
helm unittestsuites this PR originally carried are dropped. #2520 removed helm-unittest from the repository -- the plugin install, every invocation in the helm-unit leg, the existing suites in osac-csi-driver, osac-installer and osac-metering, and all references in docs/ -- leaving these with no runner. Restoring that wiring belongs in its own change, not one about ServiceMonitors. The ci-filters entry that selected the leg for these charts is reverted with them: the helm-unit leg's offline render checks are scoped to the preflight engine and report, so a chart-only change would have selected a leg that exercises nothing in them.What still covers the monitors is
osac-installer/scripts/test-input-validation.sh, which the Helm lint workflow runs, not the removed leg. It renders each monitor through the umbrella chart with the ServiceMonitor CRD present and asserts the scrape interval's value and quoting -- the CRD typesintervalas a string, so a bare0is rejected at apply time whilehelm templateaccepts it, and an exit-status check cannot see the fault. The schema side rejects fractional and Go-only-unit intervals. 18 cases, six per chart.Selectors, which Services carry
osac.openshift.io/metrics, the operators' HTTPS, token and TLS endpoint settings, and the.Capabilities.APIVersions.Hasguards are now unasserted. The four testing guides record that rather than claiming a tier that no longer exists.Re-verified after merging
main:helm lintclean on all three charts (withci-values.yamlfor fulfillment-service, as the workflow does); each chart still renders no ServiceMonitor without the CRD api-version and one with it; the input-validation gate passes including all 18 scrape-interval cases; yamllint, gitleaks and pre-commit clean on the changed files.Assisted-by: Claude Code <noreply@anthropic.com>