How gladioluss/docker_healthcheck_exporter works
Docker Healthcheck Exporter periodically reads container health from Docker, caches a snapshot, and serves Prometheus metrics from that snapshot; it can also write metrics to a configured textfile. The CLI loads settings and starts the web app, whose lifecycle starts and stops the collector. Collection applies name and label filters, classifies health states, and includes Compose labels. The graph reflects the shown calls and README-described scraping and capabilities; Docker and Prometheus are external. Configuration includes remote-Docker options, but the excerpts do not show how those settings reach the Docker client.
Main entry points: app.py Web app and refresh loop · collector.py Container collector · __main__.py CLI entry point · config.py Settings loader
Components 14
Startup and configuration
- CLI entry point
docker_healthcheck_exporter/__main__.py - Settings loader
docker_healthcheck_exporter/config.py
Docker collection
- Container collector
docker_healthcheck_exporter/collector.py - Cached snapshot
docker_healthcheck_exporter/app.py
Metrics serving
- Web app and refresh loop
docker_healthcheck_exporter/app.py - Prometheus renderer
docker_healthcheck_exporter/metrics.py - Metrics endpoint
docker_healthcheck_exporter/app.py - Health endpoint
docker_healthcheck_exporter/app.py
Logging and integrations
- Metrics textfile
- Logging
docker_healthcheck_exporter/logger.py
Other components
- Operator
- Environment settings
- Docker Engine
- Prometheus scraper
Connections 18
- Operator → CLI entry point: starts
README.md - CLI entry point → Settings loader: loads settings
docker_healthcheck_exporter/__main__.py - Environment settings → Settings loader: provides values
docker_healthcheck_exporter/config.py - CLI entry point → Web app and refresh loop: runs server
docker_healthcheck_exporter/__main__.py - Web app and refresh loop → Settings loader: loads settings
docker_healthcheck_exporter/app.py - Web app and refresh loop → Container collector: starts and stops
docker_healthcheck_exporter/app.py - Web app and refresh loop → Container collector: refreshes via
docker_healthcheck_exporter/app.py - Container collector → Docker Engine: lists and inspects
docker_healthcheck_exporter/collector.py - Container collector → Cached snapshot: returns statuses
docker_healthcheck_exporter/app.py - Web app and refresh loop → Cached snapshot: updates
docker_healthcheck_exporter/app.py - Web app and refresh loop → Prometheus renderer: renders snapshot
docker_healthcheck_exporter/app.py - Prometheus scraper → Metrics endpoint: scrapes
README.md - Metrics endpoint → Web app and refresh loop: reads metrics text
docker_healthcheck_exporter/app.py - Web app and refresh loop → Metrics textfile: writes metrics
docker_healthcheck_exporter/app.py - Operator → Health endpoint: checks health
docker_healthcheck_exporter/app.py - CLI entry point → Logging: configures logging
docker_healthcheck_exporter/__main__.py - Web app and refresh loop → Logging: logs events
docker_healthcheck_exporter/app.py - Container collector → Logging: logs events
docker_healthcheck_exporter/collector.py