Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add x-request-id to every request #1518

Merged
merged 6 commits into from
Jun 29, 2023
Merged

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Jun 19, 2023

On a suggestion from @XciD, this PR adds a custom x-request-id header in all calls made to the Hub. The request id is unique (uuid4()) and changes in each http call. The idea is to help debugging issues even when a 504 Gateway timeout is raised. At the moment, if the request id is created server-side but a 504 happens, the request id is not sent back to the client, making it much harder to track the issue in our logs.

cc @Pierrci @julien-c this shouldn't change anything for moon-landing

(I've also added a local debug log to help with it)

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 19, 2023

The documentation is not available anymore as the PR was closed or merged.

@Wauplin Wauplin marked this pull request as ready for review June 19, 2023 10:27
@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +2.14 🎉

Comparison is base (e4a419b) 80.12% compared to head (782f233) 82.27%.

❗ Current head 782f233 differs from pull request most recent head 3413f97. Consider uploading reports for the commit 3413f97 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1518      +/-   ##
==========================================
+ Coverage   80.12%   82.27%   +2.14%     
==========================================
  Files          58       57       -1     
  Lines        6268     6120     -148     
==========================================
+ Hits         5022     5035      +13     
+ Misses       1246     1085     -161     
Impacted Files Coverage Δ
src/huggingface_hub/utils/_http.py 100.00% <100.00%> (ø)

... and 28 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Wauplin Wauplin merged commit 14525a0 into main Jun 29, 2023
@Wauplin Wauplin deleted the add-request-id-in-all-requests branch June 29, 2023 08:52
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.

2 participants