Skip to content

feat: Log on successful POST to DCR - #28984

Merged
akash1810 merged 1 commit into
mainfrom
aa/dcr-request-logging
Jul 24, 2026
Merged

feat: Log on successful POST to DCR#28984
akash1810 merged 1 commit into
mainfrom
aa/dcr-request-logging

Conversation

@akash1810

@akash1810 akash1810 commented Jul 23, 2026

Copy link
Copy Markdown
Member

Note

This is a trimmed down version of #28983.

What does this change?

Whilst load testing DCR's tag-page-rendering, we've observed a correlation between payload size and latency. This change adds a log line after a request to DCR has been made to aid debugging. The log line is structured, with markers covering the URL, response code, content length and request duration.

I've attempted to namespace the markers to distinguish them from the request logs.

Whilst RelOps have been load testing DCR running on ECS, we've noticed the latency of a request is sometimes unexpectedly high. Additionally, the size of the payload sent to DCR and the size of DCR's response seem wildly different. We've a hypothesis that payload POSTed to DCR is a superset of what it needs (see also #28964 and #27894).

These logs should help us graph the size of the payload and the time taken to read it, so we can see if there's a correlation between the two.

Warning

This change will create a log line for each DCR request. To reduce noise, we could log only when a request is made to tag-page-rendering as that is the service we (RelOps) are currently looking at.

Example

Take https://www.theguardian.com/tone/minutebyminute, the HTML is 357688 bytes:

curl -I "https://www.theguardian.com/tone/minutebyminute"
HTTP/2 200
content-length: 357688

However, the data POSTed to DCR for this page is 838654 bytes:

curl -I "https://www.theguardian.com/tone/minutebyminute.json?dcr=true"
HTTP/2 200
content-length: 838654

Screenshots

After deploying to CODE, we can see the logs in Central ELK:

image

Checklist

@akash1810 akash1810 added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Jul 23, 2026
@akash1810
akash1810 force-pushed the aa/dcr-request-logging branch from 852107b to baae2eb Compare July 23, 2026 12:52
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@akash1810
akash1810 force-pushed the aa/dcr-request-logging branch from baae2eb to bc31d67 Compare July 23, 2026 13:16
@akash1810
akash1810 marked this pull request as ready for review July 23, 2026 13:41
@akash1810
akash1810 requested a review from a team as a code owner July 23, 2026 13:41
Add a log line after a request to DCR has been made to aid debugging.
Whilst load testing DCR's tag-page-rendering, we've observed a correlation between payload size and latency.
This log line should allow us to graph this to confirm this hypothesis.
@akash1810
akash1810 force-pushed the aa/dcr-request-logging branch from bc31d67 to e50fc86 Compare July 23, 2026 17:32

@Jakeii Jakeii 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.

Thanks for looking into this!

@akash1810
akash1810 merged commit c3159dd into main Jul 24, 2026
11 checks passed
@akash1810
akash1810 deleted the aa/dcr-request-logging branch July 24, 2026 13:45
@gu-prout

gu-prout Bot commented Jul 24, 2026

Copy link
Copy Markdown

Seen on ADMIN-PROD (merged by @akash1810 8 minutes and 39 seconds ago)

@gu-prout

gu-prout Bot commented Jul 24, 2026

Copy link
Copy Markdown

Seen on FRONTS-PROD (merged by @akash1810 9 minutes and 44 seconds ago)

@akash1810

Copy link
Copy Markdown
Member Author

This has been running for 2 full days now, producing ~18.5M logs a day:

image

The Central ELK cluster is still healthy, running with ~55% disk usage:

image

pull Bot pushed a commit to TheDegenerateDev5150/frontend that referenced this pull request Jul 27, 2026
Updates guardian#28984 to include the content length of the DCR response as a marker.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature Seen-on-ADMIN-PROD Seen-on-FRONTS-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants