<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Soham Mohite on Medium]]></title>
        <description><![CDATA[Stories by Soham Mohite on Medium]]></description>
        <link>https://medium.com/@sohammohite?source=rss-80b75bb98338------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*v1waf3N1iURSglOFNW1qxw.jpeg</url>
            <title>Stories by Soham Mohite on Medium</title>
            <link>https://medium.com/@sohammohite?source=rss-80b75bb98338------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 03:49:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sohammohite/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Docker Container Monitoring with cAdvisor, Prometheus, and Grafana using Docker Compose]]></title>
            <link>https://medium.com/@sohammohite/docker-container-monitoring-with-cadvisor-prometheus-and-grafana-using-docker-compose-b47ec78efbc?source=rss-80b75bb98338------2</link>
            <guid isPermaLink="false">https://medium.com/p/b47ec78efbc</guid>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[prometheus]]></category>
            <dc:creator><![CDATA[Soham Mohite]]></dc:creator>
            <pubDate>Thu, 10 Aug 2023 14:31:57 GMT</pubDate>
            <atom:updated>2023-08-10T14:31:57.962Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog post, we will explore Docker container monitoring and learn how to set up a complete Docker container monitoring solution with cAdvisor, Prometheus, and Grafana using Docker Compose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0u34lk-gl4o66m0M12LpQQ.png" /></figure><p><strong>Docker</strong><br>Docker is an open-source platform that enables you to automate application deployment, scaling, and management with containerization. It provides a way to package an application with all of its dependencies into a standardized unit called a container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G6-BsAOoNx1rt4GO" /><figcaption>Photo by <a href="https://unsplash.com/@carrier_lost?utm_source=medium&amp;utm_medium=referral">Ian Taylor</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A <strong>container</strong> is a lightweight, isolated environment that contains everything needed to run an application, including the code, runtime, system tools, and libraries.</p><p><strong>Docker Compose</strong> is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.</p><p>Install the Compose plugin: <a href="https://docs.docker.com/compose/install/linux">https://docs.docker.com/compose/install/linux/</a></p><p><strong>Container monitoring</strong> typically involves collecting and analyzing metrics such as CPU usage, memory consumption, disk I/O, network traffic, container uptime, and application-specific metrics.</p><p>In this article, we will cover docker container monitoring by using cAdvisor, Prometheus, and Grafana.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tLaFWxgkVNfYbN3NTKQo-w.gif" /></figure><p><strong>cAdvisor</strong><br>cAdvisor, short for Container Advisor, is an open-source monitoring and performance analysis tool specifically designed for Docker containers and other containerization platforms. It is a running daemon that collects, aggregates, processes, and exports information about running containers.</p><p><strong>Prometheus</strong><br>Prometheus is a free and open-source tool that helps keep an eye on your software systems, ensuring they are healthy and performing well. It collects important data about your applications and services, like how much they’re being used or if they’re running smoothly. If there’s a problem, Prometheus can raise alerts to let you know, so you can fix things before they become serious issues.</p><p><strong>Grafana</strong><br>Grafana is a user-friendly and open-source data visualization tool that helps you to turn complex data into easy-to-understand charts and graphs. It connects to various data sources, like databases or monitoring systems, and allows you to create interactive dashboards. With Grafana, you can visualize trends, track performance, and monitor the health of your applications or systems, making it easier to make informed decisions and spot potential problems quickly.</p><p>Here is a look at the file structure and docker-compose with all the configuration files.</p><p><strong>File Structure</strong></p><pre>dir/<br> |- prometheus.yml<br> |- datasources.yml<br> |- docker-compose.yml<br> |- dashboard.json<br> |- default.yaml</pre><p>The configuration files are added so a user does not have to do any configuration to set up Prometheus scrap configuration, Grafana datasources and dashboards.</p><p><strong>Configuration Files</strong></p><p><a href="https://github.com/sohammohite/container-monitoring/blob/main/prometheus.yml">prometheus.yml</a> <a href="https://github.com/sohammohite/container-monitoring/blob/main/datasources.yml">datasources.yml</a> <a href="https://github.com/sohammohite/container-monitoring/blob/main/dashboard.json">dashboard.json</a> <a href="https://github.com/sohammohite/container-monitoring/blob/main/default.yaml">default.yaml</a></p><p><strong>docker-compose.yml</strong></p><pre>version: &quot;3&quot;<br>services:<br>  cadvisor:<br>    container_name: cadvisor<br>    image: gcr.io/cadvisor/cadvisor:latest<br>    network_mode: &quot;host&quot;<br>    ports:<br>      - &quot;8080:8080&quot;<br>    volumes: <br>      - &quot;/:/rootfs&quot;<br>      - &quot;/var/run:/var/run&quot;<br>      - &quot;/sys:/sys&quot;<br>      - &quot;/var/lib/docker/:/var/lib/docker&quot;<br>      - &quot;/dev/disk/:/dev/disk&quot;<br>    privileged: true<br>    devices: <br>      - &quot;/dev/kmsg&quot;<br><br>  prometheus:<br>    container_name: prometheus<br>    image: prom/prometheus:latest<br>    network_mode: &quot;host&quot;<br>    ports:<br>      - &quot;9090:9090&quot;<br>    volumes: <br>      - &quot;./prometheus.yml:/etc/prometheus/prometheus.yml&quot;<br>    privileged: true<br>    depends_on:<br>      - cadvisor<br><br>  grafana:<br>    container_name: grafana<br>    image: grafana/grafana:latest<br>    network_mode: &quot;host&quot;<br>    ports:<br>      - &quot;3000:3000&quot;<br>    environment:<br>      - GF_PATHS_PROVISIONING=/etc/grafana/provisioning<br>      - DS_PROMETHEUS=prometheus<br>    volumes: <br>      - &quot;grafana-data:/var/lib/grafana&quot;<br>      - &quot;./datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml&quot;<br>      - &quot;./dashboard.json:/var/lib/grafana/dashboards/dashboard.json&quot;<br>      - &quot;./default.yaml:/etc/grafana/provisioning/dashboards/default.yaml&quot;<br>    privileged: true<br>    depends_on:<br>      - prometheus<br><br>volumes:<br>  grafana-data:</pre><p>Command to run docker-compose.yml</p><pre>docker compose up</pre><p>Now you can access cAdvisor on <a href="http://localhost:8080/">http://localhost:8080</a>, Prometheus on <a href="http://localhost:9090/">http://localhost:9090</a>, and Grafana on <a href="http://localhost:3000/">http://localhost:3000</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oxNCR_nZ_xD1PUseLP5q3g.png" /><figcaption>Grafana Dashboard</figcaption></figure><p>I hope this article helps you to monitor your docker container.</p><h3><strong>References</strong></h3><p><a href="https://docs.docker.com/compose/">https://docs.docker.com/compose/<br></a><a href="https://github.com/google/cadvisor/">https://github.com/google/cadvisor/<br></a><a href="https://hub.docker.com/r/prom/prometheus">https://hub.docker.com/r/prom/prometheus<br></a><a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration">https://prometheus.io/docs/prometheus/latest/configuration/configuration<br></a><a href="https://grafana.com/grafana/dashboards">https://grafana.com/grafana/dashboards<br></a><a href="https://hub.docker.com/r/grafana/grafana/">https://hub.docker.com/r/grafana/grafana</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b47ec78efbc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>