There are a variety of ways to monitor Go applications. One of the easiest ways is to set up Prometheus, a monitoring application written in Go (https://prometheus.io). This is an application that polls an endpoint based on your configuration file and collects a lot of information about your app, including the number of goroutines, memory usage, and much more. This app will use the techniques from the previous recipe to set up a Docker environment to host Prometheus and connect to it.
Monitoring applications
Getting ready
Configure your environment according to these steps:
- Refer to the Getting ready section of the Using containerization with Docker recipe.
- Run the go get github.com/prometheus/client_golang/prometheus/promhttp...