-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add readme about how to provide configuration to the collector
This explains only how to provide the configuration via the `--config` file, after #4742 will update the embedded values option. Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
- Loading branch information
1 parent
55829e2
commit 7cdfa3f
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# OpenTelemetry Collector Service | ||
|
||
## How to provide configuration | ||
|
||
The `--config` flag accepts either a file path or values in the form of a config URI `"<scheme>:<opaque_data>"`. Currently, the | ||
OpenTelemetry Collector supports the following providers `scheme`: | ||
- [file](../confmap/provider/fileprovider/provider.go) - Reads configuration from a file. E.g. `file:path/to/config.yaml`. | ||
- [env](../confmap/provider/envprovider/provider.go) - Reads configuration from an environment variable. E.g. `env:MY_CONFIG_IN_AN_ENVVAR`. | ||
- [yaml](../confmap/provider/yamlprovider/provider.go) - Reads configuration from yaml bytes. E.g. `yaml:exporters::logging::loglevel: debug`. | ||
|
||
For more technical details about how configuration is resolved you can read the [configuration resolving design](../confmap/README.md#configuration-resolving). | ||
|
||
### Single Config Source | ||
|
||
1. Simple local file: | ||
|
||
`./otelcorecol --config=examples/local/otel-config.yaml` | ||
|
||
2. Simple local file using the new URI format: | ||
|
||
`./otelcorecol --config=file:examples/local/otel-config.yaml` | ||
|
||
3. Config provided via an environment variable: | ||
|
||
`./otelcorecol --config=env:MY_CONFIG_IN_AN_ENVVAR` | ||
|
||
|
||
### Multiple Config Sources | ||
|
||
1. Merge a `otel-config.yaml` file with the content of an environment variable `MY_OTHER_CONFIG` and use the merged result as the config: | ||
|
||
`./otelcorecol --config=file:examples/local/otel-config.yaml --config=env:MY_OTHER_CONFIG` | ||
|
||
2. Merge a `config.yaml` file with the content of a yaml bytes configuration (overwrites the `exporters::logging::loglevel` config) and use the content as the config: | ||
|
||
`./otelcorecol --config=file:examples/local/otel-config.yaml --config="yaml:exporters::logging::loglevel: info"` |