Health and logs
This page shows how to tell that MakeIntelligent is healthy, where to read what it says, and how to feed a monitoring system.
Health endpoints
| Service | Endpoint | Login | Meaning |
|---|---|---|---|
| Console | GET /health and GET /api/v2/health | No | JSON with status: "healthy", service: "console-api", store, version, tls, mtls, ldap, oidc, azureSso, secretsAtRest, auditRetentionDays, smtpConfigured, httpRedirect |
| Console | GET /ready | No | 200 {"status":"ready"} or 503 {"status":"not ready"} while stopping, when the store is unreachable, or on a standby Console without the high-availability licence |
| Console | GET /api/v2/version, GET /api/v2/edition | No | Version, edition and deployment |
| Site Runtime | GET :8081/healthz, /metrics, /ingest/status | Local API of the collector (port 8081 in the plant stack and in Lite) | |
| Observing (mi-visual) | GET /health | Port 8090 in the plant stack, 8083 in Lite. Data calls need a token | |
| mi-ingest | GET :9464/healthz, /readyz, /metrics | Internal only, never on the ingress. readyz is true when the database and historian are reachable and the CA and revocation list are loaded | |
| mi-db | pg_isready plus the marker file .mii_schema_ready | Compose health check | |
| mi-tsdb | SELECT 1 through clickhouse-client | Compose health check |
Try it:
curl -fsS http://localhost:8080/api/v2/health
curl -fsS http://localhost:8080/ready
In mii Lite, mii status shows the service state and the result of the health call. The Docker image of mii Lite checks /api/v2/health every 15 seconds (60 seconds start period, 10 retries). That check covers the Console only. Other components are shown by mii health (below) and by the Runtimes page.
In the Console, the top bar shows a status chip (Console online, Runtime offline, Console unreachable) and the count of open issues. See also the Overview page.
Logs
mii Lite
All logs are in the logs folder of the data directory:
| Windows | Linux | |
|---|---|---|
| Folder | C:\ProgramData\MakeIntelligent\logs\ | /var/lib/makeintelligent/logs/ |
| File | Content |
|---|---|
mii.log | The launcher: start, stop, restarts, upgrade steps, backup |
postgres.log, migrate.log, console.log, observing.log, collector.log | One log per component |
health.jsonl | One health sample per component per minute (see below) |
Every log is rotated at 10 MB and five files are kept (mii.log and the component logs).
Windows also writes the Event Log, source MakeIntelligent, for crashes, restarts, a component that gave up (degraded) and failed upgrades. On Linux the service writes to the journal as well:
journalctl -u makeintelligent -f
Find recent errors on Windows:
Select-String C:\ProgramData\MakeIntelligent\logs\*.log -Pattern "ERROR"
On Linux:
sudo grep -h "ERROR" /var/lib/makeintelligent/logs/*.log | tail -50
Docker and the plant stack
Containers write to standard output.
docker logs mii --tail 200
docker compose -f compose.plant.yml logs -f mi-console
Level and format
| Variable | Default | Values |
|---|---|---|
MI_LOG_LEVEL | info | debug, info, warn, error |
MI_LOG_FORMAT | text | text or json. The Docker images and mii Lite use json |
Set them in config/mii.env for Lite (restart the service), or in the environment of the container. Use debug only for a short time to find a problem. It is verbose.
Component health in mii Lite: mii health
The service samples the memory, handles (file descriptors on Linux), threads and restart count of every component once a minute and appends it to logs/health.jsonl. One line per component:
{"t":"2026-12-02T08:10:00Z","name":"collector","pid":4312,"state":"running","rssBytes":182452224,"handles":210,"threads":38,"restarts":0}
mii health prints the latest sample:
COMPONENT PID RSS(MiB) HANDLES THREADS RESTARTS SAMPLED
collector 4312 174 210 38 0 23s ago
console 4288 96 140 22 0 23s ago
mii 4270 41 88 14 0 23s ago
observing 4301 58 96 16 0 23s ago
postgres 4250 210 95 9 0 23s ago
The numbers above are an example. A component with a growing restarts value is crash-looping. A steadily growing rssBytes over days points to a leak. The tool mii-soak analyses health.jsonl over time.
Crash handling
If a component crashes, the launcher restarts it with back-off: 1 s, 2 s, 4 s and so on, up to 60 s. A run longer than 60 s resets the back-off. If a component crashes more than the allowed number of times within 5 minutes, the launcher gives up on it, marks it degraded, writes the event to mii.log (and to the Windows Event Log) and leaves it stopped. Look at its own log, fix the cause and restart the service. The Windows service and the systemd unit also restart the whole mii process after a failure.
Metrics (Prometheus)
| Service | Where | Prefix |
|---|---|---|
| Console | GET /metrics and /api/v2/metrics | mi_console_ |
| Site Runtime | GET :8081/metrics | mi_runtime_ |
| mi-ingest | GET :9464/metrics |
Useful Console metrics:
| Metric | Meaning |
|---|---|
mi_console_http_requests_total{route,method,code} | Requests |
mi_console_http_request_seconds{route} | Request duration |
mi_console_login_failures_total{reason} | Failed logins: rejected, rate_limited, other |
mi_console_build_info | Version |
mi_console_leader | Whether this Console is the leader |
mi_console_runtime_heartbeat_age_seconds{runtime} | Age of the last heartbeat of each runtime |
mi_console_license_info{edition,state} | Licence edition and state |
mi_console_license_expiry_timestamp_seconds | Licence expiry |
mi_console_historian_up | Historian reachable |
mi_console_historian_last_success_timestamp_seconds | Last successful historian call |
mi_console_store_up | Database reachable |
Useful runtime metrics: mi_runtime_devices_connected, mi_runtime_devices_active, mi_runtime_buffer_queued_samples, mi_runtime_buffer_dropped_samples_total, mi_runtime_buffer_oldest_age_seconds, mi_runtime_ot_device_read_errors_total, mi_runtime_ot_device_tags_in_error, mi_runtime_child_up, mi_runtime_child_restarts, mi_runtime_disk_used_bytes, mi_runtime_process_rss_bytes.
Protect the metrics
| Variable | Default | Meaning |
|---|---|---|
MI_METRICS_ADDRESS | unset | A separate listener for /metrics, /ready and /health |
MI_METRICS_PUBLIC | false | Also serve the metrics on the UI port when the address is set |
MI_METRICS_TOKEN or MI_METRICS_TOKEN_FILE | none | Bearer token, at least 16 characters. Clients send Authorization: Bearer <token> |
With no address and no token the UI port serves /metrics without a login. With MI_METRICS_ADDRESS set, /metrics and /ready are no longer on the UI port (404) unless MI_METRICS_PUBLIC=true. Set a token in every plant that is reachable from a network you do not control.
# Prometheus scrape job
scrape_configs:
- job_name: mii-console
metrics_path: /metrics
authorization:
credentials: "<MI_METRICS_TOKEN>"
static_configs:
- targets: ["mii-console.izmir.example:9100"]
What to alert on
| Condition | Source |
|---|---|
| Console down | /ready fails, or mi_console_store_up == 0 |
| Historian down | mi_console_historian_up == 0 |
| Runtime offline | mi_console_runtime_heartbeat_age_seconds above 15 |
| Data is delayed | mi_runtime_buffer_oldest_age_seconds rising |
| Data is lost | mi_runtime_buffer_dropped_samples_total rising |
| Licence ends soon | mi_console_license_expiry_timestamp_seconds |
| Component crash loop | restarts in mii health or mi_runtime_child_restarts |
For email or webhook messages from the Console itself, use Settings → Alerts. It sends a message when a driver failed, a Destination disconnected, the rules queue is deep, or a runtime is offline. See Alarms.
Limits and good practice
- Keep at least a week of logs. The rotation keeps about 50 MB per component.
- Send the JSON logs to a central log system if you have one.
- Check
mii healthafter every upgrade and again after a day. - Do not expose port 8081, 8083, 8090 or 9464 to the network. They are internal.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
mii status says unreachable right after start | The Console needs 1 to 2 minutes to start | Wait and run it again |
/ready returns 503 | Stopping, the database is unreachable, or this is a standby Console | Check mi_console_store_up and the database |
/metrics returns 404 on the UI port | MI_METRICS_ADDRESS is set | Scrape the metrics listener, or set MI_METRICS_PUBLIC=true |
/metrics returns 401 | A token is required | Send the bearer token |
mii health says no health samples yet | The service has not run a full minute | Wait one minute |
| A component is degraded | It crashed too often | Read its log in the logs folder, fix it, restart |