All Ops Platform configuration is passed in through environment variables: written in ops.yaml for Docker Compose, or in a ConfigMap for Kubernetes. The tables below are grouped by purpose. Anything not marked as required is optional and falls back to its default if unset.
General / Gateway
| Environment Variable | Description |
|---|
| ENV_OPS_TOKEN | Access authentication key for the Ops Platform; be sure to change it on first deployment |
| ENV_OPS_SUB_PATH | Reverse proxy sub-path. Not needed for direct port access; once set, both the gateway and Grafana automatically adapt GF_SERVER_ROOT_URL and GF_SERVER_SERVE_FROM_SUB_PATH. Example: /mdis |
| ENV_OPS_PORT | Internal listening port of ops-server, default 8081, usually no need to change |
| ENV_OPS_GATEWAY_PORT | External port of the gateway, default 48881 |
Host Monitoring (Node Exporter)
| Environment Variable | Description |
|---|
| ENV_PROMETHEUS_HOST | Node_Exporter service address; replace with the actual server IP. The port is fixed at 59100; use commas to separate multiple Node_Exporters, in the format custom-hostname/IP:59100. For Docker Compose deployments, Node_Exporter defaults to a single node — just fill in the server's own internal IP. Example: hap_1/192.168.1.12:59100 For Kubernetes deployments, Node_Exporter runs on multiple nodes; use commas to separate them. Example: service_01/192.168.1.12:59100,service_02/192.168.1.13:59100 |
Cluster Monitoring (Kubernetes)
Since Ops Platform 1.3.0, monitoring a Kubernetes cluster (nodes, containers, Pods, cluster object state) is supported. For full configuration, see Kubernetes Cluster Monitoring.
| Environment Variable | Description |
|---|
| ENV_K8S_MONITOR_MODE | K8s monitoring mode: off (default, disabled) / static (outside the cluster, Docker Compose remote scraping) / incluster (inside the cluster, Pod-based auto-discovery) |
| ENV_PROMETHEUS_K8S_KSM | kube-state-metrics address in static mode, in the format alias/IP:NodePort. Example: k8s/192.168.1.10:30080 |
| ENV_PROMETHEUS_K8S_NODE | K8s node_exporter address in static mode; comma-separated for multiple nodes. Example: n1/192.168.1.10:30081,n2/192.168.1.11:30081 |
| ENV_PROMETHEUS_K8S_KUBELET | kubelet HTTPS endpoint in static mode (for scraping container-level cAdvisor metrics), in the format alias/IP:10250; comma-separated for multiple nodes. Example: n1/192.168.1.10:10250 |
| ENV_K8S_BEARER_TOKEN | ServiceAccount token used to scrape kubelet in static mode (requires nodes/proxy permission, provided by 15-metrics-reader.yaml) |
| ENV_K8S_BEARER_TOKEN_FILE | Same as above, but using the path to an already-mounted token file (choose either this or ENV_K8S_BEARER_TOKEN) |
| ENV_K8S_KSM_NAMESPACE | Namespace where kube-state-metrics runs in incluster mode, default mdis-monitoring |
Middleware Exporter Proxy Addresses
| Environment Variable | Description |
|---|
| ENV_PROMETHEUS_KAFKA | Kafka monitoring proxy address; defaults usually fine. Example: kafka_1/agent:9308 |
| ENV_PROMETHEUS_ELASTICSEARCH | Elasticsearch monitoring proxy address; defaults usually fine. Example: elasticsearch_1/agent:9114 |
| ENV_PROMETHEUS_REDIS | Redis monitoring proxy address; defaults usually fine. Example: redis_1/agent:9121 |
| ENV_PROMETHEUS_MONGODB | MongoDB monitoring proxy address; defaults usually fine. Example: mongodb_1/agent:9216 |
| ENV_PROMETHEUS_MYSQL | MySQL monitoring proxy address; defaults usually fine. Example: mysql_1/agent:9104 |
| ENV_PROMETHEUS_SERVER | Prometheus internal access address. Example: http://ops-prometheus:9090 |
Middleware Connection Details
| Environment Variable | Description |
|---|
| ENV_MYSQL_HOST | MySQL database host address. Example: 10.206.0.6 |
| ENV_MYSQL_PORT | MySQL database connection port. Example: 3306 |
| ENV_MYSQL_USERNAME | MySQL database username. Example: root |
| ENV_MYSQL_PASSWORD | MySQL database password. Example: 123456 |
| ENV_MONGODB_URI | MongoDB connection URI. Example: mongodb://root:123456@10.206.0.6:27017 Replica set example: mongodb://root:123456@10.206.0.6:27017,10.206.0.7:27017,10.206.0.8:27017 |
| ENV_MONGODB_OPTIONS | Additional MongoDB connection options, typically specifying the auth database as admin. If the database has no authentication enabled, this can be left empty. Example: ?authSource=admin |
| ENV_REDIS_HOST | Redis database host address. Example: 10.206.0.6 |
| ENV_REDIS_PORT | Redis database connection port. Example: 6379 |
| ENV_REDIS_PASSWORD | Redis database password. Example: 123456 |
| ENV_KAFKA_ENDPOINTS | Kafka service address. For a cluster, just fill in one node. Example: 10.206.0.6:9092 |
| ENV_ELASTICSEARCH_ENDPOINTS | Elasticsearch service address. For a cluster, just fill in one node. Example: http://10.206.0.6:9200 |
| ENV_ELASTICSEARCH_PASSWORD | Elasticsearch user and password. Example: elastic:your-es-password |
| ENV_FLINK_URL | Flink Web service address; can be commented out if not needed or Flink is not deployed. Example: http://flink:8081 |
Data Source Registry Mode (Since 1.4.0, Optional)
By default (ENV_PROMETHEUS_SD_MODE=env), middleware monitoring targets are statically configured via the environment variables above. Since 1.4.0, you can switch to http mode: monitoring targets are managed centrally on the Ops Platform UI's Data Source page (multiple Kafka / MongoDB / MySQL / Redis / Elasticsearch instances can be added), the agent automatically starts the corresponding exporters based on the registry, and Prometheus scrape targets are also driven by the registry — no more editing environment variables or restarting containers.
| Environment Variable | Description |
|---|
| ENV_PROMETHEUS_SD_MODE | Service discovery mode: env (default, static configuration via environment variables) / http (driven by the UI data source registry). Must be configured on both the ops-prometheus and agent services |
| ENV_OPS_SD_URL | Address at which ops-prometheus / agent reach the registry (ops-server) in http mode, default http://gateway:8081 |
| ENV_OPS_SD_TOKEN | Access token for the registry interface in http mode; keep it consistent across gateway, ops-prometheus, and agent. When empty, no validation is performed (recommended only for Docker internal networks) |
| ENV_AGENT_SD_HOST | Hostname of the agent service in http mode (for Prometheus to address the exporters), default agent, usually no need to change |
Data Retention Periods
| Environment Variable | Description |
|---|
| ENV_PROMETHEUS_RETENTION | Prometheus metrics data retention period, default 15d if unset. Example: 30d |
| ENV_LOKI_RETENTION | Loki log data retention period, default 720h (30 days) if unset. Example: 360h |
| ENV_TEMPO_RETENTION | Tempo trace data retention period, default 720h (30 days) if unset. Example: 360h |
Observability Collection (Alloy)
| Environment Variable | Description |
|---|
| ENV_TEMPO_GRPC_URL | gRPC address for alloy to forward trace data to Tempo. Example: http://ops-tempo:4317 |
| ENV_PROMETHEUS_REMOTE_WRITE_URL | Address for alloy to report metrics to Prometheus via remote_write. Example: http://ops-prometheus:9090/prometheus/server/api/v1/write |
| ENV_LOKI_PUSH_URL | HTTP API address for alloy to push logs to Loki. Example: http://ops-loki:3100/loki/api/v1/push |
Log Storage Backend (Loki S3/MinIO, Optional)
Uses Loki's local filesystem storage when unset.
| Environment Variable | Description |
|---|
| ENV_S3_ENDPOINT | S3-compatible storage endpoint. Example: http://minio:9000 |
| ENV_S3_BUCKET | Bucket name for storing logs. Example: loki |
| ENV_S3_ACCESS_KEY | S3 access key |
| ENV_S3_SECRET_KEY | S3 secret key |
Alert Subsystem (Since 1.4.0)
Ops Platform 1.4.0 includes a built-in, self-developed alert subsystem. Alert configuration data (rules/state/history/notification channels/data sources) is stored in a dedicated ops-mongo container, fully decoupled from the business MongoDB being monitored.
| Environment Variable | Description |
|---|
| ENV_OPS_MONGODB_URI | MongoDB connection address for the alert subsystem's own storage, pointing to the built-in ops-mongo container by default. Example: mongodb://ops-mongo:27017 |
| ENV_MONGODB_COLLECTION_PREFIX | Common prefix for the alert subsystem's collection names. Example: mdis_ |
| ENV_ALERT_CRYPTO_KEY | AES encryption key for data source credentials (passwords/URIs) before they are persisted. Be sure to change it to a random string on first deployment and keep it safe. After changing the key, previously saved credentials can no longer be decrypted and must be re-entered |
Alert notification channels (Feishu / DingTalk / WeCom / Email / custom Webhook) are configured on the Alert → Notification Channels page in the Ops Platform UI, no longer via environment variables. The SMTP server details for the email channel are also entered on that page.