Skip to content

[operator] Add autoscaler metrics port to BuildAutoscalerContainer#4672

Open
ashutosh1807 wants to merge 1 commit intoray-project:masterfrom
ashutosh1807:fix/autoscaler-metrics-port
Open

[operator] Add autoscaler metrics port to BuildAutoscalerContainer#4672
ashutosh1807 wants to merge 1 commit intoray-project:masterfrom
ashutosh1807:fix/autoscaler-metrics-port

Conversation

@ashutosh1807
Copy link
Copy Markdown
Contributor

@ashutosh1807 ashutosh1807 commented Apr 2, 2026

Summary

BuildAutoscalerContainer() creates the autoscaler sidecar with Env, Command, Args, and Resources but no Ports. The autoscaler process serves Prometheus metrics on port 44217 (AUTOSCALER_METRIC_PORT), and the official PodMonitor scrapes port: as-metrics — but without a declared containerPort, Prometheus can't discover the endpoint.

This adds containerPort: 44217 with name as-metrics to the injected sidecar container, so the PodMonitor works out of the box when enableInTreeAutoscaling: true.

Fixes #4671

Changes

  • controllers/ray/utils/constant.go: Add DefaultAutoscalerMetricsPort (44217) and AutoscalerMetricsPortName ("as-metrics") constants
  • controllers/ray/common/pod.go: Declare the port in BuildAutoscalerContainer()
  • controllers/ray/common/pod_test.go: Update test fixture to include the new port

The autoscaler sidecar serves Prometheus metrics on port 44217, but
BuildAutoscalerContainer did not declare a containerPort for it. This
prevented the PodMonitor from discovering the as-metrics endpoint when
enableInTreeAutoscaling is true.

Fixes ray-project#4671

Signed-off-by: Ashutosh Agarwal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[operator] BuildAutoscalerContainer does not declare containerPort for autoscaler metrics (44217)

1 participant