Repository navigation
[Core/Auth] Add RAY_AUTH_SKIP_METRICS to serve Ray's metrics endpoints without the auth token - #67264
Merged
rueian merged 2 commits intoOct 22, 2026
Conversation
…s without the auth token Signed-off-by: Chi-Sheng Liu <[email protected]>
…S in it Signed-off-by: Chi-Sheng Liu <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces the RAY_AUTH_SKIP_METRICS environment variable, which allows users to bypass token authentication specifically for Ray's metrics endpoints while keeping other endpoints protected. The changes update the WSGI token authentication middleware, Prometheus configuration generation, and add corresponding unit and integration tests to verify this behavior. I have no feedback to provide as there are no review comments.
rueian
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With token auth on, Ray's metrics endpoints require the token since #67128, and the only way to scrape them without one was to turn auth off for the whole cluster. Some scrapers can't send a bearer token, and some users protect the metrics port at the network layer instead. Setting
RAY_AUTH_SKIP_METRICS=1on every node now serves Ray's metrics endpoints (each node's metrics port, the dashboard head and both autoscaler monitors) without the token, whileRAY_AUTH_MODE=tokenstill protects everything else.All three metrics servers already go through
get_token_auth_wsgi_app, so the skip is checked there once. The env var is read withenv_bool, sotrueworks as well as1. Each Ray process reads it from its own environment, so it must be set wherever a node starts, for example inray upstart commands or KubeRay pod specs.When the skip is also set in the shell that runs
ray metrics launch-prometheus, it writes noauthorizationblock and runs Prometheus with the bundled config unchanged. Its warning for when it finds no token now says that every Ray target returns 401 unless the cluster's nodes setRAY_AUTH_SKIP_METRICS=1, since the launcher can't see the nodes' setting. With auth off, the env var changes nothing.Related issues
Closes #67251
Additional information
The opt-out is off unless the env var is set, so clusters that don't set it behave exactly as after #67128.