github.com/muhammadn/cortex@v1.9.1-0.20220510110439-46bb7000d03d/docs/configuration/config-file-reference.template (about)

     1  ---
     2  title: "Configuration file"
     3  linkTitle: "Configuration file"
     4  weight: 1
     5  slug: configuration-file
     6  ---
     7  
     8  {{ .GeneratedFileWarning }}
     9  
    10  Cortex can be configured using a YAML file - specified using the `-config.file` flag - or CLI flags. In case you combine both, CLI flags take precedence over the YAML config file.
    11  
    12  The current configuration of any Cortex component can be seen by visiting the `/config` HTTP path.
    13  Passwords are filtered out of this endpoint.
    14  
    15  ## Reference
    16  
    17  To specify which configuration file to load, pass the `-config.file` flag at the command line. The file is written in [YAML format](https://en.wikipedia.org/wiki/YAML), defined by the scheme below. Brackets indicate that a parameter is optional.
    18  
    19  ### Generic placeholders
    20  
    21  * `<boolean>`: a boolean that can take the values `true` or `false`
    22  * `<int>`: any integer matching the regular expression `[1-9]+[0-9]*`
    23  * `<duration>`: a duration matching the regular expression `[0-9]+(ns|us|µs|ms|s|m|h|d|w|y)` where y = 365 days.
    24  * `<string>`: a regular string
    25  * `<url>`: an URL
    26  * `<prefix>`: a CLI flag prefix based on the context (look at the parent configuration block to see which CLI flags prefix should be used)
    27  * `<relabel_config>`: a [Prometheus relabeling configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config).
    28  * `<time>`: a timestamp, with available formats: `2006-01-20` (midnight, local timezone), `2006-01-20T15:04` (local timezone), and RFC 3339 formats: `2006-01-20T15:04:05Z` (UTC) or `2006-01-20T15:04:05+07:00` (explicit timezone)
    29  
    30  ### Use environment variables in the configuration
    31  
    32  You can use environment variable references in the config file to set values that need to be configurable during deployment by using the `-config.expand-env` flag.
    33  To do this, use:
    34  
    35  ```
    36  ${VAR}
    37  ```
    38  
    39  Where VAR is the name of the environment variable.
    40  
    41  Each variable reference is replaced at startup by the value of the environment variable.
    42  The replacement is case-sensitive and occurs before the YAML file is parsed.
    43  References to undefined variables are replaced by empty strings unless you specify a default value or custom error text.
    44  
    45  To specify a default value, use:
    46  
    47  ```
    48  ${VAR:default_value}
    49  ```
    50  
    51  Where default_value is the value to use if the environment variable is undefined.
    52  
    53  ### Supported contents and default values of the config file
    54  
    55  {{ .ConfigFile }}