Skip to content

Commit a4b7d84

Browse files
committed
Add more options
1 parent f5ac359 commit a4b7d84

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

content/en/docs/collector/configuration.md

+48-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,25 @@ the following content:
2121
By default, the Collector configuration is located in
2222
`/etc/otelcol/config.yaml`.
2323

24-
To use a different configuration file, use the `--config` option. For example:
24+
You can provide one or more configurations using the `--config` option. For
25+
example:
2526

2627
```shell
27-
$ otelcol --config=customconfig.yaml
28+
otelcol --config=customconfig.yaml
29+
```
30+
31+
You can also provide configurations using environment variables, YAML paths, or
32+
HTTP URIs. For example:
33+
34+
```shell
35+
otelcol --config=env:MY_CONFIG_IN_AN_ENVVAR` --config=https://server/config.yaml
36+
otelcol --config="yaml:exporters::debug::verbosity: normal"`
37+
```
38+
39+
To validate a configuration file, use the `validate` command. For example:
40+
41+
```shell
42+
otelcol validate --config=customconfig.yaml
2843
```
2944

3045
## Configuration structure {#basics}
@@ -854,3 +869,34 @@ This creates two certificates:
854869
with the associated key in `cert-key.pem`.
855870

856871
[dcc]: /docs/concepts/components/#collector
872+
873+
## Override settings
874+
875+
You can override Collector settings using the `--set` option. The settings you
876+
define with this method are merged into the final configuration after all
877+
`--config` sources are resolved and merged.
878+
879+
The following example shows how to override a setting using different syntax:
880+
881+
```shell
882+
# Translates to
883+
# key: value
884+
otelcol --set key=value
885+
# Translates to
886+
# outer:
887+
# inner: value
888+
otelcol --set outer.inner=value
889+
# Translates to
890+
# key:
891+
# - a
892+
# - b
893+
# - c
894+
otelcol --set "key=[a, b, c]"
895+
# Translates to
896+
# key:
897+
# a: c
898+
otelcol --set "key={a: c}
899+
```
900+
901+
Note tha the `--set` option doesn't support setting a key that contains a dot or
902+
an equal sign.

0 commit comments

Comments
 (0)