Optimizely will be sunsetting Full Stack Experimentation on July 29, 2024. See the recommended Feature Experimentation migration timeline and documentation.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Advanced configuration

This topic describes how to set advanced configuration values for Optimizely Agent.

Setting Configuration Values

Configuration can be provided to Agent via the following methods:

  1. Reading from environment variables
  2. Reading from a YAML configuration file

When a configuration option is specified through both methods, environment variables take precedence over the config file.

Internally, Optimizely Agent uses the Viper library's support for configuration files and environment variables.

Config File Location

The default location of the config file is config.yaml in the root directory. If you want to specify another location, use the OPTIMIZELY_CONFIG_FILENAME environment variable:

OPTIMIZELY_CONFIG_FILENAME=/path/to/other_config_file.yaml make run

Nested Configuration Options

When setting the value of "nested" configuration options using environment variables, underscores denote deeper access. The following examples are equivalent ways of setting the client polling interval.

Set the polling interval in YAML:

# Setting a nested value in a .yaml file:
client:
    pollingInterval: 120s

Set the polling interval with a shell script:

# Set environment variable for pollingInterval, nested inside client
export OPTIMIZELY_CLIENT_POLLINGINTERVAL=120s

Unsupported Environment Variable Options

Some options can only be set via config file, and not environment variable (for details on these options, see the Configuration Options table in the GitHub repository's main README:

  • admin.auth.clients
  • api.auth.clients
  • Options underwebhook.projects