How to bring data from local “node_exporter” to Prometheus, and then to the Grafana Cloud
In today’s data-driven world, collecting and analyzing data has become crucial for businesses to make informed decisions. Prometheus is a popular open-source monitoring and alerting toolkit that is widely used to monitor infrastructure and applications. It provides a powerful query language and visualization tools that enable users to collect, store, and analyze metrics.
One of the primary ways to collect metrics in Prometheus is through exporters. Exporters are small programs that run on the systems being monitored and collect metrics from the various services running on those systems. A commonly used exporters is “node_exporter”.
However, collecting data is only half the battle. The data also needs to be stored and visualized in an accessible and easy-to-understand way. This is where Grafana comes in. Grafana Cloud is a cloud-based platform that provides a powerful and user-friendly interface for visualizing and analyzing data.
In this article, I will explore how to bring data from local installed “node_exporter” to Prometheus Server, and visualise it on the Grafana Cloud. I will walk through the necessary steps to configure and set up Prometheus exporters, create a Prometheus data source in Grafana Cloud, and visualize the collected metrics using Grafana Cloud’s powerful dashboarding features. All this in a easy way with preconfigured Elements – so quite no work …
But first the “OnPrem” Work
A – Download and Install “Note exporter” on the remote Host
- Go to the Node Exporter GitHub page: https://github.com/prometheus/node_exporter
- Navigate to the “Releases” tab.
- Find the latest release and download the appropriate binary file for your operating system/architecture. For example, for Linux 64-bit, download “node_exporter-<version>.linux-amd64.tar.gz”.
- Extract the downloaded archive file to a directory of your choice. This will create a directory named “node_exporter-<version>.linux-amd64” (assuming you downloaded the Linux 64-bit version).
- Open a terminal or command prompt and navigate to the directory where you extracted Node Exporter.
- Start Node Exporter by running the following command: ./node_exporter
- By default, Node Exporter will listen on port 9100. To verify that Node Exporter is running and accessible, navigate to http://<node_exporter_IP_address>:9100/metrics in your web browser. If you see a page containing metrics data, then Node Exporter is working correctly.
- Create a Start/Stop Script – Start it
B – Download and Install local Prometheus Server
- Go to the Prometheus website (https://prometheus.io/) and navigate to the “Downloads” section.
- Download the latest version of Prometheus for your operating system.
- Extract the downloaded archive file to a directory of your choice.
- Open the “prometheus.yml” file located in the extracted directory. This file is used to configure Prometheus to scrape metrics from various targets.
- Add target configurations to the “prometheus.yml” file. For example, to scrape metrics from the local node_exporter, add the following target configuration:
- Save the “prometheus.yml” file.
- Open a terminal or command prompt and navigate to the directory where you extracted Prometheus.
- Start Prometheus by running the following command: ./prometheus
- Prometheus should now be running and scraping metrics from the specified targets. You can view the collected metrics by navigating to http://localhost:9090 in your web browser.
- Create a Start/Stop Script – Start it
And second the “Cloud” Work
C – Sign up for a free Grafana Cloud Account
- Go to the Grafana Cloud website: https://grafana.com/products/cloud/
- Click on the “Get started for free” button.
- Fill out the sign-up form with your information, including your name, email address, and a password. You can also sign up using your Google or GitHub account if you prefer.
- Choose the plan that best suits your needs. Grafana Cloud offers a free plan that includes up to 10,000 series and 50 GB of logs per month, as well as paid plans with additional features and higher usage limits.
- Enter your payment information if you choose a paid plan. You will not be charged for the free plan.
- Click on the “Create account” button.
- Check your email for a verification message from Grafana Cloud. Click on the verification link in the email to activate your account.
D – Download preconfigured Dashboard
- Go to the Node Exporter dashboard page on Grafana’s website: https://grafana.com/grafana/dashboards/1860
- Click on the “Download JSON” button. (also possible direct import over “Copy ID”)
- Once the download is complete, open your Grafana instance in your web browser.
- Click on the “Create” button in the left sidebar, then select “Dashboard”.
- Click on the “Import” button in the top toolbar.
- Drag and drop the downloaded JSON file into the “Import via panel JSON” box, or click on “Upload .json file” and select the downloaded file.
- Choose the data source you want to use for the dashboard (e.g., Prometheus), then click on “Import”.
How to get a Data Source from Local Prometheus to Grafana Cloud?
Go to your free Grafana Cloud Account. See Details unser Prometheus / Send Metrics
Create a Endpoint for sending Prolethus metrics. Put this in the prometheus.yml Konfiguration File on your local Prometheus Server. (see above Point B)
And that’s IT – a great Overview over your Server – Nice done !
See also (my Inspiration)
In summary, Grafana is an extremely powerful and flexible visualization tool that offers several key advantages over other tools in its class. These advantages include:
Ease of use: Grafana’s intuitive user interface and drag-and-drop dashboard editor make it easy to create beautiful, informative visualizations without requiring extensive technical knowledge.
Compatibility: Grafana supports a wide range of data sources, including popular metrics databases like Prometheus, InfluxDB, and Elasticsearch, as well as cloud-based services like AWS CloudWatch and Google Analytics.
Flexibility: Grafana’s powerful visualization engine allows you to customize your visualizations to suit your specific needs, with a wide range of built-in visualizations and the ability to create your own custom visualizations.
Collaboration: Grafana’s built-in sharing and collaboration features make it easy to share your dashboards with others and collaborate on visualizations in real-time.
Scalability: Grafana is designed to scale with your needs, with the ability to handle large volumes of data and support for distributed architectures.
Overall, Grafana is a highly versatile and powerful visualization tool that can help you gain valuable insights into your data and make informed decisions based on those insights.
Happy working 🙂