Working on a W11 pc with the latest image available for the subsequent technologies, i’ve deployed a typical stack composed of cadvisor, Alloy, Prometheus using Docker containers.
My goal is to monitor the state of a one node Docker Swarm deployed by another user with several services. For each service i want to check how many are up compared to the total of Replicas.
For this task i’ve been asked to create a Bar Chart that combines two queries. The first gets from a hardcoded metric that is used as an inventory of sorts the service name and the total amount of replicas that should be running. For that i use this query:
The other query obtains the current replicas of each service running using the “container_last_seen” variable, having the issue that if a service has never ran, it does not appear in the graph. Which is expected behaviour, for what i’ve researched.
The current graph i have created just shows each result side by side as seen below.
What i want to do is to put the “inventory” query in the foreground and the current running services in front of it, so, if some replicas are missing from a service or that service hasn’t even been launched, you can directly see them. In the picture, the purple bars are the inventory (Which needs to have a few extra new services added that i have not typed in yet) and the orange the current containers.
Another extra bit i want to change for better clarity is just hardcoding the X axis to show, for each bar, the names of the services that appear to the right instead of the date. The issue is that all the values i can select from the X-axis value field are the services shown and it swaps the 2026 for the value of the replicas currently running in the service.
Summing it up, i want to send one query to the foreground with the other in front and swap the date for the service’s name per each bar.
¿Is this achievable? I am literally at wit’s end.




