fix: only show enabled backends in /health response#6769
Open
koriyoshi2041 wants to merge 1 commit intotensorzero:mainfrom
Open
fix: only show enabled backends in /health response#6769koriyoshi2041 wants to merge 1 commit intotensorzero:mainfrom
koriyoshi2041 wants to merge 1 commit intotensorzero:mainfrom
Conversation
Author
|
I have read the Contributor License Agreement (CLA) and hereby sign the CLA. |
Member
|
these tests will fail. |
Author
|
Could you clarify which tests you expect to fail? The unit tests in Are you referring to specific E2E tests that assert on the health response format? Happy to update those as well. |
Member
|
I thought we had e2e tests that assert on the full shape of the response but it should be fine. /check-fork |
…ensorzero#6750) The /health endpoint previously always included all backends (ClickHouse, Postgres, Valkey, Valkey cache) in its response regardless of whether they were actually configured. This changes the health check to only include a backend in the response when it is enabled, keeping the response focused on the services that are actually in use.
273935f to
9081251
Compare
Member
|
/check-fork |
Contributor
|
🚀 General Checks workflow triggered on new branch external-contributor/pr-6769! View the run: https://github.com/tensorzero/tensorzero/actions/runs/23214904673 |
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.
Summary
Resolves #6750. The
/healthendpoint previously always included all backends (ClickHouse, Postgres, Valkey, Valkey cache) in its response, even when they were disabled. This made the response noisy and potentially confusing for operators.Changes:
is_clickhouse_enabled(),is_postgres_enabled(),is_valkey_enabled()helpers that check concrete connection typeshealth_check_inner()to accept concrete types instead ofdyn HealthCheckable, enabling compile-time backend state inspectionfutures::join!withtokio::join!(removes an unnecessary dependency)Before:
{"gateway": "ok", "clickhouse": "ok", "postgres": "ok", "valkey": "ok", "valkey_cache": "ok"}After (e.g., only ClickHouse + Postgres configured):
{"gateway": "ok", "clickhouse": "ok", "postgres": "ok"}Test plan
test_health_handler_all_disabled— verifies only "gateway" appears when all backends are disabledcargo check -p tensorzero-corepasses