Skip to content

Latest commit

 

History

History
39 lines (22 loc) · 1.54 KB

README.md

File metadata and controls

39 lines (22 loc) · 1.54 KB

Prometheus and Grafana

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.

image

Prerequisites

  • Golang
  • Docker and Docker-compose

Applications

Server

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 method
  • http_request_duration - histogram representing request duration

Client

Continiously sends http requests with random methods to the server so we can observe collected metrics

How to run

Build

Execute make build. This command created binaries for server and client and puts them into dist directory.

Run

Execute make up. This command runs server, client, prometheus and grafana using docker-compose.

Stop

Execute make down. This command removes created containers, network and volumes.