Skip to content

gocache/awscache: count get response and put body bytes by storage - #28

Merged
bradfitz merged 1 commit into
mainfrom
bradfitz/awscache_get_bytes
Nov 27, 2026
Merged

bradfitz merged 1 commit into
mainfrom
bradfitz/awscache_get_bytes

Conversation

@bradfitz

Copy link
Copy Markdown
Member

The only byte metrics were the gocache_aws_object_bytes histograms of
uncompressed object sizes, labeled by op, so a dashboard could show how
many gets each storage served (from gocache_aws_get_duration_seconds)
but not how many bytes: how much is served inline from DynamoDB,
through the blob servers, and from S3 directly when the blob servers
miss.

Add counters of the body bytes actually sent in get hit responses and
received in non-duplicate puts, labeled by storage. Get responses are
counted as sent: blobs go to clients that accept lz4 (as cigocacher
does) still compressed, as they came from the blob server or S3, so
counting their uncompressed size would overstate the bytes moved. Put
bodies arrive uncompressed.

Updates tailscale/corp#52240

The only byte metrics were the gocache_aws_object_bytes histograms of
uncompressed object sizes, labeled by op, so a dashboard could show how
many gets each storage served (from gocache_aws_get_duration_seconds)
but not how many bytes: how much is served inline from DynamoDB,
through the blob servers, and from S3 directly when the blob servers
miss.

Add counters of the body bytes actually sent in get hit responses and
received in non-duplicate puts, labeled by storage. Get responses are
counted as sent: blobs go to clients that accept lz4 (as cigocacher
does) still compressed, as they came from the blob server or S3, so
counting their uncompressed size would overstate the bytes moved. Put
bodies arrive uncompressed.

Updates tailscale/corp#52240

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: I0931d5a9d05b37e76df4ad6dc1595c0e80e5d3ea
@bradfitz
bradfitz requested a review from a team November 26, 2026 04:59
@bradfitz
bradfitz merged commit faada89 into main Nov 27, 2026
3 of 4 checks passed
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