Summary
When a test fails, debugging requires correlating the test with the actual HTTP request traces in the Jaeger UI. Currently, x-request-id headers (assigned by the gateway/Envoy on every response) are only used in the dedicated tracing tests. There's no mechanism to surface these IDs in Report Portal, making it difficult to find the relevant Jaeger traces for a failed test.
Problem
After a test failure in CI, an engineer needs to:
- Open Report Portal to see which test failed
- Manually try to reproduce or guess what happened at the gateway level
- Search Jaeger blindly without knowing which request IDs belong to the failed test
There is no link between the test result in Report Portal and the distributed traces in Jaeger.
Proposed Solution
Capture the trace request ID header from every HTTP response made by KuadrantClient during a test and attach the collected IDs to the corresponding test entry in Report Portal.
Configurable header name
The header carrying the request ID depends on how tracing is configured in the Kuadrant CR. Currently the default is x-request-id (set by Envoy/Istio), but users can configure a different header name on the Kuadrant CR when setting up tracing. The testsuite must support this:
- Add a new setting in
config/settings.yaml with the default value of x-request-id under tracing.request_id_header.
- Users can override it in
config/settings.local.yaml or via KUADRANT_TRACING__request_id_header env var to match whatever header their Kuadrant CR is configured to use.
KuadrantClient reads this setting to know which response header to capture.
Implementation approach
-
Collect request IDs in KuadrantClient (testsuite/httpx/__init__.py):
- After each request, extract the configured request ID header from the response and store it in a list on the client instance (similar to the existing
denied_request_ids tracking pattern).
-
Expose collected IDs via the client fixture (testsuite/tests/singlecluster/conftest.py):
- The
client fixture already yields a KuadrantClient instance — the collected request IDs are accessible after the test runs.
-
Write IDs to JUnit XML as Report Portal properties (testsuite/tests/conftest.py):
- Add a pytest hook (or extend the existing
pytest_runtest_makereport) that, on test failure (or optionally on every test), appends the collected request IDs as __rp_request_ids user property.
- The existing RP integration pipeline (
testsuite-rptool) already imports __rp_-prefixed properties from JUnit XML.
-
Report Portal display:
- Request IDs appear as test attributes/properties in Report Portal.
- Engineers can copy any ID and search for it in Jaeger UI using the
request_id tag (e.g., tags={"request_id": "<id>"}) to see the full distributed trace across kuadrant-filter, Authorino, Limitador, and the gateway.
Optional enhancements
- Jaeger deep-link: If the Jaeger/Tempo URL is known from config, generate a clickable link directly to the trace search (e.g.,
http://<jaeger>/search?service=kuadrant-filter&tags={"request_id":"<id>"}).
- Scope control: Only attach request IDs on failure to keep Report Portal entries clean for passing tests.
- Multiple clients: Handle tests that use more than one client instance (e.g.,
client and client2).
Existing patterns to leverage
KuadrantClient already tracks X-Testsuite-Tracking UUIDs and denied_request_ids — the same pattern can be reused for request ID collection.
- The
pytest_runtest_makereport hook in testsuite/tests/conftest.py already writes __rp_rerun_* properties to report.user_properties — request IDs can be added the same way.
- Tracing tests already extract
x-request-id via response.headers.get("x-request-id") and use it to query Jaeger — the query pattern is proven.
- Dynaconf settings with
KUADRANT_ prefix env var override is already the standard config mechanism in the testsuite.
Acceptance criteria
Summary
When a test fails, debugging requires correlating the test with the actual HTTP request traces in the Jaeger UI. Currently,
x-request-idheaders (assigned by the gateway/Envoy on every response) are only used in the dedicated tracing tests. There's no mechanism to surface these IDs in Report Portal, making it difficult to find the relevant Jaeger traces for a failed test.Problem
After a test failure in CI, an engineer needs to:
There is no link between the test result in Report Portal and the distributed traces in Jaeger.
Proposed Solution
Capture the trace request ID header from every HTTP response made by
KuadrantClientduring a test and attach the collected IDs to the corresponding test entry in Report Portal.Configurable header name
The header carrying the request ID depends on how tracing is configured in the Kuadrant CR. Currently the default is
x-request-id(set by Envoy/Istio), but users can configure a different header name on the Kuadrant CR when setting up tracing. The testsuite must support this:config/settings.yamlwith the default value ofx-request-idundertracing.request_id_header.config/settings.local.yamlor viaKUADRANT_TRACING__request_id_headerenv var to match whatever header their Kuadrant CR is configured to use.KuadrantClientreads this setting to know which response header to capture.Implementation approach
Collect request IDs in
KuadrantClient(testsuite/httpx/__init__.py):denied_request_idstracking pattern).Expose collected IDs via the
clientfixture (testsuite/tests/singlecluster/conftest.py):clientfixture already yields aKuadrantClientinstance — the collected request IDs are accessible after the test runs.Write IDs to JUnit XML as Report Portal properties (
testsuite/tests/conftest.py):pytest_runtest_makereport) that, on test failure (or optionally on every test), appends the collected request IDs as__rp_request_idsuser property.testsuite-rptool) already imports__rp_-prefixed properties from JUnit XML.Report Portal display:
request_idtag (e.g.,tags={"request_id": "<id>"}) to see the full distributed trace across kuadrant-filter, Authorino, Limitador, and the gateway.Optional enhancements
http://<jaeger>/search?service=kuadrant-filter&tags={"request_id":"<id>"}).clientandclient2).Existing patterns to leverage
KuadrantClientalready tracksX-Testsuite-TrackingUUIDs anddenied_request_ids— the same pattern can be reused for request ID collection.pytest_runtest_makereporthook intestsuite/tests/conftest.pyalready writes__rp_rerun_*properties toreport.user_properties— request IDs can be added the same way.x-request-idviaresponse.headers.get("x-request-id")and use it to query Jaeger — the query pattern is proven.KUADRANT_prefix env var override is already the standard config mechanism in the testsuite.Acceptance criteria
tracing.request_id_headersetting (default:x-request-id)KuadrantClientduring test execution__rp_user properties in JUnit XML)testsuite-rptoolimport pipeline without modifications