Added a structured request-logging smoke test through app startup #572#633
Open
Rakshak05 wants to merge 4 commits into
Open
Added a structured request-logging smoke test through app startup #572#633Rakshak05 wants to merge 4 commits into
Rakshak05 wants to merge 4 commits into
Conversation
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.
Closes #572
Description
This PR introduces a top-level integration/smoke test to ensure that request IDs and structured JSON logging are correctly integrated and function end-to-end through application startup.
Specifically, the following changes were made:
logger.info("Health check endpoint accessed")call inside the/api/v1/healthendpoint inmain.pyto ensure request-level logs are emitted during the request cycle.testing/backend/integration/test_request_logging_smoke.pycontaining:test_request_id_appears_in_json_logs) checking that a generated request ID matches the one returned in response headers and is successfully correlated in the output JSON logs.test_passthrough_request_id) verifying that pre-existing request IDs sent in headers are propagated and correctly logged.log_capture) using the real application'sRequestIDFilterandJSONFormatter.Type of Change
How Has This Been Tested?
The smoke test was run and verified locally: