# Environment variables
URL: https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/mlops-agent/monitoring-agent/env-var.html

> Describes the environment variables specific to operating the monitoring agent.

# Monitoring agent environment variables

In addition to the environment variables used to configure the attached [spooler](https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/mlops-agent/monitoring-agent/spooler.html), you can configure the monitoring agent with the environment variables documented below.

### General configuration

When you run the agent using the provided `start-agent.sh` script from the `bin/` directory, the following environment configuration options are available:

| Variable | Description |
| --- | --- |
| MLOPS_AGENT_CONFIG_YAML | The full path to a custom configuration YAML file. |
| MLOPS_AGENT_LOG_DIR | The directory for writing the agent log file and stdout/error. |
| JAVA_HOME | The Java Virtual Machine (JVM) to run the agent code. If you don't provide a JVM, Java should be included in the system PATH. |
| MLOPS_MAX_FEATURES_TO_MONITOR | The maximum number of features the monitoring agent can send to DataRobot for monitoring. This value should not exceed 300, as that's the maximum number of features DataRobot can be configured to receive. For more information, see How many features can DataRobot track? |

.

### Containerized configuration

When you run the agent using the provided `Dockerfile` from the `tools/agent_docker/` directory, the following environment configuration options are available:

| Variable | Description |
| --- | --- |
| MLOPS_AGENT_CONFIG_YAML | The full path to a custom configuration YAML file. |
| MLOPS_AGENT_LOG_DIR | The directory for writing the agent log file and stdout/error. |
| MLOPS_AGENT_TMP_DIR | The directory for writing temporary files (a useful override if the container runs with a read-only root filesystem). |
| MLOPS_SERVICE_URL | Specify the service URL to access MLOps via this environment variable instead of specifying it in the YAML configuration file. |
| MLOPS_API_TOKEN | Provide your API token through this environment variable instead of specifying it in the YAML configuration file. |
| Advanced configuration |  |
| MLOPS_AGENT_JVM_OPT | Configure to override the default JVM option -Xmx1G. |
| MLOPS_AGENT_LOGGING_CONFIG | Specify a full path to a completely custom Log4J2 configuration file for the MLOps monitoring agent. |
| MLOPS_AGENT_LOGGING_FORMAT | If using our default logging configuration, you can set the logging output format to either plain or json. |
| MLOPS_AGENT_LOGGING_LEVEL | If using our default logging configuration, set the overall logging level for the agent (e.g. trace, debug, info, warning, error). |
| MLOPS_AGENT_LOG_PROPERTIES | Configure to override the default path to mlops.log4j2.properties. |
| MLOPS_AGENT_SERVER_PORT | Set a free port number to activate the embedded HTTP server; this is useful for health and metric monitoring. |

---
