Skip to content

grafana/cloudcost-exporter

Cloud Cost Exporter

Go Reference License Docker Pulls

Cloud Cost Exporter is a Prometheus exporter that collects cost and pricing data from cloud providers (AWS, GCP, Azure) in real-time.

Quick Links:

Overview

Cloud Cost Exporter provides near real-time cost visibility by exporting resource pricing rates as Prometheus metrics.

The cost data can be combined with usage metrics from tools like Stackdriver, YACE, Grafana AWS CloudWatch Metric Streams, and Promitor to calculate granular spending.

Cloud provider billing data takes hours to days to become fully accurate. This exporter bridges that gap by providing per-minute cost rate visibility for both Kubernetes and non-Kubernetes resources across multiple cloud providers.

Primary Goals

  • Multi-cloud support - Collect cost rates from AWS, GCP, and Azure through a consistent interface
  • Real-time rates - Export per-minute pricing rates (e.g., $/cpu/hr) for cloud resources
  • Prometheus native - Export metrics in Prometheus format for easy integration with monitoring stacks

Non-Goals

  • Billing accuracy - This is not a replacement for official cloud billing reports
  • Spend calculation - Exports rates, not total spend (use Prometheus queries & recording rules to calculate spend)

Project Maturity

This project is in active development and is subject to change. Grafana Labs builds and maintains this project as part of our commitment to the open source community but we do not provide support for it. The exporter exports rates for resources and not the total spend.

Supported Cloud Providers

  • AWS - Amazon Web Services
  • GCP - Google Cloud Platform
  • Azure - Microsoft Azure

Installation

Cloud Cost Exporter can be used locally using its image or deployed via a Helm Chart.

1. Local Usage via Image

To deploy locally using its image, Cloud Cost Exporter uses each provider's default authentication mechanisms:

Provider Authentication Method Documentation
AWS AWS credentials file, environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION), or IAM role AWS credentials
GCP Application Default Credentials (ADC) GCP ADC
Azure DefaultAzureCredential chain (environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET) Azure authentication

After authenticating with a cloud provider, follow these steps to do a quick start using Docker:

# Run with Docker (example for AWS)
docker run -d \
  -p 8080:8080 \
  -e AWS_ACCESS_KEY_ID=your-key \
  -e AWS_SECRET_ACCESS_KEY=your-secret \
  -e AWS_REGION=us-east-1 \
  grafana/cloudcost-exporter:latest

Metrics will be available to be scraped at http://localhost:8080/metrics

2. Kubernetes Deployment via Helm chart

For Kubernetes deployments, use the official Helm chart. See the chart repository for configuration options, values, and examples.

First, setup an IAM Role for Service Accounts (IRSA) for secure credential management:

Then, install Cloud Cost Exporter via its Helm chart:

# Add Grafana Helm repository
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update

# Install cloudcost-exporter
helm install cloudcost-exporter grafana/cloudcost-exporter

Chart source: charts/cloudcost-exporter Chart documentation: charts/cloudcost-exporter/README.md

Supported Services

Cloud Cost Exporter exposes Prometheus metrics for cost rates of cloud resources. Each service exports metrics specific to that resource type - see the metrics documentation for details on supported services.

Contributing

We welcome contributions. See the contributing guide.

License

Cloud Cost Exporter is licensed under the Apache License 2.0.

About

Prometheus Exporter for Cloud Provider agnostic cost metrics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 23

Languages