Skip to main content

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​

ServiceEndpointLoginMeaning
ConsoleGET /health and GET /api/v2/healthNoJSON with status: "healthy", service: "console-api", store, version, tls, mtls, ldap, oidc, azureSso, secretsAtRest, auditRetentionDays, smtpConfigured, httpRedirect
ConsoleGET /readyNo200 {"status":"ready"} or 503 {"status":"not ready"} while stopping, when the store is unreachable, or on a standby Console without the high-availability licence
ConsoleGET /api/v2/version, GET /api/v2/editionNoVersion, edition and deployment
Site RuntimeGET :8081/healthz, /metrics, /ingest/statusLocal API of the collector (port 8081 in the plant stack and in Lite)
Observing (mi-visual)GET /healthPort 8090 in the plant stack, 8083 in Lite. Data calls need a token
mi-ingestGET :9464/healthz, /readyz, /metricsInternal only, never on the ingress. readyz is true when the database and historian are reachable and the CA and revocation list are loaded
mi-dbpg_isready plus the marker file .mii_schema_readyCompose health check
mi-tsdbSELECT 1 through clickhouse-clientCompose 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:

WindowsLinux
FolderC:\ProgramData\MakeIntelligent\logs\/var/lib/makeintelligent/logs/
FileContent
mii.logThe launcher: start, stop, restarts, upgrade steps, backup
postgres.log, migrate.log, console.log, observing.log, collector.logOne log per component
health.jsonlOne 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​

VariableDefaultValues
MI_LOG_LEVELinfodebug, info, warn, error
MI_LOG_FORMATtexttext 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)​

ServiceWherePrefix
ConsoleGET /metrics and /api/v2/metricsmi_console_
Site RuntimeGET :8081/metricsmi_runtime_
mi-ingestGET :9464/metrics

Useful Console metrics:

MetricMeaning
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_infoVersion
mi_console_leaderWhether 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_secondsLicence expiry
mi_console_historian_upHistorian reachable
mi_console_historian_last_success_timestamp_secondsLast successful historian call
mi_console_store_upDatabase 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​

VariableDefaultMeaning
MI_METRICS_ADDRESSunsetA separate listener for /metrics, /ready and /health
MI_METRICS_PUBLICfalseAlso serve the metrics on the UI port when the address is set
MI_METRICS_TOKEN or MI_METRICS_TOKEN_FILEnoneBearer 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​

ConditionSource
Console down/ready fails, or mi_console_store_up == 0
Historian downmi_console_historian_up == 0
Runtime offlinemi_console_runtime_heartbeat_age_seconds above 15
Data is delayedmi_runtime_buffer_oldest_age_seconds rising
Data is lostmi_runtime_buffer_dropped_samples_total rising
Licence ends soonmi_console_license_expiry_timestamp_seconds
Component crash looprestarts 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 health after every upgrade and again after a day.
  • Do not expose port 8081, 8083, 8090 or 9464 to the network. They are internal.

Troubleshooting​

SymptomCauseFix
mii status says unreachable right after startThe Console needs 1 to 2 minutes to startWait and run it again
/ready returns 503Stopping, the database is unreachable, or this is a standby ConsoleCheck mi_console_store_up and the database
/metrics returns 404 on the UI portMI_METRICS_ADDRESS is setScrape the metrics listener, or set MI_METRICS_PUBLIC=true
/metrics returns 401A token is requiredSend the bearer token
mii health says no health samples yetThe service has not run a full minuteWait one minute
A component is degradedIt crashed too oftenRead its log in the logs folder, fix it, restart