{"action":"created","comment":{"url":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls/comments/142907486","pull_request_review_id":67337916,"id":142907486,"diff_hunk":"@@ -0,0 +1,35 @@\n+# Alerts example\n+\n+## Max Connections\n+\n+* Warning when Postgresql reach 70% of max connections \n+* Critical when Postgresql reach 90% of max connections\n+* Also trigger when `pg_runtime_variable_max_connections` is empty (it happens when prometheus cannot scrap exporter).\n+\n+```\n+ALERT PostgresqlTooManyConnections\n+  IF sum(pg_stat_activity_count) >  sum(pg_runtime_variable_max_connections * 0.7 )\n+  OR absent(pg_runtime_variable_max_connections)\n+  FOR 5m\n+  LABELS {\n+    service = \"postgresql\",\n+    severity = \"warning\",\n+  }\n+  ANNOTATIONS {\n+    summary = \"Postgresql max client connections\",\n+    description = \"Postgresql reached 70% of the max client connections.\",\n+  }\n+  \n+ALERT PostgresqlTooManyConnections\n+  IF sum(pg_stat_activity_count) >  sum(pg_runtime_variable_max_connections * 0.9 )\n+  OR absent(pg_runtime_variable_max_connections)","path":"examples/ALERTS.md","position":25,"original_position":25,"commit_id":"b8af8effd693856bf313b1dbad91bb2b3f4d986d","original_commit_id":"becf4866fbafb8ddba818c433f8e215a1022abd7","user":{"login":"lhoss","id":3091244,"avatar_url":"https://avatars0.githubusercontent.com/u/3091244?v=4","gravatar_id":"","url":"https://api.github.com/users/lhoss","html_url":"https://github.com/lhoss","followers_url":"https://api.github.com/users/lhoss/followers","following_url":"https://api.github.com/users/lhoss/following{/other_user}","gists_url":"https://api.github.com/users/lhoss/gists{/gist_id}","starred_url":"https://api.github.com/users/lhoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lhoss/subscriptions","organizations_url":"https://api.github.com/users/lhoss/orgs","repos_url":"https://api.github.com/users/lhoss/repos","events_url":"https://api.github.com/users/lhoss/events{/privacy}","received_events_url":"https://api.github.com/users/lhoss/received_events","type":"User","site_admin":false},"body":"isn't this `pg_settings_max_connections` ?\r\n(at least I don't get see any `pg_runtime_variable_max_connections`metric)","created_at":"2017-10-05T11:00:09Z","updated_at":"2017-10-05T11:00:10Z","html_url":"https://github.com/wrouesnel/postgres_exporter/pull/74#discussion_r142907486","pull_request_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls/74","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls/comments/142907486"},"html":{"href":"https://github.com/wrouesnel/postgres_exporter/pull/74#discussion_r142907486"},"pull_request":{"href":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls/74"}},"in_reply_to_id":129562589},"pull_request":{"url":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls/74","id":120764845,"html_url":"https://github.com/wrouesnel/postgres_exporter/pull/74","diff_url":"https://github.com/wrouesnel/postgres_exporter/pull/74.diff","patch_url":"https://github.com/wrouesnel/postgres_exporter/pull/74.patch","issue_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/issues/74","number":74,"state":"open","locked":false,"title":"alert example","user":{"login":"gianrubio","id":5694860,"avatar_url":"https://avatars1.githubusercontent.com/u/5694860?v=4","gravatar_id":"","url":"https://api.github.com/users/gianrubio","html_url":"https://github.com/gianrubio","followers_url":"https://api.github.com/users/gianrubio/followers","following_url":"https://api.github.com/users/gianrubio/following{/other_user}","gists_url":"https://api.github.com/users/gianrubio/gists{/gist_id}","starred_url":"https://api.github.com/users/gianrubio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gianrubio/subscriptions","organizations_url":"https://api.github.com/users/gianrubio/orgs","repos_url":"https://api.github.com/users/gianrubio/repos","events_url":"https://api.github.com/users/gianrubio/events{/privacy}","received_events_url":"https://api.github.com/users/gianrubio/received_events","type":"User","site_admin":false},"body":"Prometheus alerts for max connections #68","created_at":"2017-05-16T07:53:51Z","updated_at":"2017-10-05T11:00:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ff1208eff5cdfcbb9bbf6b0070402d11c9e16d0","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls/74/commits","review_comments_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls/74/comments","review_comment_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/issues/74/comments","statuses_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/statuses/b8af8effd693856bf313b1dbad91bb2b3f4d986d","head":{"label":"gianrubio:alerts-example","ref":"alerts-example","sha":"b8af8effd693856bf313b1dbad91bb2b3f4d986d","user":{"login":"gianrubio","id":5694860,"avatar_url":"https://avatars1.githubusercontent.com/u/5694860?v=4","gravatar_id":"","url":"https://api.github.com/users/gianrubio","html_url":"https://github.com/gianrubio","followers_url":"https://api.github.com/users/gianrubio/followers","following_url":"https://api.github.com/users/gianrubio/following{/other_user}","gists_url":"https://api.github.com/users/gianrubio/gists{/gist_id}","starred_url":"https://api.github.com/users/gianrubio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gianrubio/subscriptions","organizations_url":"https://api.github.com/users/gianrubio/orgs","repos_url":"https://api.github.com/users/gianrubio/repos","events_url":"https://api.github.com/users/gianrubio/events{/privacy}","received_events_url":"https://api.github.com/users/gianrubio/received_events","type":"User","site_admin":false},"repo":{"id":91430281,"name":"postgres_exporter","full_name":"gianrubio/postgres_exporter","owner":{"login":"gianrubio","id":5694860,"avatar_url":"https://avatars1.githubusercontent.com/u/5694860?v=4","gravatar_id":"","url":"https://api.github.com/users/gianrubio","html_url":"https://github.com/gianrubio","followers_url":"https://api.github.com/users/gianrubio/followers","following_url":"https://api.github.com/users/gianrubio/following{/other_user}","gists_url":"https://api.github.com/users/gianrubio/gists{/gist_id}","starred_url":"https://api.github.com/users/gianrubio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gianrubio/subscriptions","organizations_url":"https://api.github.com/users/gianrubio/orgs","repos_url":"https://api.github.com/users/gianrubio/repos","events_url":"https://api.github.com/users/gianrubio/events{/privacy}","received_events_url":"https://api.github.com/users/gianrubio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gianrubio/postgres_exporter","description":"A PostgresSQL metric exporter for Prometheus","fork":true,"url":"https://api.github.com/repos/gianrubio/postgres_exporter","forks_url":"https://api.github.com/repos/gianrubio/postgres_exporter/forks","keys_url":"https://api.github.com/repos/gianrubio/postgres_exporter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gianrubio/postgres_exporter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gianrubio/postgres_exporter/teams","hooks_url":"https://api.github.com/repos/gianrubio/postgres_exporter/hooks","issue_events_url":"https://api.github.com/repos/gianrubio/postgres_exporter/issues/events{/number}","events_url":"https://api.github.com/repos/gianrubio/postgres_exporter/events","assignees_url":"https://api.github.com/repos/gianrubio/postgres_exporter/assignees{/user}","branches_url":"https://api.github.com/repos/gianrubio/postgres_exporter/branches{/branch}","tags_url":"https://api.github.com/repos/gianrubio/postgres_exporter/tags","blobs_url":"https://api.github.com/repos/gianrubio/postgres_exporter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gianrubio/postgres_exporter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gianrubio/postgres_exporter/git/refs{/sha}","trees_url":"https://api.github.com/repos/gianrubio/postgres_exporter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gianrubio/postgres_exporter/statuses/{sha}","languages_url":"https://api.github.com/repos/gianrubio/postgres_exporter/languages","stargazers_url":"https://api.github.com/repos/gianrubio/postgres_exporter/stargazers","contributors_url":"https://api.github.com/repos/gianrubio/postgres_exporter/contributors","subscribers_url":"https://api.github.com/repos/gianrubio/postgres_exporter/subscribers","subscription_url":"https://api.github.com/repos/gianrubio/postgres_exporter/subscription","commits_url":"https://api.github.com/repos/gianrubio/postgres_exporter/commits{/sha}","git_commits_url":"https://api.github.com/repos/gianrubio/postgres_exporter/git/commits{/sha}","comments_url":"https://api.github.com/repos/gianrubio/postgres_exporter/comments{/number}","issue_comment_url":"https://api.github.com/repos/gianrubio/postgres_exporter/issues/comments{/number}","contents_url":"https://api.github.com/repos/gianrubio/postgres_exporter/contents/{+path}","compare_url":"https://api.github.com/repos/gianrubio/postgres_exporter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gianrubio/postgres_exporter/merges","archive_url":"https://api.github.com/repos/gianrubio/postgres_exporter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gianrubio/postgres_exporter/downloads","issues_url":"https://api.github.com/repos/gianrubio/postgres_exporter/issues{/number}","pulls_url":"https://api.github.com/repos/gianrubio/postgres_exporter/pulls{/number}","milestones_url":"https://api.github.com/repos/gianrubio/postgres_exporter/milestones{/number}","notifications_url":"https://api.github.com/repos/gianrubio/postgres_exporter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gianrubio/postgres_exporter/labels{/name}","releases_url":"https://api.github.com/repos/gianrubio/postgres_exporter/releases{/id}","deployments_url":"https://api.github.com/repos/gianrubio/postgres_exporter/deployments","created_at":"2017-05-16T07:44:13Z","updated_at":"2017-05-16T07:44:14Z","pushed_at":"2017-07-26T12:53:40Z","git_url":"git://github.com/gianrubio/postgres_exporter.git","ssh_url":"git@github.com:gianrubio/postgres_exporter.git","clone_url":"https://github.com/gianrubio/postgres_exporter.git","svn_url":"https://github.com/gianrubio/postgres_exporter","homepage":null,"size":5543,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"wrouesnel:master","ref":"master","sha":"1afbd62ab194c045a88488d77de2f116400dedb7","user":{"login":"wrouesnel","id":772445,"avatar_url":"https://avatars3.githubusercontent.com/u/772445?v=4","gravatar_id":"","url":"https://api.github.com/users/wrouesnel","html_url":"https://github.com/wrouesnel","followers_url":"https://api.github.com/users/wrouesnel/followers","following_url":"https://api.github.com/users/wrouesnel/following{/other_user}","gists_url":"https://api.github.com/users/wrouesnel/gists{/gist_id}","starred_url":"https://api.github.com/users/wrouesnel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wrouesnel/subscriptions","organizations_url":"https://api.github.com/users/wrouesnel/orgs","repos_url":"https://api.github.com/users/wrouesnel/repos","events_url":"https://api.github.com/users/wrouesnel/events{/privacy}","received_events_url":"https://api.github.com/users/wrouesnel/received_events","type":"User","site_admin":false},"repo":{"id":41317079,"name":"postgres_exporter","full_name":"wrouesnel/postgres_exporter","owner":{"login":"wrouesnel","id":772445,"avatar_url":"https://avatars3.githubusercontent.com/u/772445?v=4","gravatar_id":"","url":"https://api.github.com/users/wrouesnel","html_url":"https://github.com/wrouesnel","followers_url":"https://api.github.com/users/wrouesnel/followers","following_url":"https://api.github.com/users/wrouesnel/following{/other_user}","gists_url":"https://api.github.com/users/wrouesnel/gists{/gist_id}","starred_url":"https://api.github.com/users/wrouesnel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wrouesnel/subscriptions","organizations_url":"https://api.github.com/users/wrouesnel/orgs","repos_url":"https://api.github.com/users/wrouesnel/repos","events_url":"https://api.github.com/users/wrouesnel/events{/privacy}","received_events_url":"https://api.github.com/users/wrouesnel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wrouesnel/postgres_exporter","description":"A PostgresSQL metric exporter for Prometheus","fork":false,"url":"https://api.github.com/repos/wrouesnel/postgres_exporter","forks_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/forks","keys_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/teams","hooks_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/hooks","issue_events_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/issues/events{/number}","events_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/events","assignees_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/assignees{/user}","branches_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/branches{/branch}","tags_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/tags","blobs_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/git/refs{/sha}","trees_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/statuses/{sha}","languages_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/languages","stargazers_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/stargazers","contributors_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/contributors","subscribers_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/subscribers","subscription_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/subscription","commits_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/commits{/sha}","git_commits_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/git/commits{/sha}","comments_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/comments{/number}","issue_comment_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/issues/comments{/number}","contents_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/contents/{+path}","compare_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/merges","archive_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/downloads","issues_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/issues{/number}","pulls_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls{/number}","milestones_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/milestones{/number}","notifications_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/labels{/name}","releases_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/releases{/id}","deployments_url":"https://api.github.com/repos/wrouesnel/postgres_exporter/deployments","created_at":"2015-08-24T17:26:27Z","updated_at":"2017-10-04T22:45:21Z","pushed_at":"2017-10-02T08:01:25Z","git_url":"git://github.com/wrouesnel/postgres_exporter.git","ssh_url":"git@github.com:wrouesnel/postgres_exporter.git","clone_url":"https://github.com/wrouesnel/postgres_exporter.git","svn_url":"https://github.com/wrouesnel/postgres_exporter","homepage":null,"size":5567,"stargazers_count":170,"watchers_count":170,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":89,"mirror_url":null,"open_issues_count":22,"forks":89,"open_issues":22,"watchers":170,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls/74"},"html":{"href":"https://github.com/wrouesnel/postgres_exporter/pull/74"},"issue":{"href":"https://api.github.com/repos/wrouesnel/postgres_exporter/issues/74"},"comments":{"href":"https://api.github.com/repos/wrouesnel/postgres_exporter/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wrouesnel/postgres_exporter/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/wrouesnel/postgres_exporter/statuses/b8af8effd693856bf313b1dbad91bb2b3f4d986d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lhoss"}}