Problem with building a qury

18 views
Skip to first unread message

SQL DBA

unread,
Apr 2, 2020, 9:55:03 AM4/2/20
to Prometheus Users
HI all,
I'm extremely new to prometheus and have some issues with defining a query. The documentation didn't address the issue I'm having; probably something really simple but I jus dont see it. Here it is: I have about 50 SQL Servers that I'm monitoring, this is fine. If I execute CPU_____SQL_process it returns the info on all of them which is ok. I can filter down to 1; example - 

CPU_____SQL_process{DB="SQL Server",Env="dev",cluster="Test node",host="xxxxxxxx",instance="xxxxxxxxx.xxxxxxx.com:9273",job="SQLSERVER_Tst",servername="SERVER1",type="CPU usage"} 

This returns fine but is I try to run with 2:

CPU_____SQL_process{DB="SQL Server",Env="dev",cluster="Test node",host="xxxxxxxx",instance="xxxxxxxxx.xxxxxxx.com:9273",job="SQLSERVER_Tst",servername="SERVER1",type="CPU usage"} 
CPU_____SQL_process{DB="SQL Server",Env="dev",cluster="Test node",host="xxxxxxxx",instance="xxxxxxxxx.xxxxxxx.com:9273",job="SQLSERVER_Tst",servername="SERVER2",type="CPU usage"} 

I end up with errors - Error executing query: invalid parameter 'query': parse error at char 195: could not parse remaining input "CPU_____SQL_pro"...

From the documentation this should work but I must be missing something or have something in here I don't need. If anyone has any suggestion thank you in advance.

Mike


sayf eddine Hammemi

unread,
Apr 2, 2020, 10:06:22 AM4/2/20
to SQL DBA, Prometheus Users
Hello, I guess you can use regex to select both servers in one query servername=~" SERVER1|SERVER2"

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/dda3d8db-55d4-434f-a70c-8937a7172af3%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages