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

Document the common config section #4485

Merged
merged 2 commits into from
Oct 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 55 additions & 8 deletions docs/sources/configuration/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,26 @@ Pass the `-config.expand-env` flag at the command line to enable this way of set
# Configures the compactor component which compacts index shards for performance.
[compactor: <compactor_config>]

# Configures limits per-tenant or globally
# Configures limits per-tenant or globally.
[limits_config: <limits_config>]

# The frontend_worker_config configures the worker - running within the Loki
# querier - picking up and executing queries enqueued by the query-frontend.
[frontend_worker: <frontend_worker_config>]

# Configures the table manager for retention
# Configures the table manager for retention.
[table_manager: <table_manager_config>]

# Configuration for "runtime config" module, responsible for reloading runtime configuration file.
[runtime_config: <runtime_config>]

# Configuration for tracing
# Configuration for tracing.
[tracing: <tracing_config>]

# Common config to be shared between multiple modules.
# If a more specific config is given in other sections, the related config under this section
# will be ignored.
[common: <common_config>]
```

## server_config
Expand Down Expand Up @@ -529,11 +534,8 @@ storage:
# Configures backend rule storage for Swift.
[swift: <swift_storage_config>]

# Configures backend rule storage for the local filesystem.
local:
# Directory to scan for rules.
# CLI flag: -ruler.storage.local.directory
[directory: <filename> | default = ""]
# Configures backend rule storage for a local filesystem directory.
[local: <local_storage_config>]

# Remote-write configuration to send rule samples to a Prometheus remote-write endpoint.
remote_write:
Expand Down Expand Up @@ -900,6 +902,16 @@ The `swift_storage_config` configures Swift as a general storage for different d
[container_name: <string> | default = "cortex"]
```

## local_storage_config

The `local_storage_config` configures a (local) filesystem as a general storage for different data generated by Loki.

```yaml
# Filesystem directory to be used as storage.
# CLI flag: -<prefix>.local.directory
[directory: <filename> | default = ""]
```

## frontend_worker_config

The `frontend_worker_config` configures the worker - running within the Loki querier - picking up and executing queries enqueued by the query-frontend.
Expand Down Expand Up @@ -2278,6 +2290,41 @@ The `tracing_config` block configures tracing for Jaeger. Currently limited to d
[enabled: <boolean>: default = true]
```

## common_config

The `common_config` block sets common definitions to be shared by different components.
This way, one doesn't have to replicate configs in multiple places.

```yaml
# A common storage config to be used by the different Loki components.
[storage: <common_storage_config>]

# When defined, the given prefix will be present in front of the endpoint paths.
Copy link
Contributor

@darxriggs darxriggs Mar 30, 2022

Choose a reason for hiding this comment

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

This sentence is misleading. This path_prefix can be about internal directories for local storage and about URLs for remote storage - right?

See config_wrapper.go here and examples like loki-local-config.yaml here and simple-scalable/loki-config.yaml here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is wrong, I created this issue after this PR got merged.

[path_prefix: <string>]
```

### common_storage_config

The `common_storage_config` block defines a common storage to be reused by different components as a way to facilitate storage configuration.
If any specific configs for an object storage client have been provided elsewhere in the configuration file, the specific config will supersede the common storage config.

```yaml
# Configures Azure as the common storage.
[azure: <azure_storage_config>]

# Configures GCS as the common storage.
[gcs: <gcs_storage_config>]

# Configures S3 as the common storage.
[s3: <s3_storage_config>]

# Configures Swift as the common storage.
[swift: <swift_storage_config>]

# Configures a (local) filesystem as the common storage.
[filesystem: <local_storage_config>]
```

## Runtime Configuration file

Loki has a concept of "runtime config" file, which is simply a file that is reloaded while Loki is running. It is used by some Loki components to allow operator to change some aspects of Loki configuration without restarting it. File is specified by using `-runtime-config.file=<filename>` flag and reload period (which defaults to 10 seconds) can be changed by `-runtime-config.reload-period=<duration>` flag. Previously this mechanism was only used by limits overrides, and flags were called `-limits.per-user-override-config=<filename>` and `-limits.per-user-override-period=10s` respectively. These are still used, if `-runtime-config.file=<filename>` is not specified.
Expand Down