@@ -21,10 +21,25 @@ the following content:
21
21
By default, the Collector configuration is located in
22
22
` /etc/otelcol/config.yaml ` .
23
23
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:
25
26
26
27
``` 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
28
43
```
29
44
30
45
## Configuration structure {#basics}
@@ -854,3 +869,34 @@ This creates two certificates:
854
869
with the associated key in `cert-key.pem`.
855
870
856
871
[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