Skip to content

Commit

Permalink
Merge pull request #222 from bmoyles0117/fix-new-resource-types-location
Browse files Browse the repository at this point in the history
Fix location label for metrics using new resource types.
  • Loading branch information
loburm authored Jan 24, 2019
2 parents 3d2aa1a + a163791 commit 9778b1d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion hack/verify-flags/exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ prometheus-to-sd/README.md:the prometheus-to-sd. Values of the `namespace_id` an
prometheus-to-sd/translator/metrics.go: []string{"component_name", "metric_name"},
prometheus-to-sd/translator/translator.go: "namespace_id": namespace,
prometheus-to-sd/translator/translator.go: "pod_id": pod,
prometheus-to-sd/translator/translator.go: "pod_name": pod,
prometheus-to-sd/translator/translator.go: "pod_name": pod,
20 changes: 10 additions & 10 deletions prometheus-to-sd/translator/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,23 +433,23 @@ func getMonitoredResourceFromLabels(config *config.CommonConfig, labels []*dto.L
return &v3.MonitoredResource{
Type: "k8s_node",
Labels: map[string]string{
"project_id": config.GceConfig.Project,
"cluster_name": config.GceConfig.Cluster,
"cluster_location": config.GceConfig.ClusterLocation,
"node_name": config.GceConfig.Instance,
"project_id": config.GceConfig.Project,
"location": config.GceConfig.ClusterLocation,
"cluster_name": config.GceConfig.Cluster,
"node_name": config.GceConfig.Instance,
},
}
}

return &v3.MonitoredResource{
Type: "k8s_container",
Labels: map[string]string{
"project_id": config.GceConfig.Project,
"cluster_name": config.GceConfig.Cluster,
"cluster_location": config.GceConfig.ClusterLocation,
"namespace_name": namespace,
"pod_name": pod,
"container_name": container,
"project_id": config.GceConfig.Project,
"location": config.GceConfig.ClusterLocation,
"cluster_name": config.GceConfig.Cluster,
"namespace_name": namespace,
"pod_name": pod,
"container_name": container,
},
}
case "gke_container":
Expand Down

0 comments on commit 9778b1d

Please sign in to comment.