Investigating Unexplained Bandwidth Spikes on September 24th
I understand your concern about the bandwidth spike! The good news is that Sanity provides Request Logs that can help you identify exactly what's causing high bandwidth usage.
How to Access Your Request Logs:
- Go to your project settings at sanity.io/manage
- Navigate to the Usage section
- Scroll to the bottom of the page
- Download your log data (you can get up to 1GB of logs from the last 7 days, including September 24th if you're still within that window)
Note: New exports can be requested every 24 hours, and logs are available up to the day before the download.
What's in the Logs:
The logs come as GZIPPED NDJSON files and contain detailed information about every request, including:
- Request Type (API, APICDN, or CDN) - crucial for understanding if it's content queries or asset downloads
- Full URL with query parameters
- Remote IP addresses - helps identify if traffic is coming from unexpected sources
- User Agent strings - can reveal bots or scrapers
- Referrer information
- Timestamps for pinpointing exact spikes
- GROQ Query Identifier - helps group similar queries together
Analyzing the Logs:
You can convert the compressed logs to CSV for easier analysis:
gunzip --stdout [logfile].ndjson.gz | npx json2csv --ndjson --output output.csvOr use tools like jq, GROQ CLI, Jupyter Notebook, or even upload samples to ChatGPT for help identifying patterns.
Common Culprits for Bandwidth Spikes:
Based on community cases, common causes include:
- Bot traffic or scrapers hitting your API
- Missing dependencies in useEffect hooks causing request loops
- Large asset downloads (images/videos)
- Inefficient queries running repeatedly
- CDN cache misses causing repeated fetches
Important: Filter out studioRequest entries when analyzing - those are from Sanity Studio and don't count toward your bandwidth usage or costs, so they won't explain billing spikes.
If you're outside the 7-day window or need more detailed assistance for September 24th specifically, you can contact Sanity support directly through the manage interface, and they can help you investigate specific dates using the Trace IDs and Span IDs in the logs.
Show original thread18 replies
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.