Skip to Content
Technical Articles
Author's profile photo Christoph Baumann

How to bring data from local “node_exporter” to Prometheus, and then to the Grafana Cloud

Introduction

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 …

The Result

But first the “OnPrem” Work

A – Download and Install “Note exporter” on the remote Host

  1. Go to the Node Exporter GitHub page: https://github.com/prometheus/node_exporter
  2. Navigate to the “Releases” tab.
  3. 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”.
  4. 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).
  5. Open a terminal or command prompt and navigate to the directory where you extracted Node Exporter.
  6. Start Node Exporter by running the following command: ./node_exporter

  1. 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.
  2. Create a Start/Stop Script – Start it

B – Download and Install local Prometheus Server

  1. Go to the Prometheus website (https://prometheus.io/) and navigate to the “Downloads” section.
  2. Download the latest version of Prometheus for your operating system.
  3. Extract the downloaded archive file to a directory of your choice.
  4. Open the “prometheus.yml” file located in the extracted directory. This file is used to configure Prometheus to scrape metrics from various targets.
  5. Add target configurations to the “prometheus.yml” file. For example, to scrape metrics from the local node_exporter, add the following target configuration:

  1. Save the “prometheus.yml” file.
  2. Open a terminal or command prompt and navigate to the directory where you extracted Prometheus.
  3. Start Prometheus by running the following command: ./prometheus
  1. 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.
  2. Create a Start/Stop Script – Start it

And second the “Cloud” Work

C – Sign up for a free Grafana Cloud Account

  1. Go to the Grafana Cloud website: https://grafana.com/products/cloud/
  2. Click on the “Get started for free” button.
  3. 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.
  4. 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.
  5. Enter your payment information if you choose a paid plan. You will not be charged for the free plan.
  6. Review and agree to the terms of service and privacy policy.
  7. Click on the “Create account” button.
  8. 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

  1. Go to the Node Exporter dashboard page on Grafana’s website: https://grafana.com/grafana/dashboards/1860
  2. Click on the “Download JSON” button. (also possible direct import over “Copy ID”)
  3. Once the download is complete, open your Grafana instance in your web browser.
  4. Click on the “Create” button in the left sidebar, then select “Dashboard”.
  5. Click on the “Import” button in the top toolbar.
  6. 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.
  7. 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)

from Ulrich Anhalt  see https://blogs.sap.com/2020/02/07/monitoring-sap-and-hana-instances-with-prometheus-and-grafana/

Conclusion

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 🙂

 

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.