{"action":"created","comment":{"url":"https://api.github.com/repos/linkerd/linkerd2/pulls/comments/203886855","pull_request_review_id":138869103,"id":203886855,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzg4Njg1NQ==","diff_hunk":"@@ -152,14 +152,13 @@ func (l *endpointListener) toWeightedAddrSet(addresses []*updateAddress) *pb.Wei\n }\n \n func (l *endpointListener) toWeightedAddr(address *updateAddress) *pb.WeightedAddr {\n-\tmetricLabelsForPod := pkgK8s.GetOwnerLabels(address.pod.ObjectMeta)\n-\tmetricLabelsForPod[\"pod\"] = address.pod.Name\n+\tlabels, tlsIdentity := l.getAddrMetadata(address.pod)","path":"controller/destination/listener.go","position":6,"original_position":6,"commit_id":"cd72bbe3d66a46ed1a87e3da4264e99a343747e7","original_commit_id":"cd72bbe3d66a46ed1a87e3da4264e99a343747e7","user":{"login":"klingerf","id":9226,"node_id":"MDQ6VXNlcjkyMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/9226?v=4","gravatar_id":"","url":"https://api.github.com/users/klingerf","html_url":"https://github.com/klingerf","followers_url":"https://api.github.com/users/klingerf/followers","following_url":"https://api.github.com/users/klingerf/following{/other_user}","gists_url":"https://api.github.com/users/klingerf/gists{/gist_id}","starred_url":"https://api.github.com/users/klingerf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klingerf/subscriptions","organizations_url":"https://api.github.com/users/klingerf/orgs","repos_url":"https://api.github.com/users/klingerf/repos","events_url":"https://api.github.com/users/klingerf/events{/privacy}","received_events_url":"https://api.github.com/users/klingerf/received_events","type":"User","site_admin":false},"body":"This behaves slightly differently than what's currently on master. When formulating the set of labels to send back to the proxy, we used to rely exclusively on the pod's injected `linkerd.io/*` labels. In this branch I'm still reading the controller namespace and pod template hash from the pod's labels, but I'm relying on the kubernetes API to generate the owner label (deployment, replicationcontroller, etc.). This is more consistent with how we construct TLS identities, and it allows us to record outbound stats to un-injected pods.\r\n\r\nFor instance, if I inject only the web deployment from the [emojivoto demo](https://github.com/runconduit/conduit-examples/tree/master/emojivoto) using the code that's currently on master, then the deploy stats look like this:\r\n\r\n```\r\n$ linkerd stat -n emojivoto deploy\r\nNAME       MESHED   SUCCESS      RPS   LATENCY_P50   LATENCY_P95   LATENCY_P99   TLS\r\nemoji         0/1         -        -             -             -             -     -\r\nvote-bot      0/1         -        -             -             -             -     -\r\nvoting        0/1         -        -             -             -             -     -\r\nweb           1/1    89.57%   1.9rps           3ms          10ms          28ms    0%\r\n```\r\n\r\nIf I add a `--from` flag, no deploys are returned:\r\n\r\n```\r\n$ linkerd stat -n emojivoto deploy --from deploy\r\nNo traffic found.\r\n```\r\n\r\nWhereas if I recreate the same setup on this branch and add a `--from` flag, I get back data:\r\n\r\n````\r\n$ bin/linkerd stat -n emojivoto deploy --from deploy\r\nNAME     MESHED   SUCCESS      RPS   LATENCY_P50   LATENCY_P95   LATENCY_P99   TLS\r\nemoji       0/1   100.00%   2.0rps           1ms           1ms           2ms    0%\r\nvoting      0/1    81.36%   1.0rps           1ms           1ms           1ms    0%\r\n```","created_at":"2018-07-19T22:03:34Z","updated_at":"2018-07-19T22:03:34Z","html_url":"https://github.com/linkerd/linkerd2/pull/1355#discussion_r203886855","pull_request_url":"https://api.github.com/repos/linkerd/linkerd2/pulls/1355","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/linkerd/linkerd2/pulls/comments/203886855"},"html":{"href":"https://github.com/linkerd/linkerd2/pull/1355#discussion_r203886855"},"pull_request":{"href":"https://api.github.com/repos/linkerd/linkerd2/pulls/1355"}}},"pull_request":{"url":"https://api.github.com/repos/linkerd/linkerd2/pulls/1355","id":202694605,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyNjk0NjA1","html_url":"https://github.com/linkerd/linkerd2/pull/1355","diff_url":"https://github.com/linkerd/linkerd2/pull/1355.diff","patch_url":"https://github.com/linkerd/linkerd2/pull/1355.patch","issue_url":"https://api.github.com/repos/linkerd/linkerd2/issues/1355","number":1355,"state":"open","locked":false,"title":"Update prometheus labels to match k8s resource names","user":{"login":"klingerf","id":9226,"node_id":"MDQ6VXNlcjkyMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/9226?v=4","gravatar_id":"","url":"https://api.github.com/users/klingerf","html_url":"https://github.com/klingerf","followers_url":"https://api.github.com/users/klingerf/followers","following_url":"https://api.github.com/users/klingerf/following{/other_user}","gists_url":"https://api.github.com/users/klingerf/gists{/gist_id}","starred_url":"https://api.github.com/users/klingerf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klingerf/subscriptions","organizations_url":"https://api.github.com/users/klingerf/orgs","repos_url":"https://api.github.com/users/klingerf/repos","events_url":"https://api.github.com/users/klingerf/events{/privacy}","received_events_url":"https://api.github.com/users/klingerf/received_events","type":"User","site_admin":false},"body":"Our prometheus labels for replication controllers, daemonsets, statefulsets, and replicasets included underscores, which isn't consistent with how kubectl handles these types (no underscores). In this branch I'm removing the underscores.\r\n\r\nAs part of this change, I'm also changing all resource types used in our APIs to be singular. We were using a mix of singular and plural resource types, which meant that we had a lot of code for converting from singular to plural and back, so this hopefully simplifies things.\r\n\r\nThis is a big diff, but the meat of the change happens in `pkg/k8s/labels.go`.\r\n\r\nFixes #740.","created_at":"2018-07-19T21:54:55Z","updated_at":"2018-07-19T22:03:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e95bbf6aa9ece716b2fc560ac9b5ae8a0c6bf5b2","assignee":{"login":"klingerf","id":9226,"node_id":"MDQ6VXNlcjkyMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/9226?v=4","gravatar_id":"","url":"https://api.github.com/users/klingerf","html_url":"https://github.com/klingerf","followers_url":"https://api.github.com/users/klingerf/followers","following_url":"https://api.github.com/users/klingerf/following{/other_user}","gists_url":"https://api.github.com/users/klingerf/gists{/gist_id}","starred_url":"https://api.github.com/users/klingerf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klingerf/subscriptions","organizations_url":"https://api.github.com/users/klingerf/orgs","repos_url":"https://api.github.com/users/klingerf/repos","events_url":"https://api.github.com/users/klingerf/events{/privacy}","received_events_url":"https://api.github.com/users/klingerf/received_events","type":"User","site_admin":false},"assignees":[{"login":"klingerf","id":9226,"node_id":"MDQ6VXNlcjkyMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/9226?v=4","gravatar_id":"","url":"https://api.github.com/users/klingerf","html_url":"https://github.com/klingerf","followers_url":"https://api.github.com/users/klingerf/followers","following_url":"https://api.github.com/users/klingerf/following{/other_user}","gists_url":"https://api.github.com/users/klingerf/gists{/gist_id}","starred_url":"https://api.github.com/users/klingerf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klingerf/subscriptions","organizations_url":"https://api.github.com/users/klingerf/orgs","repos_url":"https://api.github.com/users/klingerf/repos","events_url":"https://api.github.com/users/klingerf/events{/privacy}","received_events_url":"https://api.github.com/users/klingerf/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"rmars","id":549258,"node_id":"MDQ6VXNlcjU0OTI1OA==","avatar_url":"https://avatars3.githubusercontent.com/u/549258?v=4","gravatar_id":"","url":"https://api.github.com/users/rmars","html_url":"https://github.com/rmars","followers_url":"https://api.github.com/users/rmars/followers","following_url":"https://api.github.com/users/rmars/following{/other_user}","gists_url":"https://api.github.com/users/rmars/gists{/gist_id}","starred_url":"https://api.github.com/users/rmars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmars/subscriptions","organizations_url":"https://api.github.com/users/rmars/orgs","repos_url":"https://api.github.com/users/rmars/repos","events_url":"https://api.github.com/users/rmars/events{/privacy}","received_events_url":"https://api.github.com/users/rmars/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":866158135,"node_id":"MDU6TGFiZWw4NjYxNTgxMzU=","url":"https://api.github.com/repos/linkerd/linkerd2/labels/review","name":"review","color":"f4bffc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/linkerd/linkerd2/pulls/1355/commits","review_comments_url":"https://api.github.com/repos/linkerd/linkerd2/pulls/1355/comments","review_comment_url":"https://api.github.com/repos/linkerd/linkerd2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkerd/linkerd2/issues/1355/comments","statuses_url":"https://api.github.com/repos/linkerd/linkerd2/statuses/cd72bbe3d66a46ed1a87e3da4264e99a343747e7","head":{"label":"linkerd:kl/fix-labels","ref":"kl/fix-labels","sha":"cd72bbe3d66a46ed1a87e3da4264e99a343747e7","user":{"login":"linkerd","id":25301026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MzAxMDI2","avatar_url":"https://avatars3.githubusercontent.com/u/25301026?v=4","gravatar_id":"","url":"https://api.github.com/users/linkerd","html_url":"https://github.com/linkerd","followers_url":"https://api.github.com/users/linkerd/followers","following_url":"https://api.github.com/users/linkerd/following{/other_user}","gists_url":"https://api.github.com/users/linkerd/gists{/gist_id}","starred_url":"https://api.github.com/users/linkerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkerd/subscriptions","organizations_url":"https://api.github.com/users/linkerd/orgs","repos_url":"https://api.github.com/users/linkerd/repos","events_url":"https://api.github.com/users/linkerd/events{/privacy}","received_events_url":"https://api.github.com/users/linkerd/received_events","type":"Organization","site_admin":false},"repo":{"id":113106184,"node_id":"MDEwOlJlcG9zaXRvcnkxMTMxMDYxODQ=","name":"linkerd2","full_name":"linkerd/linkerd2","owner":{"login":"linkerd","id":25301026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MzAxMDI2","avatar_url":"https://avatars3.githubusercontent.com/u/25301026?v=4","gravatar_id":"","url":"https://api.github.com/users/linkerd","html_url":"https://github.com/linkerd","followers_url":"https://api.github.com/users/linkerd/followers","following_url":"https://api.github.com/users/linkerd/following{/other_user}","gists_url":"https://api.github.com/users/linkerd/gists{/gist_id}","starred_url":"https://api.github.com/users/linkerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkerd/subscriptions","organizations_url":"https://api.github.com/users/linkerd/orgs","repos_url":"https://api.github.com/users/linkerd/repos","events_url":"https://api.github.com/users/linkerd/events{/privacy}","received_events_url":"https://api.github.com/users/linkerd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linkerd/linkerd2","description":"Open source service mesh for cloud-native applications, v2","fork":false,"url":"https://api.github.com/repos/linkerd/linkerd2","forks_url":"https://api.github.com/repos/linkerd/linkerd2/forks","keys_url":"https://api.github.com/repos/linkerd/linkerd2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkerd/linkerd2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkerd/linkerd2/teams","hooks_url":"https://api.github.com/repos/linkerd/linkerd2/hooks","issue_events_url":"https://api.github.com/repos/linkerd/linkerd2/issues/events{/number}","events_url":"https://api.github.com/repos/linkerd/linkerd2/events","assignees_url":"https://api.github.com/repos/linkerd/linkerd2/assignees{/user}","branches_url":"https://api.github.com/repos/linkerd/linkerd2/branches{/branch}","tags_url":"https://api.github.com/repos/linkerd/linkerd2/tags","blobs_url":"https://api.github.com/repos/linkerd/linkerd2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkerd/linkerd2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkerd/linkerd2/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkerd/linkerd2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkerd/linkerd2/statuses/{sha}","languages_url":"https://api.github.com/repos/linkerd/linkerd2/languages","stargazers_url":"https://api.github.com/repos/linkerd/linkerd2/stargazers","contributors_url":"https://api.github.com/repos/linkerd/linkerd2/contributors","subscribers_url":"https://api.github.com/repos/linkerd/linkerd2/subscribers","subscription_url":"https://api.github.com/repos/linkerd/linkerd2/subscription","commits_url":"https://api.github.com/repos/linkerd/linkerd2/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkerd/linkerd2/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkerd/linkerd2/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkerd/linkerd2/issues/comments{/number}","contents_url":"https://api.github.com/repos/linkerd/linkerd2/contents/{+path}","compare_url":"https://api.github.com/repos/linkerd/linkerd2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkerd/linkerd2/merges","archive_url":"https://api.github.com/repos/linkerd/linkerd2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkerd/linkerd2/downloads","issues_url":"https://api.github.com/repos/linkerd/linkerd2/issues{/number}","pulls_url":"https://api.github.com/repos/linkerd/linkerd2/pulls{/number}","milestones_url":"https://api.github.com/repos/linkerd/linkerd2/milestones{/number}","notifications_url":"https://api.github.com/repos/linkerd/linkerd2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkerd/linkerd2/labels{/name}","releases_url":"https://api.github.com/repos/linkerd/linkerd2/releases{/id}","deployments_url":"https://api.github.com/repos/linkerd/linkerd2/deployments","created_at":"2017-12-04T23:16:56Z","updated_at":"2018-07-19T19:04:46Z","pushed_at":"2018-07-19T21:54:56Z","git_url":"git://github.com/linkerd/linkerd2.git","ssh_url":"git@github.com:linkerd/linkerd2.git","clone_url":"https://github.com/linkerd/linkerd2.git","svn_url":"https://github.com/linkerd/linkerd2","homepage":"https://linkerd.io","size":7050,"stargazers_count":2180,"watchers_count":2180,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":127,"mirror_url":null,"archived":false,"open_issues_count":190,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":127,"open_issues":190,"watchers":2180,"default_branch":"master"}},"base":{"label":"linkerd:master","ref":"master","sha":"9821b9732680dcf81246f5f5b8282da02703b4aa","user":{"login":"linkerd","id":25301026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MzAxMDI2","avatar_url":"https://avatars3.githubusercontent.com/u/25301026?v=4","gravatar_id":"","url":"https://api.github.com/users/linkerd","html_url":"https://github.com/linkerd","followers_url":"https://api.github.com/users/linkerd/followers","following_url":"https://api.github.com/users/linkerd/following{/other_user}","gists_url":"https://api.github.com/users/linkerd/gists{/gist_id}","starred_url":"https://api.github.com/users/linkerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkerd/subscriptions","organizations_url":"https://api.github.com/users/linkerd/orgs","repos_url":"https://api.github.com/users/linkerd/repos","events_url":"https://api.github.com/users/linkerd/events{/privacy}","received_events_url":"https://api.github.com/users/linkerd/received_events","type":"Organization","site_admin":false},"repo":{"id":113106184,"node_id":"MDEwOlJlcG9zaXRvcnkxMTMxMDYxODQ=","name":"linkerd2","full_name":"linkerd/linkerd2","owner":{"login":"linkerd","id":25301026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MzAxMDI2","avatar_url":"https://avatars3.githubusercontent.com/u/25301026?v=4","gravatar_id":"","url":"https://api.github.com/users/linkerd","html_url":"https://github.com/linkerd","followers_url":"https://api.github.com/users/linkerd/followers","following_url":"https://api.github.com/users/linkerd/following{/other_user}","gists_url":"https://api.github.com/users/linkerd/gists{/gist_id}","starred_url":"https://api.github.com/users/linkerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkerd/subscriptions","organizations_url":"https://api.github.com/users/linkerd/orgs","repos_url":"https://api.github.com/users/linkerd/repos","events_url":"https://api.github.com/users/linkerd/events{/privacy}","received_events_url":"https://api.github.com/users/linkerd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linkerd/linkerd2","description":"Open source service mesh for cloud-native applications, v2","fork":false,"url":"https://api.github.com/repos/linkerd/linkerd2","forks_url":"https://api.github.com/repos/linkerd/linkerd2/forks","keys_url":"https://api.github.com/repos/linkerd/linkerd2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkerd/linkerd2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkerd/linkerd2/teams","hooks_url":"https://api.github.com/repos/linkerd/linkerd2/hooks","issue_events_url":"https://api.github.com/repos/linkerd/linkerd2/issues/events{/number}","events_url":"https://api.github.com/repos/linkerd/linkerd2/events","assignees_url":"https://api.github.com/repos/linkerd/linkerd2/assignees{/user}","branches_url":"https://api.github.com/repos/linkerd/linkerd2/branches{/branch}","tags_url":"https://api.github.com/repos/linkerd/linkerd2/tags","blobs_url":"https://api.github.com/repos/linkerd/linkerd2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkerd/linkerd2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkerd/linkerd2/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkerd/linkerd2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkerd/linkerd2/statuses/{sha}","languages_url":"https://api.github.com/repos/linkerd/linkerd2/languages","stargazers_url":"https://api.github.com/repos/linkerd/linkerd2/stargazers","contributors_url":"https://api.github.com/repos/linkerd/linkerd2/contributors","subscribers_url":"https://api.github.com/repos/linkerd/linkerd2/subscribers","subscription_url":"https://api.github.com/repos/linkerd/linkerd2/subscription","commits_url":"https://api.github.com/repos/linkerd/linkerd2/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkerd/linkerd2/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkerd/linkerd2/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkerd/linkerd2/issues/comments{/number}","contents_url":"https://api.github.com/repos/linkerd/linkerd2/contents/{+path}","compare_url":"https://api.github.com/repos/linkerd/linkerd2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkerd/linkerd2/merges","archive_url":"https://api.github.com/repos/linkerd/linkerd2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkerd/linkerd2/downloads","issues_url":"https://api.github.com/repos/linkerd/linkerd2/issues{/number}","pulls_url":"https://api.github.com/repos/linkerd/linkerd2/pulls{/number}","milestones_url":"https://api.github.com/repos/linkerd/linkerd2/milestones{/number}","notifications_url":"https://api.github.com/repos/linkerd/linkerd2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkerd/linkerd2/labels{/name}","releases_url":"https://api.github.com/repos/linkerd/linkerd2/releases{/id}","deployments_url":"https://api.github.com/repos/linkerd/linkerd2/deployments","created_at":"2017-12-04T23:16:56Z","updated_at":"2018-07-19T19:04:46Z","pushed_at":"2018-07-19T21:54:56Z","git_url":"git://github.com/linkerd/linkerd2.git","ssh_url":"git@github.com:linkerd/linkerd2.git","clone_url":"https://github.com/linkerd/linkerd2.git","svn_url":"https://github.com/linkerd/linkerd2","homepage":"https://linkerd.io","size":7050,"stargazers_count":2180,"watchers_count":2180,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":127,"mirror_url":null,"archived":false,"open_issues_count":190,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":127,"open_issues":190,"watchers":2180,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkerd/linkerd2/pulls/1355"},"html":{"href":"https://github.com/linkerd/linkerd2/pull/1355"},"issue":{"href":"https://api.github.com/repos/linkerd/linkerd2/issues/1355"},"comments":{"href":"https://api.github.com/repos/linkerd/linkerd2/issues/1355/comments"},"review_comments":{"href":"https://api.github.com/repos/linkerd/linkerd2/pulls/1355/comments"},"review_comment":{"href":"https://api.github.com/repos/linkerd/linkerd2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkerd/linkerd2/pulls/1355/commits"},"statuses":{"href":"https://api.github.com/repos/linkerd/linkerd2/statuses/cd72bbe3d66a46ed1a87e3da4264e99a343747e7"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"klingerf"}}