{"id":7324,"date":"2023-12-07T16:23:38","date_gmt":"2023-12-07T16:23:38","guid":{"rendered":"https:\/\/www.webhi.com\/how-to\/?p=7324"},"modified":"2023-12-07T16:23:40","modified_gmt":"2023-12-07T16:23:40","slug":"docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana","status":"publish","type":"post","link":"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/","title":{"rendered":"Docker Monitoring using Prometheus, cAdvisor, Node Exporter and Grafana"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/12\/docker_monitoring_en.jpg\" alt=\"Prometheus, cAdvisor, Node Exporter and Grafana ubuntu debian centos redhat\" class=\"wp-image-7332\" srcset=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/12\/docker_monitoring_en.jpg 1200w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/12\/docker_monitoring_en-300x169.jpg 300w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/12\/docker_monitoring_en-1024x576.jpg 1024w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/12\/docker_monitoring_en-768x432.jpg 768w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/12\/docker_monitoring_en-150x84.jpg 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"introduction\">Introduction<\/h2>\n\n\n\n<p>As companies adopt Docker containers to achieve improved efficiency and velocity of application deployment, monitoring and observability become increasingly critical for running containers in production. Monitoring provides valuable metrics, logs and insights into how both applications and infrastructure are performing. This enables teams to troubleshoot issues proactively before they cause downstream impacts, as well as optimize usage and spending on containerized resources.<\/p>\n\n\n\n<p>In this comprehensive guide, we will set up an integrated open-source monitoring stack for visualizing Docker host and container metrics using:<\/p>\n\n\n\n<ul>\n<li><strong>Prometheus<\/strong>: A popular open-source time series database for storing and querying numeric metrics<\/li>\n\n\n\n<li><strong>cAdvisor<\/strong>: A utility which collects resource usage and performance data from running containers<\/li>\n\n\n\n<li><strong>Node Exporter<\/strong>: Exposes hardware and OS metrics from physical and virtual Docker server hosts<\/li>\n\n\n\n<li><strong>Grafana<\/strong>: Feature-rich dashboards and graphs for analytics and visualization<\/li>\n<\/ul>\n\n\n\n<p>Collectively these tools provide end-to-end observability into Dockerized environments, from physical infrastructure up through running applications. We will deploy them with Docker and set up metrics ingestion pipelines, storage, querying and dashboarding to understand exactly how containers utilize host resources over time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"why-monitor-containers-and-hosts\">Why Monitor Containers and Hosts?<\/h3>\n\n\n\n<p>First, why is monitoring so important for container infrastructure?<\/p>\n\n\n\n<p>As applications are packaged into portable, isolated containers, they become more distributed across fluid pools of virtualized container hosts like nodes in a cluster.<\/p>\n\n\n\n<p><strong>This ephemeral architecture introduces visibility challenges including:<\/strong><\/p>\n\n\n\n<ul>\n<li>Understanding how containers utilize physical resources like CPU, memory, disk and network<\/li>\n\n\n\n<li>Mapping which containers run on which hosts over time<\/li>\n\n\n\n<li>Correlating application performance with lower-level resource metrics<\/li>\n\n\n\n<li>Identifying trends and spikes in utilization to prevent over-utilization<\/li>\n\n\n\n<li>Tuning container configurations and placements based on behavior<\/li>\n\n\n\n<li>Establishing alerts to detect anomalies or problems<\/li>\n<\/ul>\n\n\n\n<p>While containerization brings architectural benefits through loose coupling and portability, the environment grows increasingly complex from an operations view.<\/p>\n\n\n\n<p><strong>By collecting, storing and charting detailed time series metrics we regain visibility including:<\/strong><\/p>\n\n\n\n<ul>\n<li>Live resource usage monitoring with breakdowns per host, container, namespace<\/li>\n\n\n\n<li>Historical trend analysis for capacity planning and optimization<\/li>\n\n\n\n<li>Metrics-driven alerting when thresholds are crossed<\/li>\n\n\n\n<li>Correlation between application response times and lower level characteristics<\/li>\n\n\n\n<li>Dashboarding for understanding infrastructure at a glance<\/li>\n<\/ul>\n\n\n\n<p>Understanding exactly how applications consume resources empowers more efficient operation, automated responses, and helps prevent instability from overutilization or resource bottlenecks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<p>To follow along with all components, you will need:<\/p>\n\n\n\n<ul>\n<li>A Linux server running Docker with latest version of Docker Compose<\/li>\n\n\n\n<li>Docker daemon permission for writing metrics from exporters<\/li>\n\n\n\n<li>Ports 9090, 9100 and 3000 accessible from monitoring tools<\/li>\n\n\n\n<li>Basic Linux administration and Docker familiarity<\/li>\n<\/ul>\n\n\n\n<p>For convenience, we will use an Ubuntu 20.04 system. But any modern Linux distribution should work well.<\/p>\n\n\n\n<p>Now let&#8217;s explore how to wire up Prometheus metrics ingestion and visualized dashboards for container environments!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-1---create-isolated-docker-monitoring-network\">Step 1 &#8211; Create Isolated Docker Monitoring Network<\/h2>\n\n\n\n<p>First, create a user-defined bridge network for communication between the monitoring services using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker network create monitoring-net<\/code><\/pre>\n\n\n\n<p>This allows exposing the services on consistent hostnames instead of dynamic IP addresses that can change:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">prometheus\ngrafana \ncadvisor\nnode-exporter<\/code><\/pre>\n\n\n\n<p>Now run each service attached to this network for simplified connectivity.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-2---set-up-prometheus-time-series-database\">Step 2 &#8211; Set Up Prometheus Time Series Database<\/h2>\n\n\n\n<p><a href=\"https:\/\/prometheus.io\/\">Prometheus<\/a>&nbsp;is a specialized time series database optimized for ingesting and querying numeric metrics like counters, gauges and histograms even at high scale or cardinality. It scrappes and stores numeric metrics at regular intervals over time.<\/p>\n\n\n\n<p>Prometheus runs well in containers and integrates with Docker environments using exporters to provide metrics about containers, images, volumes and more.<\/p>\n\n\n\n<p>Pull the latest Prometheus server image:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker pull prom\/prometheus:latest<\/code><\/pre>\n\n\n\n<p>Next, create a directory for persistence across container restarts:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ mkdir -p \/prometheus-data<\/code><\/pre>\n\n\n\n<p>We need to define a Prometheus configuration file to discover what to monitor. Create this at&nbsp;<code>\/prometheus-data\/prometheus.yml<\/code>&nbsp;on your host with initial job definitions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">global:\n  scrape_interval: 10s\n  external_labels:\n    monitor: production-01\n\nscrape_configs:\n\n  - job_name: 'prometheus'\n    scrape_interval: 5s\n    static_configs:\n      - targets: ['localhost:9090']\n\n  - job_name: 'cadvisor'\n    scrape_interval: 5s\n    static_configs:\n      - targets: ['cadvisor:8080']\n\n  - job_name: 'node'\n    scrape_interval: 5s \n    static_configs:\n      - targets: ['node-exporter:9100']<\/code><\/pre>\n\n\n\n<p>This configures connectivity to:<\/p>\n\n\n\n<ul>\n<li><strong>Prometheus self-metrics<\/strong>&nbsp;on port 9090<\/li>\n\n\n\n<li><strong>cAdvisor<\/strong>&nbsp;exposing container metrics on 8080<\/li>\n\n\n\n<li><strong>Node Exporter<\/strong>&nbsp;for host OS metrics on 9100<\/li>\n<\/ul>\n\n\n\n<p>We will define these services next.<\/p>\n\n\n\n<p>Finally, run the Prometheus server in detached mode:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --name=prometheus \\\n    --network=monitoring-net \\\n    -p 9090:9090 \\\n    -v=\/prometheus-data:\/prometheus-data \\ \n    prom\/prometheus:latest \\\n    --config.file=\/prometheus-data\/prometheus.yml  <\/code><\/pre>\n\n\n\n<p>This launches Prometheus connected to the monitoring network, loading the configuration file and persistent volume.<\/p>\n\n\n\n<p>You can access the Prometheus UI at&nbsp;<code>http:\/\/&lt;server-ip&gt;:9090<\/code>. We will integrate Grafana shortly for dashboards.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-3---install-cadvisor-for-container-metrics\">Step 3 &#8211; Install cAdvisor for Container Metrics<\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/google\/cadvisor\">cAdvisor<\/a>&nbsp;(Container Advisor) is a utility for collecting, aggregating, processing, and exporting&nbsp;<strong>performance and resource usage metrics<\/strong>&nbsp;from running containers.<\/p>\n\n\n\n<p>For example, cAdvisor exposes CPU, memory, filesystem, and network usage statistics per container. This allows understanding how much resources containers utilize relative to their host machines over time.<\/p>\n\n\n\n<p>cAdvisor runs as a daemonset on each node in a cluster for monitoring resource usage. Here we will run it standalone with Docker.<\/p>\n\n\n\n<p>Pull the latest cAdvisor image:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker pull gcr.io\/cadvisor\/cadvisor:latest<\/code><\/pre>\n\n\n\n<p>Then launch the containerized cAdvisor agent:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run \\\n  --name=cadvisor \\\n  --network=monitoring-net \\\n  --volume=\/:\/rootfs:ro \\\n  --volume=\/var\/run:\/var\/run:rw \\\n  --volume=\/sys:\/sys:ro \\\n  --volume=\/var\/lib\/docker\/:\/var\/lib\/docker:ro \\\n  --publish=8080:8080 \\\n  --detach=true \\\n  gcr.io\/cadvisor\/cadvisor:latest<\/code><\/pre>\n\n\n\n<p>This runs cAdvisor with access to:<\/p>\n\n\n\n<ul>\n<li><strong>Host Filesystem<\/strong>&nbsp;for collecting storage usage per container at&nbsp;<code>\/<\/code><\/li>\n\n\n\n<li><strong>Docker Socket<\/strong>&nbsp;to gather detailed metrics about running containers<\/li>\n\n\n\n<li><strong>Host Info<\/strong>&nbsp;like CPU\/Memory via&nbsp;<code>\/sys<\/code><\/li>\n<\/ul>\n\n\n\n<p>cAdvisor scrapes these sources and exposes aggregated metrics on port 8080.<\/p>\n\n\n\n<p>Prometheus will automatically discover cAdvisor metrics on our monitoring network.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-4---installing-node-exporter-on-docker-hosts\">Step 4 &#8211; Installing Node Exporter on Docker Hosts<\/h2>\n\n\n\n<p>While cAdvisor exposes metrics about running containers,&nbsp;<a href=\"https:\/\/github.com\/prometheus\/node_exporter\">Node Exporter<\/a>&nbsp;gathers OS and hardware metrics from the Docker hosts themselves such as CPU, memory, disk utilization, network, systemd services, and more.<\/p>\n\n\n\n<p>This reveals performance and saturation issues that could impact applications like the operating system or physical hardware.<\/p>\n\n\n\n<p>Using docker, launch node-exporter similarly:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d \\\n  --name=node-exporter \\  \n  --network=monitoring-net \\\n  -p 9100:9100 \\  \n  prom\/node-exporter:latest<\/code><\/pre>\n\n\n\n<p>This exposes host metrics on port 9100. Prometheus will discover them for scraping into metrics like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">node_cpu_seconds_total{mode=\"idle\"}\nnode_memory_MemAvailable_bytes \nnode_network_transmit_bytes_total<\/code><\/pre>\n\n\n\n<p>We now have 2 pipelines sending system and container metrics into Prometheus.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-5---install-grafana-for-beautiful-data-visualization\">Step 5 &#8211; Install Grafana for Beautiful Data Visualization<\/h2>\n\n\n\n<p>Raw metrics numbers in Prometheus can be hard to interpret over the CLI or UI. For improved analysis,&nbsp;<a href=\"https:\/\/grafana.com\/\">Grafana<\/a>&nbsp;provides flexible data dashboards with graphs, gauges and breakdowns mixing multiple metrics together.<\/p>\n\n\n\n<p>Pull and run the official Grafana image:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d \\\n  --name=grafana \\\n  -p 3000:3000 \\  \n  --network=monitoring-net \\\n  grafana\/grafana:latest<\/code><\/pre>\n\n\n\n<p>This runs Grafana connected to our monitoring services on port 3000.<\/p>\n\n\n\n<p>Navigate to&nbsp;<code>http:\/\/&lt;server-ip&gt;:3000<\/code>&nbsp;and log into Grafana using the default credentials:<\/p>\n\n\n\n<ul>\n<li>Username: admin<\/li>\n\n\n\n<li>Password: admin<\/li>\n<\/ul>\n\n\n\n<p>Let&#8217;s set up our Prometheus data source next&#8230;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-6---configure-prometheus-data-source-in-grafana\">Step 6 &#8211; Configure Prometheus Data Source in Grafana<\/h2>\n\n\n\n<p>From the Grafana sidebar menu, click on &#8220;Configuration&#8221; then &#8220;Data Sources&#8221;.<\/p>\n\n\n\n<p>Here you can manage connections to monitoring databases like Prometheus, Graphite, InfluxDB and more.<\/p>\n\n\n\n<p>Select &#8220;<kbd>Add Data Source<\/kbd>&#8221; and set the following fields:<\/p>\n\n\n\n<ul>\n<li>Name: Prometheus<\/li>\n\n\n\n<li>Type: Prometheus<\/li>\n\n\n\n<li>URL:&nbsp;<code>http:\/\/prometheus:9090<\/code><\/li>\n\n\n\n<li>Access: Proxy<\/li>\n<\/ul>\n\n\n\n<p>Then click &#8220;Save and Test&#8221;. Grafana now has access to all metrics stored in Prometheus!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-7---import-dashboard-templates\">Step 7 &#8211; Import Dashboard Templates<\/h2>\n\n\n\n<p>Rather than creating dashboards completely from scratch, we can leverage the Grafana community dashboard ecosystem with pre-built templates.<\/p>\n\n\n\n<p>Hover over the &#8220;+&#8221; icon on the left menu and select &#8220;Import&#8221;. Then enter the Dashboard ID&nbsp;<strong>1860<\/strong>&nbsp;which handles containers, or&nbsp;<strong>893<\/strong>&nbsp;for the Docker host view.<\/p>\n\n\n\n<p>Grafana imports these templates pre-populated with graphs and breakdowns for our new Prometheus data source. Customize them or extend with more focused dashboards!<\/p>\n\n\n\n<p>Now your Grafana instance should have insightful dashboards monitoring:<\/p>\n\n\n\n<ul>\n<li>Per-Container Resource Usage Metrics<\/li>\n\n\n\n<li>Host-Level OS, CPU Memory, and Docker Stats<\/li>\n<\/ul>\n\n\n\n<p>Prometheus and Grafana now provide end-to-end data pipelines, storage and visualization for container environments. Next let&#8217;s discuss administrative functionality to maintain and scale our new monitoring stack.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"administering-the-monitoring-services\">Administering the Monitoring Services<\/h2>\n\n\n\n<p>Now that you have Prometheus, Node Exporter, cAdvisor and Grafana all running, here are best practices for administering these over the long term.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"persisting-prometheus-metrics-history\">Persisting Prometheus Metrics History<\/h3>\n\n\n\n<p>By default Prometheus stores metrics locally on disk which limits capacity and durability. For production systems, use remote storage to retain history for longer trend analysis and capacity planning.<\/p>\n\n\n\n<p>Popular long-term stores compatible with Prometheus include:<\/p>\n\n\n\n<ul>\n<li>Azure Blob Storage<\/li>\n\n\n\n<li>AWS S3<\/li>\n\n\n\n<li>Google Cloud Storage<\/li>\n\n\n\n<li>Thanos<\/li>\n<\/ul>\n\n\n\n<p>Configure these under&nbsp;<code>prometheus.yml<\/code>&#8216;s&nbsp;<code>remote_write:<\/code>&nbsp;and&nbsp;<code>remote_read:<\/code>&nbsp;sections.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"retaining-dashboard-history-in-grafana\">Retaining Dashboard History in Grafana<\/h3>\n\n\n\n<p>To persist dashboard history across Grafana restarts, configure a database like PostgreSQL or MySQL under &#8220;Configuration &#8211; Data Sources &#8211; Grafana Database&#8221;. Sync monitoring dashboards to source control for version history.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"limiting-data-cardinality\">Limiting Data Cardinality<\/h3>\n\n\n\n<p>Due to the high volume of per-container metrics possible, watch for metrics &#8220;cardinaltiy explosions&#8221;. Filter carefully with metric relabelling to control storage growth. Dropping less valuable metrics can improve performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"horizontal-sharding\">Horizontal Sharding<\/h3>\n\n\n\n<p>To distribute load as environments grow larger, run multiple Prometheus pods in a StatefulSet with hashring or federation configurations. Similarly Grafana can be made highly available through replication controllers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"summary\">Summary<\/h2>\n\n\n\n<p>In this guide we have built a comprehensive monitoring stack for Docker hosts and container estates including:<\/p>\n\n\n\n<ul>\n<li><strong>Prometheus<\/strong>: Central metrics database scraping and storing container\/host stats<\/li>\n\n\n\n<li><strong>cAdvisor<\/strong>: Gathering resource usage from running containers<\/li>\n\n\n\n<li><strong>Node Exporter<\/strong>: Harvesting OS and hardware metrics from servers<\/li>\n\n\n\n<li><strong>Grafana<\/strong>: Visualizing metrics through insightful dashboards<\/li>\n<\/ul>\n\n\n\n<p>Together, these tools provide end-to-end visibility and alerts to detect anomalies across dynamic container environments.<\/p>\n\n\n\n<p>Now that you have a working monitoring foundation, potential next steps include:<\/p>\n\n\n\n<ul>\n<li>Integrating log data in Elasticsearch for correlate traces with metrics<\/li>\n\n\n\n<li>Building alert rules and web hooks in Prometheus and Grafana<\/li>\n\n\n\n<li>Autoscaling containers based on utilization with Kubernetes Horizontal Pod Autoscaler<\/li>\n\n\n\n<li>Researching tools like Weave Scope or Lens for mapping containers to hosts<\/li>\n<\/ul>\n\n\n\n<p>As you move containers and microservices to production, I hope this exploration into metrics, monitoring and visibility helps run infrastructure reliably! Let me know if you have any other questions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction As companies adopt Docker containers to achieve improved efficiency and velocity of application deployment, monitoring and observability become increasingly critical for running containers in production. Monitoring provides valuable metrics, logs and insights into how both applications and infrastructure are performing. This enables teams to troubleshoot issues proactively before they cause downstream impacts, as well ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[69,182],"tags":[],"yoast_head":"\n<title>Docker Monitoring using Prometheus, cAdvisor, Node Exporter and Grafana - WebHi Tutorials &amp; Documentations<\/title>\n<meta name=\"description\" content=\"Learn how to set up comprehensive monitoring and observability for Docker servers and containers using the powerful combination of Prometheus, cAdvisor, Node Exporter, and Grafana.\" \/>\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.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker Monitoring using Prometheus, cAdvisor, Node Exporter and Grafana - WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"og:description\" content=\"Learn how to set up comprehensive monitoring and observability for Docker servers and containers using the powerful combination of Prometheus, cAdvisor, Node Exporter, and Grafana.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/\" \/>\n<meta property=\"og:site_name\" content=\"WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webhi.technology\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-07T16:23:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-07T16:23:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/12\/docker_monitoring_en.jpg\" \/>\n<meta name=\"author\" content=\"webhi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:site\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webhi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/\"},\"author\":{\"name\":\"webhi\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\"},\"headline\":\"Docker Monitoring using Prometheus, cAdvisor, Node Exporter and Grafana\",\"datePublished\":\"2023-12-07T16:23:38+00:00\",\"dateModified\":\"2023-12-07T16:23:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/\"},\"wordCount\":1508,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"articleSection\":[\"Linux system administration\",\"Virtualization &amp; Cloud computing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/\",\"name\":\"Docker Monitoring using Prometheus, cAdvisor, Node Exporter and Grafana - WebHi Tutorials &amp; Documentations\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\"},\"datePublished\":\"2023-12-07T16:23:38+00:00\",\"dateModified\":\"2023-12-07T16:23:40+00:00\",\"description\":\"Learn how to set up comprehensive monitoring and observability for Docker servers and containers using the powerful combination of Prometheus, cAdvisor, Node Exporter, and Grafana.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webhi.com\/how-to\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Docker Monitoring using Prometheus, cAdvisor, Node Exporter and Grafana\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"name\":\"WebHi Tutorials &amp; Documentations\",\"description\":\"System administration and knowledge base\",\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\",\"name\":\"WebHi Technology\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"width\":288,\"height\":95,\"caption\":\"WebHi Technology\"},\"image\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webhi.technology\",\"https:\/\/twitter.com\/WebHiTechnology\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\",\"name\":\"webhi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781214743\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781214743\",\"caption\":\"webhi\"},\"sameAs\":[\"https:\/\/www.webhi.com\/how-to\"],\"url\":\"https:\/\/www.webhi.com\/how-to\/author\/webhi\/\"}]}<\/script>\n","yoast_head_json":{"title":"Docker Monitoring using Prometheus, cAdvisor, Node Exporter and Grafana - WebHi Tutorials &amp; Documentations","description":"Learn how to set up comprehensive monitoring and observability for Docker servers and containers using the powerful combination of Prometheus, cAdvisor, Node Exporter, and Grafana.","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.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/","og_locale":"en_US","og_type":"article","og_title":"Docker Monitoring using Prometheus, cAdvisor, Node Exporter and Grafana - WebHi Tutorials &amp; Documentations","og_description":"Learn how to set up comprehensive monitoring and observability for Docker servers and containers using the powerful combination of Prometheus, cAdvisor, Node Exporter, and Grafana.","og_url":"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/","og_site_name":"WebHi Tutorials &amp; Documentations","article_publisher":"https:\/\/www.facebook.com\/webhi.technology","article_published_time":"2023-12-07T16:23:38+00:00","article_modified_time":"2023-12-07T16:23:40+00:00","og_image":[{"url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/12\/docker_monitoring_en.jpg"}],"author":"webhi","twitter_card":"summary_large_image","twitter_creator":"@WebHiTechnology","twitter_site":"@WebHiTechnology","twitter_misc":{"Written by":"webhi","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/#article","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/"},"author":{"name":"webhi","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54"},"headline":"Docker Monitoring using Prometheus, cAdvisor, Node Exporter and Grafana","datePublished":"2023-12-07T16:23:38+00:00","dateModified":"2023-12-07T16:23:40+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/"},"wordCount":1508,"commentCount":0,"publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"articleSection":["Linux system administration","Virtualization &amp; Cloud computing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/","url":"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/","name":"Docker Monitoring using Prometheus, cAdvisor, Node Exporter and Grafana - WebHi Tutorials &amp; Documentations","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/#website"},"datePublished":"2023-12-07T16:23:38+00:00","dateModified":"2023-12-07T16:23:40+00:00","description":"Learn how to set up comprehensive monitoring and observability for Docker servers and containers using the powerful combination of Prometheus, cAdvisor, Node Exporter, and Grafana.","breadcrumb":{"@id":"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhi.com\/how-to\/docker-monitoring-using-prometheus-cadvisor-node-exporter-grafana\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhi.com\/how-to\/"},{"@type":"ListItem","position":2,"name":"Docker Monitoring using Prometheus, cAdvisor, Node Exporter and Grafana"}]},{"@type":"WebSite","@id":"https:\/\/www.webhi.com\/how-to\/#website","url":"https:\/\/www.webhi.com\/how-to\/","name":"WebHi Tutorials &amp; Documentations","description":"System administration and knowledge base","publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webhi.com\/how-to\/#organization","name":"WebHi Technology","url":"https:\/\/www.webhi.com\/how-to\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","contentUrl":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","width":288,"height":95,"caption":"WebHi Technology"},"image":{"@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webhi.technology","https:\/\/twitter.com\/WebHiTechnology"]},{"@type":"Person","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54","name":"webhi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/","url":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781214743","contentUrl":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781214743","caption":"webhi"},"sameAs":["https:\/\/www.webhi.com\/how-to"],"url":"https:\/\/www.webhi.com\/how-to\/author\/webhi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/7324"}],"collection":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/comments?post=7324"}],"version-history":[{"count":6,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/7324\/revisions"}],"predecessor-version":[{"id":7370,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/7324\/revisions\/7370"}],"wp:attachment":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/media?parent=7324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/categories?post=7324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/tags?post=7324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}