{"action":"created","comment":{"url":"https://api.github.com/repos/intelsdi-x/snap/pulls/comments/57901297","id":57901297,"diff_hunk":"@@ -589,11 +590,19 @@ func (s *scheduler) gatherMetricsAndPlugins(wf *schedulerWorkflow) ([]core.Metri\n \t)\n \n \tfor _, m := range wf.metrics {\n-\t\tmts = append(mts, &metric{\n-\t\t\tnamespace: m.Namespace(),\n-\t\t\tversion:   m.Version(),\n-\t\t\tconfig:    wf.configTree.Get(m.Namespace()),\n-\t\t})\n+\t\tnss, err := s.metricManager.ExpandWildCards(m.Namespace())\n+\t\tif err != nil {\n+\t\t\t// use metric directly from the workflow\n+\t\t\tnss = [][]string{m.Namespace()}\n+\t\t}\n+\n+\t\tfor _, ns := range nss {\n+\t\t\tmts = append(mts, &metric{\n+\t\t\t\tnamespace: ns,\n+\t\t\t\tversion:   m.Version(),\n+\t\t\t\tconfig:    wf.configTree.Get(m.Namespace()),","path":"scheduler/scheduler.go","position":36,"original_position":36,"commit_id":"a48553ba4484ad3b41b90ae16870e92c83753348","original_commit_id":"a48553ba4484ad3b41b90ae16870e92c83753348","user":{"login":"IzabellaRaulin","id":11335874,"avatar_url":"https://avatars.githubusercontent.com/u/11335874?v=3","gravatar_id":"","url":"https://api.github.com/users/IzabellaRaulin","html_url":"https://github.com/IzabellaRaulin","followers_url":"https://api.github.com/users/IzabellaRaulin/followers","following_url":"https://api.github.com/users/IzabellaRaulin/following{/other_user}","gists_url":"https://api.github.com/users/IzabellaRaulin/gists{/gist_id}","starred_url":"https://api.github.com/users/IzabellaRaulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IzabellaRaulin/subscriptions","organizations_url":"https://api.github.com/users/IzabellaRaulin/orgs","repos_url":"https://api.github.com/users/IzabellaRaulin/repos","events_url":"https://api.github.com/users/IzabellaRaulin/events{/privacy}","received_events_url":"https://api.github.com/users/IzabellaRaulin/received_events","type":"User","site_admin":false},"body":"Yes, now it only works for \"/intel/mock/*\" and for others variations of queries (e.g like /intel/mock/(foo|bar)), but they have to start with \"/intel/mock\" to get this config. \r\n\r\nI looked on that and I suppose that turning `m.Namespace()` into `ns`  is not the only thing which needs to been done in this case. Look on [scheduler/job.go#L221](https://github.com/intelsdi-x/snap/blob/master/scheduler/job.go#L221) - I do not refactor this file (generally my approach was changing as little as possible), but might this should be changed too - according that, 2 things have to be refactored:\r\n- [in scheduler/job.go func (c *collectorJob) Run()](https://github.com/IzabellaRaulin/snap/blob/dynamic_query_support/scheduler/job.go#L221)\r\n- [in control/control.go func (p *pluginControl) CollectMetrics(..)](https://github.com/IzabellaRaulin/snap/blob/dynamic_query_support/control/control.go#L856)\r\n@jcooklin - what do you think about it? \r\n\r\n","created_at":"2016-03-30T14:48:04Z","updated_at":"2016-03-30T14:48:04Z","html_url":"https://github.com/intelsdi-x/snap/pull/803#discussion_r57901297","pull_request_url":"https://api.github.com/repos/intelsdi-x/snap/pulls/803","_links":{"self":{"href":"https://api.github.com/repos/intelsdi-x/snap/pulls/comments/57901297"},"html":{"href":"https://github.com/intelsdi-x/snap/pull/803#discussion_r57901297"},"pull_request":{"href":"https://api.github.com/repos/intelsdi-x/snap/pulls/803"}}},"pull_request":{"url":"https://api.github.com/repos/intelsdi-x/snap/pulls/803","id":64042973,"html_url":"https://github.com/intelsdi-x/snap/pull/803","diff_url":"https://github.com/intelsdi-x/snap/pull/803.diff","patch_url":"https://github.com/intelsdi-x/snap/pull/803.patch","issue_url":"https://api.github.com/repos/intelsdi-x/snap/issues/803","number":803,"state":"open","locked":false,"title":"First implementation of dynamic query support","user":{"login":"IzabellaRaulin","id":11335874,"avatar_url":"https://avatars.githubusercontent.com/u/11335874?v=3","gravatar_id":"","url":"https://api.github.com/users/IzabellaRaulin","html_url":"https://github.com/IzabellaRaulin","followers_url":"https://api.github.com/users/IzabellaRaulin/followers","following_url":"https://api.github.com/users/IzabellaRaulin/following{/other_user}","gists_url":"https://api.github.com/users/IzabellaRaulin/gists{/gist_id}","starred_url":"https://api.github.com/users/IzabellaRaulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IzabellaRaulin/subscriptions","organizations_url":"https://api.github.com/users/IzabellaRaulin/orgs","repos_url":"https://api.github.com/users/IzabellaRaulin/repos","events_url":"https://api.github.com/users/IzabellaRaulin/events{/privacy}","received_events_url":"https://api.github.com/users/IzabellaRaulin/received_events","type":"User","site_admin":false},"body":"Related to #676 \r\n\r\nSummary of changes:\r\n- adding dynamic query support (wildcard and tuple)\r\n- adding validation of metric's namespace:\r\n - (part 1) not allowed characters, especially that ones which can be invalid interpreted as regexp tokens\r\n - (part 2) a wildcard in the end of namespace - that has NOT been implemented yet. It will be added in another pull request, after revising of all existing collector plugins and refactoring that ones which have such like metrics. \r\n   Why: Already even plugin has metrics which ends with a wildcard, it works properly and can be used by snap users\r\n\r\nTesting done:\r\n-  checking a query support for plugin with no-dynamic metrics \r\n-  checking a query support for plugin with dynamic metrics (if plugin accepts wildcards in this location the framework does not attempt to evaluate that)\r\n\r\n@intelsdi-x/snap-maintainers\r\n\r\n","created_at":"2016-03-24T14:39:28Z","updated_at":"2016-03-30T14:48:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b1ef27c041ada7a484131fdaaf651db484c076dc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/intelsdi-x/snap/pulls/803/commits","review_comments_url":"https://api.github.com/repos/intelsdi-x/snap/pulls/803/comments","review_comment_url":"https://api.github.com/repos/intelsdi-x/snap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/intelsdi-x/snap/issues/803/comments","statuses_url":"https://api.github.com/repos/intelsdi-x/snap/statuses/a48553ba4484ad3b41b90ae16870e92c83753348","head":{"label":"IzabellaRaulin:dynamic_query_support","ref":"dynamic_query_support","sha":"a48553ba4484ad3b41b90ae16870e92c83753348","user":{"login":"IzabellaRaulin","id":11335874,"avatar_url":"https://avatars.githubusercontent.com/u/11335874?v=3","gravatar_id":"","url":"https://api.github.com/users/IzabellaRaulin","html_url":"https://github.com/IzabellaRaulin","followers_url":"https://api.github.com/users/IzabellaRaulin/followers","following_url":"https://api.github.com/users/IzabellaRaulin/following{/other_user}","gists_url":"https://api.github.com/users/IzabellaRaulin/gists{/gist_id}","starred_url":"https://api.github.com/users/IzabellaRaulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IzabellaRaulin/subscriptions","organizations_url":"https://api.github.com/users/IzabellaRaulin/orgs","repos_url":"https://api.github.com/users/IzabellaRaulin/repos","events_url":"https://api.github.com/users/IzabellaRaulin/events{/privacy}","received_events_url":"https://api.github.com/users/IzabellaRaulin/received_events","type":"User","site_admin":false},"repo":{"id":47624119,"name":"snap","full_name":"IzabellaRaulin/snap","owner":{"login":"IzabellaRaulin","id":11335874,"avatar_url":"https://avatars.githubusercontent.com/u/11335874?v=3","gravatar_id":"","url":"https://api.github.com/users/IzabellaRaulin","html_url":"https://github.com/IzabellaRaulin","followers_url":"https://api.github.com/users/IzabellaRaulin/followers","following_url":"https://api.github.com/users/IzabellaRaulin/following{/other_user}","gists_url":"https://api.github.com/users/IzabellaRaulin/gists{/gist_id}","starred_url":"https://api.github.com/users/IzabellaRaulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IzabellaRaulin/subscriptions","organizations_url":"https://api.github.com/users/IzabellaRaulin/orgs","repos_url":"https://api.github.com/users/IzabellaRaulin/repos","events_url":"https://api.github.com/users/IzabellaRaulin/events{/privacy}","received_events_url":"https://api.github.com/users/IzabellaRaulin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IzabellaRaulin/snap","description":"A powerful telemetry framework","fork":true,"url":"https://api.github.com/repos/IzabellaRaulin/snap","forks_url":"https://api.github.com/repos/IzabellaRaulin/snap/forks","keys_url":"https://api.github.com/repos/IzabellaRaulin/snap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IzabellaRaulin/snap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IzabellaRaulin/snap/teams","hooks_url":"https://api.github.com/repos/IzabellaRaulin/snap/hooks","issue_events_url":"https://api.github.com/repos/IzabellaRaulin/snap/issues/events{/number}","events_url":"https://api.github.com/repos/IzabellaRaulin/snap/events","assignees_url":"https://api.github.com/repos/IzabellaRaulin/snap/assignees{/user}","branches_url":"https://api.github.com/repos/IzabellaRaulin/snap/branches{/branch}","tags_url":"https://api.github.com/repos/IzabellaRaulin/snap/tags","blobs_url":"https://api.github.com/repos/IzabellaRaulin/snap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IzabellaRaulin/snap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IzabellaRaulin/snap/git/refs{/sha}","trees_url":"https://api.github.com/repos/IzabellaRaulin/snap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IzabellaRaulin/snap/statuses/{sha}","languages_url":"https://api.github.com/repos/IzabellaRaulin/snap/languages","stargazers_url":"https://api.github.com/repos/IzabellaRaulin/snap/stargazers","contributors_url":"https://api.github.com/repos/IzabellaRaulin/snap/contributors","subscribers_url":"https://api.github.com/repos/IzabellaRaulin/snap/subscribers","subscription_url":"https://api.github.com/repos/IzabellaRaulin/snap/subscription","commits_url":"https://api.github.com/repos/IzabellaRaulin/snap/commits{/sha}","git_commits_url":"https://api.github.com/repos/IzabellaRaulin/snap/git/commits{/sha}","comments_url":"https://api.github.com/repos/IzabellaRaulin/snap/comments{/number}","issue_comment_url":"https://api.github.com/repos/IzabellaRaulin/snap/issues/comments{/number}","contents_url":"https://api.github.com/repos/IzabellaRaulin/snap/contents/{+path}","compare_url":"https://api.github.com/repos/IzabellaRaulin/snap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IzabellaRaulin/snap/merges","archive_url":"https://api.github.com/repos/IzabellaRaulin/snap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IzabellaRaulin/snap/downloads","issues_url":"https://api.github.com/repos/IzabellaRaulin/snap/issues{/number}","pulls_url":"https://api.github.com/repos/IzabellaRaulin/snap/pulls{/number}","milestones_url":"https://api.github.com/repos/IzabellaRaulin/snap/milestones{/number}","notifications_url":"https://api.github.com/repos/IzabellaRaulin/snap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IzabellaRaulin/snap/labels{/name}","releases_url":"https://api.github.com/repos/IzabellaRaulin/snap/releases{/id}","deployments_url":"https://api.github.com/repos/IzabellaRaulin/snap/deployments","created_at":"2015-12-08T13:34:02Z","updated_at":"2016-01-12T12:31:42Z","pushed_at":"2016-03-30T09:23:20Z","git_url":"git://github.com/IzabellaRaulin/snap.git","ssh_url":"git@github.com:IzabellaRaulin/snap.git","clone_url":"https://github.com/IzabellaRaulin/snap.git","svn_url":"https://github.com/IzabellaRaulin/snap","homepage":"http://github.com/intelsdi-x/snap","size":9757,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"intelsdi-x:master","ref":"master","sha":"ed2e620679f19950c660b3c44ce5a2f8e67eae17","user":{"login":"intelsdi-x","id":8398747,"avatar_url":"https://avatars.githubusercontent.com/u/8398747?v=3","gravatar_id":"","url":"https://api.github.com/users/intelsdi-x","html_url":"https://github.com/intelsdi-x","followers_url":"https://api.github.com/users/intelsdi-x/followers","following_url":"https://api.github.com/users/intelsdi-x/following{/other_user}","gists_url":"https://api.github.com/users/intelsdi-x/gists{/gist_id}","starred_url":"https://api.github.com/users/intelsdi-x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intelsdi-x/subscriptions","organizations_url":"https://api.github.com/users/intelsdi-x/orgs","repos_url":"https://api.github.com/users/intelsdi-x/repos","events_url":"https://api.github.com/users/intelsdi-x/events{/privacy}","received_events_url":"https://api.github.com/users/intelsdi-x/received_events","type":"Organization","site_admin":false},"repo":{"id":22931257,"name":"snap","full_name":"intelsdi-x/snap","owner":{"login":"intelsdi-x","id":8398747,"avatar_url":"https://avatars.githubusercontent.com/u/8398747?v=3","gravatar_id":"","url":"https://api.github.com/users/intelsdi-x","html_url":"https://github.com/intelsdi-x","followers_url":"https://api.github.com/users/intelsdi-x/followers","following_url":"https://api.github.com/users/intelsdi-x/following{/other_user}","gists_url":"https://api.github.com/users/intelsdi-x/gists{/gist_id}","starred_url":"https://api.github.com/users/intelsdi-x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intelsdi-x/subscriptions","organizations_url":"https://api.github.com/users/intelsdi-x/orgs","repos_url":"https://api.github.com/users/intelsdi-x/repos","events_url":"https://api.github.com/users/intelsdi-x/events{/privacy}","received_events_url":"https://api.github.com/users/intelsdi-x/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/intelsdi-x/snap","description":"A powerful telemetry framework","fork":false,"url":"https://api.github.com/repos/intelsdi-x/snap","forks_url":"https://api.github.com/repos/intelsdi-x/snap/forks","keys_url":"https://api.github.com/repos/intelsdi-x/snap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/intelsdi-x/snap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/intelsdi-x/snap/teams","hooks_url":"https://api.github.com/repos/intelsdi-x/snap/hooks","issue_events_url":"https://api.github.com/repos/intelsdi-x/snap/issues/events{/number}","events_url":"https://api.github.com/repos/intelsdi-x/snap/events","assignees_url":"https://api.github.com/repos/intelsdi-x/snap/assignees{/user}","branches_url":"https://api.github.com/repos/intelsdi-x/snap/branches{/branch}","tags_url":"https://api.github.com/repos/intelsdi-x/snap/tags","blobs_url":"https://api.github.com/repos/intelsdi-x/snap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/intelsdi-x/snap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/intelsdi-x/snap/git/refs{/sha}","trees_url":"https://api.github.com/repos/intelsdi-x/snap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/intelsdi-x/snap/statuses/{sha}","languages_url":"https://api.github.com/repos/intelsdi-x/snap/languages","stargazers_url":"https://api.github.com/repos/intelsdi-x/snap/stargazers","contributors_url":"https://api.github.com/repos/intelsdi-x/snap/contributors","subscribers_url":"https://api.github.com/repos/intelsdi-x/snap/subscribers","subscription_url":"https://api.github.com/repos/intelsdi-x/snap/subscription","commits_url":"https://api.github.com/repos/intelsdi-x/snap/commits{/sha}","git_commits_url":"https://api.github.com/repos/intelsdi-x/snap/git/commits{/sha}","comments_url":"https://api.github.com/repos/intelsdi-x/snap/comments{/number}","issue_comment_url":"https://api.github.com/repos/intelsdi-x/snap/issues/comments{/number}","contents_url":"https://api.github.com/repos/intelsdi-x/snap/contents/{+path}","compare_url":"https://api.github.com/repos/intelsdi-x/snap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/intelsdi-x/snap/merges","archive_url":"https://api.github.com/repos/intelsdi-x/snap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/intelsdi-x/snap/downloads","issues_url":"https://api.github.com/repos/intelsdi-x/snap/issues{/number}","pulls_url":"https://api.github.com/repos/intelsdi-x/snap/pulls{/number}","milestones_url":"https://api.github.com/repos/intelsdi-x/snap/milestones{/number}","notifications_url":"https://api.github.com/repos/intelsdi-x/snap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/intelsdi-x/snap/labels{/name}","releases_url":"https://api.github.com/repos/intelsdi-x/snap/releases{/id}","deployments_url":"https://api.github.com/repos/intelsdi-x/snap/deployments","created_at":"2014-08-13T21:04:51Z","updated_at":"2016-03-30T09:58:07Z","pushed_at":"2016-03-30T13:14:07Z","git_url":"git://github.com/intelsdi-x/snap.git","ssh_url":"git@github.com:intelsdi-x/snap.git","clone_url":"https://github.com/intelsdi-x/snap.git","svn_url":"https://github.com/intelsdi-x/snap","homepage":"http://intelsdi-x.github.io/snap/","size":23032,"stargazers_count":595,"watchers_count":595,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":66,"mirror_url":null,"open_issues_count":76,"forks":66,"open_issues":76,"watchers":595,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/intelsdi-x/snap/pulls/803"},"html":{"href":"https://github.com/intelsdi-x/snap/pull/803"},"issue":{"href":"https://api.github.com/repos/intelsdi-x/snap/issues/803"},"comments":{"href":"https://api.github.com/repos/intelsdi-x/snap/issues/803/comments"},"review_comments":{"href":"https://api.github.com/repos/intelsdi-x/snap/pulls/803/comments"},"review_comment":{"href":"https://api.github.com/repos/intelsdi-x/snap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/intelsdi-x/snap/pulls/803/commits"},"statuses":{"href":"https://api.github.com/repos/intelsdi-x/snap/statuses/a48553ba4484ad3b41b90ae16870e92c83753348"}}}}