{"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/datadog-agent/pulls/comments/196639598","pull_request_review_id":130229807,"id":196639598,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjYzOTU5OA==","diff_hunk":"@@ -55,31 +59,41 @@ func (s *tagStore) processTagInfo(info *collectors.TagInfo) error {\n \t}\n \n \t// TODO: check if real change\n-\ts.storeMutex.RLock()\n+\ts.storeMutex.Lock()\n+\tdefer s.storeMutex.Unlock()\n \tstoredTags, exist := s.store[info.Entity]\n-\ts.storeMutex.RUnlock()\n-\tif exist == false {\n+\tif !exist {\n \t\tstoredTags = &entityTags{\n \t\t\tlowCardTags:  make(map[string][]string),\n \t\t\thighCardTags: make(map[string][]string),\n \t\t}\n+\t\ts.store[info.Entity] = storedTags\n \t}\n \n \tstoredTags.Lock()\n+\tdefer storedTags.Unlock()\n \tstoredTags.lowCardTags[info.Source] = info.LowCardTags\n \tstoredTags.highCardTags[info.Source] = info.HighCardTags\n \tstoredTags.cacheValid = false\n-\tstoredTags.Unlock()\n-\n-\tif exist == false {\n-\t\ts.storeMutex.Lock()\n-\t\ts.store[info.Entity] = storedTags\n-\t\ts.storeMutex.Unlock()\n-\t}\n \n \treturn nil\n }\n \n+func computeTagsHash(tags []string) string {\n+\thash := \"\"\n+\t// do not sort original slice","path":"pkg/tagger/tagstore.go","position":54,"original_position":54,"commit_id":"b4276c9cf72a3b38f0d2ef0cef4c2f132dc8997b","original_commit_id":"b4276c9cf72a3b38f0d2ef0cef4c2f132dc8997b","user":{"login":"CharlyF","id":7433560,"node_id":"MDQ6VXNlcjc0MzM1NjA=","avatar_url":"https://avatars2.githubusercontent.com/u/7433560?v=4","gravatar_id":"","url":"https://api.github.com/users/CharlyF","html_url":"https://github.com/CharlyF","followers_url":"https://api.github.com/users/CharlyF/followers","following_url":"https://api.github.com/users/CharlyF/following{/other_user}","gists_url":"https://api.github.com/users/CharlyF/gists{/gist_id}","starred_url":"https://api.github.com/users/CharlyF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CharlyF/subscriptions","organizations_url":"https://api.github.com/users/CharlyF/orgs","repos_url":"https://api.github.com/users/CharlyF/repos","events_url":"https://api.github.com/users/CharlyF/events{/privacy}","received_events_url":"https://api.github.com/users/CharlyF/received_events","type":"User","site_admin":false},"body":"Actually, I think this might happen if the DCA returns kube deploy and kube svc (i.e. at least 2 tags) I think.","created_at":"2018-06-20T03:34:49Z","updated_at":"2018-06-20T03:34:49Z","html_url":"https://github.com/DataDog/datadog-agent/pull/1839#discussion_r196639598","pull_request_url":"https://api.github.com/repos/DataDog/datadog-agent/pulls/1839","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DataDog/datadog-agent/pulls/comments/196639598"},"html":{"href":"https://github.com/DataDog/datadog-agent/pull/1839#discussion_r196639598"},"pull_request":{"href":"https://api.github.com/repos/DataDog/datadog-agent/pulls/1839"}},"in_reply_to_id":196638906},"pull_request":{"url":"https://api.github.com/repos/DataDog/datadog-agent/pulls/1839","id":194909524,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0OTA5NTI0","html_url":"https://github.com/DataDog/datadog-agent/pull/1839","diff_url":"https://github.com/DataDog/datadog-agent/pull/1839.diff","patch_url":"https://github.com/DataDog/datadog-agent/pull/1839.patch","issue_url":"https://api.github.com/repos/DataDog/datadog-agent/issues/1839","number":1839,"state":"open","locked":false,"title":"Re-schedule a check on new tags","user":{"login":"JulienBalestra","id":8077192,"node_id":"MDQ6VXNlcjgwNzcxOTI=","avatar_url":"https://avatars2.githubusercontent.com/u/8077192?v=4","gravatar_id":"","url":"https://api.github.com/users/JulienBalestra","html_url":"https://github.com/JulienBalestra","followers_url":"https://api.github.com/users/JulienBalestra/followers","following_url":"https://api.github.com/users/JulienBalestra/following{/other_user}","gists_url":"https://api.github.com/users/JulienBalestra/gists{/gist_id}","starred_url":"https://api.github.com/users/JulienBalestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulienBalestra/subscriptions","organizations_url":"https://api.github.com/users/JulienBalestra/orgs","repos_url":"https://api.github.com/users/JulienBalestra/repos","events_url":"https://api.github.com/users/JulienBalestra/events{/privacy}","received_events_url":"https://api.github.com/users/JulienBalestra/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\n\r\nWhen the Autodiscovery was created for the Agent 6, it was assumed that templates are static.\r\nThis is now an issue as a template that is created for a check will only be tagged with the tags found when the template for it is created.\r\nTherefore, if another tag is collected later on, it will not be associated to the metrics for the check.\r\n\r\nOnce the config is resolved the tags added are static.\r\nAfter this, if you create a k8s service that matches the pod you’ll never get the kube_service tags because tags are injected as instance tags when the check is launched and are never refreshed.\r\n\r\n\r\n### Motivation\r\n\r\nWhat inspired you to submit this pull request?\r\n\r\n### Additional Notes\r\n\r\nAnything else we should know when reviewing?\r\n","created_at":"2018-06-14T14:18:12Z","updated_at":"2018-06-20T03:34:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd10d4f2f516cc3fd2414105b7394c04b4a102b9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"Croissant","id":1224133,"node_id":"MDQ6VGVhbTEyMjQxMzM=","slug":"croissant","description":"Core Agent","privacy":"closed","url":"https://api.github.com/teams/1224133","members_url":"https://api.github.com/teams/1224133/members{/member}","repositories_url":"https://api.github.com/teams/1224133/repos","permission":"pull"}],"labels":[{"id":664370697,"node_id":"MDU6TGFiZWw2NjQzNzA2OTc=","url":"https://api.github.com/repos/DataDog/datadog-agent/labels/component/autodiscovery","name":"component/autodiscovery","color":"0052cc","default":false},{"id":724848823,"node_id":"MDU6TGFiZWw3MjQ4NDg4MjM=","url":"https://api.github.com/repos/DataDog/datadog-agent/labels/component/tagger","name":"component/tagger","color":"0052cc","default":false},{"id":571127627,"node_id":"MDU6TGFiZWw1NzExMjc2Mjc=","url":"https://api.github.com/repos/DataDog/datadog-agent/labels/do-not-merge/WIP","name":"do-not-merge/WIP","color":"000000","default":false},{"id":313604150,"node_id":"MDU6TGFiZWwzMTM2MDQxNTA=","url":"https://api.github.com/repos/DataDog/datadog-agent/labels/kind/bug","name":"kind/bug","color":"fc2929","default":false},{"id":796118273,"node_id":"MDU6TGFiZWw3OTYxMTgyNzM=","url":"https://api.github.com/repos/DataDog/datadog-agent/labels/noreno","name":"noreno","color":"edd682","default":false},{"id":695417157,"node_id":"MDU6TGFiZWw2OTU0MTcxNTc=","url":"https://api.github.com/repos/DataDog/datadog-agent/labels/team/kenafeh","name":"team/kenafeh","color":"d4c5f9","default":false}],"milestone":{"url":"https://api.github.com/repos/DataDog/datadog-agent/milestones/29","html_url":"https://github.com/DataDog/datadog-agent/milestone/29","labels_url":"https://api.github.com/repos/DataDog/datadog-agent/milestones/29/labels","id":3418693,"node_id":"MDk6TWlsZXN0b25lMzQxODY5Mw==","number":29,"title":"6.3.1","description":null,"creator":{"login":"hkaj","id":5287287,"node_id":"MDQ6VXNlcjUyODcyODc=","avatar_url":"https://avatars1.githubusercontent.com/u/5287287?v=4","gravatar_id":"","url":"https://api.github.com/users/hkaj","html_url":"https://github.com/hkaj","followers_url":"https://api.github.com/users/hkaj/followers","following_url":"https://api.github.com/users/hkaj/following{/other_user}","gists_url":"https://api.github.com/users/hkaj/gists{/gist_id}","starred_url":"https://api.github.com/users/hkaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkaj/subscriptions","organizations_url":"https://api.github.com/users/hkaj/orgs","repos_url":"https://api.github.com/users/hkaj/repos","events_url":"https://api.github.com/users/hkaj/events{/privacy}","received_events_url":"https://api.github.com/users/hkaj/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":0,"state":"open","created_at":"2018-06-12T11:48:52Z","updated_at":"2018-06-19T17:41:49Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/DataDog/datadog-agent/pulls/1839/commits","review_comments_url":"https://api.github.com/repos/DataDog/datadog-agent/pulls/1839/comments","review_comment_url":"https://api.github.com/repos/DataDog/datadog-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataDog/datadog-agent/issues/1839/comments","statuses_url":"https://api.github.com/repos/DataDog/datadog-agent/statuses/b4276c9cf72a3b38f0d2ef0cef4c2f132dc8997b","head":{"label":"DataDog:JulienBalestra/ad-tagger","ref":"JulienBalestra/ad-tagger","sha":"b4276c9cf72a3b38f0d2ef0cef4c2f132dc8997b","user":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":49970739,"node_id":"MDEwOlJlcG9zaXRvcnk0OTk3MDczOQ==","name":"datadog-agent","full_name":"DataDog/datadog-agent","owner":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/datadog-agent","description":"Datadog Agent ","fork":false,"url":"https://api.github.com/repos/DataDog/datadog-agent","forks_url":"https://api.github.com/repos/DataDog/datadog-agent/forks","keys_url":"https://api.github.com/repos/DataDog/datadog-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/datadog-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/datadog-agent/teams","hooks_url":"https://api.github.com/repos/DataDog/datadog-agent/hooks","issue_events_url":"https://api.github.com/repos/DataDog/datadog-agent/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/datadog-agent/events","assignees_url":"https://api.github.com/repos/DataDog/datadog-agent/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/datadog-agent/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/datadog-agent/tags","blobs_url":"https://api.github.com/repos/DataDog/datadog-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/datadog-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/datadog-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/datadog-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/datadog-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/datadog-agent/languages","stargazers_url":"https://api.github.com/repos/DataDog/datadog-agent/stargazers","contributors_url":"https://api.github.com/repos/DataDog/datadog-agent/contributors","subscribers_url":"https://api.github.com/repos/DataDog/datadog-agent/subscribers","subscription_url":"https://api.github.com/repos/DataDog/datadog-agent/subscription","commits_url":"https://api.github.com/repos/DataDog/datadog-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/datadog-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/datadog-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/datadog-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/datadog-agent/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/datadog-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/datadog-agent/merges","archive_url":"https://api.github.com/repos/DataDog/datadog-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/datadog-agent/downloads","issues_url":"https://api.github.com/repos/DataDog/datadog-agent/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/datadog-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/datadog-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/datadog-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/datadog-agent/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/datadog-agent/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/datadog-agent/deployments","created_at":"2016-01-19T17:40:41Z","updated_at":"2018-06-19T22:31:03Z","pushed_at":"2018-06-19T22:35:22Z","git_url":"git://github.com/DataDog/datadog-agent.git","ssh_url":"git@github.com:DataDog/datadog-agent.git","clone_url":"https://github.com/DataDog/datadog-agent.git","svn_url":"https://github.com/DataDog/datadog-agent","homepage":"https://docs.datadoghq.com/","size":21213,"stargazers_count":192,"watchers_count":192,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"archived":false,"open_issues_count":94,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":68,"open_issues":94,"watchers":192,"default_branch":"master"}},"base":{"label":"DataDog:master","ref":"master","sha":"173b1ffbfa3075f3dd62ef1db6c6ab3ede96fdc9","user":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":49970739,"node_id":"MDEwOlJlcG9zaXRvcnk0OTk3MDczOQ==","name":"datadog-agent","full_name":"DataDog/datadog-agent","owner":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/datadog-agent","description":"Datadog Agent ","fork":false,"url":"https://api.github.com/repos/DataDog/datadog-agent","forks_url":"https://api.github.com/repos/DataDog/datadog-agent/forks","keys_url":"https://api.github.com/repos/DataDog/datadog-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/datadog-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/datadog-agent/teams","hooks_url":"https://api.github.com/repos/DataDog/datadog-agent/hooks","issue_events_url":"https://api.github.com/repos/DataDog/datadog-agent/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/datadog-agent/events","assignees_url":"https://api.github.com/repos/DataDog/datadog-agent/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/datadog-agent/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/datadog-agent/tags","blobs_url":"https://api.github.com/repos/DataDog/datadog-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/datadog-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/datadog-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/datadog-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/datadog-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/datadog-agent/languages","stargazers_url":"https://api.github.com/repos/DataDog/datadog-agent/stargazers","contributors_url":"https://api.github.com/repos/DataDog/datadog-agent/contributors","subscribers_url":"https://api.github.com/repos/DataDog/datadog-agent/subscribers","subscription_url":"https://api.github.com/repos/DataDog/datadog-agent/subscription","commits_url":"https://api.github.com/repos/DataDog/datadog-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/datadog-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/datadog-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/datadog-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/datadog-agent/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/datadog-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/datadog-agent/merges","archive_url":"https://api.github.com/repos/DataDog/datadog-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/datadog-agent/downloads","issues_url":"https://api.github.com/repos/DataDog/datadog-agent/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/datadog-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/datadog-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/datadog-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/datadog-agent/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/datadog-agent/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/datadog-agent/deployments","created_at":"2016-01-19T17:40:41Z","updated_at":"2018-06-19T22:31:03Z","pushed_at":"2018-06-19T22:35:22Z","git_url":"git://github.com/DataDog/datadog-agent.git","ssh_url":"git@github.com:DataDog/datadog-agent.git","clone_url":"https://github.com/DataDog/datadog-agent.git","svn_url":"https://github.com/DataDog/datadog-agent","homepage":"https://docs.datadoghq.com/","size":21213,"stargazers_count":192,"watchers_count":192,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"archived":false,"open_issues_count":94,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":68,"open_issues":94,"watchers":192,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/datadog-agent/pulls/1839"},"html":{"href":"https://github.com/DataDog/datadog-agent/pull/1839"},"issue":{"href":"https://api.github.com/repos/DataDog/datadog-agent/issues/1839"},"comments":{"href":"https://api.github.com/repos/DataDog/datadog-agent/issues/1839/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/datadog-agent/pulls/1839/comments"},"review_comment":{"href":"https://api.github.com/repos/DataDog/datadog-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataDog/datadog-agent/pulls/1839/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/datadog-agent/statuses/b4276c9cf72a3b38f0d2ef0cef4c2f132dc8997b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"CharlyF"}}