Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for enabling the Carbon Cost API #211

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

mattray
Copy link
Collaborator

@mattray mattray commented Jun 14, 2024

Enabled and test:

$ curl -G http://localhost:9003/assets/carbon -d window=7d | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1508  100  1508    0     0   3441      0 --:--:-- --:--:-- --:--:--  3435
{
  "code": 200,
  "status": "success",
  "data": {
    "GCP/__undefined__/mattray-opencost/Compute/gke-opencost/Node/Kubernetes/gke-opencost-1-default-pool-e40c4801-57g6/gke-opencost-1-default-pool-e40c4801-57g6": {
      "co2e": 0.006030856875453464
    },
    "GCP/__undefined__/mattray-opencost/Compute/gke-opencost/Node/Kubernetes/gke-opencost-1-default-pool-e40c4801-gtyn/gke-opencost-1-default-pool-e40c4801-gtyn": {
      "co2e": 0.006030856875453464
    },
    "GCP/__undefined__/mattray-opencost/Compute/gke-opencost/Node/Kubernetes/gke-opencost-1-default-pool-e40c4801-vnsv/gke-opencost-1-default-pool-e40c4801-vnsv": {
      "co2e": 0.006030856875453464
    },
    "GCP/__undefined__/mattray-opencost/Storage/gke-opencost/Disk/Kubernetes/gke-opencost-1-default-pool-e40c4801-57g6/gke-opencost-1-default-pool-e40c4801-57g6": {
      "co2e": 4.5047329090239456E-17
    },
    "GCP/__undefined__/mattray-opencost/Storage/gke-opencost/Disk/Kubernetes/gke-opencost-1-default-pool-e40c4801-gtyn/gke-opencost-1-default-pool-e40c4801-gtyn": {
      "co2e": 4.5047329090239456E-17
    },
    "GCP/__undefined__/mattray-opencost/Storage/gke-opencost/Disk/Kubernetes/gke-opencost-1-default-pool-e40c4801-vnsv/gke-opencost-1-default-pool-e40c4801-vnsv": {
      "co2e": 4.5047329090239456E-17
    },
    "GCP/__undefined__/mattray-opencost/Storage/gke-opencost/Disk/Kubernetes/pvc-4b32373c-0ffc-40c9-88b8-504854b32687/pvc-4b32373c-0ffc-40c9-88b8-504854b32687": {
      "co2e": 0
    },
    "GCP/__undefined__/mattray-opencost/Storage/gke-opencost/Disk/Kubernetes/pvc-95211d76-7842-4182-afa6-de4133f46b78/pvc-95211d76-7842-4182-afa6-de4133f46b78": {
      "co2e": 0
    }
  }
}

Signed-off-by: Matt Ray <github@mattray.dev>
@mattray
Copy link
Collaborator Author

mattray commented Jun 14, 2024

Fixes #210

Copy link
Contributor

@asdfgugus asdfgugus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run helm-docs

Signed-off-by: Matt Ray <github@mattray.dev>
@mattray mattray merged commit 8957642 into opencost:main Jun 14, 2024
1 check passed
@mattray mattray deleted the carbon_costs branch June 14, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants