{"id":28378058,"url":"https://github.com/robusta-dev/prometheus-report-generator","last_synced_at":"2025-06-26T21:33:04.044Z","repository":{"id":274734437,"uuid":"922944585","full_name":"robusta-dev/prometheus-report-generator","owner":"robusta-dev","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-02T12:19:11.000Z","size":869,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-22T03:52:45.996Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robusta-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-27T11:23:44.000Z","updated_at":"2025-05-16T08:24:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"2f6acc8e-704f-4cf7-ba7d-a280ebede9a5","html_url":"https://github.com/robusta-dev/prometheus-report-generator","commit_stats":null,"previous_names":["robusta-dev/kubernetes_report","robusta-dev/prometheus-report-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robusta-dev/prometheus-report-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robusta-dev%2Fprometheus-report-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robusta-dev%2Fprometheus-report-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robusta-dev%2Fprometheus-report-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robusta-dev%2Fprometheus-report-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robusta-dev","download_url":"https://codeload.github.com/robusta-dev/prometheus-report-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robusta-dev%2Fprometheus-report-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262145201,"owners_count":23265892,"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":[],"created_at":"2025-05-30T01:35:32.089Z","updated_at":"2025-06-26T21:33:04.034Z","avatar_url":"https://github.com/robusta-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prometheus Reports Generator\n\n## Example Report Output\nThe script generates a Prometheus alerts report in PDF format. An example report can be found here: [example_prometheus_alerts_report.pdf](example_prometheus_alerts_report.pdf).\n\nThe generated PDF includes:\n1. **Alerts Over Time (Line Chart)**: Shows alert frequency trends.\n\u003cimg width=\"1001\" alt=\"Screen Shot 2025-02-02 at 14 05 00\" src=\"https://github.com/user-attachments/assets/12cea63e-f28a-46b5-94f8-81750603c143\" /\u003e\n\n2. **Alert Distribution (Pie Chart)**: Displays the proportion of each alert type.\n\u003cimg width=\"628\" alt=\"Screen Shot 2025-02-02 at 14 08 14\" src=\"https://github.com/user-attachments/assets/37908122-1f6b-4d58-8ef3-63a3342890ea\" /\u003e\n\n3. **Alert Summary Table**: Categorizes alerts based on their types and distributions.\n4. **Enrichment Summary Table**: Shows how alerts are enriched and categorized.\n\u003cimg width=\"648\" alt=\"Screen Shot 2025-02-02 at 14 05 35\" src=\"https://github.com/user-attachments/assets/ad47383c-e8e3-4d2d-9029-bfe50b9b1806\" /\u003e\n\n## How to Use\nThis script works by calling Robusta’s API, which stores historical data on Prometheus alerts. It fetches alert information and generates a detailed report.\n\n### Installation\nTo install the required dependencies, run:\n\n```sh\npip install -r requirements.txt\n```\n\n### Set Required Environment Variables\nBefore running the script, you must set the following environment variables:\n\n```sh\nexport AUTH_TOKEN=\"your_auth_token\"\nexport ACCOUNT_ID=\"your_account_id\"\n```\n\n### Run the Script\nTo generate a report for the last 30 days:\n\n```sh\npython generate_alert_report.py 30\n```\n\nYou can adjust the number of days as needed.\n\n## Troubleshooting\n- **No alerts appearing in the report?**\n  - Ensure that `AUTH_TOKEN` and `ACCOUNT_ID` are correctly set.\n  - Check if the Robusta API is returning data for the requested time range.\n- **PDF generation issues?**\n  - Ensure that `fpdf` is installed and the required fonts are available in the `imported/` directory.\n  - Check if `matplotlib` and `pandas` are installed correctly.\n\n## Contributing\nIf you'd like to improve this script, feel free to submit a pull request or open an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobusta-dev%2Fprometheus-report-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobusta-dev%2Fprometheus-report-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobusta-dev%2Fprometheus-report-generator/lists"}