Skip to main content

Cost Visibility

Cost Visibility (cost-visibility) measures allocated and used CPU, memory, GPU and storage per namespace, application and node group, and prices it from your cloud's published prices or your own rates. It installs a metering stack and its own metrics backend in the cluster, and the cluster's Astro Agent sends AstroPulse one closed hour at a time. What the numbers mean and how to read them is on Cost.

When to use it​

  • Several teams or customers share a cluster. Without it, you see what each app uses right now, not what it costs. With it, every namespace and application gets a priced cost per closed hour.
  • You suspect you pay for nodes nothing uses. With it, Idle shows the capacity you pay for that no workload was allocated.
  • Your GPUs are the bill. GPU hours are measured and priced per application and node group, next to CPU, memory and storage.
  • Your cluster has no published prices, or you pay less than list. Google Cloud and on-premises clusters read Not priced until they have a price sheet; one with your real rates also comes closer to your invoice.
  • You already run a Prometheus-compatible backend. Point Cost Visibility at it instead of installing another: Metrics backend.

You don't need it when live CPU, memory and network per application are enough: Metrics needs no add-on.

Before you start​

  • A cluster with a connected Astro Agent. If the install says the agent is too old, update it: astroctl infra k8s register agent update --cluster-name <cluster>.
  • On AWS and Azure, nothing else: usage is priced from published prices. Anywhere else, plan a price sheet, or cost is measured and reads Not priced.

In the console​

After Version, its steps are Settings, then Advanced, Resources and Components. Price sheet joins them when Pricing is Your own rates, and Prometheus while Metrics source is Managed Prometheus. Review runs the dry run, and Ask Nova at the top of the steps answers about the open step.

  1. Open the cluster from the cluster list, select the Add-ons tab, then Install Add-on, and pick Cost Visibility.

  2. Set Pricing: Published prices (the default), or Your own rates and then, under Price sheet, the CPU core hour, RAM GB hour, Storage GB hour, GPU hour and Currency (Price sheets).

  3. Optional: Metrics source, Managed Prometheus (the default) or Your Prometheus with its Prometheus endpoint (Metrics backend); Collection interval minutes; and for the backend Cost Visibility installs, Retention, and Name and Size under Storage. With published prices on a registered AWS cluster, Pricing role ARN (Spot prices on AWS).

  4. On Review, the dry run runs by itself; select Continue to deploy once it passes, then Deploy cost-visibility.

To change it later, open Cost Visibility on the Add-ons tab, open Update and select Change configuration. Go to Review, select Continue to apply once the dry run passes, type cost-visibility, then select Update cost-visibility.

You should see​

The add-on reads Deployed with its availability and cost reporting checks passing. Usage is measured at once; the first priced figure arrives after the first full hour closes, on the cluster's Cost tab (Cost). The add-on has a Cost tab of its own too.

Open zoom view

The cluster's Add-ons tab with Cost Visibility and Accelerator Metrics deployed, 2/2 checks passing

The cluster's Add-ons tab with Cost Visibility and Accelerator Metrics deployed, 2/2 checks passingThe cluster's Add-ons tab with Cost Visibility and Accelerator Metrics deployed, 2/2 checks passing

How it measures​

  • One closed UTC hour at a time. The hour in progress is never sent, so a figure never changes after you read it. Installing at 10:05 or at 10:50 makes 11:00 to 12:00 the first hour, reported a few minutes after 12:00.
  • Its own metrics backend by default. Before reporting healthy, the add-on runs a real allocation query against it. A backend of yours is checked the same way before the switch, and a failing one leaves the working source in place.
  • What leaves the cluster is per-application totals, not Pod names, images, logs or environment. A briefly disconnected cluster loses nothing: the agent keeps finished hours and sends them when it reconnects (What leaves your cluster).

Run it in production​

Cost Visibility runs a metrics backend in your cluster, and that backend costs money and grows with the cluster. Size it on purpose.

What it runs and what you pay for. One metrics store (Prometheus) with a volume, the metering engine, a cluster state collector, and a node metrics collector on every node. Your cloud bills the volume for as long as the add-on is installed, and the components take CPU and memory on your nodes. The add-on's own Cost tab, or astroctl infra k8s addons cost <cluster> cost-visibility, shows what it uses and costs.

ComponentCopiesReserved by defaultLimit
Metrics store1250m CPU, 512Mi memory, and a 20Gi volume2 CPU, 2Gi memory
Metering engine1100m CPU, 256Mi memory1 CPU, 1Gi memory
Cluster state collector150m CPU, 128Mi memory500m CPU, 512Mi memory
Node metrics collector1 per node25m CPU, 32Mi memory250m CPU, 128Mi memory

It grows with the cluster. The metrics store's memory and disk grow with the number of nodes and pods it measures. On a large or busy cluster, raise Resources (the metrics store's CPU and memory) and the Prometheus storage Size before it reaches its limits.

Retention is your recovery window, not your history. Priced hours are sent to AstroPulse and kept for your plan's history retention; the metrics store only keeps raw metrics for its Retention (7 days by default) so the agent can send hours it missed while the cluster was disconnected. It also stops at 80% of its volume: a volume too small for the cluster drops the oldest metrics first, which shortens that window.

One copy, by design. The metrics store is a single writer, so it runs one copy even with Availability set to High. Its volume sits in one zone, and a restart, upgrade or node drain pauses it briefly.

Storage is chosen once. The volume can grow, not shrink, and its storage Name is fixed at install. To change either, uninstall and install again.

Bringing your own backend is fine. With Metrics source set to Your Prometheus, Cost Visibility installs no metrics store. That backend is then yours to run: its scale, retention, availability and cost, and the series it must carry. Its retention is the recovery window instead. See Metrics backend.

Other ways in​

  • Nova: ask it, for example "install Cost Visibility on eks-prod and tell me which apps reserve far more than they use".
  • SDK and API: the same operations, in the API reference.

With astroctl​

With no configuration, Cost Visibility installs the full metering stack with its own backend, priced from published prices:

cost-visibility.yaml
apiVersion: platform.astropulse.io/v1
kind: K8sClusterAddon
metadata:
name: cost-visibility
spec:
clusterName: eks-prod
configuration:
costVisibility: {}
Terminal
astroctl infra k8s addons apply -f cost-visibility.yaml --dry-run
astroctl infra k8s addons apply -f cost-visibility.yaml
astroctl infra k8s addons cost eks-prod cost-visibility --window 24h

astroctl infra k8s addons template <cluster> cost-visibility writes every setting with what it does.

Settings​

Its own settings, under costVisibility, plus availability and resources. Every one is optional.

Price sheetcostVisibility.priceSheet

Your rates, shown when Pricing is Your own rates. With Published prices (the default) no sheet is sent.

Pricing role ARNcostVisibility.pricingRoleArn

An AWS IAM role allowed ec2:DescribeSpotPriceHistory, so Spot nodes are priced at their Spot price on a cluster AstroPulse did not create.

Prometheus endpointcostVisibility.prometheusEndpoint

Reads from your backend instead of installing one. Shown when Metrics source is Your Prometheus.

Collection interval minutescostVisibility.collectionIntervalMinutes

How often the add-on looks for closed hours to send. Hours themselves are fixed; this doesn't change accuracy.

Accepts
1 to 1440.
Default
5.
RetentioncostVisibility.prometheus.retention

How long the installed backend keeps raw metrics, the window it can recover hours from. Not with prometheusEndpoint.

Accepts
Whole hours or days from 24h to 7d.
Default
7d.
SizecostVisibility.prometheus.storage.size

The installed backend's volume. Not with prometheusEndpoint.

Accepts
1Gi to 2Ti. It can grow after install, not shrink.
Default
20Gi.
NamecostVisibility.prometheus.storage.name

The storage name bound on the cluster (its Storage tab lists them) that the volume uses, not a StorageClass name. Fixed once installed.

Default
The cluster's default storage.

If it's refused​

"collectionIntervalMinutes must be from 1 through 1440 when set"
Cause
Collection interval minutes is out of range.
Fix
Enter 1 to 1440, or leave it empty for 5.
"prometheus retention must be whole hours or days from 24h through 7d"
Cause
Retention is out of range.
Fix
Enter 24h to 7d, such as 72h or 3d.
"prometheus storage size must be a Kubernetes quantity from 1Gi through 2Ti"
Cause
The storage Size is out of range or not a quantity.
Fix
Enter 1Gi to 2Ti, such as 50Gi.
"Managed Prometheus storage class is immutable and storage can only grow; delete and reinstall to change immutable storage settings"
Cause
The apply shrinks the storage Size, or changes its Name, after install.
Fix
Keep the installed values, or grow the size only. To change the storage, uninstall and install again.
"prometheus retention and storage are only valid when Astro installs Prometheus"
Cause
The installed backend's settings are set together with a Prometheus endpoint.
Fix
Remove prometheus, or set Metrics source back to Managed Prometheus.
"pricingRoleArn is an AWS role and this cluster is not on AWS"
Cause
Pricing role ARN is set on a cluster outside AWS.
Fix
Remove it. Off AWS, price Spot nodes with a price sheet.
"pricingRoleArn must be an IAM role ARN, such as arn:aws:iam::123456789012:role/opencost-spot-prices"
Cause
The role ARN is malformed.
Fix
Copy the role's ARN from IAM, arn:aws:iam::<account-id>:role/<name>.

Refused price sheets and metrics backends: Price sheets and Metrics backend. Unpriced or missing hours: Troubleshoot Cost Visibility.

Next​