Shipping Logs and Monitoring Containers
In the previous chapter, we introduced the Docker Compose tool. We learned that this tool is mostly used to run and scale multi-service applications on a single Docker host. Typically, developers and CI servers work with single hosts and they are the main users of Docker Compose. We saw that the tool uses YAML files as input, which contain the description of the application in a declarative way. We investigated many useful tasks the tool can be used for, such as building and pushing images, to just name the most important ones.
This chapter discusses why logging and monitoring are so important and shows how container logs can be collected and shipped to a central location where the aggregated log can then be parsed for useful information.
You will also learn how to instrument an application so that it exposes metrics and how those metrics can be scraped and shipped again to a central location. Finally, you will learn how to convert those...