Skip to content

Commit 03cc9c6

Browse files
authored
Add default Collector configuration path to Configuration docs (#3940)
1 parent fb40e74 commit 03cc9c6

File tree

1 file changed

+53
-5
lines changed

1 file changed

+53
-5
lines changed

content/en/docs/collector/configuration.md

+53-5
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,42 @@ cSpell:ignore: cfssl cfssljson fluentforward gencert genkey hostmetrics initca l
88

99
<!-- markdownlint-disable link-fragments -->
1010

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:
1414

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.
1717
- [Security guidance](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/security-best-practices.md)
1818

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+
1947
## Configuration structure {#basics}
2048

2149
The structure of any Collector configuration file consists of four classes of
@@ -843,3 +871,23 @@ This creates two certificates:
843871
with the associated key in `cert-key.pem`.
844872

845873
[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

Comments
 (0)