Monitoring server-side metrics
So far, you have learned how to monitor application-side metrics by instrumenting the Gin application code. In this section, you will learn how to expose server-side metrics and monitor the overall health of the containers running on the Gin distributed web application.
To collect server-side metrics, you can use an open source solution called Telegraf (https://github.com/influxdata/telegraf), a data collection agent (DCA) that can collect metrics from multiple inputs and forward them to different sources:
Telegraf can be easily deployed using Docker. Add the following code block to docker-compose.yml
:
telegraf: image: telegraf:latest volumes: - ./telegraf.conf:/etc/telegraf/telegraf.conf - /var/run/docker.sock:/var/run/docker.sock
telegraf.conf
contains a list of data...