{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-skywalking/pulls/comments/231537742","pull_request_review_id":172527946,"id":231537742,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTUzNzc0Mg==","diff_hunk":"@@ -84,6 +97,46 @@ public static void initialize() throws ConfigNotFoundException, AgentPackageNotF\n         IS_INIT_COMPLETED = true;\n     }\n \n+    private static void overrideConfigByAgentOptions(String agentOptions) throws IllegalAccessException {\n+        Properties properties = new Properties();\n+        for (List<String> terms : parseAgentOptions(agentOptions)) {\n+            if (terms.size() != 2) {\n+                throw new IllegalArgumentException(\"[\" + terms + \"] is not a key-value pair.\");\n+            }\n+            properties.put(terms.get(0), terms.get(1));\n+        }\n+        if (!properties.isEmpty()) {\n+            ConfigInitializer.initialize(properties, Config.class);\n+        }\n+    }\n+\n+    private static List<List<String>> parseAgentOptions(String agentOptions) {\n+        List<List<String>> options = new ArrayList<List<String>>();\n+        List<String> terms = new ArrayList<String>();\n+        boolean isInQuotes = false;\n+        StringBuilder currentTerm = new StringBuilder();\n+        for (char c : agentOptions.toCharArray()) {","path":"apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/SnifferConfigInitializer.java","position":59,"original_position":59,"commit_id":"c93d81bbe7fe5a5e5947e62a0e1bee347a5ac7de","original_commit_id":"c93d81bbe7fe5a5e5947e62a0e1bee347a5ac7de","user":{"login":"ascrutae","id":12436447,"node_id":"MDQ6VXNlcjEyNDM2NDQ3","avatar_url":"https://avatars3.githubusercontent.com/u/12436447?v=4","gravatar_id":"","url":"https://api.github.com/users/ascrutae","html_url":"https://github.com/ascrutae","followers_url":"https://api.github.com/users/ascrutae/followers","following_url":"https://api.github.com/users/ascrutae/following{/other_user}","gists_url":"https://api.github.com/users/ascrutae/gists{/gist_id}","starred_url":"https://api.github.com/users/ascrutae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ascrutae/subscriptions","organizations_url":"https://api.github.com/users/ascrutae/orgs","repos_url":"https://api.github.com/users/ascrutae/repos","events_url":"https://api.github.com/users/ascrutae/events{/privacy}","received_events_url":"https://api.github.com/users/ascrutae/received_events","type":"User","site_admin":false},"body":"Why don't you spilt agent Options by ','","created_at":"2018-11-07T14:56:32Z","updated_at":"2018-11-07T14:56:33Z","html_url":"https://github.com/apache/incubator-skywalking/pull/1887#discussion_r231537742","pull_request_url":"https://api.github.com/repos/apache/incubator-skywalking/pulls/1887","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-skywalking/pulls/comments/231537742"},"html":{"href":"https://github.com/apache/incubator-skywalking/pull/1887#discussion_r231537742"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-skywalking/pulls/1887"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-skywalking/pulls/1887","id":228654751,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4NjU0NzUx","html_url":"https://github.com/apache/incubator-skywalking/pull/1887","diff_url":"https://github.com/apache/incubator-skywalking/pull/1887.diff","patch_url":"https://github.com/apache/incubator-skywalking/pull/1887.patch","issue_url":"https://api.github.com/repos/apache/incubator-skywalking/issues/1887","number":1887,"state":"open","locked":false,"title":"Support for overriding config with agent options","user":{"login":"ScienJus","id":8350653,"node_id":"MDQ6VXNlcjgzNTA2NTM=","avatar_url":"https://avatars3.githubusercontent.com/u/8350653?v=4","gravatar_id":"","url":"https://api.github.com/users/ScienJus","html_url":"https://github.com/ScienJus","followers_url":"https://api.github.com/users/ScienJus/followers","following_url":"https://api.github.com/users/ScienJus/following{/other_user}","gists_url":"https://api.github.com/users/ScienJus/gists{/gist_id}","starred_url":"https://api.github.com/users/ScienJus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScienJus/subscriptions","organizations_url":"https://api.github.com/users/ScienJus/orgs","repos_url":"https://api.github.com/users/ScienJus/repos","events_url":"https://api.github.com/users/ScienJus/events{/privacy}","received_events_url":"https://api.github.com/users/ScienJus/received_events","type":"User","site_admin":false},"body":"Please answer these questions before submitting pull request\r\n\r\n- Why submit this pull request?\r\n- [ ] Bug fix\r\n- [x] New feature provided\r\n- [ ] Improve performance\r\n\r\n- Related issues\r\n\r\n#1881 \r\n___\r\n### New feature or improvement\r\n- Describe the details and related test reports.\r\n\r\n\r\nI wrote a unit test for parsing options, it's hard to do unit testing for the agent, so i confirm the config result through local integration test:\r\n\r\n```\r\n$ java -javaagent:./agent/skywalking-agent.jar=agent.application_code=ui,collector.backend_service=127.0.0.1:11800,logging.level=info -Xms256M -Xmx512M -jar ./webapp/skywalking-webapp.jar\r\nDEBUG 2018-11-06 18:58:48:780 AgentPackagePath :  The beacon class location is jar:file:*/dist/apache-skywalking-apm-incubating/agent/skywalking-agent.jar!/org/apache/skywalking/apm/agent/core/boot/AgentPackagePath.class. \r\nINFO 2018-11-06 18:58:48:781 SnifferConfigInitializer :  Config file found in */dist/apache-skywalking-apm-incubating/agent/config/agent.config. \r\nINFO 2018-11-06 18:58:48:793 SnifferConfigInitializer :  Agent options is: agent.application_code=ui,collector.backend_service=127.0.0.1:11800,logging.level=info \r\n```\r\n","created_at":"2018-11-06T11:12:33Z","updated_at":"2018-11-07T14:56:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f58ec6601b1b8883c5b9325a50fab1b4f9872563","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":830850387,"node_id":"MDU6TGFiZWw4MzA4NTAzODc=","url":"https://api.github.com/repos/apache/incubator-skywalking/labels/agent","name":"agent","color":"c2e0c6","default":false},{"id":845597520,"node_id":"MDU6TGFiZWw4NDU1OTc1MjA=","url":"https://api.github.com/repos/apache/incubator-skywalking/labels/enhancement","name":"enhancement","color":"c5def5","default":true}],"milestone":{"url":"https://api.github.com/repos/apache/incubator-skywalking/milestones/31","html_url":"https://github.com/apache/incubator-skywalking/milestone/31","labels_url":"https://api.github.com/repos/apache/incubator-skywalking/milestones/31/labels","id":3695964,"node_id":"MDk6TWlsZXN0b25lMzY5NTk2NA==","number":31,"title":"6.0.0-beta","description":"","creator":{"login":"wu-sheng","id":5441976,"node_id":"MDQ6VXNlcjU0NDE5NzY=","avatar_url":"https://avatars2.githubusercontent.com/u/5441976?v=4","gravatar_id":"","url":"https://api.github.com/users/wu-sheng","html_url":"https://github.com/wu-sheng","followers_url":"https://api.github.com/users/wu-sheng/followers","following_url":"https://api.github.com/users/wu-sheng/following{/other_user}","gists_url":"https://api.github.com/users/wu-sheng/gists{/gist_id}","starred_url":"https://api.github.com/users/wu-sheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wu-sheng/subscriptions","organizations_url":"https://api.github.com/users/wu-sheng/orgs","repos_url":"https://api.github.com/users/wu-sheng/repos","events_url":"https://api.github.com/users/wu-sheng/events{/privacy}","received_events_url":"https://api.github.com/users/wu-sheng/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":12,"state":"open","created_at":"2018-09-28T07:58:28Z","updated_at":"2018-11-07T06:22:45Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/apache/incubator-skywalking/pulls/1887/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-skywalking/pulls/1887/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-skywalking/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-skywalking/issues/1887/comments","statuses_url":"https://api.github.com/repos/apache/incubator-skywalking/statuses/c93d81bbe7fe5a5e5947e62a0e1bee347a5ac7de","head":{"label":"ScienJus:agent-options","ref":"agent-options","sha":"c93d81bbe7fe5a5e5947e62a0e1bee347a5ac7de","user":{"login":"ScienJus","id":8350653,"node_id":"MDQ6VXNlcjgzNTA2NTM=","avatar_url":"https://avatars3.githubusercontent.com/u/8350653?v=4","gravatar_id":"","url":"https://api.github.com/users/ScienJus","html_url":"https://github.com/ScienJus","followers_url":"https://api.github.com/users/ScienJus/followers","following_url":"https://api.github.com/users/ScienJus/following{/other_user}","gists_url":"https://api.github.com/users/ScienJus/gists{/gist_id}","starred_url":"https://api.github.com/users/ScienJus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScienJus/subscriptions","organizations_url":"https://api.github.com/users/ScienJus/orgs","repos_url":"https://api.github.com/users/ScienJus/repos","events_url":"https://api.github.com/users/ScienJus/events{/privacy}","received_events_url":"https://api.github.com/users/ScienJus/received_events","type":"User","site_admin":false},"repo":{"id":156341048,"node_id":"MDEwOlJlcG9zaXRvcnkxNTYzNDEwNDg=","name":"incubator-skywalking","full_name":"ScienJus/incubator-skywalking","private":false,"owner":{"login":"ScienJus","id":8350653,"node_id":"MDQ6VXNlcjgzNTA2NTM=","avatar_url":"https://avatars3.githubusercontent.com/u/8350653?v=4","gravatar_id":"","url":"https://api.github.com/users/ScienJus","html_url":"https://github.com/ScienJus","followers_url":"https://api.github.com/users/ScienJus/followers","following_url":"https://api.github.com/users/ScienJus/following{/other_user}","gists_url":"https://api.github.com/users/ScienJus/gists{/gist_id}","starred_url":"https://api.github.com/users/ScienJus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScienJus/subscriptions","organizations_url":"https://api.github.com/users/ScienJus/orgs","repos_url":"https://api.github.com/users/ScienJus/repos","events_url":"https://api.github.com/users/ScienJus/events{/privacy}","received_events_url":"https://api.github.com/users/ScienJus/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ScienJus/incubator-skywalking","description":"A distributed tracing system, and APM ( Application Performance Monitoring )","fork":true,"url":"https://api.github.com/repos/ScienJus/incubator-skywalking","forks_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/forks","keys_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/teams","hooks_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/hooks","issue_events_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/issues/events{/number}","events_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/events","assignees_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/assignees{/user}","branches_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/branches{/branch}","tags_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/tags","blobs_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/git/refs{/sha}","trees_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/statuses/{sha}","languages_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/languages","stargazers_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/stargazers","contributors_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/contributors","subscribers_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/subscribers","subscription_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/subscription","commits_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/commits{/sha}","git_commits_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/git/commits{/sha}","comments_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/comments{/number}","issue_comment_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/issues/comments{/number}","contents_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/contents/{+path}","compare_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/merges","archive_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/downloads","issues_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/issues{/number}","pulls_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/pulls{/number}","milestones_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/milestones{/number}","notifications_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/labels{/name}","releases_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/releases{/id}","deployments_url":"https://api.github.com/repos/ScienJus/incubator-skywalking/deployments","created_at":"2018-11-06T07:09:03Z","updated_at":"2018-11-06T07:09:10Z","pushed_at":"2018-11-07T09:05:08Z","git_url":"git://github.com/ScienJus/incubator-skywalking.git","ssh_url":"git@github.com:ScienJus/incubator-skywalking.git","clone_url":"https://github.com/ScienJus/incubator-skywalking.git","svn_url":"https://github.com/ScienJus/incubator-skywalking","homepage":"https://skywalking.incubator.apache.org/","size":141196,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"bdfd5318097b654f776b7927a6668a4c6ac03a27","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":45721011,"node_id":"MDEwOlJlcG9zaXRvcnk0NTcyMTAxMQ==","name":"incubator-skywalking","full_name":"apache/incubator-skywalking","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/apache/incubator-skywalking","description":"A distributed tracing system, and APM ( Application Performance Monitoring )","fork":false,"url":"https://api.github.com/repos/apache/incubator-skywalking","forks_url":"https://api.github.com/repos/apache/incubator-skywalking/forks","keys_url":"https://api.github.com/repos/apache/incubator-skywalking/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-skywalking/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-skywalking/teams","hooks_url":"https://api.github.com/repos/apache/incubator-skywalking/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-skywalking/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-skywalking/events","assignees_url":"https://api.github.com/repos/apache/incubator-skywalking/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-skywalking/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-skywalking/tags","blobs_url":"https://api.github.com/repos/apache/incubator-skywalking/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-skywalking/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-skywalking/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-skywalking/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-skywalking/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-skywalking/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-skywalking/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-skywalking/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-skywalking/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-skywalking/subscription","commits_url":"https://api.github.com/repos/apache/incubator-skywalking/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-skywalking/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-skywalking/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-skywalking/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-skywalking/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-skywalking/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-skywalking/merges","archive_url":"https://api.github.com/repos/apache/incubator-skywalking/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-skywalking/downloads","issues_url":"https://api.github.com/repos/apache/incubator-skywalking/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-skywalking/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-skywalking/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-skywalking/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-skywalking/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-skywalking/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-skywalking/deployments","created_at":"2015-11-07T03:30:36Z","updated_at":"2018-11-07T13:52:13Z","pushed_at":"2018-11-07T09:05:12Z","git_url":"git://github.com/apache/incubator-skywalking.git","ssh_url":"git@github.com:apache/incubator-skywalking.git","clone_url":"https://github.com/apache/incubator-skywalking.git","svn_url":"https://github.com/apache/incubator-skywalking","homepage":"https://skywalking.incubator.apache.org/","size":141171,"stargazers_count":4761,"watchers_count":4761,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1475,"mirror_url":null,"archived":false,"open_issues_count":98,"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":1475,"open_issues":98,"watchers":4761,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-skywalking/pulls/1887"},"html":{"href":"https://github.com/apache/incubator-skywalking/pull/1887"},"issue":{"href":"https://api.github.com/repos/apache/incubator-skywalking/issues/1887"},"comments":{"href":"https://api.github.com/repos/apache/incubator-skywalking/issues/1887/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-skywalking/pulls/1887/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-skywalking/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-skywalking/pulls/1887/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-skywalking/statuses/c93d81bbe7fe5a5e5947e62a0e1bee347a5ac7de"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ascrutae"}}