{"id":14678,"date":"2016-09-16T13:51:19","date_gmt":"2016-09-16T10:51:19","guid":{"rendered":"https:\/\/www.webcodegeeks.com\/?p=14678"},"modified":"2016-09-15T14:07:59","modified_gmt":"2016-09-15T11:07:59","slug":"monitoring-docker-containers-elasticsearch-cadvisor","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/","title":{"rendered":"Monitoring Docker Containers with Elasticsearch and cAdvisor"},"content":{"rendered":"<p>If you\u2019re running a Swarm Mode cluster or even a single Docker engine, you\u2019ll end up asking this question:<\/p>\n<p>How do I keep track of all that\u2019s happening?<\/p>\n<p>The answer is \u201cnot easily.\u201d<\/p>\n<p>You need a few things to have a complete overview of stuff like:<\/p>\n<ol>\n<li>Number and status of containers<\/li>\n<li>If, where, and when a container has been moved to another node<\/li>\n<li>Number of containers on a given node<\/li>\n<li>Traffic peaks at a given time<\/li>\n<li>Orphan volumes and networks<\/li>\n<li>Free disk space, free inodes<\/li>\n<li>Number of containers against number of veths attached to the <code>docker0<\/code> and <code>docker_gwbridge<\/code> bridges<\/li>\n<li>Up and down Swarm nodes<\/li>\n<li>Centralize logs<\/li>\n<\/ol>\n<p>The goal of this post is to demonstrate the use of <a href=\"https:\/\/github.com\/elastic\/elasticsearch\">Elasticsearch<\/a> + <a href=\"https:\/\/github.com\/elastic\/kibana\">Kibana<\/a> + <a href=\"https:\/\/github.com\/google\/cadvisor\">cAdvisor<\/a> as tools to analyze and gather metrics and visualize dashboards for Docker containers.<\/p>\n<p>Later on in this post, you can find a dashboard trying to address a few points from the previous list. There are also points that can\u2019t be addressed by simply using cAdvisor, like the status of Swarm Mode nodes.<\/p>\n<p>Also, if you have specific needs that aren\u2019t covered by cAdvisor or another tool, I encourage you to write your own data collector and data shipper (<em>e.g.<\/em>, <a href=\"https:\/\/github.com\/elastic\/beats\">Beats<\/a>). Note that I won\u2019t be showing you how to centralize Docker containers log on Elasticsearch.<\/p>\n<h2>Why Do We Need to Monitor Containers?<\/h2>\n<p>Imagine yourself in the classic situation of managing a virtual machine, either just one or several. You are a <strong>tmux hero<\/strong>, so you have your sessions preconfigured to do basically everything, monitoring included. There\u2019s a problem in production? You just do a <code>top<\/code>, <code>htop<\/code>, <code>iotop<\/code>, <code>jnettop<\/code>, <code>whatevertop<\/code> on all your machines, and you\u2019re ready for troubleshooting!<\/p>\n<p>Now imagine that you have the same three nodes but split into 50 containers. You need some history displayed nicely in a single place where you can perform queries to know what happened instead of just risking your life in front of those ncurses tools.<\/p>\n<h2>What Is the Elastic Stack?<\/h2>\n<p>The Elastic Stack is a set of tools composed of:<\/p>\n<ul>\n<li>Elasticsearch<\/li>\n<li>Kibana<\/li>\n<li>Logstash<\/li>\n<li>Beats<\/li>\n<\/ul>\n<p>We\u2019re going to use a few open-source tools from the Elastic Stack, such as Elasticsearch for the JSON-based analytics engine and Kibana to visualize data and create dashboards.<\/p>\n<p>Another important piece of the Elastic Stack is <a href=\"https:\/\/www.elastic.co\/products\/beats\">Beats<\/a>, but in this post, we\u2019re focused on containers. There\u2019s no official Beat for Docker, so we\u2019ll just use <strong>cAdvisor<\/strong> that can natively talk with Elasticsearch.<\/p>\n<p><a href=\"https:\/\/github.com\/google\/cadvisor\">cAdvisor<\/a> is a tool that collects, aggregates, and exports metrics about running containers. In our case, those metrics are being exported to an Elasticsearch storage.<\/p>\n<p>Two cool facts about cAdvisor are:<\/p>\n<ul>\n<li>It\u2019s not limited to Docker containers.<\/li>\n<li>It has its own webserver with a simple dashboard to visualize gathered metrics for the current node.<\/li>\n<\/ul>\n<h2>Set Up a Test Cluster or BYOI<\/h2>\n<p>As I did in my <a href=\"https:\/\/blog.codeship.com\/nginx-reverse-proxy-docker-swarm-clusters\/\">previous<\/a> <a href=\"https:\/\/blog.codeship.com\/distributed-data-analysis-with-docker-swarm\/\">posts<\/a>, my habit is to provide a small script to allow the reader to set up a test environment on which to try out my project\u2019s steps in no time. So you can use the following <strong>not-for-production-use<\/strong> script to set up a little Swarm Mode cluster with Elasticsearch running as a container.<\/p>\n<p>If you have enough time\/experience, you can <strong>BYOI<\/strong> (Bring Your Own Infrastructure).<\/p>\n<p>To follow this post, you\u2019ll just need:<\/p>\n<ul>\n<li>One or more nodes running the Docker daemon &gt;= 1.12<\/li>\n<li>At least a stand-alone Elasticsearch node 2.4.X<\/li>\n<\/ul>\n<p>Again, note that this post <strong>is not<\/strong> about setting up a production-ready Elasticsearch cluster. A single node cluster is not recommended for production. So if you\u2019re planning a production installation, please refer to <a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/guide\/2.x\/deploy.html\">Elastic guidelines<\/a>.<\/p>\n<h3>A friendly note for early adopters<\/h3>\n<p>I\u2019m usually an early adopter (and I\u2019m already using the latest alpha version in production, of course). But for this post, I chose not to use the latest Elasticsearch 5.0.0 alpha. Their roadmap is not perfectly clear to me, and I don\u2019t want be the root cause of your problems!<\/p>\n<p>So the Elasticsearch reference version for this post is the latest stable version, <a href=\"https:\/\/github.com\/elastic\/elasticsearch\/releases\/tag\/v2.4.0\">2.4.0<\/a> at the moment of writing.<\/p>\n<h3>Test cluster setup script<\/h3>\n<p>As said, I wanted to provide this script for everyone who would like to follow the blog without having to figure out how to create a Swarm cluster and install an Elasticsearch. Of course, you can skip this if you choose to use your own Swarm Mode engines and your own Elasticsearch nodes.<\/p>\n<p>To execute the setup script, you\u2019ll need:<\/p>\n<ul>\n<li><strong><a href=\"https:\/\/docs.docker.com\/machine\/install-machine\/\">Docker Machine \u2013 latest version<\/a><\/strong>: to provision Docker engines on DigitalOcean<\/li>\n<li><strong><a href=\"https:\/\/cloud.digitalocean.com\/settings\/api\/tokens\/new\">DigitalOcean API Token<\/a><\/strong>: to allow <code>docker-machine<\/code> to start nodes on your behalf<\/li>\n<\/ul>\n<h2>Create Cluster Script<\/h2>\n<p>Now that you have everything we need, you can copy the following script in a file named <code>create-cluster.sh<\/code>:<\/p>\n<pre class=\" brush:php\">#!\/usr\/bin\/env bash\r\n#\r\n# Create a Swarm Mode cluster with a single master and a configurable number of workers\r\n\r\nworkers=${WORKERS:-\"worker1 worker2\"}\r\n\r\n#######################################\r\n# Creates a machine on Digital Ocean\r\n# Globals:\r\n#   DO_ACCESS_TOKEN The token needed to access DigitalOcean's API\r\n# Arguments:\r\n#   $1 the actual name to give to the machine\r\n#######################################\r\ncreate_machine() {\r\n  docker-machine create \\\r\n    -d digitalocean \\\r\n    --digitalocean-access-token=$DO_ACCESS_TOKEN \\\r\n    --digitalocean-size 2gb \\\r\n    $1\r\n}\r\n\r\n#######################################\r\n# Executes a command on the specified machine\r\n# Arguments:\r\n#   $1     The machine on which to run the command\r\n#   $2..$n The command to execute on that machine\r\n#######################################\r\nmachine_do() {\r\n  docker-machine ssh $@\r\n}\r\n\r\nmain() {\r\n\r\n  if [ -z \"$DO_ACCESS_TOKEN\" ]; then\r\n    echo \"Please export a DigitalOcean Access token: https:\/\/cloud.digitalocean.com\/settings\/api\/tokens\/new\"\r\n    echo \"export DO_ACCESS_TOKEN=&lt;yourtokenhere&gt;\"\r\n    exit 1\r\n  fi\r\n\r\n  if [ -z \"$WORKERS\" ]; then\r\n    echo \"You haven't provided your workers by setting the \\$WORKERS environment variable, using the default ones: $workers\"\r\n  fi\r\n\r\n  # Create the first and only master\r\n  echo \"Creating the master\"\r\n\r\n  create_machine master1\r\n\r\n  master_ip=$(docker-machine ip master1)\r\n\r\n  # Initialize the swarm mode on it\r\n  echo \"Initializing the swarm mode\"\r\n  machine_do master1 docker swarm init --advertise-addr $master_ip\r\n\r\n  # Obtain the token to allow workers to join\r\n  worker_tkn=$(machine_do master1 docker swarm join-token -q worker)\r\n  echo \"Worker token: ${worker_tkn}\"\r\n\r\n  # Create and join the workers\r\n  for worker in $workers; do\r\n    echo \"Creating worker ${worker}\"\r\n    create_machine $worker\r\n    machine_do $worker docker swarm join --token $worker_tkn $master_ip:2377\r\n  done\r\n}\r\n\r\nmain $@<\/pre>\n<p>And make it executable:<\/p>\n<pre class=\" brush:php\">chmod +x create-cluster.sh<\/pre>\n<h3>Create the cluster<\/h3>\n<p>As the name suggests, we\u2019ll use the script to create the cluster. By default, the script will create a cluster with a single master and two workers. If you want to configure the number of workers, you can do that by setting the <code>WORKERS<\/code> environment variable.<\/p>\n<p>Now, let\u2019s create that cluster!<\/p>\n<pre class=\" brush:php\">.\/create-cluster.sh<\/pre>\n<p>Ok, now you can go out for a coffee. This will take a while.<\/p>\n<p>Finally the cluster is ready!<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/cluster.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-14703\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/cluster.png\" alt=\"cluster\" width=\"1033\" height=\"517\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/cluster.png 1033w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/cluster-300x150.png 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/cluster-768x384.png 768w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/cluster-1024x512.png 1024w\" sizes=\"(max-width: 1033px) 100vw, 1033px\" \/><\/a><\/p>\n<p>Now, to verify that our Swarm Mode cluster is up and running, we can SSH into the master:<\/p>\n<p><code>docker-machine ssh master1<\/code><\/p>\n<p>and we can list the nodes in the cluster:<\/p>\n<pre class=\" brush:php\">docker node ls<\/pre>\n<pre class=\" brush:php\">ID                           HOSTNAME  STATUS  AVAILABILITY  MANAGER STATUS\r\n26fi3wiqr8lsidkjy69k031w2 *  master1   Ready   Active        Leader\r\ndyluxpq8sztj7kmwlzs51u4id    worker2   Ready   Active\r\nepglndegvixag0jztarn2lte8    worker1   Ready   Active<\/pre>\n<h3>Install Elasticsearch and Kibana<\/h3>\n<p>Note that from now on, all the commands are intended to be executed against a master node (master1).<\/p>\n<p>In a production environment, you\u2019ll probably want to install Elasticsearch and Kibana on a separate set of instances with <a href=\"https:\/\/www.elastic.co\/blog\/found-sizing-elasticsearch\">proper sizing<\/a>. In this case, we\u2019re just going to install them as containers in the same Swarm Mode cluster.<\/p>\n<p>In order to connect Elasticsearch with Kibana and cAdvisor, we need to create a custom network. Since we\u2019re in a cluster and the containers may be in different nodes, our network will use the <a href=\"https:\/\/docs.docker.com\/engine\/userguide\/networking\/get-started-overlay\/\">overlay<\/a> driver.<\/p>\n<p>You might be asking yourself, \u201cWhy do I need a network? Aren\u2019t links enough?\u201d Please consider that since the introduction of <em>user defined networks<\/em>, links are considered a <strong>legacy feature<\/strong>.<\/p>\n<p>From the <a href=\"https:\/\/docs.docker.com\/engine\/userguide\/networking\/default_network\/dockerlinks\/\">documentation<\/a>:<\/p>\n<p>Before the Docker networks feature, you could use the Docker link feature to allow containers to discover each other and securely transfer information about one container to another container. With the introduction of the Docker networks feature, you can still create links, but they behave differently between default bridge network and user defined networks.<\/p>\n<p>So let\u2019s create an overlay network named <code>monitoring<\/code>:<\/p>\n<pre class=\" brush:php\">docker network create monitoring -d overlay<\/pre>\n<h2>Elasticsearch container<\/h2>\n<pre class=\" brush:php\">docker service create --network=monitoring \\\r\n  --mount type=volume,target=\/usr\/share\/elasticsearch\/data \\\r\n  --constraint node.hostname==worker1 \\\r\n  --name elasticsearch elasticsearch:2.4.0<\/pre>\n<p>Note that the Elasticsearch container is constrained to the <code>worker1<\/code> node. This is because it depends on the host where it\u2019s running for mounted volumes.<\/p>\n<h2>Kibana container<\/h2>\n<pre class=\" brush:php\">docker service create --network=monitoring --name kibana -e ELASTICSEARCH_URL=\"http:\/\/elasticsearch:9200\" -p 5601:5601 kibana:4.6.0<\/pre>\n<p>As you can see, we started both containers telling them to join the <code>monitoring<\/code> network so the <code>elasticsearch<\/code> container can be accessed by its name from the services in the same network like Kibana.<\/p>\n<p>Now, thanks to the <a href=\"https:\/\/docs.docker.com\/engine\/swarm\/ingress\/\">routing mesh<\/a>, we can point our browser to any IP address of one of our machines and see the Kibana dashboard status page.<\/p>\n<p>To get the public IP of the <code>master1<\/code> instance:<\/p>\n<pre class=\" brush:php\">docker-machine ip master1<\/pre>\n<p>Open your favorite browser and point it to: <code>http:\/\/[master1-ip-address]:5601\/status<\/code><\/p>\n<p>Everything should be green, like this:<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/kibana-screenshot.png\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-14704\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/kibana-screenshot-1024x576.png\" alt=\"kibana-screenshot\" width=\"620\" height=\"349\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/kibana-screenshot-1024x576.png 1024w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/kibana-screenshot-300x169.png 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/kibana-screenshot-768x432.png 768w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>Let\u2019s go on and start collecting telemetries!<\/p>\n<h2>Collect Metrics on Running Containers<\/h2>\n<p>To start gathering metrics on running containers, we\u2019ll create a service running cAdvisor in <strong>global mode<\/strong> so that the scheduler can place one task on each available node.<\/p>\n<p>This service has to be started in the same network of Elasticsearch so that it can push metrics to it.<\/p>\n<pre class=\" brush:php\">docker service create --network=monitoring --mode global --name cadvisor \\\r\n  --mount type=bind,source=\/,target=\/rootfs,readonly=true \\\r\n  --mount type=bind,source=\/var\/run,target=\/var\/run,readonly=false \\\r\n  --mount type=bind,source=\/sys,target=\/sys,readonly=true \\\r\n  --mount type=bind,source=\/var\/lib\/docker\/,target=\/var\/lib\/docker,readonly=true \\\r\n  google\/cadvisor:latest \\\r\n  -storage_driver=elasticsearch \\\r\n  -storage_driver_es_host=\"http:\/\/elasticsearch:9200\"<\/pre>\n<p>Note: If you want to configure cAdvisor options, here\u2019s the <a href=\"https:\/\/github.com\/google\/cadvisor\/blob\/master\/docs\/runtime_options.md\">reference<\/a>.<\/p>\n<p>Okay, now that cAdvisor is sending metrics to Elasticsearch, we can define how we want to explore that data in Kibana by declaring an <strong>index pattern<\/strong>. We can do this in one of two ways: via Kibana OR via API. We\u2019ll do that the API way of course!<\/p>\n<p>You have to execute the index creation command in a running container attached to the <code>monitoring<\/code> network. You can get a shell in the <code>cAdvisor<\/code> container. Unfortunately Swarm Mode appends a unique id to the name of containers when started as services, so you have to figure out by yourself the name of the <code>cadvisor<\/code> container.<\/p>\n<p>Get a shell:<\/p>\n<pre class=\" brush:php\">docker exec -ti &lt;cadvisor-container-name&gt; sh<\/pre>\n<p>Create the index:<\/p>\n<pre class=\" brush:php\">curl -XPUT http:\/\/elasticsearch:9200\/.kibana\/index-pattern\/cadvisor -d '{\"title\" : \"cadvisor*\",  \"timeFieldName\": \"container_stats.timestamp\"}'<\/pre>\n<p>And if you\u2019re too lazy, here\u2019s a one-liner:<\/p>\n<pre class=\" brush:php\">docker exec $(docker ps | grep cadvisor | awk '{print $1}' | head -1) curl -XPUT http:\/\/elasticsearch:9200\/.kibana\/index-pattern\/cadvisor -d '{\"title\" : \"cadvisor*\",  \"timeFieldName\": \"container_stats.timestamp\"}'<\/pre>\n<h2>Putting The Pieces Together in a Dashboard<\/h2>\n<p>Cool! Now you can go and play with Kibana to create nice visualizations of the gathered metrics. But don\u2019t worry. If you\u2019re on the fast lane, I created a dashboard and a few visualizations for you as a starting point.<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/dashboard.png\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-14705\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/dashboard-1024x565.png\" alt=\"dashboard\" width=\"620\" height=\"342\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/dashboard-1024x565.png 1024w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/dashboard-300x165.png 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/dashboard-768x424.png 768w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/09\/dashboard.png 1855w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>To import my settings, visit your Kibana dashboard and go to <code>Settings =&gt; Objects =&gt; Import<\/code>, then select the file where you saved the following JSON:<\/p>\n<pre class=\" brush:php; wrap-lines:false\">[\r\n  {\r\n    \"_id\": \"cAdvisor\",\r\n    \"_type\": \"dashboard\",\r\n    \"_source\": {\r\n      \"title\": \"cAdvisor\",\r\n      \"hits\": 0,\r\n      \"description\": \"\",\r\n      \"panelsJSON\": \"[{\\\"id\\\":\\\"Filesystem-usage\\\",\\\"type\\\":\\\"visualization\\\",\\\"panelIndex\\\":1,\\\"size_x\\\":6,\\\"size_y\\\":3,\\\"col\\\":1,\\\"row\\\":1},{\\\"id\\\":\\\"Memory-[Node-equal-&gt;Container]\\\",\\\"type\\\":\\\"visualization\\\",\\\"panelIndex\\\":2,\\\"size_x\\\":6,\\\"size_y\\\":4,\\\"col\\\":7,\\\"row\\\":4},{\\\"id\\\":\\\"memory-usage-by-machine\\\",\\\"type\\\":\\\"visualization\\\",\\\"panelIndex\\\":3,\\\"size_x\\\":6,\\\"size_y\\\":6,\\\"col\\\":1,\\\"row\\\":4},{\\\"id\\\":\\\"CPU-Total-Usage\\\",\\\"type\\\":\\\"visualization\\\",\\\"panelIndex\\\":4,\\\"size_x\\\":6,\\\"size_y\\\":5,\\\"col\\\":7,\\\"row\\\":8},{\\\"id\\\":\\\"Network-RX-TX\\\",\\\"type\\\":\\\"visualization\\\",\\\"panelIndex\\\":5,\\\"size_x\\\":6,\\\"size_y\\\":3,\\\"col\\\":7,\\\"row\\\":1}]\",\r\n      \"optionsJSON\": \"{\\\"darkTheme\\\":false}\",\r\n      \"uiStateJSON\": \"{}\",\r\n      \"version\": 1,\r\n      \"timeRestore\": false,\r\n      \"kibanaSavedObjectMeta\": {\r\n        \"searchSourceJSON\": \"{\\\"filter\\\":[{\\\"query\\\":{\\\"query_string\\\":{\\\"query\\\":\\\"*\\\",\\\"analyze_wildcard\\\":true}}}]}\"\r\n      }\r\n    }\r\n  },\r\n  {\r\n    \"_id\": \"Network\",\r\n    \"_type\": \"search\",\r\n    \"_source\": {\r\n      \"title\": \"Network\",\r\n      \"description\": \"\",\r\n      \"hits\": 0,\r\n      \"columns\": [\r\n        \"machine_name\",\r\n        \"container_Name\",\r\n        \"container_stats.network.name\",\r\n        \"container_stats.network.interfaces\",\r\n        \"container_stats.network.rx_bytes\",\r\n        \"container_stats.network.rx_packets\",\r\n        \"container_stats.network.rx_dropped\",\r\n        \"container_stats.network.rx_errors\",\r\n        \"container_stats.network.tx_packets\",\r\n        \"container_stats.network.tx_bytes\",\r\n        \"container_stats.network.tx_dropped\",\r\n        \"container_stats.network.tx_errors\"\r\n      ],\r\n      \"sort\": [\r\n        \"container_stats.timestamp\",\r\n        \"desc\"\r\n      ],\r\n      \"version\": 1,\r\n      \"kibanaSavedObjectMeta\": {\r\n        \"searchSourceJSON\": \"{\\\"index\\\":\\\"cadvisor*\\\",\\\"query\\\":{\\\"query_string\\\":{\\\"analyze_wildcard\\\":true,\\\"query\\\":\\\"*\\\"}},\\\"highlight\\\":{\\\"pre_tags\\\":[\\\"@kibana-highlighted-field@\\\"],\\\"post_tags\\\":[\\\"@\/kibana-highlighted-field@\\\"],\\\"fields\\\":{\\\"*\\\":{}},\\\"fragment_size\\\":2147483647},\\\"filter\\\":[]}\"\r\n      }\r\n    }\r\n  },\r\n  {\r\n    \"_id\": \"Filesystem-usage\",\r\n    \"_type\": \"visualization\",\r\n    \"_source\": {\r\n      \"title\": \"Filesystem usage\",\r\n      \"visState\": \"{\\\"title\\\":\\\"Filesystem usage\\\",\\\"type\\\":\\\"histogram\\\",\\\"params\\\":{\\\"addLegend\\\":true,\\\"addTimeMarker\\\":false,\\\"addTooltip\\\":true,\\\"defaultYExtents\\\":false,\\\"mode\\\":\\\"stacked\\\",\\\"scale\\\":\\\"linear\\\",\\\"setYExtents\\\":false,\\\"shareYAxis\\\":true,\\\"times\\\":[],\\\"yAxis\\\":{}},\\\"aggs\\\":[{\\\"id\\\":\\\"1\\\",\\\"type\\\":\\\"avg\\\",\\\"schema\\\":\\\"metric\\\",\\\"params\\\":{\\\"field\\\":\\\"container_stats.filesystem.usage\\\",\\\"customLabel\\\":\\\"USED\\\"}},{\\\"id\\\":\\\"2\\\",\\\"type\\\":\\\"terms\\\",\\\"schema\\\":\\\"split\\\",\\\"params\\\":{\\\"field\\\":\\\"machine_name\\\",\\\"size\\\":5,\\\"order\\\":\\\"desc\\\",\\\"orderBy\\\":\\\"1\\\",\\\"row\\\":false}},{\\\"id\\\":\\\"3\\\",\\\"type\\\":\\\"avg\\\",\\\"schema\\\":\\\"metric\\\",\\\"params\\\":{\\\"field\\\":\\\"container_stats.filesystem.capacity\\\",\\\"customLabel\\\":\\\"AVAIL\\\"}},{\\\"id\\\":\\\"4\\\",\\\"type\\\":\\\"terms\\\",\\\"schema\\\":\\\"segment\\\",\\\"params\\\":{\\\"field\\\":\\\"container_stats.filesystem.device\\\",\\\"size\\\":5,\\\"order\\\":\\\"desc\\\",\\\"orderBy\\\":\\\"1\\\"}}],\\\"listeners\\\":{}}\",\r\n      \"uiStateJSON\": \"{\\\"vis\\\":{\\\"colors\\\":{\\\"Average container_stats.filesystem.available\\\":\\\"#E24D42\\\",\\\"Average container_stats.filesystem.base_usage\\\":\\\"#890F02\\\",\\\"Average container_stats.filesystem.capacity\\\":\\\"#3F6833\\\",\\\"Average container_stats.filesystem.usage\\\":\\\"#E24D42\\\",\\\"USED\\\":\\\"#BF1B00\\\",\\\"AVAIL\\\":\\\"#508642\\\"}}}\",\r\n      \"description\": \"\",\r\n      \"version\": 1,\r\n      \"kibanaSavedObjectMeta\": {\r\n        \"searchSourceJSON\": \"{\\\"index\\\":\\\"cadvisor*\\\",\\\"query\\\":{\\\"query_string\\\":{\\\"analyze_wildcard\\\":true,\\\"query\\\":\\\"*\\\"}},\\\"filter\\\":[]}\"\r\n      }\r\n    }\r\n  },\r\n  {\r\n    \"_id\": \"CPU-Total-Usage\",\r\n    \"_type\": \"visualization\",\r\n    \"_source\": {\r\n      \"title\": \"CPU Total Usage\",\r\n      \"visState\": \"{\\\"title\\\":\\\"CPU Total Usage\\\",\\\"type\\\":\\\"area\\\",\\\"params\\\":{\\\"shareYAxis\\\":true,\\\"addTooltip\\\":true,\\\"addLegend\\\":true,\\\"smoothLines\\\":false,\\\"scale\\\":\\\"linear\\\",\\\"interpolate\\\":\\\"linear\\\",\\\"mode\\\":\\\"stacked\\\",\\\"times\\\":[],\\\"addTimeMarker\\\":false,\\\"defaultYExtents\\\":false,\\\"setYExtents\\\":false,\\\"yAxis\\\":{}},\\\"aggs\\\":[{\\\"id\\\":\\\"1\\\",\\\"type\\\":\\\"avg\\\",\\\"schema\\\":\\\"metric\\\",\\\"params\\\":{\\\"field\\\":\\\"container_stats.cpu.usage.total\\\"}},{\\\"id\\\":\\\"2\\\",\\\"type\\\":\\\"date_histogram\\\",\\\"schema\\\":\\\"segment\\\",\\\"params\\\":{\\\"field\\\":\\\"container_stats.timestamp\\\",\\\"interval\\\":\\\"auto\\\",\\\"customInterval\\\":\\\"2h\\\",\\\"min_doc_count\\\":1,\\\"extended_bounds\\\":{}}},{\\\"id\\\":\\\"3\\\",\\\"type\\\":\\\"terms\\\",\\\"schema\\\":\\\"group\\\",\\\"params\\\":{\\\"field\\\":\\\"container_Name\\\",\\\"size\\\":5,\\\"order\\\":\\\"desc\\\",\\\"orderBy\\\":\\\"1\\\"}},{\\\"id\\\":\\\"4\\\",\\\"type\\\":\\\"terms\\\",\\\"schema\\\":\\\"split\\\",\\\"params\\\":{\\\"field\\\":\\\"machine_name\\\",\\\"size\\\":5,\\\"order\\\":\\\"desc\\\",\\\"orderBy\\\":\\\"1\\\",\\\"row\\\":true}}],\\\"listeners\\\":{}}\",\r\n      \"uiStateJSON\": \"{}\",\r\n      \"description\": \"\",\r\n      \"version\": 1,\r\n      \"kibanaSavedObjectMeta\": {\r\n        \"searchSourceJSON\": \"{\\\"index\\\":\\\"cadvisor*\\\",\\\"query\\\":{\\\"query_string\\\":{\\\"query\\\":\\\"*\\\",\\\"analyze_wildcard\\\":true}},\\\"filter\\\":[]}\"\r\n      }\r\n    }\r\n  },\r\n  {\r\n    \"_id\": \"memory-usage-by-machine\",\r\n    \"_type\": \"visualization\",\r\n    \"_source\": {\r\n      \"title\": \"Memory [Node]\",\r\n      \"visState\": \"{\\\"title\\\":\\\"Memory [Node]\\\",\\\"type\\\":\\\"area\\\",\\\"params\\\":{\\\"shareYAxis\\\":true,\\\"addTooltip\\\":true,\\\"addLegend\\\":true,\\\"smoothLines\\\":false,\\\"scale\\\":\\\"linear\\\",\\\"interpolate\\\":\\\"linear\\\",\\\"mode\\\":\\\"stacked\\\",\\\"times\\\":[],\\\"addTimeMarker\\\":false,\\\"defaultYExtents\\\":false,\\\"setYExtents\\\":false,\\\"yAxis\\\":{}},\\\"aggs\\\":[{\\\"id\\\":\\\"1\\\",\\\"type\\\":\\\"avg\\\",\\\"schema\\\":\\\"metric\\\",\\\"params\\\":{\\\"field\\\":\\\"container_stats.memory.usage\\\"}},{\\\"id\\\":\\\"2\\\",\\\"type\\\":\\\"date_histogram\\\",\\\"schema\\\":\\\"segment\\\",\\\"params\\\":{\\\"field\\\":\\\"container_stats.timestamp\\\",\\\"interval\\\":\\\"auto\\\",\\\"customInterval\\\":\\\"2h\\\",\\\"min_doc_count\\\":1,\\\"extended_bounds\\\":{}}},{\\\"id\\\":\\\"3\\\",\\\"type\\\":\\\"terms\\\",\\\"schema\\\":\\\"group\\\",\\\"params\\\":{\\\"field\\\":\\\"machine_name\\\",\\\"size\\\":5,\\\"order\\\":\\\"desc\\\",\\\"orderBy\\\":\\\"1\\\"}}],\\\"listeners\\\":{}}\",\r\n      \"uiStateJSON\": \"{}\",\r\n      \"description\": \"\",\r\n      \"version\": 1,\r\n      \"kibanaSavedObjectMeta\": {\r\n        \"searchSourceJSON\": \"{\\\"index\\\":\\\"cadvisor*\\\",\\\"query\\\":{\\\"query_string\\\":{\\\"query\\\":\\\"*\\\",\\\"analyze_wildcard\\\":true}},\\\"filter\\\":[]}\"\r\n      }\r\n    }\r\n  },\r\n  {\r\n    \"_id\": \"Network-RX-TX\",\r\n    \"_type\": \"visualization\",\r\n    \"_source\": {\r\n      \"title\": \"Network RX TX\",\r\n      \"visState\": \"{\\\"title\\\":\\\"Network RX TX\\\",\\\"type\\\":\\\"histogram\\\",\\\"params\\\":{\\\"addLegend\\\":true,\\\"addTimeMarker\\\":true,\\\"addTooltip\\\":true,\\\"defaultYExtents\\\":false,\\\"mode\\\":\\\"stacked\\\",\\\"scale\\\":\\\"linear\\\",\\\"setYExtents\\\":false,\\\"shareYAxis\\\":true,\\\"times\\\":[],\\\"yAxis\\\":{}},\\\"aggs\\\":[{\\\"id\\\":\\\"1\\\",\\\"type\\\":\\\"avg\\\",\\\"schema\\\":\\\"metric\\\",\\\"params\\\":{\\\"field\\\":\\\"container_stats.network.rx_bytes\\\",\\\"customLabel\\\":\\\"RX\\\"}},{\\\"id\\\":\\\"2\\\",\\\"type\\\":\\\"date_histogram\\\",\\\"schema\\\":\\\"segment\\\",\\\"params\\\":{\\\"field\\\":\\\"container_stats.timestamp\\\",\\\"interval\\\":\\\"s\\\",\\\"customInterval\\\":\\\"2h\\\",\\\"min_doc_count\\\":1,\\\"extended_bounds\\\":{}}},{\\\"id\\\":\\\"3\\\",\\\"type\\\":\\\"avg\\\",\\\"schema\\\":\\\"metric\\\",\\\"params\\\":{\\\"field\\\":\\\"container_stats.network.tx_bytes\\\",\\\"customLabel\\\":\\\"TX\\\"}}],\\\"listeners\\\":{}}\",\r\n      \"uiStateJSON\": \"{\\\"vis\\\":{\\\"colors\\\":{\\\"RX\\\":\\\"#EAB839\\\",\\\"TX\\\":\\\"#BF1B00\\\"}}}\",\r\n      \"description\": \"\",\r\n      \"savedSearchId\": \"Network\",\r\n      \"version\": 1,\r\n      \"kibanaSavedObjectMeta\": {\r\n        \"searchSourceJSON\": \"{\\\"filter\\\":[]}\"\r\n      }\r\n    }\r\n  },\r\n  {\r\n    \"_id\": \"Memory-[Node-equal-&gt;Container]\",\r\n    \"_type\": \"visualization\",\r\n    \"_source\": {\r\n      \"title\": \"Memory [Node=&gt;Container]\",\r\n      \"visState\": \"{\\\"title\\\":\\\"Memory [Node=&gt;Container]\\\",\\\"type\\\":\\\"area\\\",\\\"params\\\":{\\\"shareYAxis\\\":true,\\\"addTooltip\\\":true,\\\"addLegend\\\":true,\\\"smoothLines\\\":false,\\\"scale\\\":\\\"linear\\\",\\\"interpolate\\\":\\\"linear\\\",\\\"mode\\\":\\\"stacked\\\",\\\"times\\\":[],\\\"addTimeMarker\\\":false,\\\"defaultYExtents\\\":false,\\\"setYExtents\\\":false,\\\"yAxis\\\":{}},\\\"aggs\\\":[{\\\"id\\\":\\\"1\\\",\\\"type\\\":\\\"avg\\\",\\\"schema\\\":\\\"metric\\\",\\\"params\\\":{\\\"field\\\":\\\"container_stats.memory.usage\\\"}},{\\\"id\\\":\\\"2\\\",\\\"type\\\":\\\"date_histogram\\\",\\\"schema\\\":\\\"segment\\\",\\\"params\\\":{\\\"field\\\":\\\"container_stats.timestamp\\\",\\\"interval\\\":\\\"auto\\\",\\\"customInterval\\\":\\\"2h\\\",\\\"min_doc_count\\\":1,\\\"extended_bounds\\\":{}}},{\\\"id\\\":\\\"3\\\",\\\"type\\\":\\\"terms\\\",\\\"schema\\\":\\\"group\\\",\\\"params\\\":{\\\"field\\\":\\\"container_Name\\\",\\\"size\\\":5,\\\"order\\\":\\\"desc\\\",\\\"orderBy\\\":\\\"1\\\"}},{\\\"id\\\":\\\"4\\\",\\\"type\\\":\\\"terms\\\",\\\"schema\\\":\\\"split\\\",\\\"params\\\":{\\\"field\\\":\\\"machine_name\\\",\\\"size\\\":5,\\\"order\\\":\\\"desc\\\",\\\"orderBy\\\":\\\"1\\\",\\\"row\\\":true}}],\\\"listeners\\\":{}}\",\r\n      \"uiStateJSON\": \"{}\",\r\n      \"description\": \"\",\r\n      \"version\": 1,\r\n      \"kibanaSavedObjectMeta\": {\r\n        \"searchSourceJSON\": \"{\\\"index\\\":\\\"cadvisor*\\\",\\\"query\\\":{\\\"query_string\\\":{\\\"query\\\":\\\"* NOT container_Name.raw: \\\\\\\\\\\\\\\"\/\\\\\\\\\\\\\\\" AND NOT container_Name.raw: \\\\\\\\\\\\\\\"\/docker\\\\\\\\\\\\\\\"\\\",\\\"analyze_wildcard\\\":true}},\\\"filter\\\":[]}\"\r\n      }\r\n    }\r\n  }\r\n]<\/pre>\n<p>There are a lot of fields to play with, so you may want to customize the dashboard to add Memory Page faulting insights or RX\/TX dropped packets for example. Also it would be nice if you can address the missing points from my previous list.<\/p>\n<h2>Conclusion<\/h2>\n<p>Monitoring the right way requires a lot of time and effort. Monitoring CPU, memory, IO, network, and disk of containers is just a drop in the sea.<\/p>\n<p>I don\u2019t know where you are personally in the process, but next steps might be:<\/p>\n<ul>\n<li>Aggregating logs from running containers<\/li>\n<li>Aggregating logs from applications<\/li>\n<li>Application performance monitoring<\/li>\n<li>Alerting<\/li>\n<li>State\/Health check monitoring<\/li>\n<\/ul>\n<p>If you have hints or advice, please share in the comments! Good luck with your setup!<\/p>\n<p>And now, shut down your test infrastructure:<\/p>\n<pre class=\" brush:php\">docker-machine rm master1 worker{1,2}<\/pre>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"https:\/\/blog.codeship.com\/monitoring-docker-containers-with-elasticsearch-and-cadvisor\/\">Monitoring Docker Containers with Elasticsearch and cAdvisor<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/join-us\/wcg\/\">WCG partner<\/a> Florian Motlik at the <a href=\"http:\/\/blog.codeship.com\/\">Codeship Blog<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019re running a Swarm Mode cluster or even a single Docker engine, you\u2019ll end up asking this question: How do I keep track of all that\u2019s happening? The answer is \u201cnot easily.\u201d You need a few things to have a complete overview of stuff like: Number and status of containers If, where, and when &hellip;<\/p>\n","protected":false},"author":81,"featured_media":10356,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[393,217,285],"class_list":["post-14678","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","tag-cadvisor","tag-docker","tag-elasticsearch"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Monitoring Docker Containers with Elasticsearch and cAdvisor - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"If you\u2019re running a Swarm Mode cluster or even a single Docker engine, you\u2019ll end up asking this question: How do I keep track of all that\u2019s happening?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Monitoring Docker Containers with Elasticsearch and cAdvisor - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"If you\u2019re running a Swarm Mode cluster or even a single Docker engine, you\u2019ll end up asking this question: How do I keep track of all that\u2019s happening?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/flomotlik\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-16T10:51:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Florian Motlik\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/flomotlik\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Florian Motlik\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/\"},\"author\":{\"name\":\"Florian Motlik\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/c2ce85ee77a6cb5f80143c1f88bb8d10\"},\"headline\":\"Monitoring Docker Containers with Elasticsearch and cAdvisor\",\"datePublished\":\"2016-09-16T10:51:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/\"},\"wordCount\":1613,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"keywords\":[\"cAdvisor\",\"Docker\",\"Elasticsearch\"],\"articleSection\":[\"Web Dev\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/\",\"name\":\"Monitoring Docker Containers with Elasticsearch and cAdvisor - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"datePublished\":\"2016-09-16T10:51:19+00:00\",\"description\":\"If you\u2019re running a Swarm Mode cluster or even a single Docker engine, you\u2019ll end up asking this question: How do I keep track of all that\u2019s happening?\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Dev\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/web-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Monitoring Docker Containers with Elasticsearch and cAdvisor\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/c2ce85ee77a6cb5f80143c1f88bb8d10\",\"name\":\"Florian Motlik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d325d3a5660b2d2b2b433ebbe06cac2210d8d0e5083c7998b4ca07cc24d7cf3e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d325d3a5660b2d2b2b433ebbe06cac2210d8d0e5083c7998b4ca07cc24d7cf3e?s=96&d=mm&r=g\",\"caption\":\"Florian Motlik\"},\"sameAs\":[\"http:\/\/blog.codeship.com\/\",\"https:\/\/www.facebook.com\/flomotlik\",\"http:\/\/at.linkedin.com\/in\/florianmotlik\",\"https:\/\/x.com\/http:\/\/twitter.com\/flomotlik\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/florian-motlik\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Monitoring Docker Containers with Elasticsearch and cAdvisor - Web Code Geeks - 2026","description":"If you\u2019re running a Swarm Mode cluster or even a single Docker engine, you\u2019ll end up asking this question: How do I keep track of all that\u2019s happening?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/","og_locale":"en_US","og_type":"article","og_title":"Monitoring Docker Containers with Elasticsearch and cAdvisor - Web Code Geeks - 2026","og_description":"If you\u2019re running a Swarm Mode cluster or even a single Docker engine, you\u2019ll end up asking this question: How do I keep track of all that\u2019s happening?","og_url":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/flomotlik","article_published_time":"2016-09-16T10:51:19+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","type":"image\/jpeg"}],"author":"Florian Motlik","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/flomotlik","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Florian Motlik","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/"},"author":{"name":"Florian Motlik","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/c2ce85ee77a6cb5f80143c1f88bb8d10"},"headline":"Monitoring Docker Containers with Elasticsearch and cAdvisor","datePublished":"2016-09-16T10:51:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/"},"wordCount":1613,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","keywords":["cAdvisor","Docker","Elasticsearch"],"articleSection":["Web Dev"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/","url":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/","name":"Monitoring Docker Containers with Elasticsearch and cAdvisor - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","datePublished":"2016-09-16T10:51:19+00:00","description":"If you\u2019re running a Swarm Mode cluster or even a single Docker engine, you\u2019ll end up asking this question: How do I keep track of all that\u2019s happening?","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/web-development\/monitoring-docker-containers-elasticsearch-cadvisor\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Dev","item":"https:\/\/www.webcodegeeks.com\/category\/web-development\/"},{"@type":"ListItem","position":3,"name":"Monitoring Docker Containers with Elasticsearch and cAdvisor"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/c2ce85ee77a6cb5f80143c1f88bb8d10","name":"Florian Motlik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d325d3a5660b2d2b2b433ebbe06cac2210d8d0e5083c7998b4ca07cc24d7cf3e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d325d3a5660b2d2b2b433ebbe06cac2210d8d0e5083c7998b4ca07cc24d7cf3e?s=96&d=mm&r=g","caption":"Florian Motlik"},"sameAs":["http:\/\/blog.codeship.com\/","https:\/\/www.facebook.com\/flomotlik","http:\/\/at.linkedin.com\/in\/florianmotlik","https:\/\/x.com\/http:\/\/twitter.com\/flomotlik"],"url":"https:\/\/www.webcodegeeks.com\/author\/florian-motlik\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/14678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=14678"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/14678\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/10356"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=14678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=14678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=14678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}