Skip to content

Commit

Permalink
[COST-992] filter out empty volumename to prevent many to many issue (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cgoodfred authored May 10, 2022
1 parent 6898012 commit bffa28b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions collector/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ var (
volQueries = &querys{
query{
Name: "persistentvolume_pod_info",
QueryString: "kube_pod_spec_volumes_persistentvolumeclaims_info * on(persistentvolumeclaim, namespace) group_left(volumename) kube_persistentvolumeclaim_info",
QueryString: "kube_pod_spec_volumes_persistentvolumeclaims_info * on(persistentvolumeclaim, namespace) group_left(volumename) kube_persistentvolumeclaim_info{volumename != ''}",
MetricKey: staticFields{"namespace": "namespace", "pod": "pod"},
RowKey: []model.LabelName{"volumename"},
},
query{
Name: "persistentvolumeclaim-capacity-bytes",
QueryString: "kubelet_volume_stats_capacity_bytes * on(persistentvolumeclaim, namespace) group_left(volumename) kube_persistentvolumeclaim_info",
QueryString: "kubelet_volume_stats_capacity_bytes * on(persistentvolumeclaim, namespace) group_left(volumename) kube_persistentvolumeclaim_info{volumename != ''}",
QueryValue: &saveQueryValue{
ValName: "persistentvolumeclaim-capacity-bytes",
Method: "max",
Expand All @@ -89,7 +89,7 @@ var (
},
query{
Name: "persistentvolumeclaim-request-bytes",
QueryString: "kube_persistentvolumeclaim_resource_requests_storage_bytes * on(persistentvolumeclaim, namespace) group_left(volumename) kube_persistentvolumeclaim_info",
QueryString: "kube_persistentvolumeclaim_resource_requests_storage_bytes * on(persistentvolumeclaim, namespace) group_left(volumename) kube_persistentvolumeclaim_info{volumename != ''}",
QueryValue: &saveQueryValue{
ValName: "persistentvolumeclaim-request-bytes",
Method: "max",
Expand All @@ -100,7 +100,7 @@ var (
},
query{
Name: "persistentvolumeclaim-usage-bytes",
QueryString: "kubelet_volume_stats_used_bytes * on(persistentvolumeclaim, namespace) group_left(volumename) kube_persistentvolumeclaim_info",
QueryString: "kubelet_volume_stats_used_bytes * on(persistentvolumeclaim, namespace) group_left(volumename) kube_persistentvolumeclaim_info{volumename != ''}",
QueryValue: &saveQueryValue{
ValName: "persistentvolumeclaim-usage-bytes",
Method: "sum",
Expand All @@ -118,7 +118,7 @@ var (
},
query{
Name: "persistentvolumeclaim-labels",
QueryString: "kube_persistentvolumeclaim_labels * on(persistentvolumeclaim, namespace) group_left(volumename) kube_persistentvolumeclaim_info",
QueryString: "kube_persistentvolumeclaim_labels * on(persistentvolumeclaim, namespace) group_left(volumename) kube_persistentvolumeclaim_info{volumename != ''}",
MetricKey: staticFields{"namespace": "namespace", "persistentvolumeclaim": "persistentvolumeclaim"},
MetricKeyRegex: regexFields{"persistentvolumeclaim_labels": "label_"},
RowKey: []model.LabelName{"volumename"},
Expand Down

0 comments on commit bffa28b

Please sign in to comment.