Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default Collector configuration path to Configuration docs #3940

Merged
merged 10 commits into from
Feb 7, 2024
58 changes: 53 additions & 5 deletions content/en/docs/collector/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,42 @@ cSpell:ignore: cfssl cfssljson fluentforward gencert genkey hostmetrics initca l

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

You can configure the Collector to suit your observability needs. Before you
learn how Collector configuration works, familiarize yourself with the following
content:
You can configure the OpenTelemetry Collector to suit your observability needs.
Before you learn how Collector configuration works, familiarize yourself with
the following content:

- [Data collection concepts][dcc] in order to understand the repositories
applicable to the OpenTelemetry Collector.
- [Data collection concepts][dcc], to understand the repositories applicable to
the OpenTelemetry Collector.
- [Security guidance](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/security-best-practices.md)

## Location {#location}

By default, the Collector configuration is located in
`/etc/<otel-directory>/config.yaml`, where `<otel-directory>` can be `otelcol`,
`otelcol-contrib`, or another value, depending on the Collector version or the
Collector distribution you're using.

You can provide one or more configurations using the `--config` option. For
example:

```shell
otelcol --config=customconfig.yaml
```

You can also provide configurations using environment variables, YAML paths, or
HTTP URIs. For example:

```shell
otelcol --config=env:MY_CONFIG_IN_AN_ENVVAR` --config=https://server/config.yaml
otelcol --config="yaml:exporters::debug::verbosity: normal"`
```

To validate a configuration file, use the `validate` command. For example:

```shell
otelcol validate --config=customconfig.yaml
```

## Configuration structure {#basics}

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

[dcc]: /docs/concepts/components/#collector

## Override settings

You can override Collector settings using the `--set` option. The settings you
define with this method are merged into the final configuration after all
`--config` sources are resolved and merged.

The following examples show how to override settings inside nested sections:

```shell
# The following example sets the verbosity
# level of the debug exporter to 'detailed'
otelcol --set "exporters::debug::verbosity=detailed"
# The following example overrides gRPC
# settings for the OTLP receiver
otelcol --set "receivers::otlp::protocols::grpc={endpoint:localhost:4317, compression: gzip}"
```
Comment on lines +883 to +890
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bogdandrutu do you think having these examples make sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they're syntactically correct, could we merge and review later?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 let's do this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! Could you approve? Thanks!


Note tha the `--set` option doesn't support setting a key that contains a dot or
an equal sign.
Loading