{"id":29973414,"url":"https://github.com/rajibconf/monitoring","last_synced_at":"2025-08-04T07:03:23.745Z","repository":{"id":307131084,"uuid":"1028430935","full_name":"rajibconf/monitoring","owner":"rajibconf","description":"Monitoring Stack with Prometheus, Grafana, Loki","archived":false,"fork":false,"pushed_at":"2025-07-29T16:26:46.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-29T17:29:52.270Z","etag":null,"topics":["grafana","loki","nodeexporter","prometheus","promtail"],"latest_commit_sha":null,"homepage":"","language":null,"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/rajibconf.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,"zenodo":null}},"created_at":"2025-07-29T14:14:55.000Z","updated_at":"2025-07-29T16:26:50.000Z","dependencies_parsed_at":"2025-07-29T17:33:24.893Z","dependency_job_id":"3862b672-0ee2-4c13-8317-cb047ac41917","html_url":"https://github.com/rajibconf/monitoring","commit_stats":null,"previous_names":["rajibconf/monitoring"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/rajibconf/monitoring","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajibconf%2Fmonitoring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajibconf%2Fmonitoring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajibconf%2Fmonitoring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajibconf%2Fmonitoring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rajibconf","download_url":"https://codeload.github.com/rajibconf/monitoring/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajibconf%2Fmonitoring/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268660057,"owners_count":24286008,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["grafana","loki","nodeexporter","prometheus","promtail"],"created_at":"2025-08-04T07:00:48.799Z","updated_at":"2025-08-04T07:03:23.725Z","avatar_url":"https://github.com/rajibconf.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📊 Monitoring Stack with Prometheus, Grafana, Loki\n\nThis project provides a full monitoring stack using Prometheus, Grafana, Loki, and Promtail using Docker Compose. It also includes system monitoring from the host using `node_exporter` and `promtail` as systemd services.\nThe repository provides a complete observability stack using **Docker Compose**. It includes:\n\n- **Prometheus** for metrics collection\n- **Grafana** for visualization\n- **Loki** for log aggregation\n- **Promtail** for sending logs to Loki\n- **Node_exporter** for sending metrics to Prometheus\n\n---\n\n## 🧱 Services\n| Service       | Port | Description                              |\n| ------------- | ---- | ---------------------------------------- |\n| Prometheus    | 9090 | Metrics collection and monitoring        |\n| Grafana       | 3300 | Metrics and logs visualization           |\n| Loki          | 3400 | Log storage and querying backend         |\n| Node Exporter | 9100 | Host metrics exporter for Prometheus     |\n| Promtail      | 9080 | Log collection agent, sends logs to Loki |\n\n\n---\n\n## 🚀 Getting Started\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/rajibconf/monitoring.git\ncd monitoring\n```\n\n2. Set up environment variables\nCopy the example .env and configure if needed:\n\n```bash\ncp .env.example .env\n```\n\n⚙️ Setup on Host Machine\n---\n📁 3. Install Binaries on Host\n---\nMake sure node_exporter and promtail binaries are available in /usr/local/bin.\n```bash\n# Example for Node Exporter\nwget https://github.com/prometheus/node_exporter/releases/download/v1.9.1/node_exporter-1.9.1.linux-amd64.tar.gz\ntar xvfz node_exporter-1.9.1.linux-amd64.tar.gz\nsudo mv node_exporter-1.9.1.linux-amd64/node_exporter /usr/local/bin/\n```\n\n```bash\n# Example for Promtail\nwget https://github.com/grafana/loki/releases/latest/download/promtail-linux-amd64.zip\nunzip promtail-linux-amd64.zip\nchmod +x promtail-linux-amd64\nsudo mv promtail-linux-amd64 /usr/local/bin/promtail\n```\n\n🛠️ 4. Configure Systemd Services\nCopy systemd unit files:\n```bash\nsudo cp systemd/node_exporter.service /etc/systemd/system/node_exporter.service\nsudo cp systemd/promtail.service /etc/systemd/system/promtail.service\n```\nEnable and start the services:\n```bash\nsudo systemctl daemon-reexec\nsudo systemctl daemon-reload\n\nsudo systemctl enable node_exporter\nsudo systemctl start node_exporter\n\nsudo systemctl enable promtail\nsudo systemctl start promtail\n```\n\nCheck status:\n```bash\nsudo systemctl status node_exporter\nsudo systemctl status promtail\n```\n\n📦 5. Docker Compose Services\n```bash\ndocker compose up -d\n```\n6. Access the services\n- Grafana: http://localhost:3300\n- Prometheus: http://localhost:9090\n- Loki: http://localhost:3400 (API only)\n\n🔐 Grafana Login\nDefault credentials:\n```pgsql\nUsername: admin\nPassword: admin\n```\n⚠️ Make sure to change the password after first login.\n\n📂 File Structure\n```bash\n.\n├── docker-compose.yml         # All services defined here\n├── prometheus/\n│   └── prometheus.yml         # Prometheus config\n├── promtail/\n│   └── promtail-config.yml    # Promtail config\n├── systemd/                   # systemd unit files for host setup\n    └── node_exporter.service\n    └── promtail.service\n├── nginx/                     # nginx config file for host setup\n    └── grafana.conf\n├── .env.example               # Sample environment variables\n└── README.md                  # intructions\n```\n\n📁 nginx/grafana.conf (Host Machine Configuration)\n---\nThis Nginx configuration file sets up HTTPS reverse proxying for the Grafana dashboard running on your server.\n\n🔧 Instructions:\n- Location: This file resides in the nginx/ directory of your project.\n- Usage: It must be used on the host machine, not inside a container.\n- Change the SSL certificate \u0026 domain to the correct one in nginx/grafana.conf file.\n- Copy the file to the Nginx configuration folder on your host machine:\n```bash\nsudo cp nginx/grafana.conf /etc/nginx/conf.d/grafana.conf\n```\n- Test the Nginx configuration to make sure everything is okay:\n```bash\nsudo nginx -t\n```\n- Reload or restart Nginx:\n```bash\nsudo systemctl reload nginx\n# or if Nginx isn't running yet:\nsudo systemctl start nginx\n```\n\n📈 Dashboards\n- Grafana includes support for:\n- Prometheus metrics (Node Exporter, container metrics)\n- Loki logs via Promtail\n- You can import dashboards from Grafana Dashboards. ID: 1860\n\n🛠️ Customization\n- Add new targets in prometheus/prometheus.yml\n- Configure new log paths in promtail/promtail-config.yml\n\n🔒 Notes\n- Promtail scrapes logs and sends to Loki.\n- Node Exporter exposes system metrics on port 9100.\n- Prometheus scrapes Node Exporter on host IP.\n- Grafana is available on http://localhost:3000 (default login: admin/admin).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajibconf%2Fmonitoring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajibconf%2Fmonitoring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajibconf%2Fmonitoring/lists"}