{"id":29973332,"url":"https://github.com/tyronejosee/prototype_metrics","last_synced_at":"2026-04-04T20:32:14.274Z","repository":{"id":307201739,"uuid":"1028697811","full_name":"tyronejosee/prototype_metrics","owner":"tyronejosee","description":"Prototype for a complete Grafana and Prometheus monitoring setup, orchestrated with Docker Compose for easy deployment and configuration.","archived":false,"fork":false,"pushed_at":"2025-09-28T04:11:33.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-28T06:10:44.103Z","etag":null,"topics":["docker-compose","grafana","json","metrics","prometheus","python","yaml"],"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/tyronejosee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-07-29T23:45:33.000Z","updated_at":"2025-09-28T04:11:38.000Z","dependencies_parsed_at":"2025-07-30T01:58:25.998Z","dependency_job_id":null,"html_url":"https://github.com/tyronejosee/prototype_metrics","commit_stats":null,"previous_names":["tyronejosee/prototype_metrics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tyronejosee/prototype_metrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyronejosee%2Fprototype_metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyronejosee%2Fprototype_metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyronejosee%2Fprototype_metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyronejosee%2Fprototype_metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tyronejosee","download_url":"https://codeload.github.com/tyronejosee/prototype_metrics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyronejosee%2Fprototype_metrics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31413267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["docker-compose","grafana","json","metrics","prometheus","python","yaml"],"created_at":"2025-08-04T07:00:43.797Z","updated_at":"2026-04-04T20:32:14.222Z","avatar_url":"https://github.com/tyronejosee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prototype Metrics\n\nComplete Grafana + Prometheus monitoring setup with Docker Compose, designed for learning and experimentation.\n\n![Main](image.jpg)\n![Dashboard](dashboard.webp)\n\n## 🏗️ Architecture Overview\n\n- **Grafana**: Web interface for creating dashboards and visualizing metrics\n- **Prometheus**: Time-series database that stores metrics\n- **Pushgateway**: Allows batch jobs to push metrics to Prometheus\n- **Python Script**: Generates realistic system metrics\n\n## 🚀 Quick Start Guide\n\nPrerequisites\n\n- Docker and Docker Compose installed\n- Python 3.7+ (for the metric generator script)\n\nStart the Services\n\n```bash\n# Start all services in the background\ndocker compose up -d\n\n# Check if all services are running\ndocker compose ps\n```\n\nInstall Python Dependencies\n\n\u003e Recommended to use [uv](https://docs.astral.sh/uv/guides/install-python/#getting-started).\n\n```bash\nuv sync\n```\n\nRun the Metric Generator\n\n```bash\nuv run metric_generator.py\n```\n\nAccess the Services\n\n- **Grafana**: \u003chttp://localhost:3000\u003e\n  - Username: `admin`\n  - Password: `admin123`\n  \n- **Prometheus**: \u003chttp://localhost:9090\u003e\n- **Pushgateway**: \u003chttp://localhost:9091\u003e\n\n## 📊 Pre-configured Dashboard\n\nThe setup includes a pre-configured dashboard called \"System Metrics Dashboard\" that displays:\n\n- CPU Usage\n- Memory Usage  \n- Request Count\n- Error Count\n\n## 🛠️ Customization Ideas\n\nAdding New Metrics\n\n1. Modify `metric_generator.py` to include new metrics\n2. Update the dashboard JSON or create new panels in Grafana UI\n\nDifferent Data Sources\n\n- Replace Prometheus with InfluxDB for different time-series storage\n- Add Loki for log aggregation\n- Include Node Exporter for real system metrics\n\nAdvanced Features\n\n- Set up alerting rules in Prometheus\n- Add notification channels in Grafana\n- Create custom alert conditions\n\n## 🧪 Testing and Development\n\nView Raw Metrics\n\nVisit \u003chttp://localhost:9091/metrics\u003e to see raw metrics from Pushgateway\n\nQuery Metrics in Prometheus\n\nGo to \u003chttp://localhost:9090\u003e and try these queries:\n\n- `cpu_usage_percent`\n- `memory_usage_percent`\n- `rate(request_count_total[5m])`\n\nStop Everything\n\n```bash\ndocker-compose down\n\n# Remove volumes (caution: this deletes all data)\ndocker-compose down -v\n```\n\n## 📁 File Structure\n\n```bash\nprototype_grafana_prometheus/\n├── docker-compose.yml          # Main orchestration file\n├── prometheus/\n│   └── prometheus.yml          # Prometheus configuration\n├── datasources/\n│   └── prometheus.yml          # Grafana datasource config\n├── dashboards/\n│   ├── dashboard.yml           # Dashboard provider config\n│   └── system-metrics.json     # Pre-built dashboard\n├── metric_generator.py         # Metric generation script\n├── requirements.txt            # Python dependencies\n└── README.md                   # This file\n```\n\n## 🔧 Troubleshooting\n\nServices won't start\n\n- Check Docker is running: `docker ps`\n- Check logs: `docker-compose logs [service-name]`\n\nNo data in Grafana\n\n- Verify Prometheus is scraping: \u003chttp://localhost:9090/targets\u003e\n- Check if metrics are being pushed: \u003chttp://localhost:9091/metrics\u003e\n- Ensure the Python script is running without errors\n\nCan't access Grafana\n\n- Wait a few minutes for services to fully start\n- Check if port 3000 is available: `netstat -an | grep 3000`\n\n## ⚖️ License\n\nThis project is licensed under the [MIT License](LICENSE).\n\nEnjoy! 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyronejosee%2Fprototype_metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyronejosee%2Fprototype_metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyronejosee%2Fprototype_metrics/lists"}