https://github.com/bolcom/local-prometheus-grafana
https://github.com/bolcom/local-prometheus-grafana
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/bolcom/local-prometheus-grafana
- Owner: bolcom
- Created: 2021-06-16T15:13:57.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-20T16:10:34.000Z (about 3 years ago)
- Last Synced: 2025-02-07T22:27:16.351Z (over 1 year ago)
- Size: 35.2 KB
- Stars: 5
- Watchers: 7
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# How to run local prometheus + grafana instance
to test / validate your metrics...
## how it is set-up
Prometheus is configured to "scrape" the node-exporter container. This container is not necessary, but illustrates how you can add your own LOCAL Java/Go service to be scraped as well.
## how to start
- First download required files: https://github.com/bolcom/local-prometheus-grafana/archive/refs/heads/master.zip
- Unzip contents
- Run `docker-compose up` inside directory.
- Then open grafana: http://localhost:3000/.
- Log-in with username `foo` and password `bar`.
- There is already a dashboard `test` created with one graph, fetching data out of the local prometheus instance. Wait a few minutes, then the data will arrive.
## exposed services
- prometheus server: http://localhost:9090/ (see targets here: http://localhost:9090/targets)
- grafana: http://localhost:3000/
- node-exporter: http://localhost:9100/metrics
When all containers are started, open grafana and open the "test" dashboard.
## how to add your local running service?
Simple, change the prometheus config file (`prometheus.yml`) and add a new target. Since the whole stack is running in docker containers, you should connect to `host.docker.internal:<>`. An example can be found in the config file, just uncomment it.
## More info
See this blogpost: https://techlab.bol.com/how-to-validate-your-apps-metrics-on-a-local-grafana-instance/