Log serverless request receipt#2303
Open
hansent wants to merge 4 commits into
Open
Conversation
…est-received-log # Conflicts: # inference/core/interfaces/http/http_api.py # tests/inference/unit_tests/core/interfaces/http/test_http_api.py
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
Adds an early
Request receivedlog in the GCP serverless authorization middleware immediately after the existing observability context is prepared.Why
Some model requests can crash or terminate the inference server before the normal access log is emitted. Because the existing access log is written after request handling completes, those crash-triggering requests can disappear from the logs entirely. Logging request receipt as soon as the serverless middleware sees the request gives us a durable breadcrumb with the route that was hit before any model loading or inference work begins.
Details
API_LOGGING_ENABLEDis enabled.method,path,request_id, andexecution_idwhen available from_prepare_serverless_observability_context.Validation
python -m py_compile inference/core/interfaces/http/http_api.py tests/inference/unit_tests/core/interfaces/http/test_http_api.pygit diff --cached --checkI could not run pytest in this local shell because the environment is missing
pytest,fastapi, andstarlette.