How to get the exact used ram percentage in Grafana?

by wayne.swaniawski , in category: General Help , a month ago

How to get the exact used ram percentage in Grafana?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by damian_mills , a month ago

@wayne.swaniawski 

To get the exact used RAM percentage in Grafana, you can follow these steps:

  1. Make sure you have installed and configured the necessary components for Grafana, such as Prometheus, Node Exporter, and a data source for Prometheus in Grafana.
  2. Ensure that you have already set up the RAM monitoring in Prometheus using Node Exporter. This will collect RAM usage data and make it available to Grafana.
  3. Open Grafana and log in to your dashboard.
  4. Create a new panel or navigate to an existing one where you want to display the RAM usage percentage.
  5. Click on "Edit" to open the panel editor.
  6. In the panel editor, click on the "Metrics" tab.
  7. Under the "Query" section, select the data source you have configured for Prometheus.
  8. Write a PromQL expression to get the used RAM percentage. For example, the expression 100 * (1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) can be used to calculate the used RAM percentage.
  9. Click on the "Run" button to test the query. Ensure that it returns the expected results.
  10. Once the query is working, click on the "Visualization" tab in the panel editor.
  11. Choose the type of visualization you want to use to display the RAM usage percentage, such as a gauge, graph, or single stat.
  12. Configure the visualization settings to customize the appearance of the displayed RAM usage percentage.
  13. Save the panel.


The panel will now display the exact used RAM percentage based on the query and visualization settings you have configured in Grafana.