Repository navigation
PrometheusMonitor: use oc exec instead of oc rsh to avoid 16KB truncation - #31705
ptalgulk01 wants to merge 1 commit into
Conversation
|
Pipeline controller notification This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration. Use |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ptalgulk01 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Scheduling tests matching the |
|
@ptalgulk01: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Summary
compat_otp.Monitor's Prometheus-querying methods (InstantQuery/SimpleQuery,RangeQuery,queryRules/GetAllRules/GetAlertRules/GetRecordRules, andGetAlerts) all fetch their response by runningcurlinside theprometheus-k8spod viaRemoteShPod, which executes the command withoc rsh.Direct experimentation (see discussion on openshift/openshift-tests-private#30147) found that
oc rsh-captured output gets hard-truncated at 16,384 bytes, whileoc execreturns the complete response regardless of size:oc rsh -n openshift-monitoring prometheus-k8s-0 sh -c "curl ..."oc rsh -n openshift-monitoring prometheus-k8s-0 curl ...oc exec -n openshift-monitoring prometheus-k8s-0 -- sh -c "curl ..."oc exec -n openshift-monitoring prometheus-k8s-0 -- curl ...On a cluster with enough concurrently firing/pending alerts to push
/api/v1/alertspast 16KB, this makes consumers ofGetAlerts()fail with an unparseable/truncated JSON response, deterministically, on every call — not an intermittent flake.Fix
RemoteExecPod()inpods.go: same signature shape asRemoteShPod, but runs the command viaoc exec -n <namespace> <pod> -- <cmd...>instead ofoc rsh.Monitor/PrometheusMonitorquery methods (InstantQuery,RangeQuery,queryRules,GetAlerts) to useRemoteExecPodinstead ofRemoteShPod.RemoteShPoditself is untouched, so this doesn't change behavior for any other caller.Test plan
go build ./test/extended/util/compat_otp/...passesGetAlerts()no longer truncatesSummary by CodeRabbit