Good observability doesn't have to be expensive. This episode covers controlling metric costs through cardinality and recording rules, log costs through sampling and retention, trace costs through intelligent sampling, and optimizing infrastructure costs in object storage and compute.

The more telemetry data there is, the bigger the storage, compute, and network costs. Without a strategy, the observability bill can quietly balloon — especially in the cloud-native era where data volumes are relentless.
This episode covers cost control across three data types: metrics, logs, and traces, plus infrastructure cost optimization. The goal is simple: keep observability complete, but keep costs under control.
Cardinality is the biggest metric cost killer. A single metric with a user_id label can create millions of time series.
prometheus.remote_write "default" {
endpoint {
url = "http://mimir:9009/api/v1/push"
}
}Combine remote_write with filter components to block high-cardinality metrics right at the collector.
Mimir provides adaptive metrics that automatically flag high-cardinality series for removal. This feature is discussed further in episode 35.
As a rough guide: ten moderately labeled metrics are cheaper than one high-cardinality metric. That's why you should review metric labels periodically and involve service owners before removing any label — a removed label means historical data loses that dimension. Team agreement is far better than unilateral removal.
loki.process "sample_info" {
stage.match {
selector = "{level=\"info\"}"
stage.sampling {
rate = 0.1
}
}
}The rule stage.sampling rate: 0.1 only stores 10 percent of info-level logs — the most effective way to cut log costs without losing error context.
store: errors, slow, critical services
sample: normal traces at a ratioThe pattern store: errors, slow, critical services ensures observability value stays high while costs drop. Combining sampling at the collector and retention at the backend gives two layers of control over trace costs.
The combination of proper sampling and storage tiering usually yields the biggest savings. Prioritize savings on the data type with the largest volume — for most teams, that's logs, not metrics or traces.
Start with a small audit: list the five metrics, five log streams, and five services with the biggest costs, then apply one optimization step for each. The results are more measurable than trying to optimize everything at once.
Tip
Observability costs should be monitored with a dedicated dashboard: volume per data type, cost per tenant, and storage growth. What isn't measured can't be optimized.
In episode 26 you understood metric cost control strategies with cardinality and recording rules, log costs with filters, sampling, and retention, trace costs with intelligent sampling, and infrastructure cost optimization.
The key takeaways:
In the next episode 27 we'll discuss observability in Kubernetes — the architecture for monitoring nodes, pods, and clusters, metric sources like cAdvisor and kube-state-metrics, service discovery and relabeling, pod log collection, and tracing with a service mesh. Your LGTM Stack will move up a class into the world of Kubernetes.