![]() Start the prometheus and node-exporter containers using the docker-compose command. You can find these in the Prometheus panel of the Cloud Portal. ![]() remote_write: Configuration for Prometheus to send scraped metrics to a remote endpoint.Ĭreate a Prometheus configuration file named prometheus.yml in the same directory as docker-compose.yml with the following: global:Įdit this file to include your Grafana Cloud username, API key, and remote_write endpoint.In this example, we set the scrape_interval for scraping metrics from configured jobs to 15 seconds. global: Global Prometheus config defaults.In this step, you’ll configure Prometheus to scrape node-exporter metrics and ship them to Grafana Cloud. Step 2: Create the Prometheus configuration file In the next step, we’ll create the Prometheus configuration file, which Compose will read from. Docker Compose will create this directory after starting the prometheus container. The prometheus service persists its data to a local directory on the host at. '=/etc/prometheus/consoles'įor the node-exporter service, we mount some necessary paths from the host into the container in :ro or read-only mode: prometheus.yml:/etc/prometheus/prometheus.yml Open a file called docker-compose.yml in your favorite editor and paste in the following: version: '3.8' In this step, you’ll create a docker-compose.yml file which will define our prometheus and node-exporter services, as well as our monitoring bridge network. Docker and Docker Compose installed on your Linux machine.A Grafana Cloud API key with the Metrics Publisher role.To create an account, please see Grafana Cloud and click on Start for free. Prerequisitesīefore you begin you should have the following available: You’ll then install a preconfigured dashboard or create your own to visualize these system metrics. You’ll mount the relevant host directories into the Node Exporter and Prometheus containers, and configure Prometheus to scrape Node Exporter metrics and push them to Grafana Cloud. In this guide, you’ll learn how to run Prometheus and Node Exporter as Docker containers on a Linux machine, with the containers managed by Docker Compose. Grafana Cloud Monitoring a Linux host with Prometheus, Node Exporter, and Docker Compose
0 Comments
Leave a Reply. |