Observability Fundamentals

Managing observability costs for ephemeral environments

Chris Churilo
September 5, 2026
 |  
7
min read
September 5, 2026
7
min read
Observability Fundamentals

A preview cluster that scales from 50 to 200 hosts for five days can set your Datadog bill at the 200-host peak for the entire month. Vendors designed per-host and per-series pricing models for stable fleets, and PR-driven environments that spin up and tear down dozens of times a day break that assumption at the billing layer. This article defines ephemeral environment observability cost, explains the host-churn mechanics behind surprise bills, enumerates the largest cost drivers in preview-environment stacks, walks through six control tactics, shows how flat per-node pricing removes the volume penalty, and ends with a checklist and FAQ.

What ephemeral environment observability cost means

Ephemeral environment observability cost is the monitoring spend generated by PR previews and other short-lived branch or test environments that exist for hours or days before teams destroy them on merge. Unlike a static shared staging environment, which registers as a fixed set of hosts and a stable set of metric series, ephemeral environments create and destroy hosts, pods, namespaces, and label values continuously.

That churn is now the normal shape of Kubernetes workloads. Datadog’s State of Containers report (vendor-stated, drawn from tens of thousands of customers) found that nearly two-thirds of Kubernetes containers have uptime under 10 minutes, and one-third finish in under one minute. Spotify’s Backstage team alone creates nearly 400 ephemeral environments per month.

Platform teams see costs concentrate here because observability is already a large budget line and churn multiplies its billing units. Grafana Labs’ 2025 Observability Survey, based on 294 usable responses, put observability at a mean of 17% of total compute infrastructure spend, with a median of 10%. Neither the FinOps Foundation nor CNCF provides an independently audited benchmark that isolates the increment attributable to ephemeral environments specifically, so the mechanism analysis below matters more than any headline percentage. Having defined the term, the next question is why the bills spike.

Why observability bills spike with ephemeral environments

Host churn drives most ephemeral-environment bill spikes. Every host that appears and disappears interacts with two billing constructs: host counting and time-series cardinality.

How per-host and per-series pricing penalizes high-churn infrastructure

Datadog defines a billable host as “any physical or virtual OS instance that you monitor with Datadog” and records the number of unique hosts each hour. Under its High-Watermark Plan, Datadog bills the month using the maximum of the lower 99% of those hourly readings, which excludes roughly 7 hours of peak usage per month by Obsium’s analysis. A preview fleet that holds an elevated host count for five days blows through that exclusion window, and Obsium’s worked example shows the 50-to-200-host burst producing a $6,200 APM bill instead of $1,550. Datadog itself recommends its hourly Monthly/Hourly Plan for “autoscaling fleets or short-lived workloads,” an acknowledgment that the default model penalizes churn.

Other vendors meter churn differently but still meter it:

  • Dynatrace rounds any host monitored for under 15 minutes up to a full 15-minute interval, so one minute of preview-node life bills as fifteen.
  • Grafana Cloud bills $6.50 per 1,000 active series at the 95th percentile, where an active series is one that received data in the previous 20 minutes; churned environments keep minting new series that count against that percentile.
  • New Relic does not bill hosts at all but charges $0.40 to $0.60 per GB ingested, which shifts the churn penalty onto telemetry volume.
  • Across these models, per-host pricing penalizes host count, while per-series and per-GB pricing penalize what those hosts emit.

The second half of the mechanism is where those series come from.

Cardinality explosion from host churn

Every ephemeral environment mints new time series because Prometheus treats any change in a label’s value as a new series. PR branch names and environment-specific namespace or pod IDs are exactly the high-cardinality label values Prometheus documentation warns against, and the CNCF flags converting OpenTelemetry resource attributes into labels as a cardinality explosion risk. Labels multiply: a PromCon 2019 example shows 100 instances × 10 buckets × 10 endpoints × 10 response codes × 4 methods × 100 tenants producing 40,000,000 series.

Those series cost memory and money whether or not anyone queries them. Grafana Mimir provisions 1 CPU core and 2.5 GB of memory per 300,000 in-memory series and ships a default limit of 150,000 series per tenant, a ceiling a busy preview fleet can hit on its own. On the sending side, Prometheus remote write adds roughly 25% memory overhead, and its documentation states that “large amounts of series churn” significantly increase memory usage because the remote-write code caches a label mapping for every series in the WAL. Host churn and cardinality compound each other, which is why the same PR fleet inflates both a per-host bill and a per-series bill at once. With the mechanism established, the next step is locating where the money actually goes.

The biggest cost drivers in ephemeral environment stacks

Five common cost drivers appear in a preview-environment stack, and only some of them appear on the observability invoice itself:

Each driver maps to a specific control, which is what the next section walks through.

How to control ephemeral environment observability costs

Six tactics address these drivers: teardown automation kills idle spend, agent lifecycle management fixes host counting, sampling and filtering cut ingestion, shared infrastructure removes the fixed-cost multiplier, tagging makes spend attributable, and retention forwarding preserves debug data after deletion.

Automated lifecycle management and CI/CD-triggered teardown

Tie environment lifetime to the PR lifecycle. Argo CD’s ApplicationSet Pull Request generator removes closed PR applications; configure webhooks, because the default polling interval is 30 minutes. Plane’s team pairs this pattern with a daily PR cleanup job and tears down anything merged or closed.

Add time-based TTLs as a second layer. HCP Terraform supports both a one-time auto-destroy-at timestamp and an inactivity trigger such as auto-destroy-activity-duration: "14d", inheritable as a project-level default. Okteto’s garbage collector sleeps idle preview environments after 1 hour and deletes them after 7 days by default, and kube-janitor applies TTL annotations from 1m to 1w to arbitrary Kubernetes resources.

Practitioners layer safety nets on top of both: one documented pattern runs a CronJob every 6 hours deleting namespaces older than 48 hours, cross-referenced against the GitHub PR API. Handle PersistentVolumeClaims explicitly; Signadot warns they “outlive namespace intent”. Teardown stops compute spend, but it does not fix host counting, which is the agent’s job.

Managing the observability agent lifecycle

A churned host must stop reporting before the monitoring platform can mark it inactive. In Datadog, non-reporting hosts marked INACTIVE do not bill, but they can take up to 2 hours to drop out of the Infrastructure List, so the inventory display can lag behind infrastructure teardown.

Deployment topology matters as much as shutdown. Datadog documents that installing the Agent directly in each container makes every container count as a host, and Obsium describes a 50-node cluster running 10 pods per node showing 500 billable hosts instead of 50 from that single misconfiguration. Run one node-level agent per host and account for the inactive-host status lag during teardown. If you stay on a per-host vendor, move burst-prone fleets to hourly metering. Clean host counting still leaves the per-series and per-GB exposure, which sampling and filtering address.

Telemetry sampling, filtering, and cardinality control

Strip churn-derived labels before they reach a billed backend. Prometheus applies metric_relabel_configs as the last step before ingestion and write_relabel_configs before remote write, so teams can drop pod names and PR identifiers or aggregate them away before they mint series. In OpenTelemetry pipelines, the filter processor drops telemetry using OTTL conditions.

Head-based sampling cuts trace volume but costs debug signal, and the OpenTelemetry documentation describes the tradeoff precisely. The documentation states that with head sampling “you cannot ensure that all traces with an error within them are sampled”, and a USENIX study quantifies it: at a 0.1% head-sampling probability, a trace of the problem exists with 0.1% probability. Two rules keep sampling survivable. First, materialize metrics before sampling, because “sampled traces distort metrics”; place a spanmetricsconnector ahead of the tailsamplingprocessor. Second, budget for tail sampling honestly, since it requires stateful trace buffering. Platform teams use filtering to control variable cost; they need a different pattern for the fixed-cost multiplier.

Shared infrastructure patterns

Namespace-per-environment on a shared cluster removes duplicated control planes and shared platform components such as load balancers. Kubernetes ResourceQuota and LimitRange keep tenants honest: one documented preview setup caps containers at 500m CPU and 512Mi memory and each namespace at 2 CPU and 2Gi total. Manatal’s implementation provisions databases and backing services such as queues or caches per preview namespace while sharing staging backends, so each PR pays only for what it changes. Qovery’s namespace-per-preview design means namespace deletion removes resources.

Namespaces are soft isolation, and where stronger boundaries matter, virtual clusters sit between the extremes. A vCluster restart takes about 6 seconds versus 30 to 45 minutes for a physical cluster running heavyweight platform services, and Deloitte’s consolidation of dozens of clusters onto 50+ vCluster instances produced 89% faster environment provisioning and roughly 500 QA hours saved per year. Shared infrastructure lowers the total, but it also blurs who spent what, which is where tagging comes in.

Cost attribution by owner and workload

Platform engineering owns attribution because the shared cluster makes spend invisible by default. The FinOps Foundation defines chargeback as allocating actual consumption to financial P&L budgets, while showback reports consumption without moving money, and its guidance is direct: “Showback is always required”, but chargeback is dependent on organizational accounting policies.

Apply attribution labels when you create each environment. The FinOps Foundation’s container cost allocation working group recommends a five-label allocation schema of cost-center, team, service, component, and tech-stack, with observability itself as a tech-stack value. Add the PR number as a label in the templating step so costs from every namespace and its metric or log streams trace back to a pull request. For the shared platform residue that no single team owns, the Foundation documents even splits plus fixed- or variable-proportional splits, noting that mature organizations distribute shared costs proportionally to direct charges monthly. Platform teams use attribution data to calculate each environment’s cost; the last tactic ensures that its telemetry outlives it.

Log and trace retention after teardown

Debug data must leave the environment before the environment dies. Kubernetes documentation states the principle: a separate backend “decouples log lifecycles”. The CNCF case-study pattern runs a lightweight collector per cluster that injects a tenant ID and forwards to a central persistent backend, so deleting the namespace leaves telemetry that collectors already shipped intact.

Do not trust in-environment buffers to survive teardown. The OTel Collector’s in-memory queues lose data after a crash or forced termination. The file_storage extension’s WAL dies with the pod’s filesystem unless a PersistentVolume backs it, and retry logic drops batches after a default max_elapsed_time of 300 seconds. PreStop flush hooks share the pod’s terminationGracePeriodSeconds budget, so large buffers are not guaranteed to drain. For CI-side artifacts, GitHub Actions retains logs and artifacts 90 days by default. Teams can configure retention for each artifact. Every tactic so far works within volume-priced billing models; the remaining question is what changes when the model itself stops charging for volume.

How groundcover changes the ephemeral cost equation

groundcover prices on the monthly average of monitored nodes, which removes the churn penalty structurally rather than operationally. groundcover counts each monitored host, whether Kubernetes or Linux and regardless of size, as a billing unit, and computes the total by averaging monthly node measurements. groundcover states that all plans use the monthly average host count, so short-lived spikes do not inflate the bill. A preview node alive for half the month contributes 0.5 node-months. There is no high-watermark or 15-minute rounding, and churned label values do not fill a per-series meter.

Under this model, ephemeral environments do not multiply volume-based charges. There are no per-GB ingestion or per-user charges, including custom-metric surcharges.

PR-suffixed labels and high-volume preview workloads, including duplicated services or log-heavy test runs, do not change the per-node unit price. The pricing model removes the volume-based incentive to discard preview-environment signal. BigBasket reported a 50% reduction in observability spend while expanding coverage to development and testing environments. Data volume and user count do not change the per-node unit price, although node growth still affects the monthly average.

The architecture adds two cost controls. The eBPF sensor deploys as a single DaemonSet, one pod per node, so there is one sensor lifecycle to manage per host instead of separate APM agents and telemetry components such as log shippers or metrics exporters. eBPF captures telemetry directly from the Linux kernel at packet level.

Under BYOC (Bring Your Own Cloud, where your data plane runs in your own cloud account), ClickHouse and VictoriaMetrics run inside your environment. Preview telemetry stays in your account instead of transiting the internet-egress path to a vendor’s SaaS. Retention after teardown is a policy you set on storage you control. If you want to validate the architecture on your own cluster, the free plan includes BYOC and requires no credit card. Deploy Flora on one cluster and evaluate full-cluster visibility within hours.

A cost-aware observability checklist for platform engineers

Each action below maps to the cost lever it pulls:

  • Drive teardown from the PR lifecycle (idle spend): Use Argo CD’s PR generator with webhooks, plus a scheduled job that reconciles namespaces against PR state.
  • Set layered TTLs (orphaned environments): Combine an inactivity trigger, a hard maximum lifetime, and a periodic cleanup CronJob so no single mechanism is a point of failure.
  • Delete PVCs explicitly (storage residue): Persistent volumes outlive namespace intent and keep billing until removed.
  • Run one node-level agent and account for status lag (host count): Per-container agents multiply billable hosts; inactive hosts can remain visible in infrastructure inventory after teardown.
  • Match the billing plan to churn (peak lock-in): On per-host vendors, burst-prone fleets belong on hourly metering, not high-watermark plans.
  • Strip churn labels before remote write (cardinality): Drop pod names, PR IDs, and namespace suffixes in write_relabel_configs or an OTel filter processor.
  • Materialize metrics before sampling traces (signal integrity): Place span-to-metrics conversion ahead of any sampling processor.
  • Share the cluster, isolate by namespace or vCluster (fixed-cost multiplier): Quota each environment; share control planes, load balancers, and stable backends.
  • Route telemetry through VPC endpoints (egress): Gateway and interface endpoints avoid NAT processing fees on telemetry paths.
  • Label every environment at creation (attribution): Apply team and service labels, plus a PR-number label, so showback per pull request is a query, not a project.
  • Forward telemetry to a central backend before deletion (post-teardown debugging): Never rely on in-pod buffers or PreStop hooks to drain large queues.

FAQ

Why do observability bills spike when we scale preview environments? Because billing units count churn, not just usage. Host-based billing counts host appearances hourly. Series- and volume-based billing count new label combinations or duplicated telemetry from every preview service. A fleet that bursts and tears down repeatedly inflates each applicable dimension.

How exactly does a per-host tool penalize host churn? Datadog’s high-watermark plan bills the month on the maximum of the lower 99% of hourly host readings, which excludes only about 7 hours of peak. Any preview burst longer than that sets the month’s bill at the burst’s host count, even after every preview node is gone.

Misconception: “Our teardown script deletes the namespace, so the environment stops costing money.” Deleting the namespace stops compute. It can leave PVCs billing and NAT gateways accruing hourly fees. A monitoring platform’s infrastructure inventory can also take up to two hours to remove inactive hosts, although Datadog states that hosts marked INACTIVE do not bill. Teardown has to cover storage and networking, not just workloads.

What is the right TTL configuration for PR environments? Layer PR-close deletion via your GitOps or deployment tool with an inactivity-based TTL. Okteto sleeps previews after one hour idle, and HCP Terraform supports inactivity durations like 14 days. Add a hard-maximum cleanup job as a safety net. One practitioner pattern uses a 72-hour ceiling with an 8-hour idle timeout.

How do we attribute observability cost to a specific PR or team? Apply the FinOps Foundation’s container label schema (cost-center, team, service, component, tech-stack) plus the PR number at environment creation, then run showback reports per label. Showback is the baseline every FinOps practice needs; chargeback into P&L is optional and depends on your accounting policies.

What do we give up by sampling traces from preview environments? Head sampling decides before the trace completes, so it can discard error traces; at 0.1% sampling, a trace of a given problem survives with 0.1% probability. If you sample, generate RED metrics from spans first, because metrics computed from sampled traces are inaccurate.

How do we keep logs and traces after the environment is destroyed? Ship them continuously to a persistent backend whose lifecycle is independent of the environment, and tag them with a tenant or PR identifier. In-memory queues and pod-local WALs do not survive pod deletion; PreStop hooks have a bounded grace period and cannot guarantee that large buffers drain. Under groundcover’s BYOC model, that backend is ClickHouse and VictoriaMetrics in your own account, with retention set by your policy rather than a vendor’s default window.

Sign up for Updates

Keep up with all things cloud-native observability.

We care about data. Check out our privacy policy.

Observability
for what comes next.

Start in minutes. No migrations. No data leaving your infrastructure. No surprises on the bill.