Skip to content

Commit

Permalink
feat(v2client): inject X-Request-ID in headers if REQUEST_ID in env
Browse files Browse the repository at this point in the history
If REQUEST_ID is set in the system env, then all v2 API calls will
have X-Request-ID header set to the value of REQUEST_ID. This is
particularly helpful in debugging.
  • Loading branch information
YaswanthKumar-eng authored and pallabpain committed Sep 4, 2024
1 parent 501ce5f commit 5ce15f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions riocli/v2client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ def _get_auth_header(self: Client, with_project: bool = True) -> dict:
if with_project and self._project is not None:
headers['project'] = self._project

custom_client_request_id = os.getenv('REQUEST_ID')
if custom_client_request_id:
headers['X-Request-ID'] = custom_client_request_id

return headers

# Project APIs
Expand Down

0 comments on commit 5ce15f1

Please sign in to comment.