Cost of Running a SaaS on AWS: Logs Cost More Than Compute
Orkosi Team · · 12 min read

Most founders budget for servers and get surprised by paperwork. When you add up the real cost of running a SaaS on AWS for a product with a few hundred to a few thousand users, the compute line is often smaller than the telemetry line: CloudWatch Logs ingestion, custom metrics, dashboards, alarms and whatever APM agent you installed on day three. The machines doing the work cost less than the machines describing the work.

The bill that surprises every first-time SaaS founder
The shape of a small SaaS bill is counterintuitive. Compute for a low-traffic product is genuinely cheap now. Observability — collecting logs, metrics and traces so you can understand what a running system is doing — is priced per gigabyte and per metric, and neither of those is capped by how many customers you have.
A typical small-SaaS cost shape
Here is an illustrative breakdown, not real AWS pricing, for a product serving roughly 500 active users from a single region with a Lambda-based API, a small managed database and default framework logging left switched on:
| Line item | Share of bill | Why |
|---|---|---|
| Managed database | ~35% | Always-on instance, storage, backups |
| Logs ingestion and storage | ~30% | Per-GB ingest, no retention policy set |
| Compute (Lambda/containers) | ~12% | Scales with requests, which are few |
| Custom metrics and alarms | ~10% | Priced per metric name and dimension set |
| Data transfer, NAT, misc | ~8% | NAT Gateway hourly charges |
| Third-party APM | ~5% | Per-host or per-GB plan |
Those proportions vary enormously, but the pattern repeats: logs plus metrics frequently beat compute. For the actual numbers, read Amazon CloudWatch Pricing and AWS Lambda Pricing directly, because rates differ by region and change over time. The useful exercise is comparing those two pages side by side: a million Lambda invocations at modest memory costs very little, while a few hundred gigabytes of log ingestion does not.
Why nobody warns you about telemetry
Tutorials optimise for getting something working, and verbose logging makes tutorials work. Framework defaults print every request. Example code logs the full response body. Nobody writing a "deploy your first API" guide is thinking about your month-nine bill.
The second reason is that telemetry spend has no natural ceiling tied to revenue. A pricing page tells you what 10,000 users cost. Nothing tells you what one accidental logger.info(JSON.stringify(payload)) inside a retry loop costs.
Why observability scales with chattiness, not with customers
Compute and logging scale on different axes, and that is the whole story.
Compute scales with work done
Request volume determines compute. Ten requests per second on a serverless platform bills for ten invocations per second, plus memory and duration. Doubling your customers roughly doubles your compute — a boring, predictable relationship, which is exactly why it rarely surprises anyone. Container and instance-based compute is even more predictable: you pay for the box whether it is busy or idle, so a small SaaS on one right-sized instance has an effectively fixed monthly compute cost.
Logs scale with how talkative your code is
Log volume is a function of verbosity per unit of work, not units of work. Write ten log lines per request and your ingestion is ten times what it would be at one line. Serialise a 4 KB JSON payload into each of those lines and you are ingesting 40 KB per request before anything goes wrong.
Then the multipliers arrive. Health checks from a load balancer hitting /health every 10 seconds produce roughly 250,000 log lines a month from zero customers. Retries log the same failure three times. A stack trace is 2 to 20 KB. A debug statement inside a loop over 1,000 rows writes 1,000 lines for one request.
CloudWatch charges separately for data ingested, data stored, custom metrics, dashboards and alarms, as set out on the CloudWatch pricing page. Every one of those dimensions responds to developer verbosity rather than customer count. That is the structural reason AWS observability costs behave the way they do.
The four line items that dominate the cost of running a SaaS on AWS
Naming the drivers is not enough. You need the mechanism, because the mechanism tells you what to change.
Log ingestion per GB
Ingestion is almost always the biggest telemetry item, and it is charged on the uncompressed bytes you send. It is also the hardest to notice, because no single log line looks expensive. The damage is cumulative and invisible until the invoice arrives.
A practical rule: estimate bytes per request times requests per month, then add health checks and background jobs. If that number is in the hundreds of gigabytes for a product with modest traffic, your code is the problem, not AWS.
Custom metrics and high-cardinality tags
Custom metrics are priced per unique combination of metric name and dimensions. Cardinality is the number of distinct values a dimension can take. Tag a metric with region and you have maybe five series. Tag it with user_id and you have one series per user, each billed as a separate custom metric. Tag by request_id and you have invented a metric per request, which is the most expensive way ever devised to count things. High-cardinality data belongs in logs or traces, not in metrics.
Retention you never set
CloudWatch log groups default to never expiring. Unless you set a retention policy, every debug line from your first prototype is still sitting there accruing storage charges, forever, for a version of the code that no longer exists.
This is the single most common unforced error in a SaaS infrastructure cost breakdown. It is also a five-minute fix, which makes it more embarrassing, not less.
Third-party APM priced per host or per GB
Application performance monitoring vendors charge per host, per agent, per container, per custom metric or per gigabyte ingested, and sometimes several of those at once. The tooling is genuinely good. The pricing model assumes you are an enterprise with an observability budget.
For a two-person SaaS, a vendor APM plan can exceed the entire AWS bill. That might still be worth it if it saves you ten hours a month of debugging. Decide deliberately rather than discovering it on a renewal.
My position: default-on verbose logging is a design bug
Shipping INFO and DEBUG to production everywhere is not diligence. It is an unmade decision, deferred to whoever reads the bill.
Logging as a debugging crutch
Verbose logging feels responsible because it feels like preparation. In practice it produces a haystack and then charges you rent on the haystack. When something breaks at 2am, nobody greps 40 GB of INFO: handler entered. They look at the exception, the request ID and the trace.
The honest test: in the last three incidents, how many were solved by a log line below WARN? If the answer is zero, you are paying per gigabyte for reassurance.
What good looks like: structured, sampled, levelled
The defensible production configuration is narrow and specific:
- Structured JSON for every log line, with a request ID, user ID and route as fields rather than interpolated into a string. Structured logs cost the same to ingest and are vastly cheaper to search.
- WARN and ERROR by default, with a runtime toggle (environment variable or feature flag) to raise verbosity for a single service or user when you are actively investigating.
- Metrics for anything you graph. If you want a chart of request counts, emit a metric, not a log line per request that a dashboard then counts.
- Sampling for traces. OpenTelemetry's sampling documentation defines head sampling (decide at the start of a request) and tail sampling (decide after seeing the whole trace). Tail sampling is the one you want, because it can keep every slow or failed trace and discard the boring successful ones.

The trade-off is real: sampling loses data, and occasionally it loses exactly the request a customer is emailing you about. The mitigation is to never sample errors, auth or payment events, and to keep complete traces for anything exceeding a latency threshold. Sample the successful, fast, uninteresting 95%.
Cut the telemetry bill in an afternoon
This playbook is ordered by return on effort. Most teams find half their logging spend in the first two steps.

Find the top log groups by ingestion
Start with measurement. CloudWatch publishes an IncomingBytes metric per log group in the AWS/Logs namespace. Graph it summed over the last 30 days, sorted descending, and you will usually find two or three log groups account for most of your ingestion. Do not guess. The offender is frequently something you forgot exists, like a VPC flow log or a load balancer access log.
Set retention on everything
Set an explicit retention period on every log group, including new ones created by deployments. Fourteen days covers most debugging. Thirty days is generous. Never-expire is a mistake you pay for monthly.
Automate it, because log groups get recreated. A scheduled job or an infrastructure-as-code policy that applies retention to every group is the difference between fixing this once and fixing it quarterly.
Kill the noise at the source
Filter before ingest, not after. The cheapest gigabyte is the one you never send.
- Exclude health-check paths from access logging entirely.
- Drop framework request logs in production and emit a metric instead.
- Remove payload serialisation from log statements; log IDs and reference the record.
- De-duplicate retry logging so a failed call logs once, not once per attempt.
- Delete the debug line in the loop. You know the one.
Move archives to cheaper storage
For logs you keep only to satisfy auditors, AWS offers a cheaper tier. The CloudWatch Logs log classes documentation describes the Infrequent Access class, which costs less to ingest in exchange for a reduced feature set (no Live Tail, metric filters or subscription filters). Alternatively, export to S3 and apply a lifecycle policy to Glacier-class storage.
Then build a tripwire. Set a budget with threshold alerts using AWS Budgets and enable cost anomaly detection, so the next logging regression pages an engineer in week one rather than appearing as a surprise in month two. This is the single highest-leverage step to reduce your CloudWatch bill permanently rather than once.
What you should still pay for (don't optimise yourself blind)
Cost-cutting has a failure mode: a product that is cheap to run and impossible to diagnose. Some telemetry is a floor, not a leak.
Errors, audit trails and billing events
Keep these unsampled and unfiltered, always:
- Exceptions with full context: stack trace, request ID, user ID, input shape. This is the data that actually resolves incidents.
- Authentication events: logins, failures, password resets, token issuance. Required for security investigations and for any enterprise security questionnaire.
- Payment and subscription events: charges, refunds, plan changes, webhook receipts. When Stripe and your database disagree, these logs are the referee.
- Audit logs: who changed what, when. Enterprise buyers and SOC 2-style reviews ask for this, and retrofitting it after a deal is in flight is miserable.
Price this deliberately. Estimate the gigabytes these categories generate, multiply by the rate on the CloudWatch pricing page for your region, and accept the result as a fixed cost of doing business. Everything above that number is negotiable.
Alarms that wake someone up
Keep a small set of alarms tied to symptoms a user would notice: elevated 5xx rate, p99 latency breach, queue depth growing, failed payments spiking, health check failing. Five to ten alarms is plenty for a small SaaS.
Alarms on causes rather than symptoms (CPU at 80%, memory climbing) generate noise, and noisy alarms get muted, which is worse than having none. Charges for alarms are modest compared with ingestion, so this is rarely where you save money. It is where you spend it well.
How this plays out when agents build and run the product
If AI agents are writing and deploying your code, telemetry decisions get made by whatever the agent considers reasonable unless you say otherwise. That is a spec problem, and it is solvable the same way any spec problem is.
Logging conventions as part of the spec
On Orkosi, agents build the product, deploy it to AWS and keep iterating through tasks, with hosting included in the plan. So put your logging conventions in the brief from the start: "structured JSON logs, WARN and above in production, 14-day CloudWatch retention on all log groups, no payload bodies in logs, metrics for request counts rather than log-derived counts."
Write that once and it propagates. Leave it out and you get framework defaults, which are verbose by design. The same applies to any builder or any human contractor; agents are not uniquely careless here, they are just fast enough to generate a lot of log statements quickly.
Asking for a telemetry audit as a task
Treat cost review as a recurring task rather than a crisis. "Report the top five log groups by ingested bytes over 30 days and propose reductions" is a perfectly good task to hand an agent, as is "apply retention policies to every log group and add a budget alert at a threshold I specify."
The honest trade-off: an agent will not know which logs matter to your business unless you tell it, so the audit output needs your judgement applied to it. Orkosi handles the execution, not the decision about which 5 GB of logs you would miss. To see the kinds of products this applies to, browse what people build with Orkosi, check the implementation docs, or see how Orkosi compares with other builders.
FAQ
How much does logging cost on AWS for a small SaaS?
It depends almost entirely on how verbose your code is, not how many users you have. A quiet, well-levelled application might ingest a few gigabytes a month; a chatty one with default framework logging can ingest hundreds. Multiply your estimated monthly gigabytes by the ingestion and storage rates on the CloudWatch pricing page for your region, since rates vary and change.
Is CloudWatch cheaper than Datadog or Grafana Cloud?
For a small SaaS, CloudWatch is usually cheaper because there is no per-host or seat minimum, but it is also a less capable product for correlation and tracing. Vendor APM tools typically bill per host, agent or ingested gigabyte, which scales badly for tiny teams. Compare current vendor pricing against CloudWatch pricing directly, and factor in the engineering hours each saves.
What log retention period should a SaaS use?
Fourteen to thirty days covers nearly all operational debugging, which is why it is the most common AWS log retention best practice for small products. Compliance or audit logs may need months or years, in which case export them to S3 with a lifecycle policy, or use the Infrequent Access log class. The one answer that is always wrong is never expire.
Will reducing logs make outages harder to debug?
Only if you cut the wrong things. Keep errors, exceptions, auth events and payment events complete and unsampled, and add a runtime toggle that raises verbosity when you are actively investigating. Use tail sampling so slow and failed traces are always retained while routine successful ones are discarded.
Describe your product, set your logging conventions in the brief, and let the agents build and deploy it on AWS: start free. Plan details and credit allowances are on the pricing page.