8

I want to exclude mulitple app groups from my query... Not sure how to go about it.. My thoughts are like this

count(master_build_state{app_group~! "oss-data-repair", "pts-plan-tech-solution", kubernets_namespace = "etc"} ==0) 

I do not want to include those two app_groups, but am not sure how to implement in PromQL. You would thing to add () or [], but it throws errors. Let me know if anyone can help!

Thanks

ColeGulledge
  • 393
  • 1
  • 2
  • 12

2 Answers2

14
count(master_build_state{app_group !~ "(oss-data-repair|pts-plan-tech-solution)", kubernets_namespace="etc"} ==0)
Robert Hunt
  • 7,914
  • 5
  • 40
  • 43
ColeGulledge
  • 393
  • 1
  • 2
  • 12
7

you can use the != comparison binary operator to do that. Just write it twice on your promQL.

count(
  master_build_state{
    app_group!="oss-data-repair", 
    app_group!="pts-plan-tech-solution",
    kubernets_namespace="etc"} 
== 0) 
Felipe
  • 7,013
  • 8
  • 44
  • 102