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

Adding request_id to logs from CAS requests #173

Merged
merged 4 commits into from
Feb 18, 2025
Merged

Conversation

jgodlew
Copy link
Contributor

@jgodlew jgodlew commented Feb 14, 2025

  • Add debug log to http client whenever we receive a response from CAS, logging the request_id and status code.
  • Add request_id to error logs when a response from CAS fails
  • Refactor logic to process http response result into a helper trait/fn for consistency across CAS apis.

@jgodlew
Copy link
Contributor Author

jgodlew commented Feb 14, 2025

Example error message:

{"timestamp":"2025-02-14T20:08:00.057728Z","level":"ERROR","fields":{"message":"upload_xorb api failed: request id: 01JM316G9MD5PVP61YX80YZHRK, error: reqwest::Error { kind: Status(400), url: \"http://localhost:4884/xorb/default/73287bdf1a5ff5e17d61cee9302adc33a38b10d2344ba65443e50a3ef4db5148\" }","caller":"/Users/jgodlew/git/huggingface/xet-core/cas_client/src/http_client.rs:198"},"filename":"/Users/jgodlew/git/huggingface/xet-core/error_printer/src/lib.rs","line_number":28}

Copy link
Contributor

@assafvayner assafvayner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit, otherwise LGTM

Copy link
Collaborator

@seanses seanses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Can you also help refactor similar places in HttpShardClient?

@jgodlew
Copy link
Contributor Author

jgodlew commented Feb 18, 2025

Can you also help refactor similar places in HttpShardClient?

HttpShardClient should also have the refactors (uses process_error instead of multiple log_errors). The only place I didn't update was get_dedup_shards, as it is a "best-effort" API and we swallow unsuccessful requests.

@jgodlew jgodlew merged commit 4dcd042 into main Feb 18, 2025
2 checks passed
@jgodlew jgodlew deleted the jgodlew/cas-request-id branch February 18, 2025 23:30
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.

4 participants