Skip to content

feat(proxy): add upstream failover retry, read timeout, and trace ID propagation - #6

Merged
ATLURI0001 merged 1 commit into
mainfrom
feat/proxy-failover-timeout-and-trace-propagation
Nov 14, 2026
Merged

ATLURI0001 merged 1 commit into
mainfrom
feat/proxy-failover-timeout-and-trace-propagation

Conversation

@ATLURI0001

Copy link
Copy Markdown
Owner

Overview

Hardens proxy snippet invariants with upstream failover policies, uniform read/send timeouts, runtime header stripping (X-Powered-By), and end-to-end request trace ID (X-Request-ID) propagation through demo backend services.

Technical Highlights

  • Upstream Failover & Retries: Added proxy_next_upstream error timeout http_502 http_503 http_504; with proxy_next_upstream_tries 2; in nginx/snippets/proxy.conf to enable transparent fallback across pool members (e.g. api-a to api-b).
  • Read Timeout Alignment: Explicitly declared proxy_read_timeout 30s; alongside proxy_send_timeout 30s; and proxy_connect_timeout 3s;.
  • Runtime Fingerprint Mitigation: Added proxy_hide_header X-Powered-By; to prevent leaking backend framework versions to clients.
  • Trace ID Propagation: In apps/demo/app.py, extracted incoming X-Request-ID and forwarded it in both response headers and JSON/HTML payloads across /health and wildcard index routes.

Quality Assurance

  • Executed unit test suite via python -m unittest discover tests:
    • Verified proxy forwarding invariants including failover, timeout alignment, and header stripping.
    • Added test_trace_id_propagation_in_demo_app asserting header extraction and response payload inclusion.
    • Ran 17 tests with 0 failures in 0.002s.

@ATLURI0001
ATLURI0001 merged commit 7712437 into main Nov 14, 2026
0 of 2 checks passed
@ATLURI0001
ATLURI0001 deleted the feat/proxy-failover-timeout-and-trace-propagation branch November 14, 2026 05:59
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.

1 participant