/cloudcost-exporter

Prometheus Exporter for Cloud Provider agnostic cost metrics

Primary LanguageGoApache License 2.0Apache-2.0

Cloud Cost Exporter

Go Reference

Cloud Cost exporter is a designed to collect cost data from cloud providers and export the data in Prometheus format. The cost data can then be combined with usage data from tools such as stackdriver, yace, and promitor to measure the spend of resources at a granular level.

Warning

This project is in the early stages of 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. In its current state, the exporter exports rates for resources and not the total spend. We intend to opensource recording rules we use internally to measure the spend of resources. For a better understanding of how we view measuring costs, view a talk given at KubeCon NA 2023

Goals

The goal of this project is to provide a consistent interface for collecting the rate of cost data from multiple cloud providers and exporting the data in Prometheus format. There was a need to track the costs of both kubernetes and non-kubernetes resources across multiple cloud providers at a per minute interval. Billing data for each cloud provider takes hours to days for it to be fully accurate, and we needed a way of having a more real-time view of costs.

Primary goals:

  • Track the rate(IE, $/cpu/hr) for resources across
  • Export the rate in Prometheus format
  • Support the major cloud providers(AWS, GCP, Azure)

Non Goals:

  • Billing level accuracy
  • Measure the spend of resources
  • Take into account CUDs/Discounts/Reservations pricing information

Supported Cloud Providers

  • AWS
  • GCP
  • Azure

Usage

Each tagged version will publish a docker image to https://hub.docker.com/r/grafana/cloudcost-exporter with the version tag. The image can be run locally or deployed to a kubernetes cluster. Cloud Cost Exporter has an opinionated way of authenticating against each cloud provider.

Provider Notes
GCP Depends on default credentials
AWS Uses profile names from your credentials file or AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_REGION env variables
Azure Uses the default azure credential chain, e.g. enviornment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, and AZURE_CLIENT_SECRET

When running in a kubernetes cluster, it is recommended to use a service account with the necessary permissions for the cloud provider.

  • TODO: Document the necessary permissions for each cloud provider.

There is no helm chart available at this time, but one is planned.

Check out the follow docs for metrics:

Contributing

Grafana Labs is always looking to support new contributors! Please take a look at our contributing guide for more information on how to get started.