@@ -8,14 +8,42 @@ cSpell:ignore: cfssl cfssljson fluentforward gencert genkey hostmetrics initca l
8
8
9
9
<!-- markdownlint-disable link-fragments -->
10
10
11
- You can configure the Collector to suit your observability needs. Before you
12
- learn how Collector configuration works, familiarize yourself with the following
13
- content:
11
+ You can configure the OpenTelemetry Collector to suit your observability needs.
12
+ Before you learn how Collector configuration works, familiarize yourself with
13
+ the following content:
14
14
15
- - [ Data collection concepts] [ dcc ] in order to understand the repositories
16
- applicable to the OpenTelemetry Collector.
15
+ - [ Data collection concepts] [ dcc ] , to understand the repositories applicable to
16
+ the OpenTelemetry Collector.
17
17
- [ Security guidance] ( https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/security-best-practices.md )
18
18
19
+ ## Location {#location}
20
+
21
+ By default, the Collector configuration is located in
22
+ ` /etc/<otel-directory>/config.yaml ` , where ` <otel-directory> ` can be ` otelcol ` ,
23
+ ` otelcol-contrib ` , or another value, depending on the Collector version or the
24
+ Collector distribution you're using.
25
+
26
+ You can provide one or more configurations using the ` --config ` option. For
27
+ example:
28
+
29
+ ``` shell
30
+ otelcol --config=customconfig.yaml
31
+ ```
32
+
33
+ You can also provide configurations using environment variables, YAML paths, or
34
+ HTTP URIs. For example:
35
+
36
+ ``` shell
37
+ otelcol --config=env:MY_CONFIG_IN_AN_ENVVAR` --config=https://server/config.yaml
38
+ otelcol --config=" yaml:exporters::debug::verbosity: normal" `
39
+ ```
40
+
41
+ To validate a configuration file, use the ` validate ` command. For example:
42
+
43
+ ``` shell
44
+ otelcol validate --config=customconfig.yaml
45
+ ```
46
+
19
47
## Configuration structure {#basics}
20
48
21
49
The structure of any Collector configuration file consists of four classes of
@@ -843,3 +871,23 @@ This creates two certificates:
843
871
with the associated key in `cert-key.pem`.
844
872
845
873
[dcc] : /docs/concepts/components/#collector
874
+
875
+ # # Override settings
876
+
877
+ You can override Collector settings using the `--set` option. The settings you
878
+ define with this method are merged into the final configuration after all
879
+ ` --config` sources are resolved and merged.
880
+
881
+ The following examples show how to override settings inside nested sections :
882
+
883
+ ` ` ` shell
884
+ # The following example sets the verbosity
885
+ # level of the debug exporter to 'detailed'
886
+ otelcol --set "exporters::debug::verbosity=detailed"
887
+ # The following example overrides gRPC
888
+ # settings for the OTLP receiver
889
+ otelcol --set "receivers::otlp::protocols::grpc={endpoint:localhost:4317, compression: gzip}"
890
+ ` ` `
891
+
892
+ Note tha the `--set` option doesn't support setting a key that contains a dot or
893
+ an equal sign.
0 commit comments