grafana / cloudcost-exporter

Prometheus Exporter for Cloud Provider agnostic cost metrics
Apache License 2.0
66 stars 4 forks source link

Implement AWS EKS cost metrics in `cloudcost-exporter` #67

Closed Pokom closed 5 months ago

Pokom commented 10 months ago

Overview

CloudCost Exporter needs to implement a module within aws that performs the following:

There was a proof of concept done many months ago: https://github.com/grafana/deployment_tools/pull/96916 Note that the project structure has been completely refactored so you can't use it as is. However the api endpoints and clients could be useful for helping bootstrap the issue.

Pricing Map

One major deviation from other Cloud Providers is that AWS only provides pricing by instance type. The implication is that we need to make an estimate of how much an instance costs by CPU and Memory. One way we can do this is by looking at GCP prices and finding the ratio of CPU:Memory costs.

Unknowns:

Some considerations:

Collecting a list of running ec2 instances

In order to export metrics, we need to list of each of the ec2 instances that are running within a project/profile. We need to keep track of the following bits of metadata:

Some considerations:

Export Metrics

Use the pricing map and ec2 instances to export the following metrics:

Both metrics should have the following labels