Skip to content

Configuration

MikroAPM resolves configuration from environment variables, the config file, and defaults.

The default server config file is:

mikroapm.config.json

Use MIKROAPM_CONFIG_PATH or CONFIG_PATH to point the server at another file.

{
"sites": [
{
"name": "Website",
"url": "https://example.com",
"timeout": 10000,
"expectedStatuses": [200, 204],
"maxLatencyMs": 2000,
"retries": 2,
"retryDelayMs": 500
}
],
"checkIntervalMinutes": 5,
"enableSummaryWrites": true,
"admin": {
"token": "replace-with-a-long-random-token"
},
"public": {
"password": "optional-public-dashboard-password"
}
}

Each site can set:

FieldPurpose
nameHuman-readable label. Defaults to the protocol-less URL.
urlURL to check.
methodHTTP method, usually GET or POST.
headersOptional request headers.
bodyOptional request body.
timeoutRequest timeout in milliseconds.
expectedStatusesAccepted status codes.
expectedTextText that must appear in the response.
maxLatencyMsMarks checks unhealthy when latency exceeds the limit.
retriesRetry count after a failed attempt.
retryDelayMsDelay between retries.
pausedStops checks for the site.
maintenanceWindowsSuppresses checks and alerts during planned downtime.
allowPrivateNetworkAllows private or localhost targets. Disabled by default.
VariablePurpose
MIKROAPM_PORT or PORTServer port. Defaults to 3000.
MIKROAPM_CONFIG_PATH or CONFIG_PATHConfig file path.
MIKROAPM_DB_PATH or DB_PATHPikoDB data directory.
ENABLE_SCHEDULERSet to false to disable automatic checks.
CHECK_INTERVAL_MINUTESHealth check interval.
ENABLE_SUMMARY_WRITESEnables daily summary writes.
MIKROAPM_ADMIN_TOKEN or ADMIN_TOKENAdmin password for protected admin APIs.
MIKROAPM_PUBLIC_PASSWORD or PUBLIC_PASSWORDOptional password for public status APIs and dashboard data.

For Cloudflare Workers, keep CHECK_INTERVAL_MINUTES aligned with the cron schedule in wrangler.toml.