Skip to content

Commit

Permalink
Add host label to Proxy and Devapp monitored resources (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
msukruth authored and jkohen committed Dec 19, 2019
1 parent 30fc3d0 commit eb29f70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions retrieval/resource_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ var DevappResourceMap = ResourceMap{
"__meta_kubernetes_pod_label_org": constValue("org"),
"__meta_kubernetes_pod_label_env": constValue("env"),
"api_product_name": constValue("api_product_name"),
"__meta_kubernetes_pod_name": constValue("host"),
},
}

Expand All @@ -112,6 +113,7 @@ var ProxyResourceMap = ResourceMap{
"__meta_kubernetes_pod_label_env": constValue("env"),
"proxy_name": constValue("proxy_name"),
"revision": constValue("revision"),
"__meta_kubernetes_pod_name": constValue("host"),
},
}

Expand Down
4 changes: 4 additions & 0 deletions retrieval/resource_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func TestTranslateDevapp(t *testing.T) {
{KubernetesLocationLabel, "us-central1-a"},
{"__meta_kubernetes_pod_label_org", "my-org"},
{"__meta_kubernetes_pod_label_env", "my-env"},
{"__meta_kubernetes_pod_name", "my-pod"},
}
metricLabels := labels.Labels{
{"api_product_name", "my-name"},
Expand All @@ -149,6 +150,7 @@ func TestTranslateDevapp(t *testing.T) {
"org": "my-org",
"env": "my-env",
"api_product_name": "my-name",
"host": "my-pod",
}
expectedFinalLabels := labels.Labels{
{"extra_label", "my-label"},
Expand All @@ -172,6 +174,7 @@ func TestTranslateProxy(t *testing.T) {
{KubernetesLocationLabel, "us-central1-a"},
{"__meta_kubernetes_pod_label_org", "my-org"},
{"__meta_kubernetes_pod_label_env", "my-env"},
{"__meta_kubernetes_pod_name", "my-pod"},
}
metricLabels := labels.Labels{
{"proxy_name", "my-name"},
Expand All @@ -185,6 +188,7 @@ func TestTranslateProxy(t *testing.T) {
"env": "my-env",
"proxy_name": "my-name",
"revision": "my-revision",
"host": "my-pod",
}
expectedFinalLabels := labels.Labels{
{"extra_label", "my-label"},
Expand Down

0 comments on commit eb29f70

Please sign in to comment.