Introducing "" Monitoring Tool "" for monitoring Docker

image.png

The data can be very powerful and useful in all its forms. The data collected always provides incredible insights to help you make decisions for optimization, failure awareness / tolerance, and the development of new features. These data can come from a business, a set of software applications, or a container.

Containers have become an integral part of modern software architectures, allowing databases, parts of applications, and even entire applications to be hosted in a self-contained environment independent of the host server. Therefore, proper monitoring of a container is absolutely essential to keep the container-hosted applications healthy and efficient.

Today, Docker is the dominant force in the container world, accounting for more than 83% of all containers in production in 2018. Due to its popularity, Docker container monitoring can result in selection issues due to the variety of tools available. Choose from them, each with its own strengths and weaknesses.

For many use cases, MetricFire is a great option for monitoring Docker containers. I will. MetricFire is a platform that offers hosted versions of Graphite, Prometheus, and Grafana. Built on these open source tools, MetricFire is highly customizable and provides agile tools that are well known throughout the DevOps and SRE communities. Moreover, the price is reasonable. Book a demo for free here at MetricFire (https://www.metricfire.com/demo-japan/?utm_source=blog&utm_medium=Qiita&utm_campaign=Japan&utm_content=Docker%20Monitoring%20Tools) and start monitoring Docker containers today Please contact us if you have any questions or needs to do so.

The purpose of this article is to provide details on popular Docker monitoring tools, along with ways to help you determine the best tool with use cases.

MetricFire Built on the open source Prometheus, Graphite, and Grafana, MetricFire is ready to instantly monitor your Docker container with default dashboards and plugins available. MetricFire is basically a service that provides a hosted version of an open source project, so MetricFire can do basically everything an open source project can do. It includes all adaptations and plugins developed throughout the community.

image.png

MetricFire is integrated with cAdvisor, Prometheus and Kubernetes to monitor Docker containers. It has become the ultimate tool for. As a result of the large community of followers behind open source tools, the technology behind MetricFire is also constantly being developed and evolved.

So if you choose MetricFire as your Docker monitoring tool, you don't have to worry about your monitoring technology becoming obsolete due to the rapid development of Docker and Kubernetes.

MetricFire has a 14-day free trial, so first book a free demo Please contact us about your use case.

Docker CLI(docker stats) Let's take a look at the dockerstats command, which is a monitoring tool provided by docker itself. Running this command in the terminal returns a live data stream to run the container and provides basic metrics that cover the container's resource consumption.

These metrics include container ID, CPU, memory, and network usage for the various running containers that exist. If you want to list the metrics for a single container instead of all running containers, just add the container ID for that container at the end of the command. Here is an example:

image.png

In the above example, we are fetching the metric only for the container whose container ID is fb649db2dc20. Use the --no-stream option to disable streaming statistics so that only the first result is pulled.

If you run this command without that flag, these metrics will continue to be polled and displayed until you manually stop the process. Other useful flags for this command can be found in the docker documentation.

However, the docker stats command does not support any form of data visualization. Just display the metric as raw data in the terminal. This helps you see the status and status of your container at a glance, but it's not very valuable in situations where you need detailed monitoring or a visual monitoring dashboard. Grafana is recommended for long-term monitoring with good visualization.

cAdvisor cAdvisor is an open source container monitoring tool managed by Google. With built-in support for Docker, or literally other types of containers, you can use cAdvisor to collect data about virtually any type of running container. It consists of a single execution daemon that collects, processes, aggregates, and exports information about running containers.

This information can be exported from the built-in user interface for viewing, or exported to a larger monitoring platform for analysis and visualization. However, while cAdvisor collects a large amount of metrics in the container it monitors, it only displays general data about certain aspects of container performance, such as memory and CPU utilization, which limits the web user interface considerably. I am. The following is an example of the cAdvisor dashboard.

image.png

Use the storage plugin to access these metrics in order to access the detailed metrics that cAdvisor collects. You can export to a larger monitoring or storage system and process from there. For more information on how to use cAdvisor to monitor Docker containers, see this article (https://qiita.com/TomoEndo/items/4aa2d9889c49148a3d7f). Also consider integrating cAdvisor with MetricFire. This gives you the best of both worlds.

Prometheus Prometheus is a very popular open source monitoring and warning system. Unlike most monitoring tools that use a push-based mechanism to collect metrics (the agent on the monitored container collects and sends the metrics), Prometheus uses a pull-based mechanism (polling).

In a pull-based system, the container / server exposes metric endpoints to Prometheus, and Prometheus retrieves metric data from these endpoints at configurable intervals.

Prometheus then processes and aggregates this data and uses the Built-in Expression Browser (https://www.metricfire.com/blog/prometheus-dashboards) to view the data or [Grafana]. Enables visualization tools such as (https://www.metricfire.com/blog/grafana-dashboards-from-basic-to-advanced) to build insightful dashboards.

Prometheus offers a large number of client libraries that, in combination with polling mechanisms, enable a wide variety of client-side integrations.

Basically, all you need to do to bring metrics into Prometheus is to use the appropriate client libraries in your application code and define and publish these metrics using HTTP endpoints on your application instance (client library). Metrics created using are called custom metrics).

A complete tutorial can be found here, including an example of importing Redis DB metrics into Prometheus. Prometheus can scrape these metrics and visualize them using an expression browser or a visualizer such as Grafana. Below is an example of the Prometheus Expression Browser.

image.png

You can use these client libraries to monitor applications running inside a Docker container by including the appropriate libraries and publishing the custom metrics you want to publish, but you can use these libraries to: You can't get the metrics for a Docker container like this. For example, container CPU or memory usage.

This was possible using a container exporter that exports Docker container metrics directly to Prometheus. However, the container exporter methods have been deprecated and you can now use cAdvisor to monitor container metrics and expose them to Prometheus as described above.

Choosing Prometheus comes with the trade-off of having to do a lot of configuration and maintenance. If you want to prioritize easy, ready-to-use Prometheus instances and skip these configuration and maintenance bottlenecks, the Prometheus managed tool Hosted Prometheus from MetricFire Free Demo. Sign up for .com / demo-japan /? Utm_source = blog & utm_medium = Qiita & utm_campaign = Japan & utm_content = Docker% 20Monitoring% 20Tools) and talk directly with your team.

Summary

Given the containerized architecture and the general popularity of Docker, there are several other monitoring options. These include Datadog, Sysdig, SolarWinds, NewRelic and SignalFx.

Each has its strengths and weaknesses, and its architecture is different. Some are agent-based and some are cloud-hosted. Choosing from a large number of options can be difficult, but which one you choose depends largely on your use case or your ultimate goal.

If you need help making a decision, contact MetricFire by booking a demo (https://www.metricfire.com/demo-japan/?utm_source=blog&utm_medium=Qiita&utm_campaign=Japan&utm_content=Docker%20Monitoring%20Tools) please. We are monitoring experts and are there to guide you towards the best monitoring settings for you. Happy monitoring!

Recommended Posts

Introducing "" Monitoring Tool "" for monitoring Docker
[For newcomers] Introducing JUnit
CI / CD Docker container monitoring
Install docker, docker-compose for debin10
Environment construction with Docker for beginners
[Folio LSP] Roughly Docker (for beginners)
Jupyter's Docker environment for running TensorFlow
Docker execution memo summarized for myself
[WIP] Use NFS for Docker Volume
[Docker] Unsupported config option for services.app:'node'
docker single container restart for myself
Docker For Mac Slow: Countermeasure II
Docker related commands (notes for yourself)