Cloud Logging pricing (GCP): ingestion, retention, and query scans
Start with a calculator if you need a first-pass estimate, then use this guide to validate the assumptions and catch the billing traps.
Logging costs are predictable when you treat logs like data: bytes in, bytes stored, bytes scanned. The biggest wins come from controlling ingestion volume and retention, and from preventing dashboards from scanning wide windows repeatedly.
0) Inventory sources (do not blend)
List the sources that can dominate volume and model them separately.
- Ingress/access: very high volume, moderate size.
- Firewall/WAF: can be high volume and high size (rule metadata).
- Audit/security: lower volume but required retention.
- Application logs: depends on log level and request volume.
1) Ingestion (GB)
Ingestion is the core driver. If you have usage exports, use them. If not, estimate from event rate and payload size.
Tools: Log ingestion, Estimate GB/day guide.
- Model baseline + peak: incident traffic and verbose logging can create a peak month.
- Sample bytes/event for the top sources instead of using one blended average.
2) Retention (GB-month)
Retention is a storage multiplier. In steady state, stored volume is roughly the last N days of logs, so retained GB is approximately GB/day × retention days.
Tools: Retention storage, Tiered log storage.
- Keep a short hot window for troubleshooting and archive only what you must keep long-term.
- Split retention by log class (access vs audit vs app logs) instead of one global retention setting.
3) Query and scan (dashboards + alerts)
Query costs depend on how much data you scan and how often. Dashboards and alert rules can scan far more data than you expect, especially with broad time windows and frequent refresh.
Tool: Log scan/search.
- A dashboard refreshing every minute is 1,440 refreshes/day.
- Prefer queries that filter early and use narrower time windows.
Worked estimate template (copy/paste)
- GB/day ingested = sum over sources(events/day × bytes/event ÷ 1e9)
- GB/month ingested = GB/day × 30.4 (baseline + peak)
- Retained GB ~= GB/day × retention days (split by source)
- GB scanned/month = scans/day × GB/scan × 30.4 (dashboards + alerts)
Common pitfalls
- Turning on high-volume sources without measuring their payload sizes.
- Using one blended event size that hides a dominant source (ingress/firewall).
- Keeping long retention everywhere by default.
- Dashboards/alerts scanning wide windows repeatedly (query cost explosion).
- Verbose logging during incidents (peak ingestion dominates the month).
How to validate
- Sample payload sizes for top sources and compute bytes/event.
- Validate which sources are enabled and disable/suppress the noisiest first.
- Validate retention per log class and apply tiered storage if needed.
- Audit dashboard refresh intervals and alert windows (reduce repeated wide scans).