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

[COST-1665] add node to storage reports #99

Merged
merged 7 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading