How to build Query in grafana?


#1

Please i need urgent help !!

Hello Grafana Team,

I install grafana with prometheus running on individual post localhost:3000 and localhost:9090 and node_exporter and mysqld_exporter both are running successfully localhost:9100 and 9104. i’m using this site to install all the process https://www.percona.com/blog/2016/02/29/graphing-mysql-performance-with-prometheus-and-grafana/ everything is running succesfully but i would like to know how to build query in grafana i have a database name otrs and i want to find id , name from user table so how to build query to show graph


#2

You will have to learn the Prometheus query language (PromQL). The query editor in Grafana for Prometheus is just a textbox for writing PromQL. (Other Time Series dbs have a query editor with dropdowns and intellisense but the Prometheus community generally prefers to use PromQL).

The Grafana Demo site has a few dashboards where you can look at examples:

Prometheus Dashboards on Grafana.com: https://grafana.com/dashboards?dataSource=prometheus


#3

thank you for the support but i want to fetch data from mysql i am already mention in previous message please sample query how to fetch data i have a database name otrs and i want to find id , name from user table so how to build query to show graph


#4

There is no way to read data directly from MySQL yet, you use prometheus to collect MySQL metrics and performance data which you graph in Grafana.

If you want to do SQL queries and show response in Grafana you need to wait for our MySQL datasource support


#5

Please see …

I install grafana with prometheus running on individual post localhost:3000 and localhost:9090 and node_exporter and mysqld_exporter both are running successfully localhost:9100 and 9104. i’m using this site to install all the process https://www.percona.com/blog/2016/02/29/graphing-mysql-performance-with-prometheus-and-grafana/1 everything is running succesfully but i would like to know how to build query in grafana i have a database name otrs and i want to find id , name from user table so how to build query to show graph


#6

Just checking but do you know that Grafana is for visualizing metrics from time series databases (like Prometheus)? Here is a definition for time series.

MySql is not a time series database. We will be adding support for time series queries (queries that are in time series form) from MySQL in future versions but that is not available in the current version.


#7

i already understand that point i would like to know how to fetch data in grafana through prometheus by mysql


#8

Sorry, I don’t understand your question. What sort of data do you want to fetch through Prometheus. Can you give an example? Are you monitoring your MySQL server with Prometheus and are trying to show something from this list?


#9

Hi torkel,

Recently we have configured Grafana in our account.
After installing we can see only few things. I did some research and imported few dashboards but unable to see which the data i need.

Mainly we are looking for below things.
1)Pods status
Incase of any Pod fails i want to see which Pod failed i.e Pod name from Grafana.
2)Services status in Pod
what is the status of the service like up or down.
for any reason if any service goes down

Need to view in Grafana.

Kindly help on this. I am new to Grafana
Appreciate your help on this.
If you have any dashboard available with above features kindly share the same.