payload: {"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/paas-cf/pulls/comments/311480305","pull_request_review_id":271868901,"id":311480305,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxMTQ4MDMwNQ==","diff_hunk":"@@ -0,0 +1,15 @@\n+---\n+\n+- type: replace\n+  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/custom_rules?/-\n+  value:\n+    name: ExchangeRatesDrifting\n+    rules:\n+      - alert: ExchangeRatesDrifting_Critical\n+        expr: \"paas_currency_real_ratio > paas_currency_configured_ratio\"","path":"manifests/prometheus/alerts.d/exchange-rate.yml","position":9,"original_position":9,"commit_id":"672ed2a70d49d279263392c506dfdf839cbdae88","original_commit_id":"672ed2a70d49d279263392c506dfdf839cbdae88","user":{"login":"46bit","id":163111,"node_id":"MDQ6VXNlcjE2MzExMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/163111?v=4","gravatar_id":"","url":"https://api.github.com/users/46bit","html_url":"https://github.com/46bit","followers_url":"https://api.github.com/users/46bit/followers","following_url":"https://api.github.com/users/46bit/following{/other_user}","gists_url":"https://api.github.com/users/46bit/gists{/gist_id}","starred_url":"https://api.github.com/users/46bit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/46bit/subscriptions","organizations_url":"https://api.github.com/users/46bit/orgs","repos_url":"https://api.github.com/users/46bit/repos","events_url":"https://api.github.com/users/46bit/events{/privacy}","received_events_url":"https://api.github.com/users/46bit/received_events","type":"User","site_admin":false},"body":"Looks good. I'd gently nudge that we should be updating the exchange rate when it changes in our favour too.","created_at":"2019-08-07T10:27:51Z","updated_at":"2019-08-07T10:27:52Z","html_url":"https://github.com/alphagov/paas-cf/pull/2016#discussion_r311480305","pull_request_url":"https://api.github.com/repos/alphagov/paas-cf/pulls/2016","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/alphagov/paas-cf/pulls/comments/311480305"},"html":{"href":"https://github.com/alphagov/paas-cf/pull/2016#discussion_r311480305"},"pull_request":{"href":"https://api.github.com/repos/alphagov/paas-cf/pulls/2016"}},"in_reply_to_id":311147111},"pull_request":{"url":"https://api.github.com/repos/alphagov/paas-cf/pulls/2016","id":303801904,"node_id":"MDExOlB1bGxSZXF1ZXN0MzAzODAxOTA0","html_url":"https://github.com/alphagov/paas-cf/pull/2016","diff_url":"https://github.com/alphagov/paas-cf/pull/2016.diff","patch_url":"https://github.com/alphagov/paas-cf/pull/2016.patch","issue_url":"https://api.github.com/repos/alphagov/paas-cf/issues/2016","number":2016,"state":"open","locked":false,"title":"Monitor exchange rates using Prometheus","user":{"login":"tlwr","id":1482692,"node_id":"MDQ6VXNlcjE0ODI2OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1482692?v=4","gravatar_id":"","url":"https://api.github.com/users/tlwr","html_url":"https://github.com/tlwr","followers_url":"https://api.github.com/users/tlwr/followers","following_url":"https://api.github.com/users/tlwr/following{/other_user}","gists_url":"https://api.github.com/users/tlwr/gists{/gist_id}","starred_url":"https://api.github.com/users/tlwr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlwr/subscriptions","organizations_url":"https://api.github.com/users/tlwr/orgs","repos_url":"https://api.github.com/users/tlwr/repos","events_url":"https://api.github.com/users/tlwr/events{/privacy}","received_events_url":"https://api.github.com/users/tlwr/received_events","type":"User","site_admin":false},"body":"What\r\n----\r\n\r\nAdd USD currency metrics to paas-metrics\r\n\r\nEvents have caused the value of our charging currency (GBP) to change not insignificantly.\r\n\r\nThe exchange rate is not something we keep in our heads regularly, but has a significant impact on cross-charging and re-charging for infrastructure; a large portion of our infrastructure costs are in USD, so we risk losing money.\r\n\r\nThis PR does the following:\r\n\r\n- Add 2 metrics to paas-metrics\r\n  - One which is hardcoded to the same value as our exchange rate\r\n  - Another uses the European Central Bank currency rates to get a GBP/USD exchange rate.\r\n- Adds a test to ensure that we keep our paas-metrics and config/billing rates the same (eventually expose the exchange rates inside paas-billing with an endpoint maybe?)\r\n- Adds a Prometheus alert which tells us when our exchange rate has drifted\r\n\r\nHow to review\r\n-------------\r\n\r\nCode review\r\n\r\nTravis\r\n\r\nSee [tlwr paas-metrics](https://paas-metrics.tlwr.dev.cloudpipelineapps.digital/metrics) metrics:\r\n\r\n- `paas_currency_configured_ratio`\r\n- `paas_currency_real_ratio`\r\n\r\nSee [tlwr Prometheus Alerts](https://prometheus-1.tlwr.dev.cloudpipeline.digital/alerts) to see that the alert is firing\r\n\r\nWho can review\r\n--------------\r\n\r\nNot @tlwr\r\n","created_at":"2019-08-02T14:05:50Z","updated_at":"2019-08-07T10:27:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5aa2982a03ddfbe3aed4181e2408c10266a7446","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/paas-cf/pulls/2016/commits","review_comments_url":"https://api.github.com/repos/alphagov/paas-cf/pulls/2016/comments","review_comment_url":"https://api.github.com/repos/alphagov/paas-cf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/paas-cf/issues/2016/comments","statuses_url":"https://api.github.com/repos/alphagov/paas-cf/statuses/672ed2a70d49d279263392c506dfdf839cbdae88","head":{"label":"alphagov:monitor-currency","ref":"monitor-currency","sha":"672ed2a70d49d279263392c506dfdf839cbdae88","user":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":46716359,"node_id":"MDEwOlJlcG9zaXRvcnk0NjcxNjM1OQ==","name":"paas-cf","full_name":"alphagov/paas-cf","private":false,"owner":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/alphagov/paas-cf","description":"GOV.UK PaaS - Cloud Foundry","fork":false,"url":"https://api.github.com/repos/alphagov/paas-cf","forks_url":"https://api.github.com/repos/alphagov/paas-cf/forks","keys_url":"https://api.github.com/repos/alphagov/paas-cf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/paas-cf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/paas-cf/teams","hooks_url":"https://api.github.com/repos/alphagov/paas-cf/hooks","issue_events_url":"https://api.github.com/repos/alphagov/paas-cf/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/paas-cf/events","assignees_url":"https://api.github.com/repos/alphagov/paas-cf/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/paas-cf/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/paas-cf/tags","blobs_url":"https://api.github.com/repos/alphagov/paas-cf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/paas-cf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/paas-cf/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/paas-cf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/paas-cf/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/paas-cf/languages","stargazers_url":"https://api.github.com/repos/alphagov/paas-cf/stargazers","contributors_url":"https://api.github.com/repos/alphagov/paas-cf/contributors","subscribers_url":"https://api.github.com/repos/alphagov/paas-cf/subscribers","subscription_url":"https://api.github.com/repos/alphagov/paas-cf/subscription","commits_url":"https://api.github.com/repos/alphagov/paas-cf/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/paas-cf/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/paas-cf/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/paas-cf/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/paas-cf/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/paas-cf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/paas-cf/merges","archive_url":"https://api.github.com/repos/alphagov/paas-cf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/paas-cf/downloads","issues_url":"https://api.github.com/repos/alphagov/paas-cf/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/paas-cf/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/paas-cf/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/paas-cf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/paas-cf/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/paas-cf/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/paas-cf/deployments","created_at":"2015-11-23T11:36:57Z","updated_at":"2019-08-07T07:47:27Z","pushed_at":"2019-08-07T09:12:36Z","git_url":"git://github.com/alphagov/paas-cf.git","ssh_url":"git@github.com:alphagov/paas-cf.git","clone_url":"https://github.com/alphagov/paas-cf.git","svn_url":"https://github.com/alphagov/paas-cf","homepage":"","size":59395,"stargazers_count":48,"watchers_count":48,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":15,"open_issues":7,"watchers":48,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"ed3cd54d073bd92f05c45558145de2bb9a821c9c","user":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":46716359,"node_id":"MDEwOlJlcG9zaXRvcnk0NjcxNjM1OQ==","name":"paas-cf","full_name":"alphagov/paas-cf","private":false,"owner":{"login":"alphagov","id":596977,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5Njk3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/596977?v=4","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/alphagov/paas-cf","description":"GOV.UK PaaS - Cloud Foundry","fork":false,"url":"https://api.github.com/repos/alphagov/paas-cf","forks_url":"https://api.github.com/repos/alphagov/paas-cf/forks","keys_url":"https://api.github.com/repos/alphagov/paas-cf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/paas-cf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/paas-cf/teams","hooks_url":"https://api.github.com/repos/alphagov/paas-cf/hooks","issue_events_url":"https://api.github.com/repos/alphagov/paas-cf/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/paas-cf/events","assignees_url":"https://api.github.com/repos/alphagov/paas-cf/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/paas-cf/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/paas-cf/tags","blobs_url":"https://api.github.com/repos/alphagov/paas-cf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/paas-cf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/paas-cf/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/paas-cf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/paas-cf/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/paas-cf/languages","stargazers_url":"https://api.github.com/repos/alphagov/paas-cf/stargazers","contributors_url":"https://api.github.com/repos/alphagov/paas-cf/contributors","subscribers_url":"https://api.github.com/repos/alphagov/paas-cf/subscribers","subscription_url":"https://api.github.com/repos/alphagov/paas-cf/subscription","commits_url":"https://api.github.com/repos/alphagov/paas-cf/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/paas-cf/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/paas-cf/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/paas-cf/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/paas-cf/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/paas-cf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/paas-cf/merges","archive_url":"https://api.github.com/repos/alphagov/paas-cf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/paas-cf/downloads","issues_url":"https://api.github.com/repos/alphagov/paas-cf/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/paas-cf/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/paas-cf/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/paas-cf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/paas-cf/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/paas-cf/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/paas-cf/deployments","created_at":"2015-11-23T11:36:57Z","updated_at":"2019-08-07T07:47:27Z","pushed_at":"2019-08-07T09:12:36Z","git_url":"git://github.com/alphagov/paas-cf.git","ssh_url":"git@github.com:alphagov/paas-cf.git","clone_url":"https://github.com/alphagov/paas-cf.git","svn_url":"https://github.com/alphagov/paas-cf","homepage":"","size":59395,"stargazers_count":48,"watchers_count":48,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":15,"open_issues":7,"watchers":48,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/paas-cf/pulls/2016"},"html":{"href":"https://github.com/alphagov/paas-cf/pull/2016"},"issue":{"href":"https://api.github.com/repos/alphagov/paas-cf/issues/2016"},"comments":{"href":"https://api.github.com/repos/alphagov/paas-cf/issues/2016/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/paas-cf/pulls/2016/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/paas-cf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/paas-cf/pulls/2016/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/paas-cf/statuses/672ed2a70d49d279263392c506dfdf839cbdae88"}},"author_association":"MEMBER"}}
other: {"actor":{"display_login":"46bit"}}