{"id":18447492,"url":"https://github.com/revsys/local-compose-loki-prometheus-vector","last_synced_at":"2026-04-29T00:32:38.728Z","repository":{"id":228171996,"uuid":"773326179","full_name":"revsys/local-compose-loki-prometheus-vector","owner":"revsys","description":"Example Docker Compose configuration for using Loki, Prometheus, and Grafana is a local development setting to better consume logs and metrics","archived":false,"fork":false,"pushed_at":"2024-03-17T11:49:42.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T06:44:04.534Z","etag":null,"topics":["docker-compose","grafana","loki","prometheus","vector"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/revsys.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}},"created_at":"2024-03-17T11:17:00.000Z","updated_at":"2024-11-13T23:02:08.000Z","dependencies_parsed_at":"2024-03-17T12:34:02.100Z","dependency_job_id":"e08f57c7-90f4-4aa5-a150-5fedbfddf2aa","html_url":"https://github.com/revsys/local-compose-loki-prometheus-vector","commit_stats":null,"previous_names":["revsys/local-compose-loki-prometheus-vector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revsys%2Flocal-compose-loki-prometheus-vector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revsys%2Flocal-compose-loki-prometheus-vector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revsys%2Flocal-compose-loki-prometheus-vector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revsys%2Flocal-compose-loki-prometheus-vector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/revsys","download_url":"https://codeload.github.com/revsys/local-compose-loki-prometheus-vector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023729,"owners_count":21199958,"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":["docker-compose","grafana","loki","prometheus","vector"],"created_at":"2024-11-06T07:13:29.672Z","updated_at":"2026-04-29T00:32:33.707Z","avatar_url":"https://github.com/revsys.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using Loki and Prometheus for Local Development with Docker Compose\n\n## Why?\n\nAs developers, we are often asked to include robust logging (hopefully structured)\nand metrics for later use in our deployed environment for operations reasons.\n\nHowever, we don't have great ways to consume them ourselves or even verify\nour work.\n\nThis git repository gives you a *mostly working* example of how to do this\nwithout a ton of configuration.\n\n## Stack\n\n### Loki\n\n[Loki](https://grafana.com/oss/loki/) is an efficient log aggregation system.\nIts role is the equivalent of ElasticSearch in the typical ELK/EFK stacks you\nmay be familiar with.\n\n### Vector\n\n[Vector](https://vector.dev/) is a logging agent. It collects logs from all of\nour containers and sends them to Loki.\n\nIt is configured via [docker/vector.yaml](docker/vector.yaml).\n\n### Prometheus\n\n[Prometheus](https://prometheus.io/) is the most popular time series metrics\nstorage.\n\nIt is configured via [docker/prometheus.yml](docker/prometheus.yml).\n\n### Grafana\n\n[Grafana](https://grafana.com/grafana/) is the most popular visualization tool\nused by operations teams.\n\nWith this set up you can quickly explore the metrics and logs that are being\ncollected.  You can also create dashboards of information that can be useful\nduring local development and debugging.\n\nAnother reason you may want to create a Dashboard is to verify it's set up\nand then export it for use in your deployed environments.\n\n## FAQ\n\n**Q: Doesn't this take up a bunch of resources on my laptop?**\n\nI too was worried about this and was pleasantly surprised how lightweight it\nended up being.  I'm on an M1 Macbook Pro (2021) and it ends up taking up about\n200-300 MBs of RAM and 1-2% of CPU.  I would imagine the CPU would be a bit\nhigher on x86 architectures than arm, but wouldn't imagine it would even\napproach 5%.\n\n**Q: What do I need to do to log in my own code?**\n\nAll you need to do is have your code emit logging data to stdout, preferably\nin a structured format like JSON.  This makes it far easier to search and filter\nyour log data in meaningful ways.\n\n## Customizing\n\nYou can adjust the Vector, Prometheus, and/or Grafana configurations defined\nin their respective YAML files and `compose.yml` itself. For example, you\nmay need to add a [transform](https://vector.dev/guides/level-up/transformation/)\nto your Vector configuration to help filter or shape your log data before\nsending it on to Loki.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevsys%2Flocal-compose-loki-prometheus-vector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevsys%2Flocal-compose-loki-prometheus-vector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevsys%2Flocal-compose-loki-prometheus-vector/lists"}