{"id":25841278,"url":"https://github.com/dingus-technology/infrastructure-simulation","last_synced_at":"2025-03-01T05:23:03.095Z","repository":{"id":279834591,"uuid":"930995503","full_name":"dingus-technology/INFRASTRUCTURE-SIMULATION","owner":"dingus-technology","description":"Run simulations for collecting data in Prometheus and Loki to explore in Grafana","archived":false,"fork":false,"pushed_at":"2025-02-27T17:40:48.000Z","size":501,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-28T01:08:42.499Z","etag":null,"topics":["debugging","devops","grafana","logs","loki","metrics","prometheus"],"latest_commit_sha":null,"homepage":"https://www.dingusai.dev","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/dingus-technology.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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-02-11T14:55:40.000Z","updated_at":"2025-02-26T22:04:15.000Z","dependencies_parsed_at":"2025-02-28T01:08:49.145Z","dependency_job_id":"d894398a-7ac0-475c-bac4-8b2baa1fd49f","html_url":"https://github.com/dingus-technology/INFRASTRUCTURE-SIMULATION","commit_stats":null,"previous_names":["dingus-technology/infrastructure-simulation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dingus-technology%2FINFRASTRUCTURE-SIMULATION","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dingus-technology%2FINFRASTRUCTURE-SIMULATION/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dingus-technology%2FINFRASTRUCTURE-SIMULATION/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dingus-technology%2FINFRASTRUCTURE-SIMULATION/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dingus-technology","download_url":"https://codeload.github.com/dingus-technology/INFRASTRUCTURE-SIMULATION/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241319561,"owners_count":19943554,"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":["debugging","devops","grafana","logs","loki","metrics","prometheus"],"created_at":"2025-03-01T05:22:58.526Z","updated_at":"2025-03-01T05:23:03.089Z","avatar_url":"https://github.com/dingus-technology.png","language":"Python","readme":"# 🐕 Monitoring Simulation Data with Loki, Prometheus \u0026 Grafana\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/grafana-demo-ui.png\" alt=\"Grafana UI\" width=\"850\"\u003e\n\u003c/p\u003e\n\n## 🚀 Overview\nThis guide explains how to set up **Loki**, **Prometheus**, and **Grafana** using Docker Compose to monitor CPU load data from a Python application locally.\n\n🔹 **Prometheus** - Scrapes metrics from the app  \n🔹 **Loki** - Collects \u0026 indexes logs  \n🔹 **Grafana** - Visualizes the data  \n\n---\n\n## 📌 Prerequisites\nEnsure you have the following installed:\n- [Docker \u0026 Docker Compose](https://docs.docker.com/get-docker/)\n- [Colima](https://github.com/abiosoft/colima) (for Mac users)\n\n\n---\n\n## 🚀 Start the Monitoring Stack\nRun the following command to build and start the services:\n\n```bash\ndocker compose up --build\n```\n\n---\n\n## 🔍 Verify Prometheus Scraping Data\n1. Open **Prometheus UI** → [http://localhost:9090](http://localhost:9090)\n2. Navigate to **\"Status\" \u003e \"Targets\"** to check if `sanitised-data` is `UP`\n3. Run a query in PromQL:\n\n   ```promql\n   cpu_load\n   ```\n\n   You should see CPU load data in real-time!\n\n---\n\n## 📊 Connect Grafana to Prometheus\n1. Open **Grafana UI** → [http://localhost:3000](http://localhost:3000)\n2. **Login** with:\n   - Username: `admin`\n   - Password: `admin`\n3. Navigate to **\"Configuration\" \u003e \"Data Sources\"**\n4. Click **\"Add Data Source\"** and select **Prometheus**\n5. Set the **URL**:\n\n   ```\n   http://host.docker.internal:9090\n   ```\n\n6. Click **\"Save \u0026 Test\"** 🎯\n\n---\n\n## 📈 Create a Grafana Dashboard\n1. Go to **\"Create\" \u003e \"Dashboard\"**\n2. Click **\"Add a new panel\"**\n3. In the **Metrics** section, enter:\n\n   ```promql\n   cpu_load\n   ```\n\n4. Click **\"Run query\"** to visualize CPU load\n5. Customize the graph, then click **\"Save\"** ✅\n\n---\n\n## 📜 Configure Loki for Log Monitoring\n1. Navigate to **\"Logs\"** in Grafana\n2. Select **\"Loki\"** as the **\"Data Source\"**\n3. Run a log query to filter logs:\n\n   ```logql\n   {app=\"sanitised-data\"}\n   ```\n\n---\n\n## 🎉 Done!  \nYour **sanitised-data service** is now fully monitored with **Prometheus, Loki \u0026 Grafana**! 🚀  \n\n✅ **Metrics →** Tracked via **Prometheus**  \n✅ **Logs →** Indexed with **Loki**  \n✅ **Visualization →** Displayed in **Grafana**  \n\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdingus-technology%2Finfrastructure-simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdingus-technology%2Finfrastructure-simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdingus-technology%2Finfrastructure-simulation/lists"}