-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pvc): Get disk name from k8s labels instead (#142)
When comparing the output data from opencost and cloudcost exporter, one bit that didn't quite make sense was a mismatch in PVC's between the two. The total costs between the two was small enough to be insignificant, which only made things more confusing. After analyzing the metrics further, the biggest difference was the name of the disks. `cloudcost-exporter` was pulling the name directly from the disk metadata, which was prepending most pv's with `gke-$cluster`. The problem with this is that `kube-state-metrics` and other metrics only look at what k8s calls them. This change updates how name is sourced. 1. Loads the `disk.Description` into a map 2. Check for the existence of two labels 3. If either keys are found, return the value 4. Otherwise, fall back to `disk.Name` as a final resource
- Loading branch information
Showing
2 changed files
with
94 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters