Hi, Moving this thread to prometheus-users (+bcc -dev), where it is a better fit.
Assuming the label names and values referenced in your expression actually exist in your metrics data, one problem is that with the regex you are trying to select only part of a string. However, Prometheus regular expression matchers always try to match an entire string, not a substring. If for example you want to match any string that ends with "-aws-db-prd-om-enc", you would have to explicitly make it a substring match like so: dbinstance_identifier=~".*-aws-db-prd-om-enc". Note you have some "com", "om", "-om" inconsistencies in your examples. I assume you are just starting out with this query fragment and are still planning on adding further constructs (like "== 0") around that selector expression to actually detect if the sum is 0. Cheers, Julius On Wed, Apr 8, 2020 at 11:40 AM Travel & Devops <[email protected]> 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",d* > *binstance_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 > > -- > You received this message because you are subscribed to the Google Groups > "Prometheus Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prometheus-developers/3694e31d-f03a-4cb3-81e5-8a4970801977%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-developers/3694e31d-f03a-4cb3-81e5-8a4970801977%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Prometheus Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CA%2BT6YozLt1k-x%2BTB3Wa4aLu2vBvyGZJU7rYgjUugDjYgsp4kJQ%40mail.gmail.com.

