{"id":25874651,"url":"https://github.com/lyft/opsreview","last_synced_at":"2025-03-02T09:28:38.804Z","repository":{"id":4265662,"uuid":"50050684","full_name":"lyft/opsreview","owner":"lyft","description":"Compile a report of recent PagerDuty alerts for a single escalation policy.","archived":false,"fork":false,"pushed_at":"2023-12-21T15:10:39.000Z","size":40,"stargazers_count":29,"open_issues_count":1,"forks_count":23,"subscribers_count":101,"default_branch":"master","last_synced_at":"2023-12-21T18:28:21.181Z","etag":null,"topics":["lyft"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lyft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-01-20T18:26:32.000Z","updated_at":"2023-12-21T18:28:25.087Z","dependencies_parsed_at":"2023-12-21T18:28:23.426Z","dependency_job_id":"a4a4cdb5-14dc-45b9-bbbb-2d996347271a","html_url":"https://github.com/lyft/opsreview","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyft%2Fopsreview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyft%2Fopsreview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyft%2Fopsreview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyft%2Fopsreview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lyft","download_url":"https://codeload.github.com/lyft/opsreview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241485243,"owners_count":19970448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lyft"],"created_at":"2025-03-02T09:28:38.274Z","updated_at":"2025-03-02T09:28:38.795Z","avatar_url":"https://github.com/lyft.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# opsreview\nCompile a report of recent PagerDuty alerts for a given list of escalation policies.\n\n[![Build Status](https://travis-ci.org/lyft/opsreview.svg?branch=master)](https://travis-ci.org/lyft/opsreview)\n\n## Purpose\nTo keep the on-call duty tolerable, it's important to regularly review recent alerts and determine what actions need to be taken. That might be fixing the originating issue, or modifying your alerting behaviors.\n\nUsing the opsreview tool, you can quickly compile a report on recent alerts for a single escalation policy and determine what actions should be taken.\n\n## Example Output\n```\n\u003e python pull_alerts.py\n\nTime: Tuesday, January 19 - 9:19 AM +0000\nService: api\nDescription: Failing API alarm: CRON failure\nURL: https://subdomain.pagerduty.com/incidents/ABC123\nNotes:\n['bob@lyft.com: #a - Re-ran CRON']\n\nTime: Tuesday, January 19 - 12:03 PM +0000\nService: api\nDescription: Failing API alarm: CPU percent \u003e 10\nURL: https://subdomain.pagerduty.com/incidents/ABC124\nNotes:\n['bob@lyft.com: #na - Temporary spike in CPU, no action taken. Alert is too sensitive.']\n\nTime: Tuesday, January 19 - 1:35 PM +0000\nService: www\nDescription: Failing WWW alarm: 5XX percent \u003e 5\nURL: https://subdomain.pagerduty.com/incidents/ABC125\nNotes:\n['sally@lyft.com: #a - Bad deploy']\n```\n\n## Setup\nUpdate your settings. To get an API token, go to the \"User Settings\" tab on your PagerDuty profile and click \"Create API User Token\". Make sure to use a v2 token.\n```bash\ncp settings_example.py settings.py\n\n# Update settings.py for your PagerDuty escalation policy.\n#\n# PAGERDUTY_API_TOKEN = 'yourapitoken'\n# ESCALATION_POLICIES = ['PYODVQB']  # Get from https://yoursubdomain.pagerduty.com/escalation_policies#PYODVQB\n```\n\nSet up your environment.\n```bash\npip3 install virtualenv\nvirtualenv venv3\nsource venv3/bin/activate\npip install -r requirements.txt\n```\n\nRun the script.\n```bash\npython pull_alerts.py\n```\n\n## Timezone\nBy default, local timezone is used to print alert time. To change default timezone use `TZ` environment variable:\n```bash\nTZ=UTC python pull_alerts.py\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyft%2Fopsreview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flyft%2Fopsreview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyft%2Fopsreview/lists"}