{"id":24373292,"url":"https://github.com/biglogic/grafana-loki-prometheus","last_synced_at":"2026-04-10T11:01:28.502Z","repository":{"id":273077715,"uuid":"918628691","full_name":"biglogic/grafana-loki-prometheus","owner":"biglogic","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-18T13:38:53.000Z","size":8167,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-27T21:51:55.481Z","etag":null,"topics":["alertmanager","docker","docker-compose","grafana","monitoring","prometheus"],"latest_commit_sha":null,"homepage":"","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/biglogic.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-18T12:48:07.000Z","updated_at":"2025-01-18T13:43:07.000Z","dependencies_parsed_at":"2025-01-18T14:53:33.519Z","dependency_job_id":"48872572-c2ca-4895-a409-789c75efe253","html_url":"https://github.com/biglogic/grafana-loki-prometheus","commit_stats":null,"previous_names":["biglogic/grafana-loki-prometheus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/biglogic/grafana-loki-prometheus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biglogic%2Fgrafana-loki-prometheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biglogic%2Fgrafana-loki-prometheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biglogic%2Fgrafana-loki-prometheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biglogic%2Fgrafana-loki-prometheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biglogic","download_url":"https://codeload.github.com/biglogic/grafana-loki-prometheus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biglogic%2Fgrafana-loki-prometheus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31639524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"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":["alertmanager","docker","docker-compose","grafana","monitoring","prometheus"],"created_at":"2025-01-19T05:10:33.101Z","updated_at":"2026-04-10T11:01:28.485Z","avatar_url":"https://github.com/biglogic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monitoring Stack with Docker Compose\n\nThis project sets up a monitoring stack using Docker Compose, consisting of:\n\n- **Grafana**: For data visualization and dashboarding.\n- **Loki**: For log aggregation.\n- **Prometheus**: For metrics collection and alerting.\n- **Alertmanager**: For managing alerts generated by Prometheus.\n- **Blackbox Exporter**: For probing endpoints and testing network connectivity.\n\n## Prerequisites\n\n- Docker and Docker Compose installed on your system.\n- Basic understanding of Docker and monitoring concepts.\n- install loki plugin for log collection from container \n   ```\n      docker plugin install grafana/loki-docker-driver:2.9.2 --alias loki --grant-all-permissions\n   ```\n\n## Configuration Files\n\n### Docker Compose File\n\nThe `docker-compose.yaml` file defines the services:\n\n- **Loki**: Log aggregation service with a volume to store logs.\n- **Alertmanager**: Sends notifications based on Prometheus alerts.\n- **Prometheus**: Scrapes metrics and generates alerts.\n- **Blackbox Exporter**: Probes endpoints for network connectivity checks.\n- **Grafana**: Visualizes metrics and logs with dashboards.\n\n### Prometheus Configuration (`prometheus.yaml`)\n\n- Sets global scrape interval to 15 seconds.\n- Includes `blackbox` and `prometheus` jobs.\n- Configures alerting rules using `alert_rules.yml`.\n\n### Alert Rules (`alert_rules.yml`)\n\nContains an alert rule for HTTP status code mismatch:\n\n```yaml\ngroups:\n  - name: http-probe-alerts\n    rules:\n      - alert: HTTPStatusCodeMismatch\n        expr: probe_http_status_code{instance=\"Url\"} != 200\n        for: 1m\n        labels:\n          severity: critical\n        annotations:\n          summary: \"HTTP Status Code Alert for {{ $labels.instance }}\"\n          description: \"The HTTP status code for the instance {{ $labels.instance }} is not 200. Current status code: {{ $value }}\"\n```\n\n### Alertmanager Configuration (`alertmanager.yml`)\n\nDefines alert routing and notification settings:\n\n- **Route**: Groups alerts and defines intervals.\n- **Receiver**: Sends alerts via email using Gmail's SMTP server.\n\n## Usage\n\n1. Clone the repository and navigate to the project directory.\n\n```bash\ngit clone \u003crepository_url\u003e\ncd \u003crepository_folder\u003e\n```\n\n2. Start the stack using Docker Compose:\n\n```bash\ndocker-compose up -d\n```\n\n3. Access the services in your browser:\n\n- **Grafana**: [http://localhost:3200](http://localhost:3200)\n- **Prometheus**: [http://localhost:9099](http://localhost:9099)\n- **Alertmanager**: [http://localhost:9094](http://localhost:9094)\n- **Blackbox Exporter**: [http://localhost:9115](http://localhost:9115)\n\n4. Configure data sources in Grafana for Prometheus and Loki.\n\n## Notes\n\n- **Loki Configuration**: Ensure the `loki-url` in `x-logging` matches your setup.\n- **Email Alerts**: Replace placeholders in `alertmanager.yml` with your email credentials and settings.\n- **Volumes**: Persistent storage is used for Loki and Prometheus data. Ensure directories like `./prometheus-data` and `./loki-storage` exist.\n\n## Customization\n\n- Update `alert_rules.yml` and `alertmanager.yml` to add more alerts and customize notifications.\n- Add more Prometheus scrape jobs in `prometheus.yaml` as needed.\n- Modify the network and volume configurations in `docker-compose.yaml` to suit your environment.\n\n## Stopping the Stack\n\nTo stop and remove the containers, run:\n\n```bash\ndocker-compose down\n```\n\n## Troubleshooting\n\n- Check container logs for debugging:\n\n```bash\ndocker logs \u003ccontainer_name\u003e\n```\n\n- Ensure all required ports are available and not blocked by a firewall.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiglogic%2Fgrafana-loki-prometheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiglogic%2Fgrafana-loki-prometheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiglogic%2Fgrafana-loki-prometheus/lists"}