I am using following query:
sum(count_over_time(container_tasks_state{state="running", container_label_com_docker_swarm_task_name=~".+"}[35s]) ) by (container_label_com_docker_swarm_service_name, container_label_com_docker_swarm_node_id) < 2
How to change this query to make sure that state of the found container is currently running?
Thanks
My scrape_interval is 15s. If my query returns value less than 2, this means that a running container was stopped or a new container was started. This works fine for me, but I need to separate cases when a container was stopped and when a container was started.