Skip to content

Environment variables

Both ongrid and ongrid-edge are configured exclusively through environment variables. No YAML. The canonical wiring lives in internal/pkg/config/config.go and the compose env block at deploy/docker-compose.yml. Every variable below is read at startup; the manager does not hot-reload.

Tables group variables by subsystem. Defaults shown are what the binary picks when the variable is unset or empty. "Required" means "the feature in column 1 will not work without it".


HTTP & metrics listeners

VariableTypeDefaultDescription
ONGRID_HTTP_ADDRstring:8080TCP listen for the API + SPA. nginx in the compose stack proxies /api/* here.
ONGRID_METRICS_ADDRstring:9100TCP listen for /metrics. Scraped by Prometheus.
ONGRID_TUNNEL_ADDRstring:40012Geminio broker listen. Bound by the frontier service, not the manager itself.
ONGRID_PUBLIC_URLstringemptyCanonical https://... URL the manager hands out to edges as the data-plane endpoint (logs/traces ingest, edge bundle download). Empty disables data plane plugin endpoints. Set this in production.

Database (MySQL default, SQLite opt-in)

VariableTypeDefaultDescription
ONGRID_DB_DIALECTstringmysqlmysql (default) or sqlite. Empty is treated as mysql.
ONGRID_DB_DSNstringongrid:ongrid@tcp(127.0.0.1:3306)/ongrid?parseTime=true&charset=utf8mb4&loc=LocalMySQL DSN. Required in production.
ONGRID_DB_PATHstring./data/ongrid.dbSQLite database file path. :memory: is accepted in tests.

JWT (iam)

VariableTypeDefaultDescription
ONGRID_JWT_SECRETstringdev-insecure-secret-change-meHS256 signing key for access + refresh tokens. Required; the default refuses to issue tokens in production builds.
ONGRID_JWT_ACCESS_TTLduration15mAccess-token TTL.
ONGRID_JWT_REFRESH_TTLduration168h (7d)Refresh-token TTL.

Durations accept Go time.ParseDuration syntax (15m, 2h, 30s). A bare integer is interpreted as seconds.


LLM providers

The chat agent supports six first-class providers plus a Custom (OpenAI-compatible) slot. Each provider is gated by its API key — empty key = provider not surfaced to the chat picker.

OpenAI

VariableTypeDefaultDescription
ONGRID_OPENAI_API_KEYstringemptyOpenAI API key. Empty = OpenAI hidden from the picker.
ONGRID_OPENAI_MODELstringgpt-5.4Default model when OpenAI is the selected provider.
ONGRID_OPENAI_BASE_URLstringemptyOverride base URL for OpenAI-compatible relays (Azure / vLLM / Ollama / one-api).

Anthropic, Zhipu, Gemini, DeepSeek, Kimi

Each provider has the same three keys (API key / default model / base URL) and a fourth (MODELS, comma-separated list of selectable model slugs):

VariableDefault
ONGRID_ANTHROPIC_API_KEYempty
ONGRID_ANTHROPIC_MODELclaude-sonnet-4-6
ONGRID_ANTHROPIC_BASE_URLempty
ONGRID_ANTHROPIC_MODELSclaude-opus-4-7,claude-sonnet-4-6,claude-haiku-4-5
ONGRID_ZHIPU_API_KEYempty
ONGRID_ZHIPU_MODELglm-4.7
ONGRID_ZHIPU_BASE_URLempty
ONGRID_ZHIPU_MODELSglm-5.1,glm-5,glm-4.7,glm-4.7-flash
ONGRID_GEMINI_API_KEYempty
ONGRID_GEMINI_MODELgemini-2.5-pro
ONGRID_GEMINI_BASE_URLempty
ONGRID_GEMINI_MODELSgemini-3.5-flash,gemini-2.5-pro,gemini-2.5-flash
ONGRID_DEEPSEEK_API_KEYempty
ONGRID_DEEPSEEK_MODELdeepseek-v4-flash
ONGRID_DEEPSEEK_BASE_URLempty
ONGRID_DEEPSEEK_MODELSdeepseek-v4-pro,deepseek-v4-flash,deepseek-reasoner
ONGRID_KIMI_API_KEYempty
ONGRID_KIMI_MODELkimi-k2.6
ONGRID_KIMI_BASE_URLempty
ONGRID_KIMI_MODELSkimi-k2.6,kimi-k2.5,moonshot-v1-128k

Routing & budget

VariableTypeDefaultDescription
ONGRID_LLM_DEFAULT_PROVIDERstringemptyProvider used when a request does not specify one. Empty = first configured provider (alphabetical). Set this when you want a specific provider to be the site default.
ONGRID_LLM_DAILY_TOKEN_LIMITint0Global per-UTC-day token ceiling. 0 = unlimited.

Agent kernel & tools

VariableTypeDefaultDescription
ONGRID_AGENT_KERNELstringgraphgraph enables the eino graph kernel + SkillRegistry.Resolve activation-keyword filter + ToolBag deferral pipeline. legacy is the older for-loop runner with all tools always full-schema. Flip to legacy only to bisect.
ONGRID_TOOLBAG_DEFERRAL_THRESHOLDint30Tool-count threshold above which specialty-tier tools get redacted schemas (LLM must call ToolSearch to expand).
ONGRID_SKILLS_EXTERNAL_DIRScsvemptyComma/colon-separated absolute paths the skill loader scans for skill.json manifests. Each must be absolute; relative or missing entries are skipped with a log line.

Frontier broker client

VariableTypeDefaultDescription
ONGRID_FRONTIER_ADDRstringfrontier:40011Service-bound listen of the upstream frontier broker the manager dials.
ONGRID_FRONTIER_SERVICE_NAMEstringongrid-managerIdentifier reported on connect.
ONGRID_FRONTIER_DISABLEDboolfalseSkip the long-lived service-end dial entirely. Used by e2e harness — features requiring the broker (webssh, edge reverse calls) error at call site.

Cloud-side Prometheus

VariableTypeDefaultDescription
ONGRID_PROM_ENABLEDboolfalseGates Prometheus wiring. When false the manager runs without metric storage; push_prom_samples silently drops, and query_promql is not registered as a tool.
ONGRID_PROM_URLstringhttp://prometheus:9090Prom server root URL.
ONGRID_PROM_REMOTE_WRITE_URLstringemptyExact remote_write endpoint when the upstream is not rooted at /api/v1/write (Mimir / Cortex / VictoriaMetrics gateway).
ONGRID_PROM_QUERY_URLstringemptyQuery API root for query_promql. Empty falls back to ONGRID_PROM_URL.
ONGRID_PROM_TLS_INSECUREboolfalseSkip TLS cert verification.
ONGRID_PROM_TLS_CA_FILEstringemptyPEM file with the root CA used to verify the TSDB's cert. Empty = system roots.

Grafana

VariableTypeDefaultDescription
ONGRID_GRAFANA_INTERNAL_URLstringhttp://grafana:3000/grafanaURL the manager uses to reach Grafana over the docker network.
ONGRID_GRAFANA_BOOTSTRAP_USERstringadminOne-time admin user used to auto-create the ongrid Service Account + token.
ONGRID_GRAFANA_BOOTSTRAP_PASSWORDstringemptyBootstrap password; empty disables bootstrap (paste a manually-created SA token in the UI).
ONGRID_GRAFANA_TLS_INSECUREboolfalseSkip cert verification for the bootstrap call.
ONGRID_GRAFANA_ROOT_URLstring%(protocol)s://%(domain)s/grafana/Forwarded to GF_SERVER_ROOT_URL.

Logs & traces (data plane)

VariableTypeDefaultDescription
ONGRID_LOG_QUERY_URLstringhttp://loki:3100Loki API root the manager talks to for query_range / labels / values. Empty = Logs page returns 503.
ONGRID_TRACE_QUERY_URLstringhttp://tempo:3200Tempo HTTP listener root for /api/search, /api/traces/<id>, /api/search/tag/<tag>/values. Empty = Traces page returns 503.

The edge data plane endpoints (where the logs / traces plugins POST) are derived from ONGRID_PUBLIC_URL; see Telemetry data plane.


Built-in alert thresholds

These drive the four canonical built-in rules over the host metric closed set. Set to 0 to disable.

VariableTypeDefaultDescription
ONGRID_ALERT_ENABLEDbooltrueMaster switch for built-in host alert evaluation.
ONGRID_ALERT_COOLDOWNduration10mPer-(edge, rule) cooldown. Notifications inside this window are suppressed.
ONGRID_ALERT_CPU_PERCENTfloat90Fires when cpu_pct >= threshold.
ONGRID_ALERT_MEM_PERCENTfloat90Fires when mem_pct >= threshold.
ONGRID_ALERT_DISK_USED_PERCENTfloat90Fires when disk_used_pct >= threshold.
ONGRID_ALERT_LOAD1float0Fires when load1 >= threshold. 0 disables (load varies too widely across host shapes for a useful default).
ONGRID_ALERT_EVAL_INTERVALduration5mHow often the pipeline evaluator scans edges and queries Prom.
ONGRID_ALERT_EDGE_OFFLINE_THRESHOLDduration90sHeartbeat staleness above which an edge counts as offline.
ONGRID_ALERT_PROM_INGEST_FAIL_LIMITint5Consecutive remote_write failure count at which prom_ingest_fail fires.

Notifications

Master switch + the four built-in channel types. UI-created channels carry their own enabled flag and are unaffected by these.

VariableTypeDefaultDescription
ONGRID_NOTIFY_ENABLEDbooltrueMaster switch for outbound notifications.
ONGRID_NOTIFY_DEFAULT_CHANNELScsvemptyOrdered channel-name list used when a caller does not specify destinations.
ONGRID_NOTIFY_TIMEOUTduration10sPer-channel send timeout.
ONGRID_NOTIFY_WEBHOOK_ENABLEDboolfalseEnable the env-configured webhook channel.
ONGRID_NOTIFY_WEBHOOK_NAMEstringwebhookDisplay name.
ONGRID_NOTIFY_WEBHOOK_URLstringemptyPOST endpoint.
ONGRID_NOTIFY_WEBHOOK_SECRETstringemptyOptional HMAC secret.
ONGRID_NOTIFY_SLACK_ENABLEDboolfalseEnable the env-configured Slack channel.
ONGRID_NOTIFY_SLACK_NAMEstringslackDisplay name.
ONGRID_NOTIFY_SLACK_WEBHOOK_URLstringemptyIncoming Webhook URL.
ONGRID_NOTIFY_FEISHU_ENABLEDboolfalseEnable the env-configured Larksuite / Feishu channel.
ONGRID_NOTIFY_FEISHU_NAMEstringfeishuDisplay name.
ONGRID_NOTIFY_FEISHU_WEBHOOK_URLstringemptyCustom-Bot URL.
ONGRID_NOTIFY_FEISHU_SECRETstringemptySigning secret.
ONGRID_NOTIFY_DINGTALK_ENABLEDboolfalseEnable the env-configured DingTalk channel.
ONGRID_NOTIFY_DINGTALK_NAMEstringdingtalkDisplay name.
ONGRID_NOTIFY_DINGTALK_WEBHOOK_URLstringemptyCustom-Bot URL.
ONGRID_NOTIFY_DINGTALK_SECRETstringemptySigning secret.

For WeCom and Telegram channels, create them via the Settings → Channels UI — they are first-class but have no env-configuration shortcut.


Bootstrap admin

VariableTypeDefaultDescription
ONGRID_ADMIN_EMAILstringemptyEmail of the bootstrap admin. If empty, no admin is seeded; you must register from the UI on first boot.
ONGRID_ADMIN_PASSWORDstringemptyInitial password. Operator is expected to change it on first login.

Edge agent

These are consumed by ongrid-edge, written into /etc/ongrid-edge/ongrid-edge.env by the installer.

VariableTypeDefaultDescription
ONGRID_EDGE_CLOUD_ADDRstring127.0.0.1:40012Frontier broker host:port. The agent dials this with TLS.
ONGRID_EDGE_ACCESS_KEYstringemptyPer-edge access key. Issued by the manager when you create an edge in the UI.
ONGRID_EDGE_SECRET_KEYstringemptyMatching secret. Shown once at edge creation; rotate via the UI.
ONGRID_EDGE_COLLECTOR_MODEstringoffoff (default; the hostmetrics + procmetrics plugins handle metrics), auto (legacy embedded + scraper), embedded (embedded push only), scrape (multi-target HTTP scraper).
ONGRID_EDGE_SCRAPE_CONFIG_FILEstring/etc/ongrid-edge/scrape.yamlPath to the scrape config YAML. Only consulted when COLLECTOR_MODE=scrape.
ONGRID_EDGE_COLLECTOR_INTERVALduration10sHow often the embedded collector snapshots. Scrape mode ignores this.
ONGRID_EDGE_PLUGIN_BIN_DIRstring/usr/local/lib/ongrid-edgeDirectory holding plugin binaries (promtail, otelcol-contrib, node_exporter, process_exporter).
ONGRID_EDGE_PLUGIN_WORK_DIRstring/var/lib/ongrid-edge/pluginsPer-plugin runtime dirs (configs, PID files, queue spool).
ONGRID_EDGE_UPGRADE_STAGE_DIRstring/var/lib/ongrid-edge/.upgradeADR-024 staged-bundle directory. Empty disables remote whole-bundle upgrades.
ONGRID_INSTALL_WAITint20Seconds the curl-pipe installer polls the journal waiting for "registered with cloud".

Embedding & RAG

VariableTypeDefaultDescription
ONGRID_EMBEDDING_PROVIDERstringzhipuzhipu (default; calls GLM embedding API), local (uses an on-disk bge model), openai (uses OpenAI embeddings).
ONGRID_EMBEDDING_LOCAL_MODEL_PATHstringemptyAbsolute path to the local model when PROVIDER=local. The release tarball stages bge-base-en-v1.5 under .cache/.
ONGRID_VAULT_REPO_URLstringhttps://github.com/ongridio/vaultUpstream vault repository the manager pulls baseline knowledge from. Override for air-gapped mirrors.

Locale & misc

VariableTypeDefaultDescription
ONGRID_DEFAULT_LOCALEstringenDefault locale used by automatic LLM outputs (alert investigations, scheduled summaries). UI-triggered chat uses the user's UI locale instead.

See also

  • REST API — endpoints these env vars wire up.
  • CLI — the two binaries' command-line flags.
  • Telemetry data plane — why log/trace endpoints differ from the tunnel.
  • Architecture — where each env var lives in the stack diagram.