{"action":"closed","number":113,"pull_request":{"url":"https://api.github.com/repos/influxdb/kapacitor/pulls/113","id":54417872,"html_url":"https://github.com/influxdb/kapacitor/pull/113","diff_url":"https://github.com/influxdb/kapacitor/pull/113.diff","patch_url":"https://github.com/influxdb/kapacitor/pull/113.patch","issue_url":"https://api.github.com/repos/influxdb/kapacitor/issues/113","number":113,"state":"closed","locked":false,"title":"added OpsGenie service for alerting","user":{"login":"ericiles","id":875672,"avatar_url":"https://avatars.githubusercontent.com/u/875672?v=3","gravatar_id":"","url":"https://api.github.com/users/ericiles","html_url":"https://github.com/ericiles","followers_url":"https://api.github.com/users/ericiles/followers","following_url":"https://api.github.com/users/ericiles/following{/other_user}","gists_url":"https://api.github.com/users/ericiles/gists{/gist_id}","starred_url":"https://api.github.com/users/ericiles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericiles/subscriptions","organizations_url":"https://api.github.com/users/ericiles/orgs","repos_url":"https://api.github.com/users/ericiles/repos","events_url":"https://api.github.com/users/ericiles/events{/privacy}","received_events_url":"https://api.github.com/users/ericiles/received_events","type":"User","site_admin":false},"body":"Implements #71 \r\n\r\nI am running this code in our production environment, and have been getting OpsGenie alerts since 12/18/2015.\r\n\r\nUsage:\r\n```\r\nstream\r\n\t.from().measurement('cpu')\r\n\t.where(lambda: \"host\" == 'serverA')\r\n\t.groupBy('host')\r\n\t.window()\r\n\t\t.period(10s)\r\n\t\t.every(10s)\r\n\t.mapReduce(influxql.count('idle'))\r\n\t.alert()\r\n\t\t.id('kapacitor/{{ .Name }}/{{ index .Tags \"host\" }}')\r\n\t\t.info(lambda: \"count\" > 6.0)\r\n\t\t.warn(lambda: \"count\" > 7.0)\r\n\t\t.crit(lambda: \"count\" > 8.0)\r\n\t\t.opsGenie()\r\n\t\t.ogTeams('test_team,another_team')\r\n\t\t.ogRecipients('test_recipient,another_recipient')\r\n```\r\n\r\nConfiguration:\r\n```\r\n[opsgenie]\r\n    # Configure OpsGenie with your API key and default routing key.\r\n    enabled = false\r\n    # Your OpsGenie API Key.\r\n    api-key = \"\"\r\n    # Default OpsGenie teams, can be overridden per alert.\r\n    teams = \"\"\r\n    # Default OpsGenie recipients, can be overridden per alert.\r\n    recipients = \"\"\r\n    # The OpsGenie API URL should not need to be changed.\r\n    url = \"https://api.opsgenie.com/v1/json/alert\"\r\n    # The OpsGenie Recovery URL, you can change this\r\n    # based on which behavior you want a recovery to\r\n    # trigger (Add Notes, Close Alert, etc.)\r\n    recovery_url = \"https://api.opsgenie.com/v1/json/alert/note\"\r\n    # If true the all alerts will be sent to OpsGenie\r\n    # without explicity marking them in the TICKscript.\r\n    # The routing key can still be overridden.\r\n    global = false\r\n```\r\n\r\nThis is my first run at working with Go, so some changes may be necessary. This is mainly a copy of the VictorOps service, modified to work properly with OpsGenie.\r\n\r\n- [ ] CHANGELOG.md updated\r\n- [x] Rebased/mergable\r\n- [X] Tests pass\r\n- [X] Sign [CLA](http://influxdb.com/community/cla.html) (if not already signed)","created_at":"2015-12-22T21:38:23Z","updated_at":"2015-12-23T18:17:05Z","closed_at":"2015-12-23T18:17:05Z","merged_at":"2015-12-23T18:17:05Z","merge_commit_sha":"979008a9bef1e1102d6f37b7e31cac5125861c36","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/influxdb/kapacitor/pulls/113/commits","review_comments_url":"https://api.github.com/repos/influxdb/kapacitor/pulls/113/comments","review_comment_url":"https://api.github.com/repos/influxdb/kapacitor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influxdb/kapacitor/issues/113/comments","statuses_url":"https://api.github.com/repos/influxdb/kapacitor/statuses/071f35ae95a473e9d70b7854f09260fae6f8d4e7","head":{"label":"ericiles:opsgenie","ref":"opsgenie","sha":"071f35ae95a473e9d70b7854f09260fae6f8d4e7","user":{"login":"ericiles","id":875672,"avatar_url":"https://avatars.githubusercontent.com/u/875672?v=3","gravatar_id":"","url":"https://api.github.com/users/ericiles","html_url":"https://github.com/ericiles","followers_url":"https://api.github.com/users/ericiles/followers","following_url":"https://api.github.com/users/ericiles/following{/other_user}","gists_url":"https://api.github.com/users/ericiles/gists{/gist_id}","starred_url":"https://api.github.com/users/ericiles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericiles/subscriptions","organizations_url":"https://api.github.com/users/ericiles/orgs","repos_url":"https://api.github.com/users/ericiles/repos","events_url":"https://api.github.com/users/ericiles/events{/privacy}","received_events_url":"https://api.github.com/users/ericiles/received_events","type":"User","site_admin":false},"repo":{"id":48453487,"name":"kapacitor","full_name":"ericiles/kapacitor","owner":{"login":"ericiles","id":875672,"avatar_url":"https://avatars.githubusercontent.com/u/875672?v=3","gravatar_id":"","url":"https://api.github.com/users/ericiles","html_url":"https://github.com/ericiles","followers_url":"https://api.github.com/users/ericiles/followers","following_url":"https://api.github.com/users/ericiles/following{/other_user}","gists_url":"https://api.github.com/users/ericiles/gists{/gist_id}","starred_url":"https://api.github.com/users/ericiles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericiles/subscriptions","organizations_url":"https://api.github.com/users/ericiles/orgs","repos_url":"https://api.github.com/users/ericiles/repos","events_url":"https://api.github.com/users/ericiles/events{/privacy}","received_events_url":"https://api.github.com/users/ericiles/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ericiles/kapacitor","description":"Open source framework for processing, monitoring, and alerting on time series data","fork":true,"url":"https://api.github.com/repos/ericiles/kapacitor","forks_url":"https://api.github.com/repos/ericiles/kapacitor/forks","keys_url":"https://api.github.com/repos/ericiles/kapacitor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ericiles/kapacitor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ericiles/kapacitor/teams","hooks_url":"https://api.github.com/repos/ericiles/kapacitor/hooks","issue_events_url":"https://api.github.com/repos/ericiles/kapacitor/issues/events{/number}","events_url":"https://api.github.com/repos/ericiles/kapacitor/events","assignees_url":"https://api.github.com/repos/ericiles/kapacitor/assignees{/user}","branches_url":"https://api.github.com/repos/ericiles/kapacitor/branches{/branch}","tags_url":"https://api.github.com/repos/ericiles/kapacitor/tags","blobs_url":"https://api.github.com/repos/ericiles/kapacitor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ericiles/kapacitor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ericiles/kapacitor/git/refs{/sha}","trees_url":"https://api.github.com/repos/ericiles/kapacitor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ericiles/kapacitor/statuses/{sha}","languages_url":"https://api.github.com/repos/ericiles/kapacitor/languages","stargazers_url":"https://api.github.com/repos/ericiles/kapacitor/stargazers","contributors_url":"https://api.github.com/repos/ericiles/kapacitor/contributors","subscribers_url":"https://api.github.com/repos/ericiles/kapacitor/subscribers","subscription_url":"https://api.github.com/repos/ericiles/kapacitor/subscription","commits_url":"https://api.github.com/repos/ericiles/kapacitor/commits{/sha}","git_commits_url":"https://api.github.com/repos/ericiles/kapacitor/git/commits{/sha}","comments_url":"https://api.github.com/repos/ericiles/kapacitor/comments{/number}","issue_comment_url":"https://api.github.com/repos/ericiles/kapacitor/issues/comments{/number}","contents_url":"https://api.github.com/repos/ericiles/kapacitor/contents/{+path}","compare_url":"https://api.github.com/repos/ericiles/kapacitor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ericiles/kapacitor/merges","archive_url":"https://api.github.com/repos/ericiles/kapacitor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ericiles/kapacitor/downloads","issues_url":"https://api.github.com/repos/ericiles/kapacitor/issues{/number}","pulls_url":"https://api.github.com/repos/ericiles/kapacitor/pulls{/number}","milestones_url":"https://api.github.com/repos/ericiles/kapacitor/milestones{/number}","notifications_url":"https://api.github.com/repos/ericiles/kapacitor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ericiles/kapacitor/labels{/name}","releases_url":"https://api.github.com/repos/ericiles/kapacitor/releases{/id}","created_at":"2015-12-22T20:54:00Z","updated_at":"2015-12-22T20:54:01Z","pushed_at":"2015-12-23T17:58:26Z","git_url":"git://github.com/ericiles/kapacitor.git","ssh_url":"git@github.com:ericiles/kapacitor.git","clone_url":"https://github.com/ericiles/kapacitor.git","svn_url":"https://github.com/ericiles/kapacitor","homepage":null,"size":1840,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"influxdb:master","ref":"master","sha":"0f5c2cc16abde1c8979589d64332429c4870b221","user":{"login":"influxdb","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdb","html_url":"https://github.com/influxdb","followers_url":"https://api.github.com/users/influxdb/followers","following_url":"https://api.github.com/users/influxdb/following{/other_user}","gists_url":"https://api.github.com/users/influxdb/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdb/subscriptions","organizations_url":"https://api.github.com/users/influxdb/orgs","repos_url":"https://api.github.com/users/influxdb/repos","events_url":"https://api.github.com/users/influxdb/events{/privacy}","received_events_url":"https://api.github.com/users/influxdb/received_events","type":"Organization","site_admin":false},"repo":{"id":41681600,"name":"kapacitor","full_name":"influxdb/kapacitor","owner":{"login":"influxdb","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdb","html_url":"https://github.com/influxdb","followers_url":"https://api.github.com/users/influxdb/followers","following_url":"https://api.github.com/users/influxdb/following{/other_user}","gists_url":"https://api.github.com/users/influxdb/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdb/subscriptions","organizations_url":"https://api.github.com/users/influxdb/orgs","repos_url":"https://api.github.com/users/influxdb/repos","events_url":"https://api.github.com/users/influxdb/events{/privacy}","received_events_url":"https://api.github.com/users/influxdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdb/kapacitor","description":"Open source framework for processing, monitoring, and alerting on time series data","fork":false,"url":"https://api.github.com/repos/influxdb/kapacitor","forks_url":"https://api.github.com/repos/influxdb/kapacitor/forks","keys_url":"https://api.github.com/repos/influxdb/kapacitor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdb/kapacitor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdb/kapacitor/teams","hooks_url":"https://api.github.com/repos/influxdb/kapacitor/hooks","issue_events_url":"https://api.github.com/repos/influxdb/kapacitor/issues/events{/number}","events_url":"https://api.github.com/repos/influxdb/kapacitor/events","assignees_url":"https://api.github.com/repos/influxdb/kapacitor/assignees{/user}","branches_url":"https://api.github.com/repos/influxdb/kapacitor/branches{/branch}","tags_url":"https://api.github.com/repos/influxdb/kapacitor/tags","blobs_url":"https://api.github.com/repos/influxdb/kapacitor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdb/kapacitor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdb/kapacitor/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdb/kapacitor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdb/kapacitor/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdb/kapacitor/languages","stargazers_url":"https://api.github.com/repos/influxdb/kapacitor/stargazers","contributors_url":"https://api.github.com/repos/influxdb/kapacitor/contributors","subscribers_url":"https://api.github.com/repos/influxdb/kapacitor/subscribers","subscription_url":"https://api.github.com/repos/influxdb/kapacitor/subscription","commits_url":"https://api.github.com/repos/influxdb/kapacitor/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdb/kapacitor/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdb/kapacitor/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdb/kapacitor/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdb/kapacitor/contents/{+path}","compare_url":"https://api.github.com/repos/influxdb/kapacitor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdb/kapacitor/merges","archive_url":"https://api.github.com/repos/influxdb/kapacitor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdb/kapacitor/downloads","issues_url":"https://api.github.com/repos/influxdb/kapacitor/issues{/number}","pulls_url":"https://api.github.com/repos/influxdb/kapacitor/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdb/kapacitor/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdb/kapacitor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdb/kapacitor/labels{/name}","releases_url":"https://api.github.com/repos/influxdb/kapacitor/releases{/id}","created_at":"2015-08-31T14:54:42Z","updated_at":"2015-12-22T22:53:43Z","pushed_at":"2015-12-23T18:17:05Z","git_url":"git://github.com/influxdb/kapacitor.git","ssh_url":"git@github.com:influxdb/kapacitor.git","clone_url":"https://github.com/influxdb/kapacitor.git","svn_url":"https://github.com/influxdb/kapacitor","homepage":null,"size":1871,"stargazers_count":263,"watchers_count":263,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":23,"forks":10,"open_issues":23,"watchers":263,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/influxdb/kapacitor/pulls/113"},"html":{"href":"https://github.com/influxdb/kapacitor/pull/113"},"issue":{"href":"https://api.github.com/repos/influxdb/kapacitor/issues/113"},"comments":{"href":"https://api.github.com/repos/influxdb/kapacitor/issues/113/comments"},"review_comments":{"href":"https://api.github.com/repos/influxdb/kapacitor/pulls/113/comments"},"review_comment":{"href":"https://api.github.com/repos/influxdb/kapacitor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influxdb/kapacitor/pulls/113/commits"},"statuses":{"href":"https://api.github.com/repos/influxdb/kapacitor/statuses/071f35ae95a473e9d70b7854f09260fae6f8d4e7"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"nathanielc","id":3771906,"avatar_url":"https://avatars.githubusercontent.com/u/3771906?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanielc","html_url":"https://github.com/nathanielc","followers_url":"https://api.github.com/users/nathanielc/followers","following_url":"https://api.github.com/users/nathanielc/following{/other_user}","gists_url":"https://api.github.com/users/nathanielc/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanielc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanielc/subscriptions","organizations_url":"https://api.github.com/users/nathanielc/orgs","repos_url":"https://api.github.com/users/nathanielc/repos","events_url":"https://api.github.com/users/nathanielc/events{/privacy}","received_events_url":"https://api.github.com/users/nathanielc/received_events","type":"User","site_admin":false},"comments":7,"review_comments":8,"commits":1,"additions":387,"deletions":1,"changed_files":9}}