A data collection service that monitors real-time occupancy and temperature data for public swimming pools in Zürich, Switzerland and exposes metrics in Prometheus format.
This is a just for fun project.
This project collects data from Zürich's swimming pools through:
- Real-time occupancy data via WebSocket connection
- Temperature data via HTTP polling
- Exposes metrics in Prometheus format for monitoring and visualization
This project is an independent, open-source initiative and is not affiliated with, endorsed by, or associated with the City of Zürich, the Sportamt Zürich, or any of their agencies. All code provided by this project is for informational purposes only.
# HELP zurich_pools_current_fill Current number of visitors at the pool
# TYPE zurich_pools_current_fill gauge
zurich_pools_current_fill{pool_name="Freibad Seebach",pool_uid="SSD-11"} 4.0
zurich_pools_current_fill{pool_name="Hallenbad Oerlikon",pool_uid="SSD-7"} 69.0
# HELP zurich_pools_water_temperature Water temperature of the pool in degrees Celsius
# TYPE zurich_pools_water_temperature gauge
zurich_pools_water_temperature{pool_name="Hallenbad Oerlikon",pool_uid="SSD-7"} 28.0
zurich_pools_water_temperature{pool_name="Freibad Seebach",pool_uid="SSD-11"} 23.0
This project uses Devbox for development environment setup:
# Install Devbox (if not already installed)
# Then, activate the development environment:
devbox shellThis will automatically:
- Set up Python
- Set up the virtual environment
- Install tools such as uv and ruff
# Build a wheel locally and install using pipx
devbox run build
PIPX_DEFAULT_PYTHON=/usr/local/bin/python3.13 pipx install dist/pool_exporter-*.whl # Start the development environment
devbox shell
# Run the exporter locally from an editable install
devbox run serve
curl http://localhost:8000/metrics# Run type checking
devbox run mypy
# Format code
devbox run format
devbox run check
devbox run mdformat
devbox run dprint fmt
# Build wheel into /dist
devbox run build
# Build container
devbox run docker-build
# Wipe temporary files
devbox run clear
# Run tests
devbox run testRun the dockerized exporter locally together with Grafana and Prometheus for testing.
# Build and start services
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build