{"_id":"57fcc4870312b20e00ac64f0","project":"5435687035740020002a1c04","category":{"_id":"57fcc4860312b20e00ac64c7","__v":0,"version":"57fcc4860312b20e00ac64c0","project":"5435687035740020002a1c04","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-11-25T22:05:12.981Z","from_sync":false,"order":6,"slug":"agent-integration","title":"Data Agent"},"parentDoc":null,"__v":0,"user":"5435682035740020002a1c01","version":{"_id":"57fcc4860312b20e00ac64c0","project":"5435687035740020002a1c04","__v":1,"createdAt":"2016-10-11T10:52:54.637Z","releaseDate":"2016-10-11T10:52:54.637Z","categories":["57fcc4860312b20e00ac64c1","57fcc4860312b20e00ac64c2","57fcc4860312b20e00ac64c3","57fcc4860312b20e00ac64c4","57fcc4860312b20e00ac64c5","57fcc4860312b20e00ac64c6","57fcc4860312b20e00ac64c7","57fcc4860312b20e00ac64c8","57fcc4860312b20e00ac64c9","57fcc4860312b20e00ac64ca","57fcc4860312b20e00ac64cb"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"[APP-1265], [APP-1035]","version_clean":"5.2.0","version":"5.2"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-24T19:32:04.228Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":9,"body":"Take note of the following agent command line switches to help debug your custom executables and scripts:\n\n-  `--verbosity (debug | info | error)` controls the amount of information that the Agent outputs while running. In general, you will want to use `info` during development, `error` while in production, and `debug` when you need a little extra help figuring out why things aren't working the way you expect.\n- `--filter <expr>` limits the jobs you execute in either run once or scheduled mode by matching their IDs with the Perl regular expression provided in `<expr>`. This is useful primarily for debugging purposes when you want to constrain the activity of a large scheduled run to one or more misbehaving jobs.\n\nThe Telemetry Agent also supports a debugging mode that blocks data from being sent to the API. The output of each flow will be printed to the console when this mode is enabled. We recommend using this feature when developing your scripts as it will prevent any data from unintentionally being sent to Telemetry.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Setting the debugging flag\"\n}\n[/block]\nThe Agent will output the following under normal run configurations:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"➜  test_scripts  ./gotelemetry_agent run --config config.toml\\n\\nTelemetry Agent v 2.3.0\\nCopyright © 2012-2016 Telemetry, Inc.\\n\\nFor license information, see the LICENSE file\\n---------------------------------------------\\n\\n2016/01/19 14:02:11 Info : Submission interval set to 1s\\n2016/01/19 14:02:11 Info : test_output -> Process plugin completed in 4.495315ms.\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nWe simply add the `--debug` flag to enable debug mode:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"➜  test_scripts  ./gotelemetry_agent run --config config.toml --debug\\n\\nTelemetry Agent v 2.3.0\\nCopyright © 2012-2016 Telemetry, Inc.\\n\\nFor license information, see the LICENSE file\\n---------------------------------------------\\n\\n2016/01/19 14:02:16 Info : Submission interval set to 1s\\n\\nPrinting the output results of \\\"test_output\\\":\\n{\\n  \\\"number\\\": {\\n    \\\"value\\\": 22\\n  }\\n}\\n2016/01/19 14:02:16 Info : test_output -> Process plugin completed in 872.595µs.\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nNotice that the process completes significantly faster when in debug mode. This is the result of time being saved by blocking calls to the Telemetry API.","excerpt":"","slug":"debugging","type":"basic","title":"Debugging"}
Take note of the following agent command line switches to help debug your custom executables and scripts: - `--verbosity (debug | info | error)` controls the amount of information that the Agent outputs while running. In general, you will want to use `info` during development, `error` while in production, and `debug` when you need a little extra help figuring out why things aren't working the way you expect. - `--filter <expr>` limits the jobs you execute in either run once or scheduled mode by matching their IDs with the Perl regular expression provided in `<expr>`. This is useful primarily for debugging purposes when you want to constrain the activity of a large scheduled run to one or more misbehaving jobs. The Telemetry Agent also supports a debugging mode that blocks data from being sent to the API. The output of each flow will be printed to the console when this mode is enabled. We recommend using this feature when developing your scripts as it will prevent any data from unintentionally being sent to Telemetry. [block:api-header] { "type": "basic", "title": "Setting the debugging flag" } [/block] The Agent will output the following under normal run configurations: [block:code] { "codes": [ { "code": "➜ test_scripts ./gotelemetry_agent run --config config.toml\n\nTelemetry Agent v 2.3.0\nCopyright © 2012-2016 Telemetry, Inc.\n\nFor license information, see the LICENSE file\n---------------------------------------------\n\n2016/01/19 14:02:11 Info : Submission interval set to 1s\n2016/01/19 14:02:11 Info : test_output -> Process plugin completed in 4.495315ms.", "language": "text" } ] } [/block] We simply add the `--debug` flag to enable debug mode: [block:code] { "codes": [ { "code": "➜ test_scripts ./gotelemetry_agent run --config config.toml --debug\n\nTelemetry Agent v 2.3.0\nCopyright © 2012-2016 Telemetry, Inc.\n\nFor license information, see the LICENSE file\n---------------------------------------------\n\n2016/01/19 14:02:16 Info : Submission interval set to 1s\n\nPrinting the output results of \"test_output\":\n{\n \"number\": {\n \"value\": 22\n }\n}\n2016/01/19 14:02:16 Info : test_output -> Process plugin completed in 872.595µs.", "language": "text" } ] } [/block] Notice that the process completes significantly faster when in debug mode. This is the result of time being saved by blocking calls to the Telemetry API.