{"action":"created","issue":{"url":"https://api.github.com/repos/Shopify/dd-agent/issues/2","labels_url":"https://api.github.com/repos/Shopify/dd-agent/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/Shopify/dd-agent/issues/2/comments","events_url":"https://api.github.com/repos/Shopify/dd-agent/issues/2/events","html_url":"https://github.com/Shopify/dd-agent/pull/2","id":84137002,"number":2,"title":"gather stats from zookeeper mntr command","user":{"login":"jpittis","id":5767836,"avatar_url":"https://avatars.githubusercontent.com/u/5767836?v=3","gravatar_id":"","url":"https://api.github.com/users/jpittis","html_url":"https://github.com/jpittis","followers_url":"https://api.github.com/users/jpittis/followers","following_url":"https://api.github.com/users/jpittis/following{/other_user}","gists_url":"https://api.github.com/users/jpittis/gists{/gist_id}","starred_url":"https://api.github.com/users/jpittis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpittis/subscriptions","organizations_url":"https://api.github.com/users/jpittis/orgs","repos_url":"https://api.github.com/users/jpittis/repos","events_url":"https://api.github.com/users/jpittis/events{/privacy}","received_events_url":"https://api.github.com/users/jpittis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-06-02T18:16:22Z","updated_at":"2015-06-03T14:07:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Shopify/dd-agent/pulls/2","html_url":"https://github.com/Shopify/dd-agent/pull/2","diff_url":"https://github.com/Shopify/dd-agent/pull/2.diff","patch_url":"https://github.com/Shopify/dd-agent/pull/2.patch"},"body":"Zookeeper has a tcp 4 letter command API that reports information worth logging.\r\nCurrently only the 'stat' command is being read. This adds 'mntr' command.\r\n\r\nI'm trying to follow similar style to the parsing of the 'stat' command. Currently, all the results are reported as gauges with a tag of the given state. (one of 'standalone', 'leader' or 'follower')\r\n\r\nI'm having trouble visualizing how this will be displayed in DataDog. I am also concerned with information conflicts between the 'stat' and 'mntr' command.\r\n\r\nTo test locally:\r\n1. Make sure you have zookeeper running locally on the default port.\r\n2. Setup the dd-agent repo as explained in the readme.\r\n3. Add the following code block to the bottom of the `checks.d/zk.py` file.\r\n```` python\r\nif __name__ == '__main__':\r\n    import json\r\n    check, instances = ZookeeperCheck.from_yaml('/home/vagrant/src/dd-agent/conf.d/zk.yaml.example')\r\n    for instance in instances:\r\n        check.check(instance)\r\n        if check.has_events():\r\n            print(json.dumps(check.get_events(), indent=2, separators=(',',': ')))\r\n        print(json.dumps(check.get_metrics(), indent=2, separators=(',',': ')))\r\n````\r\n4 . While inside the venv (with `. venv/bin/activate`) run the file.\r\n````\r\nPYTHONPATH=. python checks.d/zk.py\r\n````\r\n\r\n@Sirupsen @fw42 maybe have a quick glance at this?"},"comment":{"url":"https://api.github.com/repos/Shopify/dd-agent/issues/comments/108440676","html_url":"https://github.com/Shopify/dd-agent/pull/2#issuecomment-108440676","issue_url":"https://api.github.com/repos/Shopify/dd-agent/issues/2","id":108440676,"user":{"login":"jpittis","id":5767836,"avatar_url":"https://avatars.githubusercontent.com/u/5767836?v=3","gravatar_id":"","url":"https://api.github.com/users/jpittis","html_url":"https://github.com/jpittis","followers_url":"https://api.github.com/users/jpittis/followers","following_url":"https://api.github.com/users/jpittis/following{/other_user}","gists_url":"https://api.github.com/users/jpittis/gists{/gist_id}","starred_url":"https://api.github.com/users/jpittis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpittis/subscriptions","organizations_url":"https://api.github.com/users/jpittis/orgs","repos_url":"https://api.github.com/users/jpittis/repos","events_url":"https://api.github.com/users/jpittis/events{/privacy}","received_events_url":"https://api.github.com/users/jpittis/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T14:07:01Z","updated_at":"2015-06-03T14:07:01Z","body":"Looks like the `parse_stat` already in the code does not handle this form and will just [raise an exception](https://github.com/Shopify/dd-agent/blob/zookeeper-mntr/checks.d/zk.py#L154) in this case. I have a feeling it will require re-writing maybe? @Sirupsen @wvanbergen "}}