Prometheus Expression correction

22 views
Skip to first unread message

Travel & Devops

unread,
Apr 8, 2020, 5:45:28 AM4/8/20
to Prometheus Users
Hello Team ,

I am trying to create a alert rule to monitor RDS databse connections count , if the database connection count is less-than one we need an alert  , but RDS has read-replicas and we don't want to monitor read-replicas , 

I have wrote the below alert rule to exclude read-replica but i was not giving any data seem's to be some issue with the expression,

aws_rds_database_connections_sum{dbinstance_identifier=~"aws-db-prd-om-enc",dbinstance_identifier!~".*-read-replica"}

above expression is not giving any data 
Can any one help me on this to correct the expression

Sample DB name :testing-c1-us-east-1-aws-db-prd-com-enc" 
Replica DB Name: testing-c1-us-east-1-aws-db-prd--om-enc-read-replica"

Regards
Reddy

Brian Candler

unread,
Apr 8, 2020, 7:23:38 AM4/8/20
to Prometheus Users
On Wednesday, 8 April 2020 10:45:28 UTC+1, Travel & Devops wrote:
Hello Team ,

I am trying to create a alert rule to monitor RDS databse connections count , if the database connection count is less-than one we need an alert  , but RDS has read-replicas and we don't want to monitor read-replicas , 

I have wrote the below alert rule to exclude read-replica but i was not giving any data seem's to be some issue with the expression,

aws_rds_database_connections_sum{dbinstance_identifier=~"aws-db-prd-om-enc",dbinstance_identifier!~".*-read-replica"}

above expression is not giving any data 
Can any one help me on this to correct the expression

Sample DB name :testing-c1-us-east-1-aws-db-prd-com-enc" 

That will not match dbinstance_identifier=~"aws-db-prd-om-enc"

However it will match dbinstance_identifier=~".*aws-db-prd-om-enc"
Reply all
Reply to author
Forward
0 new messages