{"id":2231,"date":"2024-11-13T10:23:44","date_gmt":"2024-11-13T02:23:44","guid":{"rendered":"https:\/\/www.ruianding.com\/blog\/?p=2231"},"modified":"2024-11-18T17:38:23","modified_gmt":"2024-11-18T09:38:23","slug":"monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus","status":"publish","type":"post","link":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/","title":{"rendered":"Monitoring Stack \u2013 Part 2: Building a Monitoring Stack with Node Exporter and Prometheus"},"content":{"rendered":"\n<p>In Part 1, we set up Grafana on a Linux server as a powerful visualization tool. Now, let\u2019s complete our monitoring stack by adding <strong>Node Exporter<\/strong> and <strong>Prometheus<\/strong> to collect and store system metrics for Grafana to display.<\/p>\n\n\n\n<p>In this guide, we\u2019ll walk through installing and configuring Node Exporter to collect system metrics, Prometheus to store and serve those metrics, and finally, we\u2019ll troubleshoot a common setup issue involving Prometheus\u2019s storage directory.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-cyan-bluish-gray-color has-alpha-channel-opacity has-cyan-bluish-gray-background-color has-background is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding the Components of a Monitoring Stack<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Data Collector<\/strong> (Node Exporter): Gathers system-level metrics like CPU usage, memory utilization, and network stats from the server.<\/li>\n\n\n\n<li><strong>Data Storage and Processing<\/strong> (Prometheus): Fetches metrics from Node Exporter and stores them, making the data available to Grafana for visualization.<\/li>\n\n\n\n<li><strong>Data Visualization and Alerting<\/strong> (Grafana): Connects to Prometheus to visualize and monitor metrics.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Monitoring Workflow<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Node Exporter<\/strong> collects system resource metrics.<\/li>\n\n\n\n<li><strong>Prometheus<\/strong> scrapes metrics from Node Exporter and stores them.<\/li>\n\n\n\n<li><strong>Grafana<\/strong> reads data from Prometheus to visualize metrics and set up alerts.<\/li>\n<\/ol>\n\n\n\n<p>This configuration allows Grafana to act as a \u201cvisualization layer\u201d for all the data collected by Node Exporter and stored by Prometheus.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"955\" height=\"642\" src=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4.png\" alt=\"\" class=\"wp-image-2232\" style=\"width:400px;height:auto\" srcset=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4.png 955w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4-300x202.png 300w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4-768x516.png 768w\" sizes=\"auto, (max-width: 955px) 100vw, 955px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-cyan-bluish-gray-color has-alpha-channel-opacity has-cyan-bluish-gray-background-color has-background is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">1. Setting Up Node Exporter<\/h2>\n\n\n\n<p><strong>Download and Install Node Exporter<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl -LO https:\/\/github.com\/prometheus\/node_exporter\/releases\/download\/v1.3.1\/node_exporter-1.3.1.linux-amd64.tar.gz\ntar xvf node_exporter-1.3.1.linux-amd64.tar.gz\nsudo mv node_exporter-1.3.1.linux-amd64\/node_exporter \/usr\/local\/bin\/<\/pre>\n\n\n\n<p><strong>Run Node Exporter as a Service<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo vi \/etc\/systemd\/system\/node_exporter.service<\/pre>\n\n\n\n<p><strong>Insert this configuration:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[Unit]\nDescription=Node Exporter\nAfter=network.target\n\n[Service]\nUser=nobody\nExecStart=\/usr\/local\/bin\/node_exporter\n\n[Install]\nWantedBy=default.target<\/pre>\n\n\n\n<p><strong>Start and Enable Node Exporter<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl daemon-reload\nsudo systemctl start node_exporter\nsudo systemctl enable node_exporter<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"249\" src=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-6-1024x249.png\" alt=\"\" class=\"wp-image-2234\" srcset=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-6-1024x249.png 1024w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-6-300x73.png 300w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-6-768x187.png 768w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-6.png 1454w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Verify Node Exporter<\/strong>:<\/p>\n\n\n\n<p>Visit <code>http:\/\/your-server-ip:9100\/metrics<\/code> to confirm that metrics are exposed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"653\" src=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-5-1024x653.png\" alt=\"\" class=\"wp-image-2233\" style=\"width:535px\" srcset=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-5-1024x653.png 1024w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-5-300x191.png 300w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-5-768x490.png 768w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-5-1536x979.png 1536w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-5-2048x1306.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-cyan-bluish-gray-color has-alpha-channel-opacity has-cyan-bluish-gray-background-color has-background is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2. Setting Up Prometheus<\/h2>\n\n\n\n<p><strong>Download and Install Prometheus<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">curl -LO https:\/\/github.com\/prometheus\/prometheus\/releases\/download\/v2.33.1\/prometheus-2.33.1.linux-amd64.tar.gz\ntar xvf prometheus-2.33.1.linux-amd64.tar.gz\nsudo mv prometheus-2.33.1.linux-amd64\/prometheus \/usr\/local\/bin\/\nsudo mv prometheus-2.33.1.linux-amd64\/promtool \/usr\/local\/bin\/<\/pre>\n\n\n\n<p><strong>Configure Prometheus<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo mkdir -p \/etc\/prometheus\nsudo vi \/etc\/prometheus\/prometheus.yml<\/pre>\n\n\n\n<p><strong>Add this configuration:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">global:\n  scrape_interval: 15s\n\nscrape_configs:\n  - job_name: 'node_exporter'\n    static_configs:\n      - targets: ['localhost:9100']<\/pre>\n\n\n\n<p><strong>Set Up the Storage Directory<\/strong>:<\/p>\n\n\n\n<p>Prometheus requires a data storage directory where it can write time-series data. This is a common setup issue if not configured.<\/p>\n\n\n\n<p>Create the storage directory and set permissions: <code>sudo mkdir -p \/var\/lib\/prometheus sudo chown -R prometheus:prometheus \/var\/lib\/prometheus<\/code><\/p>\n\n\n\n<p>Add the <code>--storage.tsdb.path<\/code> parameter to the Prometheus service file to specify this directory.<\/p>\n\n\n\n<p><strong>Configure and Run Prometheus as a Service<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo vi \/etc\/systemd\/system\/prometheus.service<\/pre>\n\n\n\n<p>Add the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[Unit]\nDescription=Prometheus\nAfter=network.target\n\n[Service]\nUser=prometheus\nExecStart=\/usr\/local\/bin\/prometheus \\\n  --config.file=\/etc\/prometheus\/prometheus.yml \\\n  --storage.tsdb.path=\/var\/lib\/prometheus \\\n  --storage.tsdb.retention.time=7d\n\n[Install]\nWantedBy=default.target<\/pre>\n\n\n\n<p><strong>Start and Enable Prometheus<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl daemon-reload\nsudo systemctl start prometheus\nsudo systemctl enable prometheus<\/pre>\n\n\n\n<p><strong>Verify Prometheus<\/strong>:<\/p>\n\n\n\n<p>Visit <code>http:\/\/your-server-ip:9090<\/code> to check the Prometheus UI.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"653\" src=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-7-1024x653.png\" alt=\"\" class=\"wp-image-2235\" style=\"width:535px\" srcset=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-7-1024x653.png 1024w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-7-300x191.png 300w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-7-768x490.png 768w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-7-1536x979.png 1536w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-7-2048x1306.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting: Unable to Start Prometheus Due to &#8220;Unable to Create mmap-ed Active Query Log&#8221; Error<\/h2>\n\n\n\n<p>One common error when starting Prometheus is related to its storage directory:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Error Message: Unable to create mmap-ed active query log<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"395\" src=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-8-1024x395.png\" alt=\"\" class=\"wp-image-2236\" srcset=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-8-1024x395.png 1024w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-8-300x116.png 300w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-8-768x297.png 768w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-8-1536x593.png 1536w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-8.png 1678w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Solution<\/strong>: Ensure that Prometheus has write access to the specified storage directory (<code>\/var\/lib\/prometheus<\/code> in this case) and that the <code>--storage.tsdb.path<\/code> parameter is included in the service file.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"232\" src=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-9-1024x232.png\" alt=\"\" class=\"wp-image-2237\" srcset=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-9-1024x232.png 1024w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-9-300x68.png 300w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-9-768x174.png 768w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-9-1536x349.png 1536w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-9.png 1674w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After setting the correct permissions and specifying the storage path, restart Prometheus to resolve the issue:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl daemon-reload\nsudo systemctl restart prometheus<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Connecting Prometheus to Grafana<\/h3>\n\n\n\n<p><strong>Add Prometheus as a Data Source in Grafana<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open Grafana.<\/li>\n\n\n\n<li>Go to <strong>Connections &gt; Data Sources<\/strong> and click <strong>Add data source<\/strong>.<\/li>\n\n\n\n<li>Select <strong>Prometheus<\/strong> and enter <code>http:\/\/localhost:9090<\/code> as the URL.<\/li>\n\n\n\n<li>Click <strong>Save &amp; Test<\/strong>.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"574\" src=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-10-1024x574.png\" alt=\"\" class=\"wp-image-2245\" style=\"width:639px;height:auto\" srcset=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-10-1024x574.png 1024w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-10-300x168.png 300w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-10-768x431.png 768w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-10-1536x861.png 1536w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-10.png 1980w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Create Dashboards in Grafana<\/strong>:<\/p>\n\n\n\n<p>With Prometheus set as a data source, you can now create dashboards in Grafana using metrics from Node Exporter.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"478\" src=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-11-1024x478.png\" alt=\"\" class=\"wp-image-2246\" style=\"width:779px;height:auto\" srcset=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-11-1024x478.png 1024w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-11-300x140.png 300w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-11-768x359.png 768w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-11-1536x718.png 1536w, https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-11.png 1978w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-cyan-bluish-gray-color has-alpha-channel-opacity has-cyan-bluish-gray-background-color has-background is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p>With Node Exporter and Prometheus, you now have a full monitoring stack:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Node Exporter<\/strong> collects system-level metrics.<\/li>\n\n\n\n<li><strong>Prometheus<\/strong> stores and serves metrics.<\/li>\n\n\n\n<li><strong>Grafana<\/strong> visualizes data and enables alerting.<\/li>\n<\/ul>\n\n\n\n<p>This setup provides a flexible and powerful monitoring solution, ideal for a variety of applications. Future posts could cover custom dashboards or setting up alerting rules to notify you when certain thresholds are met.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Part 1, we set up Grafana on a Linux server as a powerful visualization tool. Now, let\u2019s complete our monitoring stack by adding Node Exporter and Prometheus to collect and store system metrics for Grafana to display. In this guide, we\u2019ll walk through installing and configuring Node Exporter to collect system metrics, Prometheus to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[63],"tags":[65,64],"class_list":["post-2231","post","type-post","status-publish","format-standard","hentry","category-monitoringstack","tag-grafana","tag-prometheus"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Monitoring Stack \u2013 Part 2: Building a Monitoring Stack with Node Exporter and Prometheus - \u6781\u7b80IT\uff5cSimpleIT<\/title>\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.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Monitoring Stack \u2013 Part 2: Building a Monitoring Stack with Node Exporter and Prometheus - \u6781\u7b80IT\uff5cSimpleIT\" \/>\n<meta property=\"og:description\" content=\"In Part 1, we set up Grafana on a Linux server as a powerful visualization tool. Now, let\u2019s complete our monitoring stack by adding Node Exporter and Prometheus to collect and store system metrics for Grafana to display. In this guide, we\u2019ll walk through installing and configuring Node Exporter to collect system metrics, Prometheus to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/\" \/>\n<meta property=\"og:site_name\" content=\"\u6781\u7b80IT\uff5cSimpleIT\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-13T02:23:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-18T09:38:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4.png\" \/>\n\t<meta property=\"og:image:width\" content=\"955\" \/>\n\t<meta property=\"og:image:height\" content=\"642\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ruian Ding\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ruian Ding\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/\"},\"author\":{\"name\":\"Ruian Ding\",\"@id\":\"https:\/\/www.ruianding.com\/blog\/#\/schema\/person\/440d88575b7dc819a4cefc8c4199db3b\"},\"headline\":\"Monitoring Stack \u2013 Part 2: Building a Monitoring Stack with Node Exporter and Prometheus\",\"datePublished\":\"2024-11-13T02:23:44+00:00\",\"dateModified\":\"2024-11-18T09:38:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/\"},\"wordCount\":499,\"publisher\":{\"@id\":\"https:\/\/www.ruianding.com\/blog\/#\/schema\/person\/440d88575b7dc819a4cefc8c4199db3b\"},\"image\":{\"@id\":\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4.png\",\"keywords\":[\"Grafana\",\"Prometheus\"],\"articleSection\":[\"MonitoringStack\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/\",\"url\":\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/\",\"name\":\"Monitoring Stack \u2013 Part 2: Building a Monitoring Stack with Node Exporter and Prometheus - \u6781\u7b80IT\uff5cSimpleIT\",\"isPartOf\":{\"@id\":\"https:\/\/www.ruianding.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4.png\",\"datePublished\":\"2024-11-13T02:23:44+00:00\",\"dateModified\":\"2024-11-18T09:38:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#primaryimage\",\"url\":\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4.png\",\"contentUrl\":\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4.png\",\"width\":955,\"height\":642},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.ruianding.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Monitoring Stack \u2013 Part 2: Building a Monitoring Stack with Node Exporter and Prometheus\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ruianding.com\/blog\/#website\",\"url\":\"https:\/\/www.ruianding.com\/blog\/\",\"name\":\"Ruian's Tech Troubleshooting Toolbox\",\"description\":\"Debug the World.\",\"publisher\":{\"@id\":\"https:\/\/www.ruianding.com\/blog\/#\/schema\/person\/440d88575b7dc819a4cefc8c4199db3b\"},\"alternateName\":\"\u4e01\u777f\u5b89\u7684\u6280\u672f\u5206\u4eab\u535a\u5ba2\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ruianding.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.ruianding.com\/blog\/#\/schema\/person\/440d88575b7dc819a4cefc8c4199db3b\",\"name\":\"Ruian Ding\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ruianding.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2023\/05\/logo.png\",\"contentUrl\":\"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2023\/05\/logo.png\",\"width\":284,\"height\":284,\"caption\":\"Ruian Ding\"},\"logo\":{\"@id\":\"https:\/\/www.ruianding.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"I am currently a Support Specialist at NIO, focusing on cloud-related issues for NIO Power. Previously, at Microsoft Entra ID, I specialized in identity and access management (IAM), including device registration, Windows Hello for Business (WHfB), multi-factor authentication (MFA), and single sign-on (SSO). In addition to my core expertise, I have a strong foundation in Active Directory, Servers, Cloud Computing, Network Administration, and Front-end Web Development. This diverse technical skill set enables me to effectively handle a wide range of challenges in a fast-paced IT environment.\",\"sameAs\":[\"https:\/\/www.ruianding.com\"],\"url\":\"https:\/\/www.ruianding.com\/blog\/author\/ruiand\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Monitoring Stack \u2013 Part 2: Building a Monitoring Stack with Node Exporter and Prometheus - \u6781\u7b80IT\uff5cSimpleIT","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.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/","og_locale":"en_US","og_type":"article","og_title":"Monitoring Stack \u2013 Part 2: Building a Monitoring Stack with Node Exporter and Prometheus - \u6781\u7b80IT\uff5cSimpleIT","og_description":"In Part 1, we set up Grafana on a Linux server as a powerful visualization tool. Now, let\u2019s complete our monitoring stack by adding Node Exporter and Prometheus to collect and store system metrics for Grafana to display. In this guide, we\u2019ll walk through installing and configuring Node Exporter to collect system metrics, Prometheus to [&hellip;]","og_url":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/","og_site_name":"\u6781\u7b80IT\uff5cSimpleIT","article_published_time":"2024-11-13T02:23:44+00:00","article_modified_time":"2024-11-18T09:38:23+00:00","og_image":[{"width":955,"height":642,"url":"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4.png","type":"image\/png"}],"author":"Ruian Ding","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ruian Ding","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#article","isPartOf":{"@id":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/"},"author":{"name":"Ruian Ding","@id":"https:\/\/www.ruianding.com\/blog\/#\/schema\/person\/440d88575b7dc819a4cefc8c4199db3b"},"headline":"Monitoring Stack \u2013 Part 2: Building a Monitoring Stack with Node Exporter and Prometheus","datePublished":"2024-11-13T02:23:44+00:00","dateModified":"2024-11-18T09:38:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/"},"wordCount":499,"publisher":{"@id":"https:\/\/www.ruianding.com\/blog\/#\/schema\/person\/440d88575b7dc819a4cefc8c4199db3b"},"image":{"@id":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#primaryimage"},"thumbnailUrl":"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4.png","keywords":["Grafana","Prometheus"],"articleSection":["MonitoringStack"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/","url":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/","name":"Monitoring Stack \u2013 Part 2: Building a Monitoring Stack with Node Exporter and Prometheus - \u6781\u7b80IT\uff5cSimpleIT","isPartOf":{"@id":"https:\/\/www.ruianding.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#primaryimage"},"image":{"@id":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#primaryimage"},"thumbnailUrl":"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4.png","datePublished":"2024-11-13T02:23:44+00:00","dateModified":"2024-11-18T09:38:23+00:00","breadcrumb":{"@id":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#primaryimage","url":"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4.png","contentUrl":"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2024\/11\/image-4.png","width":955,"height":642},{"@type":"BreadcrumbList","@id":"https:\/\/www.ruianding.com\/blog\/monitoring-stack-part-2-building-a-monitoring-stack-with-node-exporter-and-prometheus\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.ruianding.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Monitoring Stack \u2013 Part 2: Building a Monitoring Stack with Node Exporter and Prometheus"}]},{"@type":"WebSite","@id":"https:\/\/www.ruianding.com\/blog\/#website","url":"https:\/\/www.ruianding.com\/blog\/","name":"Ruian's Tech Troubleshooting Toolbox","description":"Debug the World.","publisher":{"@id":"https:\/\/www.ruianding.com\/blog\/#\/schema\/person\/440d88575b7dc819a4cefc8c4199db3b"},"alternateName":"\u4e01\u777f\u5b89\u7684\u6280\u672f\u5206\u4eab\u535a\u5ba2","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ruianding.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.ruianding.com\/blog\/#\/schema\/person\/440d88575b7dc819a4cefc8c4199db3b","name":"Ruian Ding","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ruianding.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2023\/05\/logo.png","contentUrl":"https:\/\/www.ruianding.com\/blog\/wp-content\/uploads\/2023\/05\/logo.png","width":284,"height":284,"caption":"Ruian Ding"},"logo":{"@id":"https:\/\/www.ruianding.com\/blog\/#\/schema\/person\/image\/"},"description":"I am currently a Support Specialist at NIO, focusing on cloud-related issues for NIO Power. Previously, at Microsoft Entra ID, I specialized in identity and access management (IAM), including device registration, Windows Hello for Business (WHfB), multi-factor authentication (MFA), and single sign-on (SSO). In addition to my core expertise, I have a strong foundation in Active Directory, Servers, Cloud Computing, Network Administration, and Front-end Web Development. This diverse technical skill set enables me to effectively handle a wide range of challenges in a fast-paced IT environment.","sameAs":["https:\/\/www.ruianding.com"],"url":"https:\/\/www.ruianding.com\/blog\/author\/ruiand\/"}]}},"_links":{"self":[{"href":"https:\/\/www.ruianding.com\/blog\/wp-json\/wp\/v2\/posts\/2231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ruianding.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ruianding.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ruianding.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ruianding.com\/blog\/wp-json\/wp\/v2\/comments?post=2231"}],"version-history":[{"count":8,"href":"https:\/\/www.ruianding.com\/blog\/wp-json\/wp\/v2\/posts\/2231\/revisions"}],"predecessor-version":[{"id":2304,"href":"https:\/\/www.ruianding.com\/blog\/wp-json\/wp\/v2\/posts\/2231\/revisions\/2304"}],"wp:attachment":[{"href":"https:\/\/www.ruianding.com\/blog\/wp-json\/wp\/v2\/media?parent=2231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ruianding.com\/blog\/wp-json\/wp\/v2\/categories?post=2231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ruianding.com\/blog\/wp-json\/wp\/v2\/tags?post=2231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}