Health, capacity, and tuning monitor for MedDream servers, with a web UI
369
Health, capacity and tuning monitor for one or more MedDream servers, with a web UI.
mdMonitor reads MedDream's management endpoint (/manage, Spring Boot
Actuator), keeps the readings in a database of its own, and answers four
questions instead of showing a thousand numbers:
It only reads from MedDream, with one exception: the Logs tab's Logging level dialog changes a logger's level when you ask it to, and puts it back after 60 minutes.
docker run -d --name mdmonitor \
-p 8090:8090 \
-v mdmonitor-data:/data \
-e MDMONITOR_MANAGE_URL=http://meddream.example:8081/manage \
-e MDMONITOR_MANAGE_USER=admin \
-e MDMONITOR_MANAGE_PASSWORD=change-me \
meddream/mdmonitor:latest
Open http://<docker host>:8090 and log in with admin / admin. Every
page shows a red warning until you change that password (see Login).
With only these variables, mdMonitor monitors one instance and shows live data, but keeps no history. Add a database (see Docker Compose) for charts over time, the Logs tab and Export diagnostics.
services:
mdmonitor:
image: meddream/mdmonitor:latest
restart: unless-stopped
ports:
- "8090:8090"
volumes:
- ./data:/data
environment:
MDMONITOR_DB_ENABLED: "true"
MDMONITOR_DB_ENGINE: postgresql
MDMONITOR_DB_HOST: db
MDMONITOR_DB_USER: mdmonitor
MDMONITOR_DB_PASSWORD: change-me
MDMONITOR_DB_NAME: mdmonitor
depends_on:
- db
db:
image: postgres:18
restart: unless-stopped
environment:
POSTGRES_USER: mdmonitor
POSTGRES_PASSWORD: change-me
POSTGRES_DB: mdmonitor
volumes:
- ./postgresql:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mdmonitor -d mdmonitor"]
interval: 5s
timeout: 5s
retries: 10
Put the MedDream instances in ./data/config.json (below), or add them from
the Configure instances page once mdMonitor is running. MySQL / MariaDB
work too: set MDMONITOR_DB_ENGINE: mysql. mdMonitor creates its tables on
startup and upgrades them when you pull a newer image. It needs a database of
its own; never point it at MedDream's.
/data volume| Path | What it is |
|---|---|
/data/config.json | All settings: instances, database, login, log collection. Holds passwords. |
/data/favorites.json | Favourite charts. |
/data/diagnostics/ | Recorded diagnostics bundles. |
The Configure instances and Logs pages write to config.json, so mount /data
writable. If there is no config.json, defaults and environment variables
apply; the first save from the Configure instances page creates the file.
A minimal config.json for two servers:
{
"instances": [
{ "key": "prod1", "label": "Production",
"url": "http://10.0.0.10:8081/manage",
"username": "admin", "password": "..." },
{ "key": "test", "label": "Test",
"url": "https://10.0.0.20:8087/manage",
"username": "admin", "password": "...", "verify_tls": false }
],
"database": { "enabled": true, "engine": "postgresql", "host": "db",
"user": "mdmonitor", "password": "...", "database": "mdmonitor",
"retention_days": 7 },
"auth": { "username": "admin", "password": "pbkdf2_sha256$..." }
}
key is the instance's permanent identity: history is stored under it, so do
not change it once data exists. label is the name people see; change it
freely.verify_tls: false skips the certificate check, for example when MedDream is
reached by IP address or through a tunnel. The connection stays encrypted.retention_days (default 7) - older samples are deleted hourly.Each one overrides a single value in config.json.
| Variable | Sets |
|---|---|
MDMONITOR_MANAGE_URL, _USER, _PASSWORD, MDMONITOR_VERIFY_TLS, MDMONITOR_REQUEST_TIMEOUT | The MedDream instance - only when exactly one is configured |
MDMONITOR_DB_ENABLED, _ENGINE, _HOST, _PORT, _USER, _PASSWORD, _NAME, _CREATE, _RETENTION_DAYS | The history database (_ENGINE: mysql or postgresql) |
MDMONITOR_LIVENESS_INTERVAL, _METRICS_INTERVAL, _SCHEDULER_INTERVAL, _INFO_INTERVAL | Polling intervals in seconds (defaults 15, 20, 60, 300) |
MDMONITOR_HISTORY_SECONDS | How much history is kept in memory (default 7200) |
MDMONITOR_LOG_LEVEL | mdMonitor's own log level (default INFO) |
MDMONITOR_CONFIG | Path of config.json (the image sets /data/config.json) |
MDMONITOR_WEB_HOST, MDMONITOR_WEB_PORT | Web address and port (the image sets 0.0.0.0 and 8090) |
mdMonitor's own log goes to the container output: docker logs mdmonitor.
Every page needs a login except /healthz, which you can use for a container
health check. The account is auth in config.json. To store a hash
instead of the plain password:
docker run --rm -it meddream/mdmonitor:latest --hash-password
Paste the printed pbkdf2_sha256$... value as auth.password and restart
the container. Five failed logins from one address lock it out for a minute.
"auth": {"enabled": false} switches login off, only for a deployment that is
already behind an authenticating proxy.
MedDream ships with its management endpoints switched off. Set these in
MedDream's application.properties (or as environment variables in its own
container) and restart it. The ? MedDream setup button on mdMonitor's
Configure instances page shows the full list, with a Copy button.
management.endpoints.enabled-by-default=true
management.endpoints.web.exposure.include=prometheus,health,info,scheduledtasks,httpexchanges,logfile,loggers,threaddump
authentication.manager.username=<manager user>
authentication.manager.password=<manager password>
The same as environment variables:
MANAGEMENT_ENDPOINTS_ENABLEDBYDEFAULT=true
MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE=prometheus,health,info,scheduledtasks,httpexchanges,logfile,loggers,threaddump
AUTHENTICATION_MANAGER_USERNAME=<manager user>
AUTHENTICATION_MANAGER_PASSWORD=<manager password>
| Endpoint | Feeds | Needed? |
|---|---|---|
prometheus | every metric: users, requests, queues, threads, CPU, memory, disks | required |
health | liveness ping and licence check | optional |
info | MedDream build and version | optional |
scheduledtasks | scheduled tasks, hung or overdue ones | optional |
httpexchanges | the slowest actual requests, with their URLs | optional |
logfile | the Logs tab: MedDream's errors, explained | optional |
loggers | the Logs tab's Logging level dialog | optional |
threaddump | thread dumps in an Export diagnostics recording | optional |
List the endpoints by name; do not use *, which also exposes shutdown,
restart, env and heapdump. Any optional endpoint you leave out is shown as
Not measured. Detect endpoints on the Configure instances page checks
what a server actually serves.
Recommended too:
server.tomcat.mbeanregistry.enabled=true - shows Tomcat's busy request
threads and open connections.management.metrics.tags.key=spring - makes all of MedDream's thread pools
visible, not only some.management.endpoint.logfile.external-file=<path>/meddream.main.log - lets
the Logs tab read MedDream's log.management.metrics.system.diskspace.paths=<path 1>,<path 2> - free space on
every disk MedDream writes to.management.server.port=8081 - keeps /manage off the port users reach.
Expose it only to mdMonitor, never to the internet./api/status only.Content type
Image
Digest
sha256:b10d24dfa…
Size
54.4 MB
Last updated
4 days ago
docker pull meddream/mdmonitor