Skip to content

docs-rs CDN: generate request ID in CDN - #1197

Merged
marcoieni merged 1 commit into
rust-lang:masterfrom
syphar:request-id
Sep 2, 2026
Merged

docs-rs CDN: generate request ID in CDN#1197
marcoieni merged 1 commit into
rust-lang:masterfrom
syphar:request-id

Conversation

@syphar

@syphar syphar commented Aug 26, 2026

Copy link
Copy Markdown
Member

will be useful for application and access logs later.

Also we will see it on our origin servers.

@syphar
syphar marked this pull request as ready for review August 26, 2026 18:29
@syphar

syphar commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

r? @marcoieni

// Generate the request ID at the POP receiving the client request. On
// shield POPs, preserve the ID set by the edge POP.
if shield.response_is_for_client() {
req.set_header(X_REQUEST_ID, Uuid::new_v4().to_string());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

did you consider using https://docs.rs/fastly/latest/fastly/struct.Request.html#method.get_client_request_id ?

Suggested change
req.set_header(X_REQUEST_ID, Uuid::new_v4().to_string());
let request_id = req
.get_client_request_id()
.context("this is the client request, it should have a request ID")?
.to_owned();
req.set_header(X_REQUEST_ID, request_id);

Disclaimer: finding found by AI

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@marcoieni marcoieni self-assigned this Aug 31, 2026
@syphar
syphar requested a review from marcoieni August 31, 2026 09:30

@marcoieni marcoieni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

applied

@marcoieni
marcoieni merged commit ccb61af into rust-lang:master Sep 2, 2026
7 checks passed
@syphar
syphar deleted the request-id branch September 2, 2026 07:45
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