I don't understand this

Please kindly help me to check if this is the correct syntax or not as below:

I want to count the Buffer Pool Size of Total RAM, please see the expression statement(Prometheus datasource):

(mysql_global_variables_innodb_buffer_pool_size{instance="$host"} * 100) / on (instance) node_memory_MemTotal{instance="$host"}

I don’t understand “on (instance)” here…I can get a correct value from the expression statement “mysql_global_variables_innodb_buffer_pool_size{instance=”$host"}, but I can’t get nothing from the expression statement “node_memory_MemTotal{instance=”$host"}…I also checked on Prometheus but get nothing. Does anyone know this?
Thanks in advance.

Hi,

What kind of Prometheus exporters are you using?

I think you need to run the Prometheus Node Exporter to gather node_memory_MemTotal metric.

Marcus

Hi, @mefraimsson, I apologise for the late reply. Yeap, you are exactly right. It works very well now with your solution. But I have another issue: I went into the settings on the top of the dashboard, and marked the tags for that certain dashboard, I tried to link to other dashboards through the “Links” button, besides, I want to open those dashboards with a new window. I tried so many times but failed, that page covered the former one. What is quite strange to me is that it works fine when I tried in the “Drilldown/detail link” part, the page would open in a new tab. Do you know the reason for this? Thanks a lot in advance.

Hi,

Glad it worked out.

Regarding your second problem, there’s an open issue for that.

Thanks

Marcus

@mefraimsson, thank you. Hope we can have it fixed ASAP. Bless…:smiley:

I am having a similar issue, I have installed the prometheus node_exporter running on port 9100 and mysqld_exporter running in port 9104 and configured grafana to use prometheus as the default source.

From the grafana explorer, I can query the node_memory_MemTotal_bytes using something like:

node_memory_MemTotal_bytes{instance="10.0.0.4:9100"}

notice port 9100 (node_exporter)

And I can query also the innodb_buffer_pool_size using:

 mysql_global_variables_innodb_buffer_pool_size{instance="10.0.0.4:9104"}

notice port 9104 (mysqld_exporter)

I would like to calculate the Buffer pool size of total RAM using:

(mysql_global_variables_innodb_buffer_pool_size{instance=~"$host"} * 100) / on (instance) node_memory_MemTotal_bytes{instance=~"$host"}

The problem I have is that $host is the IP and the port: 10.0.0.4:9104 and can only obtain the mysql_global_variables_innodb_buffer_pool_size from the mysqld_exporter and not the node_memory_MemTotal_bytes since is in port 9100 because of this I am getting No Data

Any ideas about how could I mix data the metrics from the node_exporter & the mysqld_exporter?

This is the prometheus configuration:

- job_name: test_mysql
  scheme: http
  static_configs:
  - targets:
    - 10.0.0.4:9104

- job_name: test_node
  scheme: http
  static_configs:
  - targets:
    - 10.0.0.4:9100