This repository is for everyone who is interested in collecting and displaying metrics in golang applications using Prometheus and Grafana.
The stack is fully configured, so you can use it as a starting point.
After launching the applications, you will be able to observe the graphs at the standard address http://127.0.0.1:3000
. Use login admin
and password admin
to login to Grafana.
- Golang
- Docker and Docker-compose
Simple http server which accepts any request on /
and replies with 200 OK
status code and request method used. It has artificial latency on any request. Server exposes two custom metrics:
http_request_total
- counter representing total number of requests labeled by request methodhttp_request_duration
- histogram representing request duration
Continiously sends http requests with random methods to the server so we can observe collected metrics
Execute make build
. This command created binaries for server and client and puts them into dist
directory.
Execute make up
. This command runs server, client, prometheus and grafana using docker-compose
.
Execute make down
. This command removes created containers, network and volumes.