Skip to content

Commit

Permalink
[COST-1665] add node to storage reports (#99)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Skarbek <mskarbek@redhat.com>
  • Loading branch information
adberglund and maskarb authored Apr 18, 2024
1 parent 35df228 commit 87f86f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/collector/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ var (
query{
Name: "persistentvolumeclaim-usage-bytes",
QueryString: QueryMap["cost:persistentvolumeclaim_usage_bytes"],
MetricKey: staticFields{"node": "node"},
QueryValue: &saveQueryValue{
ValName: "persistentvolumeclaim-usage-bytes",
Method: "sum",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
report_period_start,report_period_end,interval_start,interval_end,namespace,pod,persistentvolumeclaim,persistentvolume,storageclass,persistentvolumeclaim_capacity_bytes,persistentvolumeclaim_capacity_byte_seconds,volume_request_storage_byte_seconds,persistentvolumeclaim_usage_byte_seconds,persistentvolume_labels,persistentvolumeclaim_labels
2020-11-01 00:00:00 +0000 UTC,2020-12-01 00:00:00 +0000 UTC,2020-11-06 18:00:00 +0000 UTC,2020-11-06 18:59:59 +0000 UTC,openshift-metering,hive-metastore-0,hive-metastore-db-data,pvc-025604dc-93ff-4801-ac06-316243ccd45a,gp2,5217320960.000000,18782355456000.000000,19327352832000.000000,94858444800.000000,label_failure_domain_beta_kubernetes_io_region:us-east-2|label_failure_domain_beta_kubernetes_io_zone:us-east-2a,label_app:hive-metastore|label_metering_openshift_io_ns_prune:openshift-metering|label_metering_openshift_io_prune:hive-metastore-pvc
report_period_start,report_period_end,interval_start,interval_end,namespace,pod,node,persistentvolumeclaim,persistentvolume,storageclass,persistentvolumeclaim_capacity_bytes,persistentvolumeclaim_capacity_byte_seconds,volume_request_storage_byte_seconds,persistentvolumeclaim_usage_byte_seconds,persistentvolume_labels,persistentvolumeclaim_labels
2020-11-01 00:00:00 +0000 UTC,2020-12-01 00:00:00 +0000 UTC,2020-11-06 18:00:00 +0000 UTC,2020-11-06 18:59:59 +0000 UTC,openshift-metering,hive-metastore-0,ip-10-0-150-20.us-east-2.compute.internal,hive-metastore-db-data,pvc-025604dc-93ff-4801-ac06-316243ccd45a,gp2,5217320960.000000,18782355456000.000000,19327352832000.000000,94858444800.000000,label_failure_domain_beta_kubernetes_io_region:us-east-2|label_failure_domain_beta_kubernetes_io_zone:us-east-2a,label_app:hive-metastore|label_metering_openshift_io_ns_prune:openshift-metering|label_metering_openshift_io_prune:hive-metastore-pvc
3 changes: 3 additions & 0 deletions internal/collector/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ type storageRow struct {
*dateTimes
Namespace string
Pod string
Node string `mapstructure:"node"`
PersistentVolumeClaim string `mapstructure:"persistentvolumeclaim"`
PersistentVolume string `mapstructure:"persistentvolume"`
StorageClass string `mapstructure:"storageclass"`
Expand All @@ -218,6 +219,7 @@ func (storageRow) csvHeader() []string {
"interval_end",
"namespace",
"pod",
"node",
"persistentvolumeclaim",
"persistentvolume",
"storageclass",
Expand All @@ -237,6 +239,7 @@ func (row storageRow) csvRow() []string {
row.IntervalEnd,
row.Namespace,
row.Pod,
row.Node,
row.PersistentVolumeClaim,
row.PersistentVolume,
row.StorageClass,
Expand Down

0 comments on commit 87f86f7

Please sign in to comment.