cloudcost_exporter

package module
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

README

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.

Documentation

Index

Constants

View Source
const (
	ExporterName = "cloudcost_exporter"
	MetricPrefix = "cloudcost"
)

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
mocks
pkg/azure/azureClientWrapper
Code generated by MockGen.
Code generated by MockGen.
pkg
aws
provider/mocks
Code generated by MockGen.
Code generated by MockGen.
scripts
gcp-fetch-skus
Usage: go run gcp-fetch-skus.go THis is a useful utility if you want to fetch a set of sku's for a particular service and export them to CSV.
Usage: go run gcp-fetch-skus.go THis is a useful utility if you want to fetch a set of sku's for a particular service and export them to CSV.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL