{"action":"created","issue":{"url":"https://api.github.com/repos/zorkian/go-datadog-api/issues/49","repository_url":"https://api.github.com/repos/zorkian/go-datadog-api","labels_url":"https://api.github.com/repos/zorkian/go-datadog-api/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/zorkian/go-datadog-api/issues/49/comments","events_url":"https://api.github.com/repos/zorkian/go-datadog-api/issues/49/events","html_url":"https://github.com/zorkian/go-datadog-api/issues/49","id":158267982,"number":49,"title":"Failed to unmarshal json because 'no_data_timeframe' sometimes returns false","user":{"login":"takus","id":290039,"avatar_url":"https://avatars.githubusercontent.com/u/290039?v=3","gravatar_id":"","url":"https://api.github.com/users/takus","html_url":"https://github.com/takus","followers_url":"https://api.github.com/users/takus/followers","following_url":"https://api.github.com/users/takus/following{/other_user}","gists_url":"https://api.github.com/users/takus/gists{/gist_id}","starred_url":"https://api.github.com/users/takus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takus/subscriptions","organizations_url":"https://api.github.com/users/takus/orgs","repos_url":"https://api.github.com/users/takus/repos","events_url":"https://api.github.com/users/takus/events{/privacy}","received_events_url":"https://api.github.com/users/takus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-03T00:25:46Z","updated_at":"2016-06-12T04:06:36Z","closed_at":null,"body":"Hi,\r\n\r\nI hit the error `json: cannot unmarshal bool into Go value of type int.` when I called GetMonitors(). It seems that the value of `options.NoDataTimeframe` becomes `false`.\r\n\r\nAccording to the official document, `no_data_timeframe` supposed to be `int`.\r\n\r\n> no_data_timeframe the number of minutes before a monitor will notify when data stops reporting. Must be at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks.\r\n\r\nBut, it becomes sometimes `bool`. For example, `GET ALL MONITOR DETAILS` of Shell section in http://docs.datadoghq.com/api/ describes it like this:\r\n\r\n```\r\n    {\r\n        \"id\": 91875,\r\n        \"message\": \"\",\r\n        \"name\": \"**system.net.bytes_rcvd** over **host:host0** was **> 100** on average during the **last 1h**.\",\r\n        \"options\": {\r\n            \"escalation_message\": \"\",\r\n            \"no_data_timeframe\": false,\r\n            \"notify_audit\": true,\r\n            \"notify_no_data\": false,\r\n            \"renotify_interval\": null,\r\n            \"silenced\": {},\r\n            \"timeout_h\": null\r\n        },\r\n        \"org_id\": 1499,\r\n        \"query\": \"avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100\",\r\n        \"type\": \"metric alert\",\r\n        \"multi\": false,\r\n        \"created\": \"2015-12-18T16:34:14.014039+00:00\",\r\n        \"modified\": \"2015-12-18T16:34:14.014039+00:00\"\r\n    }\r\n```\r\n\r\nI'm asking Datadog supports whether this is expected or not. If this is not a bug, I'll make a pull request to manage this issue."},"comment":{"url":"https://api.github.com/repos/zorkian/go-datadog-api/issues/comments/225408986","html_url":"https://github.com/zorkian/go-datadog-api/issues/49#issuecomment-225408986","issue_url":"https://api.github.com/repos/zorkian/go-datadog-api/issues/49","id":225408986,"user":{"login":"zorkian","id":361428,"avatar_url":"https://avatars.githubusercontent.com/u/361428?v=3","gravatar_id":"","url":"https://api.github.com/users/zorkian","html_url":"https://github.com/zorkian","followers_url":"https://api.github.com/users/zorkian/followers","following_url":"https://api.github.com/users/zorkian/following{/other_user}","gists_url":"https://api.github.com/users/zorkian/gists{/gist_id}","starred_url":"https://api.github.com/users/zorkian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zorkian/subscriptions","organizations_url":"https://api.github.com/users/zorkian/orgs","repos_url":"https://api.github.com/users/zorkian/repos","events_url":"https://api.github.com/users/zorkian/events{/privacy}","received_events_url":"https://api.github.com/users/zorkian/received_events","type":"User","site_admin":false},"created_at":"2016-06-12T04:06:36Z","updated_at":"2016-06-12T04:06:36Z","body":"Thanks for the report! Did you get any answer on the issue yet?\n \n--\nMark Smith\nmark@qq.is\n \n \nOn Thu, Jun 2, 2016, at 05:25 PM, Takumi Sakamoto wrote:\n> Hi,\n> I hit the error json: cannot unmarshal bool into Go value of type int.\n> when I called GetMonitors(). It seems that the value of\n> options.NoDataTimeframe becomes 'false'.\n> According to the official document, no_data_timeframe should be int.\n>> no_data_timeframe the number of minutes before a monitor will notify\n>> when data stops reporting. Must be at least 2x the monitor timeframe\n>> for metric alerts or 2 minutes for service checks.\n> But, it becomes sometimes false. For example, GET ALL MONITOR\n> DETAILS of Shell section in http://docs.datadoghq.com/api/ describes\n> it like this:\n\n\n>     { \"id\": 91875, \"message\": \"\", \"name\": \"**system.net.bytes_rcvd**\n>     over **host:host0** was **> 100** on average during the **last\n>     1h**.\", \"options\": { \"escalation_message\": \"\",\n>     \"no_data_timeframe\": false, \"notify_audit\": true,\n>     \"notify_no_data\": false, \"renotify_interval\": null, \"silenced\":\n>     {}, \"timeout_h\": null }, \"org_id\": 1499, \"query\":\n>     \"avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100\",\n>     \"type\": \"metric alert\", \"multi\": false, \"created\": \"2015-12-\n>     18T16:34:14.014039+00:00\", \"modified\": \"2015-12-\n>     18T16:34:14.014039+00:00\" }\n>\n> I'm asking Datadog supports whether this is expected or not. If this\n> is not a bug, I'll make a pull request to manage this issue.\n> — You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub[1], or mute the\n> thread[2].\n>\n\nLinks:\n\n  1. https://github.com/zorkian/go-datadog-api/issues/49\n  2. https://github.com/notifications/unsubscribe/AAWD1IYDYlgFehKhpWKFMaPYxClfLcZ-ks5qH3SKgaJpZM4ItGmh\n"}}
{"actor":{"display_login":"zorkian"}}