I have a simple PromQL query that performs a count:
sum(up{container_name="my-container",environment_name="$env"})
This is part of a Grafana Dashboard and allows for ${env} to be selected from a drop down menu.
I would like to perform different queries depending on the environment.
How do I construct something like this in PromQL:
if ${env} == 'dev' or ${env} == 'integration':
if sum(up{container_name="my-container",environment_name="$env"}) == 1:
sum(up{container_name="my-container",environment_name="$env"}) + 1
else:
sum(up{container_name="my-container",environment_name="$env"})
else:
sum(up{container_name="my-container",environment_name="$env"})
The purpose is to falsely inflate the count to trigger a healthy threshold in a RAG status panel in environments that are running single containers.