|
|
@@ -87,7 +87,7 @@ func newPodKey(cluster, namespace, pod string) podKey {
|
|
|
// as the podKey's Cluster field. If a given field does not exist on the
|
|
|
// result, an error is returned. (The only exception to that is clusterLabel,
|
|
|
// which we expect may not exist, but has a default value.)
|
|
|
-func resultPodKey(res *prom.QueryResult, clusterLabel, namespaceLabel, podLabel string) (podKey, error) {
|
|
|
+func resultPodKey(res *prom.QueryResult, clusterLabel, namespaceLabel string) (podKey, error) {
|
|
|
key := podKey{}
|
|
|
|
|
|
cluster, err := res.GetString(clusterLabel)
|
|
|
@@ -102,9 +102,12 @@ func resultPodKey(res *prom.QueryResult, clusterLabel, namespaceLabel, podLabel
|
|
|
}
|
|
|
key.Namespace = namespace
|
|
|
|
|
|
- pod, err := res.GetString(podLabel)
|
|
|
- if err != nil {
|
|
|
- return key, err
|
|
|
+ pod, err := res.GetString("pod")
|
|
|
+ if pod == "" || err != nil {
|
|
|
+ pod, err = res.GetString("pod_name")
|
|
|
+ if err != nil {
|
|
|
+ return key, err
|
|
|
+ }
|
|
|
}
|
|
|
key.Pod = pod
|
|
|
|