{
  "run_id": "2026-09-23-r3-exa",
  "round": 2,
  "tool": "exa",
  "mode": "search",
  "tc_id": "TC3",
  "capability": "C1",
  "scenario": "S3",
  "suite_role": "probe",
  "query_text": "In Loki, the log aggregation system from Grafana Labs, which configuration block does retention_enabled have to be set in for old log data to actually be deleted?",
  "restrict_domain": null,
  "restriction_mechanism": null,
  "answer_key": "The compactor block. Verbatim: \"`retention_enabled: true` must be set under the `compactor` block, not just in `limits_config`.\" (FAQ \"Why isn't my log retention policy deleting old data?\", bottom third of the page.)",
  "key_urls": [
    {
      "url": "https://grafana.com/docs/loki/",
      "role": "supports"
    },
    {
      "url": "https://grafana.com/oss/loki/",
      "role": "supports"
    }
  ],
  "pass_criteria": "Results are about Grafana Loki, not Marvel's Loki, AND what came back names the compactor block - not merely the top-of-page description of what Loki is",
  "key_verified_date": "2026-09-09",
  "before_check_rule": null,
  "timestamp_utc": "2026-09-23T09:17:46Z",
  "region": "ap-south-1",
  "status": "ok",
  "graded": null,
  "pass_fail": null,
  "grader_notes": null,
  "latency_ms": 2494.6,
  "http_status": 200,
  "error": null,
  "attempts": 1,
  "credits_reported": 0.007,
  "tokens_reported": null,
  "results": [
    {
      "rank": 1,
      "url": "https://grafana.com/docs/loki/latest/operations/storage/logs-deletion/",
      "title": "Log entry deletion | Grafana Loki documentation",
      "content": "Log entry deletion | Grafana Loki documentation \n\n# Log entry deletion \n\nGrafana Loki supports the deletion of log entries from a specified stream. Log entries that fall within a specified time window and match an optional line filter are those that will be deleted.\n\nLog entry deletion is supported when the TSDB index is configured as the index store. It is also supported on the deprecated BoltDB Shipper index, but BoltDB Shipper is being removed in Loki 4.0, so new deployments should use TSDB.\n\nThe compactor component exposes REST endpoints that process delete requests. Hitting the endpoint specifies the streams and the time window. The deletion of the log entries takes place after a configurable cancellation time period expires.\n\nLog entry deletion relies on configuration of the custom logs retention workflow as defined for the compactor. The compactor looks at unprocessed requests which are past their cancellation period to decide whether a chunk is to be deleted or not.\n\n## Configuration \n\nEnable log entry deletion by setting `retention_enabled` to `true` in the compactor\u2019s configuration (`-compactor.retention-enabled` on the command line). The tenant\u2019s `deletion_mode` must also be `filter-only` or `filter-and-delete`, which is the case by default. `delete_request_store` also needs to be configured when retention is enabled to process delete requests, this determines the storage bucket that stores the delete requests.\n\n> Warning\n> \n> Be very careful when enabling retention. It is strongly recommended that you also enable versioning on your objects in object storage to allow you to recover from accidental misconfiguration of a retention setting. If you want to enable deletion but do not want to enforce retention, configure the `retention_period` setting with a value of `0s`.\n\n`deletion_mode` is a global and per-tenant setting in `limits_config`. Its default value is `filter-and-delete`, so log entry deletion is active for every tenant as soon as `retention_enabled` is `true` and `delete_request_store` is configured, unless you explicitly change the mode. Set `deletion_mode` in the main configuration file for a global default, or override it per tenant in the runtime configuration file.\n\n`deletion_mode` supports three values:\n\n- `disabled`: Deletion is not allowed. Requests to the deletion API endpoints are rejected with a `403 Forbidden` response.\n- `filter-only`: Log lines matching the query in the delete request are filtered out when querying Loki. They are not removed from storage.\n- `filter-and-delete`: Log lines matching the query in the delete request are filtered out when querying Loki, and they are also removed from storage. This is the default.\n\nA delete request may be canceled within a configurable cancellation period. Set the `delete_request_cancel_period` in the compactor\u2019s YAML configuration or on the command line when invoking Loki. Its default value is 24h. To cancel a delete request that has already started processing, pass the `force=true` query parameter to the cancellation endpoint.\n\nDelete requests that include a line filter are split into smaller requests that each cover no more than `delete_max_interval` (24h by default). You can request a smaller split for a single request with the `max_interval` query parameter, but it cannot be larger than `delete_max_interval`. Delete requests without a line filter are not split. Refer to the HTTP API reference for the full set of request parameters.\n\nDelete requests themselves are stored using the database type set by `delete_request_store_db_type`, which defaults to `boltdb`. You can instead use `sqlite`. When you migrate from one database type to another, you can set `backup_delete_request_store_db_type` to `boltdb` so that delete requests are also written to a backup database. Refer to the compactor configuration reference for details.\n\nThe deletion API endpoints are registered only when `compactor.retention_enabled` is `true`. When retention is not enabled, the endpoints are unavailable for every tenant, whatever the `deletion_mode` value is. When retention is enabled, use the `deletion_mode` tenant override to control which tenants can use the deletion API.\n\n> Note\n> \n> Deletion of log lines with line filters is one of the compactor\u2019s most resource-intensive operations. If you delete large volumes of data with line filters, refer to Horizontal scaling of Compactor to distribute that work across multiple compactor instances.",
      "content_chars": 4474,
      "published_date": null
    },
    {
      "rank": 2,
      "url": "https://grafana.com/docs/loki/latest/operations/storage/retention/",
      "title": "Log retention | Grafana Loki documentation",
      "content": "Log retention | Grafana Loki documentation \n\n# Log retention \n\nRetention in Grafana Loki is achieved through the Compactor. By default the `compactor.retention-enabled` flag is not set, so the logs sent to Loki live forever.\n\n> Note\n> \n> If you have a lifecycle policy configured on the object store, please ensure that it is longer than the retention period.\n\nGranular retention policies to apply retention at per tenant or per stream level are also supported by the Compactor.\n\n> Note\n> \n> The Compactor does not support retention on legacy index types. Please use the Table Manager when using legacy index types. Both the Table manager and legacy index types are deprecated and may be removed in future major versions of Loki.\n\n## Compactor \n\nThe Compactor is responsible for compaction of index files and applying log retention.\n\n> Note\n> \n> Run the Compactor as a singleton (a single instance).\n\nThe Compactor runs compaction and retention on two independent schedules:\n\n- Compaction runs every `compactor.compaction-interval`.\n- Retention runs every `compactor.apply-retention-interval`. If you leave this at its default of `0s`, Loki sets it to the same value as `compactor.compaction-interval`. Whenever the two intervals are equal, Loki extends the retention interval by the smaller of `10m` or half the interval, so that compaction and retention do not run at the same time. For example, with the default `compaction_interval` of `10m`, retention runs every `15m`.\n\nIf the Compactor falls behind on either schedule, it runs the corresponding operation as soon as possible. Both compaction and retention are idempotent, which means once the action has been performed, if the action is performed multiple times, it has no further effect on logs after the first time it is performed. If the Compactor restarts, it continues from where it left off.\n\n> Note\n> \n> Changes to your retention period are not retroactive, that is, they are not applied to logs that have already been ingested.\n\nThe Compactor\u2019s algorithm to apply retention is as follows:\n\n- For each day or table (one table per day with 24h index period):\n\n- Compact multiple index files in the table into per-tenant index files. Result of compaction is a single index file per tenant per day.\n- Traverse the per-tenant index. Use the tenant configuration to identify the chunks that need to be removed.\n- Remove the references to the matching chunks from the index and add the chunk references to a marker file on disk.\n- Upload the new modified index files.\n\nChunks are not deleted while applying the retention algorithm on the index. They are deleted asynchronously by a sweeper process and this delay can be configured by setting `-compactor.retention-delete-delay`. Marker files are used to keep track of the chunks pending for deletion.\n\nChunks cannot be deleted immediately for the following reasons:\n\n- Index Gateway downloads a copy of the index files to serve queries and refreshes them at a regular interval. Having a delay allows the index gateways to pull the modified index file which would not contain any reference to the chunks marked for deletion. Without the delay, index files (that are stale) on the gateways could refer to already deleted chunks leading to query failures.\n- It provides a short window of time in which to cancel chunk deletion in the case of a configuration mistake.\n\nBy default, marker files are written to local disk, under `<working_directory>/retention/<object_store_type>_<period_from_date>/markers/`. Marker files should be stored on a persistent disk to ensure that the chunks pending for deletion are processed even if the Compactor process restarts.\n\n> Note\n> \n> Grafana Labs recommends running Compactor as a stateful deployment (StatefulSet when using Kubernetes) with a persistent storage for storing marker files.\n\nAlternatively, you can configure the Compactor to store marker files in object storage instead of local disk, by setting `compactor.deletion-marker-object-store-prefix` (`deletion_marker_object_store_prefix`) to a prefix that ends with `/`. When set, the Compactor writes marker files to the same per-period object store bucket used for chunks, under that prefix. On startup it also copies any existing marker files from local disk to that prefix, then removes the local copies. This lets you run the Compactor without a persistent volume for marker files. Leave this setting empty to keep using local disk.\n\n### Retention Configuration \n\nThis Compactor configuration example activates retention.\n\n```yaml\ncompactor:\n  working_directory: /data/retention\n  compaction_interval: 10m\n  retention_enabled: true\n  retention_delete_delay: 2h\n  retention_delete_worker_count: 150\n  delete_request_store: gcs\nschema_config:\n  configs:\n    - from: \"2020-07-31\"\n      index:\n        period: 24h\n        prefix: index_\n      object_store: gcs\n      schema: v13\n      store: tsdb\nstorage_config:\n  tsdb_shipper:\n    active_index_directory: /data/index\n    cache_location: /data/index_cache\n  gcs:\n    bucket_name: loki\n```\n\n> Note\n> \n> Retention is only available if the index period is 24h. Single store TSDB and single store BoltDB require 24h index period.\n\n`retention_enabled` should be set to true. Without this, the Compactor will only compact tables.\n\n`delete_request_store` should be set to configure the store for delete requests. This is required when retention is enabled.\n\n`working_directory` is the directory where marked chunks and temporary tables will be saved.\n\n`compaction_interval` dictates how often compaction is applied. If the Compactor falls behind, compaction occurs as soon as possible.\n\n`apply_retention_interval` dictates how often retention is applied, independently of `compaction_interval`. Refer to Compactor for how the default value is derived from `compaction_interval`.\n\n`retention_delete_delay` is the delay after which the Compactor will delete marked chunks.\n\n`retention_delete_worker_count` specifies the maximum quantity of goroutine workers instantiated to delete chunks.\n\nA few other options are also relevant when tuning retention:\n\n- `retention_table_timeout` bounds how long the Compactor spends applying retention and processing delete requests on any single table. It defaults to `0s`, meaning no timeout. If the work on a table exceeds this timeout, the Compactor logs a warning and stops early rather than failing, and the remaining work is picked up again on a later run.\n- `retention_backoff_config` controls the retry behavior (minimum and maximum backoff, and number of retries) used by the sweeper when it fails to delete a marked chunk.\n- `delete_request_store_key_prefix` sets the path prefix used to store delete requests within `delete_request_store` (default `index/`).\n- `delete_request_store_db_type` sets the type of database used to store delete requests (default `boltdb`).\n\nRefer to the Configuration reference for the full list of `compactor` options and their defaults.\n\n#### Configuring the retention period \n\nRetention period is configured within the `limits_config` configuration section.\n\nThere are two ways of setting retention policies:\n\n- `retention_period` which is applied globally for all log streams.\n- `retention_stream` which is only applied to log streams matching the selector.\n\n> Note\n> \n> Each `retention_stream` rule\u2019s `period` must be at least 24h. Loki rejects configuration with a shorter value, both in the global `retention_stream` list and in any per-tenant override. This minimum does not apply to the `retention_period` setting, either globally or per tenant.\n\nThis example configures global retention that applies to all tenants (unless overridden by configuring per-tenant overrides):\n\n```yaml\n...\nlimits_config:\n  retention_period: 744h\n  retention_stream:\n  - selector: '{namespace=\"dev\"}'\n    priority: 1\n    period: 24h\n  per_tenant_override_config: /etc/overrides.yaml\n...\n```\n\n> Note\n> \n> You can only use label matchers in the `selector` field of a `retention_stream` definition. Arbitrary LogQL expressions are not supported.\n\nPer tenant retention can be defined by configuring runtime overrides. For example:\n\n```yaml\noverrides:\n    \"29\":\n        retention_period: 168h\n        retention_stream:\n        - selector: '{namespace=\"prod\"}'\n          priority: 2\n          period: 336h\n        - selector: '{container=\"loki\"}'\n          priority: 1\n          period: 72h\n    \"30\":\n        retention_stream:\n        - selector: '{container=\"nginx\", level=\"debug\"}'\n          priority: 1\n          period: 24h\n```\n\nRetention period for a given stream is decided based on the first match in this list:\n\n1. If multiple per-tenant `retention_stream` selectors match the stream, retention period with the highest priority is picked.\n2. If multiple global `retention_stream` selectors match the stream, retention period with the highest priority is picked. This value is not considered if per-tenant `retention_stream` is set.\n3. If a per-tenant `retention_period` is specified, it will be applied.\n4. The global `retention_period` will be applied if none of the above match.\n5. If no global `retention_period` is specified, the default value of `0s` is used, which means logs are kept indefinitely.\n\n> Note\n> \n> The larger the priority value, the higher the priority. If two matching `retention_stream` rules have the same priority, Loki applies the shorter (lowest) of the two periods.\n\nStream matching uses the same syntax as Prometheus label matching:\n\n- `=`: Select labels that are exactly equal to the provided string.\n- `!=`: Select labels that are not equal to the provided string.\n- `=~`: Select labels that regex-match the provided string.\n- `!~`: Select labels that do not regex-match the provided string.\n\nThe example configurations defined above will result in the following retention periods:\n\n- For tenant `29`:\n\n- Streams that have the namespace label `prod` will have a retention period of `336h` (2 weeks), even if the container label is `loki`, since the priority of the `prod` rule is higher.\n- Streams that have the container label `loki` but are not in the namespace `prod` will have a `72h` retention period.\n- For the rest of the streams in this tenant, per-tenant override `retention_period` value of `168h` is applied.\n- For tenant `30`:\n\n- Streams that have the label `nginx` and level `debug` will have a retention period of `24h`.\n- For the rest of the streams in this tenant the global retention period of `744h`, since there is no override specified.\n- All tenants except `29` and `30`:\n\n- Streams that have the namespace label `dev` will have a retention period of `24h` hours.\n- Streams except those with the namespace label `dev` will have the retention period of `744h`.\n\n> Note\n> \n> If you are a Grafana Cloud customer, you can use the config self-serve API to configure your tenant retention.\n\n## Table Manager (deprecated) \n\nRetention through the Table Manager is achieved by relying on the object store TTL feature, and will work for both boltdb-shipper store and chunk/index stores.\n\nIn order to enable the retention support, the Table Manager needs to be configured to enable deletions and a retention period. Please refer to the `table_manager` section of the Loki configuration reference for all available options. Alternatively, the `table-manager.retention-period` and `table-manager.retention-deletes-enabled` command line flags can be used. The provided retention period needs to be a duration represented as a string that can be parsed using the Prometheus common model ParseDuration. Examples: `7d`, `1w`, `168h`.\n\n> Warning\n> \n> The retention period must be a multiple of the index and chunks table `period`, configured in the `period_config` block. See the Table Manager documentation for more information.\n\n> Note\n> \n> To avoid querying of data beyond the retention period,`max_query_lookback` config in `limits_config` must be set to a value less than or equal to what is set in `table_manager.retention_period`.\n\nWhen using S3 or GCS, the bucket storing the chunks needs to have the expiry policy set correctly. For more details check S3\u2019s documentation or GCS\u2019s documentation.\n\nIf you must delete ingested logs, you can delete old chunks in your object store. Note, however, that this only deletes the log content and keeps the label index intact; you will still be able to see related labels but will be unable to retrieve the deleted log content.\n\nFor further details on the Table Manager internals, refer to the Table Manager documentation.\n\nAlternatively, if the BoltDB Shipper is configured for the index store, you can enable Log entry deletion to delete log entries from a specific stream.\n\n## Example Configuration \n\nExample configuration with GCS with a 28 day retention:\n\n```yaml\nschema_config:\n  configs:\n    - from: 2018-04-15\n      store: tsdb\n      object_store: gcs\n      schema: v13\n      index:\n        prefix: loki_index_\n        period: 24h\n\nstorage_config:\n  tsdb_shipper:\n    active_index_directory: /loki/index\n    cache_location: /loki/index_cache\n  gcs:\n    bucket_name: GCS_BUCKET_NAME\n\nlimits_config:\n  max_query_lookback: 672h # 28 days\n  retention_period: 672h   # 28 days\n\ncompactor:\n  working_directory: /data/retention\n  delete_request_store: gcs\n  retention_enabled: true\n```\n\n## Object store lifecycle policies \n\nLoki stores chunks and indexes as objects in the configured object store (S3, GCS, Azure Blob Storage, and so on). Chunks are deleted by the Compactor according to your configured retention, but the Compactor only removes chunk objects: it never deletes the objects that hold cluster state, such as the index or the cluster seed.\n\nIf you also configure an object store lifecycle policy on the bucket, scope it carefully. A blanket \u201cdelete everything older than N days\u201d rule will eventually remove objects that Loki must keep, which corrupts the store and causes query failures. The note at the top of this page applies here as well: any lifecycle expiration must be longer than your retention period.\n\n> Warning\n> \n> Never apply a lifecycle rule with an empty prefix (one that targets the whole bucket). Always scope lifecycle rules to the per-tenant chunk prefixes described below.\n\n### Bucket object layout \n\nThe following objects are written to the configured bucket. The exact prefixes depend on your `schema_config` and on whether multi-tenancy is enabled, so confirm them against your own configuration before writing a lifecycle rule.\n\n| Object or prefix | Content | Safe to expire with a lifecycle policy? |\n| --- | --- | --- |\n| `<tenant_id>/` (for example, `fake/` in single-tenant mode, or your org ID per tenant) | Chunk objects (the log data). | Yes. These are the only objects a lifecycle rule should target. |\n| Index objects (under the index path prefix, `index/` by default, set by `index.path_prefix` in `schema_config`) | TSDB or BoltDB index files, written by ingesters and rewritten by the Compactor. The `index.prefix` value (for example `index_` or `loki_index_`) is the table-name prefix used inside this path, not the path itself, so match a lifecycle rule against the path prefix. | No. Loki manages the index lifecycle internally. Deleting index objects removes references to live chunks and breaks queries. |\n| `loki_cluster_seed.json` | A small file at the bucket root holding the cluster seed used by usage reporting. It is written once and never rotated. | No. A blanket age-based rule will delete it once it ages past the time to live (TTL). |\n| Delete-request store objects (a `delete_requests/` table under `delete_request_store_key_prefix`, `index/` by default, in the bucket configured by `delete_request_store`) | The Compactor\u2019s database of delete requests submitted through the Log entry deletion API, and their processing status. | No. Removing these makes the Compactor lose track of pending delete requests. |\n| Deletion marker objects (only present if you set `deletion_marker_object_store_prefix`; otherwise markers are kept on the Compactor\u2019s local disk and never appear in the bucket) | The Compactor\u2019s record of chunks that are marked for deletion but not yet swept. Written under the configured prefix in the same per-period bucket used for chunks. | No. Removing these makes the Compactor lose track of chunks pending deletion. |\n| Ruler store objects (if the Ruler is backed by the same bucket) | Recording and alerting rule files. | No. These are configuration, not time-series data. |\n\n### Compactor retention versus object store lifecycle policies \n\nCompactor retention and object store lifecycle policies are two independent mechanisms, and they should not be configured in ways that conflict:\n\n- The Compactor is index-aware. It only deletes a chunk after it has removed every reference to that chunk from the index, and it waits `compactor.retention-delete-delay` (default `2h`) before the sweeper deletes the marked chunk, so that index gateways pick up the rewritten index first.\n- An object store lifecycle policy is index-unaware. It deletes objects purely by age and prefix, with no knowledge of whether a chunk is still referenced by the index.\n\nFor most deployments, enabling Compactor retention is sufficient and an object store lifecycle policy is not required. If you do add a lifecycle policy as a cost safety net, set its expiration longer than your retention period plus `compactor.retention-delete-delay`, so the Compactor always deletes chunks first and the lifecycle rule only ever catches objects the Compactor has already orphaned.\n\n### Example: Amazon S3 lifecycle policy \n\nThis policy expires only chunk objects under a single tenant prefix. Replace `fake/` with your tenant prefix (use one rule per tenant, or your org ID prefix, when multi-tenancy is enabled). The `Days` value must be larger than your retention period plus the delete delay.\n\n```json\n{\n  \"Rules\": [\n    {\n      \"ID\": \"loki-chunk-expiration\",\n      \"Status\": \"Enabled\",\n      \"Filter\": {\n        \"Prefix\": \"fake/\"\n      },\n      \"Expiration\": {\n        \"Days\": 395\n      }\n    }\n  ]\n}\n```\n\nApply it with the AWS CLI:\n\n```bash\naws s3api put-bucket-lifecycle-configuration \\\n  --bucket YOUR_LOKI_BUCKET \\\n  --lifecycle-configuration file://lifecycle.json\n```\n\n### Example: Google Cloud Storage lifecycle rule \n\nThe equivalent GCS rule expires objects by age and prefix. As with S3, scope `matchesPrefix` to the tenant chunk prefix and keep `age` larger than your retention period plus the delete delay.\n\n```json\n{\n  \"rule\": [\n    {\n      \"action\": {\"type\": \"Delete\"},\n      \"condition\": {\n        \"age\": 395,\n        \"matchesPrefix\": [\"fake/\"]\n      }\n    }\n  ]\n}\n```\n\nApply it with the Google Cloud CLI:\n\n```bash\ngcloud storage buckets update gs://YOUR_LOKI_BUCKET --lifecycle-file=lifecycle.json\n```\n\nFor Azure Blob Storage, use a management policy with a `prefixMatch` set to the tenant chunk prefix and the same \u201cexpiration must exceed retention plus delete delay\u201d rule.\n\nEmail docs@grafana.com\n\nOn this page",
      "content_chars": 18971,
      "published_date": null
    },
    {
      "rank": 3,
      "url": "https://grafana.com/docs/loki/latest/operations/storage/retention/?pg=loki-2-3-is-out-custom-retention-15x-query-speed-on-recent-data-prometheus-style-recording-rules&plcmt=in-text",
      "title": "Log retention | Grafana Loki documentation",
      "content": "Log retention | Grafana Loki documentation \n\n# Log retention \n\nRetention in Grafana Loki is achieved through the Compactor. By default the `compactor.retention-enabled` flag is not set, so the logs sent to Loki live forever.\n\n> Note\n> \n> If you have a lifecycle policy configured on the object store, please ensure that it is longer than the retention period.\n\nGranular retention policies to apply retention at per tenant or per stream level are also supported by the Compactor.\n\n> Note\n> \n> The Compactor does not support retention on legacy index types. Please use the Table Manager when using legacy index types. Both the Table manager and legacy index types are deprecated and may be removed in future major versions of Loki.\n\n## Compactor \n\nThe Compactor is responsible for compaction of index files and applying log retention.\n\n> Note\n> \n> Run the Compactor as a singleton (a single instance).\n\nThe Compactor loops to apply compaction and retention at every `compactor.compaction-interval`, or as soon as possible if running behind. Both compaction and retention are idempotent, which means once the action has been performed, if the action is performed multiple times, it has no further effect on logs after the first time it is performed. If the Compactor restarts, it continues from where it left off.\n\n> Note\n> \n> Changes to your retention period are not retroactive, that is, they are not applied to logs that have already been ingested.\n\nThe Compactor\u2019s algorithm to apply retention is as follows:\n\n- For each day or table (one table per day with 24h index period):\n\n- Compact multiple index files in the table into per-tenant index files. Result of compaction is a single index file per tenant per day.\n- Traverse the per-tenant index. Use the tenant configuration to identify the chunks that need to be removed.\n- Remove the references to the matching chunks from the index and add the chunk references to a marker file on disk.\n- Upload the new modified index files.\n\nChunks are not deleted while applying the retention algorithm on the index. They are deleted asynchronously by a sweeper process and this delay can be configured by setting `-compactor.retention-delete-delay`. Marker files are used to keep track of the chunks pending for deletion.\n\nChunks cannot be deleted immediately for the following reasons:\n\n- Index Gateway downloads a copy of the index files to serve queries and refreshes them at a regular interval. Having a delay allows the index gateways to pull the modified index file which would not contain any reference to the chunks marked for deletion. Without the delay, index files (that are stale) on the gateways could refer to already deleted chunks leading to query failures.\n- It provides a short window of time in which to cancel chunk deletion in the case of a configuration mistake.\n\nMarker files should be stored on a persistent disk to ensure that the chunks pending for deletion are processed even if the Compactor process restarts.\n\n> Note\n> \n> Grafana Labs recommends running Compactor as a stateful deployment (StatefulSet when using Kubernetes) with a persistent storage for storing marker files.\n\n### Retention Configuration \n\nThis Compactor configuration example activates retention.\n\n```yaml\ncompactor:\n  working_directory: /data/retention\n  compaction_interval: 10m\n  retention_enabled: true\n  retention_delete_delay: 2h\n  retention_delete_worker_count: 150\n  delete_request_store: gcs\nschema_config:\n  configs:\n    - from: \"2020-07-31\"\n      index:\n        period: 24h\n        prefix: index_\n      object_store: gcs\n      schema: v13\n      store: tsdb\nstorage_config:\n  tsdb_shipper:\n    active_index_directory: /data/index\n    cache_location: /data/index_cache\n  gcs:\n    bucket_name: loki\n```\n\n> Note\n> \n> Retention is only available if the index period is 24h. Single store TSDB and single store BoltDB require 24h index period.\n\n`retention_enabled` should be set to true. Without this, the Compactor will only compact tables.\n\n`delete_request_store` should be set to configure the store for delete requests. This is required when retention is enabled.\n\n`working_directory` is the directory where marked chunks and temporary tables will be saved.\n\n`compaction_interval` dictates how often compaction and/or retention is applied. If the Compactor falls behind, compaction and/or retention occur as soon as possible.\n\n`retention_delete_delay` is the delay after which the Compactor will delete marked chunks.\n\n`retention_delete_worker_count` specifies the maximum quantity of goroutine workers instantiated to delete chunks.\n\n#### Configuring the retention period \n\nRetention period is configured within the `limits_config` configuration section.\n\nThere are two ways of setting retention policies:\n\n- `retention_period` which is applied globally for all log streams.\n- `retention_stream` which is only applied to log streams matching the selector.\n\n> Note\n> \n> The minimum retention period is 24h.\n\nThis example configures global retention that applies to all tenants (unless overridden by configuring per-tenant overrides):\n\n```yaml\n...\nlimits_config:\n  retention_period: 744h\n  retention_stream:\n  - selector: '{namespace=\"dev\"}'\n    priority: 1\n    period: 24h\n  per_tenant_override_config: /etc/overrides.yaml\n...\n```\n\n> Note\n> \n> You can only use label matchers in the `selector` field of a `retention_stream` definition. Arbitrary LogQL expressions are not supported.\n\nPer tenant retention can be defined by configuring runtime overrides. For example:\n\n```yaml\noverrides:\n    \"29\":\n        retention_period: 168h\n        retention_stream:\n        - selector: '{namespace=\"prod\"}'\n          priority: 2\n          period: 336h\n        - selector: '{container=\"loki\"}'\n          priority: 1\n          period: 72h\n    \"30\":\n        retention_stream:\n        - selector: '{container=\"nginx\", level=\"debug\"}'\n          priority: 1\n          period: 24h\n```\n\nRetention period for a given stream is decided based on the first match in this list:\n\n1. If multiple per-tenant `retention_stream` selectors match the stream, retention period with the highest priority is picked.\n2. If multiple global `retention_stream` selectors match the stream, retention period with the highest priority is picked. This value is not considered if per-tenant `retention_stream` is set.\n3. If a per-tenant `retention_period` is specified, it will be applied.\n4. The global `retention_period` will be applied if none of the above match.\n5. If no global `retention_period` is specified, the default value of `0s` is used, which means logs are kept indefinitely.\n\n> Note\n> \n> The larger the priority value, the higher the priority.\n\nStream matching uses the same syntax as Prometheus label matching:\n\n- `=`: Select labels that are exactly equal to the provided string.\n- `!=`: Select labels that are not equal to the provided string.\n- `=~`: Select labels that regex-match the provided string.\n- `!~`: Select labels that do not regex-match the provided string.\n\nThe example configurations defined above will result in the following retention periods:\n\n- For tenant `29`:\n\n- Streams that have the namespace label `prod` will have a retention period of `336h` (2 weeks), even if the container label is `loki`, since the priority of the `prod` rule is higher.\n- Streams that have the container label `loki` but are not in the namespace `prod` will have a `72h` retention period.\n- For the rest of the streams in this tenant, per-tenant override `retention_period` value of `168h` is applied.\n- For tenant `30`:\n\n- Streams that have the label `nginx` and level `debug` will have a retention period of `24h`.\n- For the rest of the streams in this tenant the global retention period of `744h`, since there is no override specified.\n- All tenants except `29` and `30`:\n\n- Streams that have the namespace label `dev` will have a retention period of `24h` hours.\n- Streams except those with the namespace label `dev` will have the retention period of `744h`.\n\n> Note\n> \n> If you are a Grafana Cloud customer, you can use the config self-serve API to configure your tenant retention.\n\n## Table Manager (deprecated) \n\nRetention through the Table Manager is achieved by relying on the object store TTL feature, and will work for both boltdb-shipper store and chunk/index stores.\n\nIn order to enable the retention support, the Table Manager needs to be configured to enable deletions and a retention period. Please refer to the `table_manager` section of the Loki configuration reference for all available options. Alternatively, the `table-manager.retention-period` and `table-manager.retention-deletes-enabled` command line flags can be used. The provided retention period needs to be a duration represented as a string that can be parsed using the Prometheus common model ParseDuration. Examples: `7d`, `1w`, `168h`.\n\n> Warning\n> \n> The retention period must be a multiple of the index and chunks table `period`, configured in the `period_config` block. See the Table Manager documentation for more information.\n\n> Note\n> \n> To avoid querying of data beyond the retention period,`max_query_lookback` config in `limits_config` must be set to a value less than or equal to what is set in `table_manager.retention_period`.\n\nWhen using S3 or GCS, the bucket storing the chunks needs to have the expiry policy set correctly. For more details check S3\u2019s documentation or GCS\u2019s documentation.\n\nIf you must delete ingested logs, you can delete old chunks in your object store. Note, however, that this only deletes the log content and keeps the label index intact; you will still be able to see related labels but will be unable to retrieve the deleted log content.\n\nFor further details on the Table Manager internals, refer to the Table Manager documentation.\n\nAlternatively, if the BoltDB Shipper is configured for the index store, you can enable Log entry deletion to delete log entries from a specific stream.\n\n## Example Configuration \n\nExample configuration with GCS with a 28 day retention:\n\n```yaml\nschema_config:\n  configs:\n    - from: 2018-04-15\n      store: tsdb\n      object_store: gcs\n      schema: v13\n      index:\n        prefix: loki_index_\n        period: 24h\n\nstorage_config:\n  tsdb_shipper:\n    active_index_directory: /loki/index\n    cache_location: /loki/index_cache\n  gcs:\n    bucket_name: GCS_BUCKET_NAME\n\nlimits_config:\n  max_query_lookback: 672h # 28 days\n  retention_period: 672h   # 28 days\n\ncompactor:\n  working_directory: /data/retention\n  delete_request_store: gcs\n  retention_enabled: true\n```\n\n## Object store lifecycle policies \n\nLoki stores chunks and indexes as objects in the configured object store (S3, GCS, Azure Blob Storage, and so on). Chunks are deleted by the Compactor according to your configured retention, but the Compactor only removes chunk objects: it never deletes the objects that hold cluster state, such as the index or the cluster seed.\n\nIf you also configure an object store lifecycle policy on the bucket, scope it carefully. A blanket \u201cdelete everything older than N days\u201d rule will eventually remove objects that Loki must keep, which corrupts the store and causes query failures. The note at the top of this page applies here as well: any lifecycle expiration must be longer than your retention period.\n\n> Warning\n> \n> Never apply a lifecycle rule with an empty prefix (one that targets the whole bucket). Always scope lifecycle rules to the per-tenant chunk prefixes described below.\n\n### Bucket object layout \n\nThe following objects are written to the configured bucket. The exact prefixes depend on your `schema_config` and on whether multi-tenancy is enabled, so confirm them against your own configuration before writing a lifecycle rule.\n\n| Object or prefix | Content | Safe to expire with a lifecycle policy? |\n| --- | --- | --- |\n| `<tenant_id>/` (for example, `fake/` in single-tenant mode, or your org ID per tenant) | Chunk objects (the log data). | Yes. These are the only objects a lifecycle rule should target. |\n| Index objects (under the index path prefix, `index/` by default, set by `index.path_prefix` in `schema_config`) | TSDB or BoltDB index files, written by ingesters and rewritten by the Compactor. The `index.prefix` value (for example `index_` or `loki_index_`) is the table-name prefix used inside this path, not the path itself, so match a lifecycle rule against the path prefix. | No. Loki manages the index lifecycle internally. Deleting index objects removes references to live chunks and breaks queries. |\n| `loki_cluster_seed.json` | A small file at the bucket root holding the cluster seed used by usage reporting. It is written once and never rotated. | No. A blanket age-based rule will delete it once it ages past the time to live (TTL). |\n| Compactor delete-request store (the `delete_request_store` you configure, such as `markers/` and the delete-request objects) | The Compactor\u2019s record of chunks pending deletion and of in-flight delete requests. | No. Removing these makes the Compactor lose track of pending deletions. |\n| Ruler store objects (if the Ruler is backed by the same bucket) | Recording and alerting rule files. | No. These are configuration, not time-series data. |\n\n### Compactor retention versus object store lifecycle policies \n\nCompactor retention and object store lifecycle policies are two independent mechanisms, and they should not be configured in ways that conflict:\n\n- The Compactor is index-aware. It only deletes a chunk after it has removed every reference to that chunk from the index, and it waits `compactor.retention-delete-delay` (default `2h`) before the sweeper deletes the marked chunk, so that index gateways pick up the rewritten index first.\n- An object store lifecycle policy is index-unaware. It deletes objects purely by age and prefix, with no knowledge of whether a chunk is still referenced by the index.\n\nFor most deployments, enabling Compactor retention is sufficient and an object store lifecycle policy is not required. If you do add a lifecycle policy as a cost safety net, set its expiration longer than your retention period plus `compactor.retention-delete-delay`, so the Compactor always deletes chunks first and the lifecycle rule only ever catches objects the Compactor has already orphaned.\n\n### Example: Amazon S3 lifecycle policy \n\nThis policy expires only chunk objects under a single tenant prefix. Replace `fake/` with your tenant prefix (use one rule per tenant, or your org ID prefix, when multi-tenancy is enabled). The `Days` value must be larger than your retention period plus the delete delay.\n\n```json\n{\n  \"Rules\": [\n    {\n      \"ID\": \"loki-chunk-expiration\",\n      \"Status\": \"Enabled\",\n      \"Filter\": {\n        \"Prefix\": \"fake/\"\n      },\n      \"Expiration\": {\n        \"Days\": 395\n      }\n    }\n  ]\n}\n```\n\nApply it with the AWS CLI:\n\n```bash\naws s3api put-bucket-lifecycle-configuration \\\n  --bucket YOUR_LOKI_BUCKET \\\n  --lifecycle-configuration file://lifecycle.json\n```\n\n### Example: Google Cloud Storage lifecycle rule \n\nThe equivalent GCS rule expires objects by age and prefix. As with S3, scope `matchesPrefix` to the tenant chunk prefix and keep `age` larger than your retention period plus the delete delay.\n\n```json\n{\n  \"rule\": [\n    {\n      \"action\": {\"type\": \"Delete\"},\n      \"condition\": {\n        \"age\": 395,\n        \"matchesPrefix\": [\"fake/\"]\n      }\n    }\n  ]\n}\n```\n\nApply it with the Google Cloud CLI:\n\n```bash\ngcloud storage buckets update gs://YOUR_LOKI_BUCKET --lifecycle-file=lifecycle.json\n```\n\nFor Azure Blob Storage, use a management policy with a `prefixMatch` set to the tenant chunk prefix and the same \u201cexpiration must exceed retention plus delete delay\u201d rule.\n\nScaling and securing your logs with Grafana Loki\n\nThis webinar covers the challenges of scaling and securing logs, and how Grafana Cloud Logs powered by Grafana Loki can help, cost-effectively.\n\nOn this page\n\n See what\u2019s actually working with AI in observability. Learn how teams are using AI for investigations, incident response, OpenTelemetry, and telemetry cost control in production. \n\n Bring your hardest observability problem. From OpenTelemetry and incident response to telemetry cost control and AI-powered investigations, learn what\u2019s working at scale. \n\n Learn how teams are scaling observability with AI, OpenTelemetry, and Adaptive Telemetry. Real systems. Real incidents. Real operational lessons.",
      "content_chars": 16394,
      "published_date": null
    },
    {
      "rank": 4,
      "url": "https://github.com/grafana/loki/issues/6300",
      "title": "Old chunks not getting deleted after retention period",
      "content": "# Old chunks not getting deleted after retention period\n\n- State: closed\n- Author: wzjjack\n- Created: 2022-06-03T06:31:56Z\n- Updated: 2026-04-22T00:46:55Z\n- Repository: grafana/loki\n- Number: #6300\n\n---\n\n \n \n**Describe the bug** \nI've configured 168h retention for my logs, but I can see chunks 5 years old filling my disk \n \n**To Reproduce** \n \nthis is my config \n```\r\nauth_enabled: false\r\n\r\nserver:\r\n  http_listen_port: 3100\r\n  grpc_listen_port: 9096\r\n  grpc_server_max_recv_msg_size: 8388608\r\n  grpc_server_max_send_msg_size: 8388608\r\nquerier:\r\n  engine:\r\n    max_look_back_period: 168h      \r\n\r\ningester:\r\n  wal:\r\n    enabled: true\r\n    dir: /tmp/wal\r\n  lifecycler:\r\n    address: 127.0.0.1\r\n    ring:\r\n      kvstore:\r\n        store: inmemory\r\n      replication_factor: 1\r\n    final_sleep: 0s\r\n  chunk_idle_period: 24h       # Any chunk not receiving new logs in this time will be flushed\r\n  max_chunk_age: 24h           # All chunks will be flushed when they hit this age, default is 1h\r\n  chunk_target_size: 1048576  # Loki will attempt to build chunks up to 1.5MB, flushing first if chunk_idle_period or max_chunk_age is reached first\r\n  chunk_retain_period: 5m    # Must be greater than index read cache TTL if using an index cache (Default index read cache TTL is 5m)\r\n  max_transfer_retries: 0     # Chunk transfers disabled\r\n\r\nschema_config:\r\n  configs:\r\n    - from: 2020-10-24\r\n      store: boltdb-shipper\r\n      object_store: filesystem\r\n      schema: v11\r\n      index:\r\n        prefix: index_\r\n        period: 24h\r\n\r\nstorage_config:\r\n  boltdb_shipper:\r\n    active_index_directory: /tmp/loki/boltdb-shipper-active\r\n    cache_location: /tmp/loki/boltdb-shipper-cache\r\n    cache_ttl: 24h         # Can be increased for faster performance over longer query periods, uses more disk space\r\n    shared_store: filesystem\r\n  filesystem:\r\n    directory: /tmp/loki/chunks\r\n\r\ncompactor:\r\n  working_directory: /tmp/loki/boltdb-shipper-compactor\r\n  shared_store: filesystem\r\n\r\nlimits_config:\r\n  reject_old_samples: true\r\n  reject_old_samples_max_age: 168h\r\n  max_streams_per_user: 1000000\r\n  max_entries_limit_per_query: 5000000\r\n  ingestion_rate_mb: 100\r\n  ingestion_burst_size_mb: 20 \r\nchunk_store_config:\r\n  max_look_back_period: 168h\r\n\r\ntable_manager:\r\n  retention_deletes_enabled: false\r\n  retention_period: 168h\r\n```\r\n \n**Expected behavior** \nChunks older than 168h should be deleted. \n \n**Environment:** \n - Infrastructure: [e.g., Kubernetes, bare-metal, laptop] \n - Deployment tool: [e.g., helm, jsonnet] \n \n**Screenshots, Promtail config, or terminal output** \nWe can see 49 days of logs although I've configured 168h \nimage \n\n## Timeline\n\n- Referenced by issue #936: Old chunks not getting deleted after retention period\n\n**DeBuXer** commented on 2022-06-03T13:04:57Z:\n\n> I got the same issue. Logs older than 7 days are deleted and they're not visible in Grafana. Only the chunk files won't be deleted on the filesystem.\n> \n> ```\n> loki, version 2.5.0 (branch: HEAD, revision: 2d9d0ee23)\n> build user: root@4779f4b48f3a\n> build date: 2022-04-07T21:50:00Z\n> go version: go1.17.6\n> platform: linux/amd64\n> ```\n> \n> ```\n> server:\n> http_listen_port: 3100\n> grpc_listen_port: 9096\n> \n> common:\n> path_prefix: /var/lib/loki\n> storage:\n> filesystem:\n> chunks_directory: /var/lib/loki/chunks\n> rules_directory: /var/lib/loki/rules\n> replication_factor: 1\n> ring:\n> instance_addr: 127.0.0.1\n> kvstore:\n> store: inmemory\n> \n> schema_config:\n> configs:\n> - from: 2020-10-24\n> store: boltdb-shipper\n> object_store: filesystem\n> schema: v11\n> index:\n> prefix: index_\n> period: 24h\n> \n> chunk_store_config:\n> max_look_back_period: 168h\n> \n> table_manager:\n> retention_deletes_enabled: true\n> retention_period: 168h\n> ```\n\n**splitice** commented on 2022-06-04T07:15:14Z:\n\n> Use compactor not table_manager if you arent using AWS S3.\n\n**DeBuXer** commented on 2022-06-07T08:52:38Z:\n\n> > Use compactor not table_manager if you arent using AWS S3.\n> \n> Thanks, that did the trick :)\n\n**Mastedont** commented on 2022-06-14T09:56:43Z:\n\n> Hey @DeBuXer, could you post what you add to your config file in order to get deletion on s3 done?. I am running the same issue and I have not found the solution.\n\n- DeBuXer mentioned\n\n- DeBuXer subscribed\n\n**DeBuXer** commented on 2022-06-14T10:00:18Z:\n\n> @Mastedont, I don't use S3, I store my chunks directly on disk. My current configuration:\n> \n> ```\n> server:\n> http_listen_port: 3100\n> grpc_listen_port: 9096\n> \n> common:\n> path_prefix: /var/lib/loki\n> storage:\n> filesystem:\n> chunks_directory: /var/lib/loki/chunks\n> rules_directory: /var/lib/loki/rules\n> replication_factor: 1\n> ring:\n> instance_addr: 127.0.0.1\n> kvstore:\n> store: inmemory\n> \n> schema_config:\n> configs:\n> - from: 2020-10-24\n> store: boltdb-shipper\n> object_store: filesystem\n> schema: v11\n> index:\n> prefix: index_\n> period: 24h\n> \n> chunk_store_config:\n> max_look_back_period: 168h\n> \n> compactor:\n> working_directory: /var/lib/loki/retention\n> shared_store: filesystem\n> compaction_interval: 10m\n> retention_enabled: true\n> retention_delete_delay: 2h\n> retention_delete_worker_count: 150\n> \n> limits_config:\n> retention_period: 168h\n> \n> ruler:\n> alertmanager_url: http://127.0.0.1:9093\n> ```\n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n**Mastedont** commented on 2022-06-14T10:02:00Z:\n\n> Thank you, @DeBuXer \n\n- DeBuXer mentioned\n\n- DeBuXer subscribed\n\n**Mastedont** commented on 2022-06-14T11:02:51Z:\n\n> One last question @DeBuXer.\n> \n> Do you how can I know if log retention is working or not? What output written in logs will let know thats is working?\n\n- DeBuXer mentioned\n\n- DeBuXer subscribed\n\n**DeBuXer** commented on 2022-06-14T13:19:51Z:\n\n> @Mastedont, Not 100% sure, but I guess:\n> \n> ```\n> Jun 14 15:15:44 loki loki[277929]: level=info ts=2022-06-14T13:15:44.57537489Z caller=index_set.go:280 table-name=index_19150 msg=\"removing source db files from storage\" count=1\n> Jun 14 15:15:44 loki loki[277929]: level=info ts=2022-06-14T13:15:44.576099223Z caller=compactor.go:495 msg=\"finished compacting table\" table-name=index_19150\n> ```\n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n**Mastedont** commented on 2022-06-14T14:07:09Z:\n\n> That log output is from Ingester?\n> \n> I only can see outpur like this, despite of having Compactor enabled:\n> \n> ```\n> level=info ts=2022-06-14T14:05:17.574831148Z caller=table.go:358 msg=\"uploading table loki_pre_19157\"\n> level=info ts=2022-06-14T14:05:17.574847901Z caller=table.go:385 msg=\"finished uploading table loki_pre_19157\"\n> level=info ts=2022-06-14T14:05:17.57485537Z caller=table.go:443 msg=\"cleaning up unwanted dbs from table loki_pre_19157\"\n> ```\n\n**DeBuXer** commented on 2022-06-14T14:26:06Z:\n\n> > That log output is from Ingester?\n> \n> From /var/log/syslog but should have the same information. When compactor is enabled, you should see something like;\n> \n> ```\n> level=info ts=2022-06-14T14:24:56.072803949Z caller=compactor.go:324 msg=\"this instance has been chosen to run the compactor, starting compactor\"\n> ```\n\n**rickydjohn** commented on 2022-07-05T07:19:52Z:\n\n> @DeBuXer , thanks a lot for your support here. I don't see the chunk files getting rotated. I also see pretty old index directories as well. I wanted my logs to be rotated every 7 days. I am not sure what I am doing wrong here. Could you please help me with it?\n> \n> ```\n> auth_enabled: false\n> chunk_store_config:\n> max_look_back_period: 168h\n> \n> compactor:\n> shared_store: filesystem\n> working_directory: /data/loki/boltdb-shipper-compactor\n> \n> ingester:\n> chunk_block_size: 262144\n> chunk_idle_period: 3m\n> chunk_retain_period: 1m\n> wal:\n> dir: /data/loki/wal \n> flush_on_shutdown: true\n> lifecycler:\n> ring:\n> kvstore:\n> store: inmemory\n> replication_factor: 1\n> max_transfer_retries: 0\n> \n> limits_config:\n> enforce_metric_name: false\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> ingestion_rate_mb: 32\n> ingestion_burst_size_mb: 36\n> unordered_writes: true\n> retention_period: 168h\n> \n> schema_config:\n> configs:\n> - from: 2020-10-24\n> index:\n> period: 24h\n> prefix: index_\n> object_store: filesystem\n> schema: v11\n> store: boltdb-shipper\n> \n> server:\n> http_listen_port: 3100\n> \n> storage_config:\n> boltdb_shipper:\n> active_index_directory: /data/loki/boltdb-shipper-active\n> cache_location: /data/loki/boltdb-shipper-cache\n> cache_ttl: 24h\n> shared_store: filesystem\n> filesystem:\n> directory: /data/loki/chunks\n> \n> table_manager:\n> retention_deletes_enabled: true\n> retention_period: 168h\n> \n> ```\n\n- DeBuXer mentioned\n\n- DeBuXer subscribed\n\n**DeBuXer** commented on 2022-07-05T07:30:31Z:\n\n> @rickydjohn, I think you need to enable ` retention_enabled`. See also https://grafana.com/docs/loki/latest/operations/storage/retention/#retention-configuration\n\n- rickydjohn mentioned\n\n- rickydjohn subscribed\n\n**stale[bot]** commented on 2022-08-13T12:49:02Z:\n\n> Hi! This issue has been automatically marked as stale because it has not had any\n> activity in the past 30 days.\n> \n> We use a stalebot among other tools to help manage the state of issues in this project.\n> A stalebot can be very useful in closing issues in a number of cases; the most common\n> is closing issues or PRs where the original reporter has not responded.\n> \n> Stalebots are also emotionless and cruel and can close issues which are still very relevant.\n> \n> **If this issue is important to you, please add a comment to keep it open. More importantly, please add a thumbs-up to the original issue entry.**\n> \n> We regularly sort for closed issues which have a `stale` label sorted by thumbs up.\n> \n> We may also:\n> * Mark issues as `revivable` if we think it's a valid issue but isn't something we are likely\n> to prioritize in the future (the issue will still remain closed).\n> * Add a `keepalive` label to silence the stalebot if the issue is very common/popular/important.\n> \n> We are doing our best to respond, organize, and prioritize all issues but it can be a challenging task,\n> our sincere apologies if you find yourself at the mercy of the stalebot.\n\n- stale[bot] added label \"stale\"\n\n**atze234** commented on 2022-08-30T08:20:16Z:\n\n> Hi @Mastedont ,\n> did you manage to get the chunks deleted from s3? Im having that same problem, that i cannot see any logs about compactor and in s3 store there are older files (>7days) than my configured retention. It seems only the index is cleared, because grafana wont show older log entries. \n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n**ghost** commented on 2022-09-05T07:10:20Z:\n\n> > Hi @Mastedont , did you manage to get the chunks deleted from s3? Im having that same problem, that i cannot see any logs about compactor and in s3 store there are older files (>7days) than my configured retention. It seems only the index is cleared, because grafana wont show older log entries.\n> \n> I have the same problem\n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n- stale[bot] removed label \"stale\"\n\n**webfrank** commented on 2022-11-16T17:11:14Z:\n\n> Hi, I have this relevant config:\n> \n> ```\n> compactor:\n> compaction_interval: 10m\n> retention_delete_delay: 2h\n> retention_delete_worker_count: 150\n> retention_enabled: true\n> shared_store: s3\n> working_directory: /var/loki/retention\n> limits_config:\n> enforce_metric_name: false\n> max_cache_freshness_per_query: 10m\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> retention_period: 720h\n> split_queries_by_interval: 30m\n> ```\n> \n> but log files are not deleted on S3, only index compacted.\n\n**jarrettprosser** commented on 2022-11-18T03:32:44Z:\n\n> I'm also finding this on loki 2.4.0, using minio as storage. Even with `retention_delete_delay: 5m` no chunks are being deleted. \n\n**Codecaver** commented on 2022-12-19T08:13:04Z:\n\n> > @Mastedont, I don't use S3, I store my chunks directly on disk. My current configuration:\n> > \n> > ```\n> > server:\n> > http_listen_port: 3100\n> > grpc_listen_port: 9096\n> > \n> > common:\n> > path_prefix: /var/lib/loki\n> > storage:\n> > filesystem:\n> > chunks_directory: /var/lib/loki/chunks\n> > rules_directory: /var/lib/loki/rules\n> > replication_factor: 1\n> > ring:\n> > instance_addr: 127.0.0.1\n> > kvstore:\n> > store: inmemory\n> > \n> > schema_config:\n> > configs:\n> > - from: 2020-10-24\n> > store: boltdb-shipper\n> > object_store: filesystem\n> > schema: v11\n> > index:\n> > prefix: index_\n> > period: 24h\n> > \n> > chunk_store_config:\n> > max_look_back_period: 168h\n> > \n> > compactor:\n> > working_directory: /var/lib/loki/retention\n> > shared_store: filesystem\n> > compaction_interval: 10m\n> > retention_enabled: true\n> > retention_delete_delay: 2h\n> > retention_delete_worker_count: 150\n> > \n> > limits_config:\n> > retention_period: 168h\n> > \n> > ruler:\n> > alertmanager_url: http://127.0.0.1:9093\n> > ```\n> Hi\uff0cwill this configuration clean up expired files in the chunks directory?\n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n**patsevanton** commented on 2022-12-30T10:38:28Z:\n\n> any update ?\n\n**seany89** commented on 2023-01-27T13:29:47Z:\n\n> Judging from the discussion in this issue https://github.com/grafana/loki/issues/7068\n> I don't think the compactor will delete the chunks in s3 object store you need a bucket lifecycle policy for that.\n> \n> It would be nice to have a clear answer on this though.\n\n**nvanheuverzwijn** commented on 2023-02-15T19:16:38Z:\n\n> For everyone wondering what's going with the retention, I've tested the feature _a lot_ in the past days so here are what will work.\n> \n> ### Minimal Configuration Needed\n> First of all, you absolutely need those config setup\n> ```\n> limits_config:\n> retention_period: 10d # Keep 10 days\n> compactor:\n> delete_request_cancel_period: 10m # don't wait 24h before processing the delete_request\n> retention_enabled: true # actually do the delete\n> retention_delete_delay: 2h # wait 2 hours before actually deleting stuff\n> ```\n> You can tweak those config to delete faster or slower.\n> \n> ### Check If It's Working\n> Once you got those config up and running, check that the logs are actually reporting that the retention is being applied : `msg=\"applying retention with compaction\"`. The \"caller\" for this log is `compactor.go`.\n> \n> Next, check that the retention manager is actually doing it's job in the logs: `msg=\"mark file created\"` and `msg=\"no marks file found\"` from the caller `marker.go`.\n> \n> The `mark file created` means that loki did found some chunks to be deleted and it has created a file to keep track of it. The `no marks file found` means that while performing the chunk delete routine, there was no file that matched it's filters, the filters mainly being the delay.\n> \n> Whenever you see the `mark file created` logs, you can go into the working directory of the compactor and check for the mark files. The path should be something like `/var/loki/compactor/retention/markers`. These files are kept there for 2 hours or whatever is set in `retention_delete_delay`. After `retention_delete_delay` is passed, loki _will_ delete the chunks.\n> \n> Not having any of the logs mentionned above means that the retention process is not started.\n> \n> ### Important Notes\n> Loki will *only delete chunks that are indexed*. The indexes are actually being purged before deleting the chunks. This means that if you lose files from the compactor's working directory, whatever chunks that were marked there won't be deleted ever so it is still worth to have a lifecycle policy to cover for this OR have persistent storage for this particular folder.\n\n**amseager** commented on 2023-03-05T13:27:48Z:\n\n> @nvanheuverzwijn if I were the CTO of Grafana Labs, I would give you a job offer immediately\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**adthonb** commented on 2023-04-28T00:54:14Z:\n\n> @nvanheuverzwijn Thank you a lot! Your explanation makes me clear. The Loki document makes me confuse that Table Manager also deletes chucks when using the filesystem chuck store.\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**yangmeilly** commented on 2023-07-11T12:48:42Z:\n\n> more info about 'Check If It's Working'\n> such as `compaction_interval: 10m`\n> assuming the loki instance start at `2023-07-11T12:30:25.060395045Z`, then there are logs about caller=compactor.go at `ts=2023-07-11T12:40:25.047110295Z`\n> \n> level=info ts=2023-07-11T12:30:25.060441045Z caller=compactor.go:440 msg=\"waiting 10m0s for ring to stay stable and previous compactions to finish before starting compactor\"\n> level=info ts=2023-07-11T12:40:25.045542628Z caller=compactor.go:445 msg=\"compactor startup delay completed\"\n> level=info ts=2023-07-11T12:40:25.045568295Z caller=compactor.go:497 msg=\"compactor started\"\n> **level=info ts=2023-07-11T12:40:25.04562367Z caller=compactor.go:454 msg=\"applying retention with compaction\"**\n> level=info ts=2023-07-11T12:40:25.047110295Z caller=compactor.go:609 msg=\"compacting table\" table-name=loki_index_19549\n> level=info ts=2023-07-11T12:40:25.047208753Z caller=table_compactor.go:325 table-name=loki_index_19549 msg=\"using compactor-1689078092.gz as seed file\"\n> level=info ts=2023-07-11T12:40:25.048495753Z caller=util.go:85 table-name=loki_index_19549 file-name=compactor-1689078092.gz msg=\"downloaded file\" total_time=1.280041ms\n> level=info ts=2023-07-11T12:40:25.06665592Z caller=compactor.go:614 msg=\"finished compacting table\" table-name=loki_index_19549\n> level=info ts=2023-07-11T12:40:25.066668503Z caller=compactor.go:609 msg=\"compacting table\" table-name=loki_index_19548\n> level=info ts=2023-07-11T12:40:25.067591628Z caller=util.go:85 table-name=loki_index_19548 file-name=compactor-1689041382.gz msg=\"downloaded file\" total_time=863.125\u00b5s\n> level=info ts=2023-07-11T12:40:25.078401878Z caller=compactor.go:614 msg=\"finished compacting table\" table-name=loki_index_19548\n\n**Nurlan199206** commented on 2023-07-12T07:56:53Z:\n\n> @yangmeilly \n> \n> you can send full config pls `loki.yaml`?\n> \n> for me not working.\n\n- yangmeilly mentioned\n\n- yangmeilly subscribed\n\n**yangmeilly** commented on 2023-07-13T08:30:15Z:\n\n> > @yangmeilly\n> > \n> > you can send full config pls `loki.yaml`?\n> > \n> > for me not working.\n> \n> in my scenario, using boltdb-shipper for indexs and filesystem for chunks.\n> the full loki config as following, and bold should have your attention.\n> \n> \n> **compactor block:\n> compaction_interval: 10m\n> delete_request_cancel_period: 2h\n> retention_delete_delay: 2h\n> retention_delete_worker_count: 150\n> retention_enabled: true\n> shared_store: filesystem\n> working_directory: /var/loki/retention**\n> \n> limits_config block:\n> enforce_metric_name: false\n> max_cache_freshness_per_query: 10m\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> split_queries_by_interval: 15m\n> **etention_period: 72h\n> max_query_lookback: 72h**\n> \n> \n> table_manager block: // this make nosense for filesystem\n> retention_deletes_enabled: false\n> retention_period: 0\n\n- yangmeilly mentioned\n\n- yangmeilly subscribed\n\n**HammerNL89** commented on 2023-07-25T12:55:21Z:\n\n> > Whenever you see the `mark file created` logs, you can go into the working directory of the compactor and check for the mark files. The path should be something like `/var/loki/compactor/retention/markers`. These files are kept there for 2 hours or whatever is set in `retention_delete_delay`. After `retention_delete_delay` is passed, loki _will_ delete the chunks.\n> > \n> > Not having any of the logs mentionned above means that the retention process is not started.\n> > \n> \n> @nvanheuverzwijn\n> Thanks for the info. Regarding your statement, loki will delete the chunks, are you talking about a filesystem backend or also a s3/azure backend? \n> I can't find a definitive answer stating that loki is able to delete chunks from external storage.\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**nvanheuverzwijn** commented on 2023-07-25T13:09:29Z:\n\n> It will also delete on S3/Azure. I did this with Google Cloud storage but\n> it should be the same for the other backend.\n> \n> Le mar. 25 juill. 2023, 08 h 55, HammerNL89 ***@***.***> a\n> \u00e9crit :\n> \n> > Whenever you see the mark file created logs, you can go into the working\n> > directory of the compactor and check for the mark files. The path should be\n> > something like /var/loki/compactor/retention/markers. These files are\n> > kept there for 2 hours or whatever is set in retention_delete_delay.\n> > After retention_delete_delay is passed, loki *will* delete the chunks.\n> >\n> > Not having any of the logs mentionned above means that the retention\n> > process is not started.\n> >\n> > @nvanheuverzwijn \n> > Thanks for the info. Regarding your statement, loki will delete the\n> > chunks, are you talking about a filesystem backend or also a s3/azure\n> > backend?\n> > I can't find a definitive answer stating that loki is able to delete\n> > chunks from external storage.\n> >\n> > \u2014\n> > Reply to this email directly, view it on GitHub\n> >, or\n> > unsubscribe\n> > \n> > .\n> > You are receiving this because you were mentioned.Message ID:\n> > ***@***.***>\n> >\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**stringang** commented on 2023-08-03T10:59:23Z:\n\n> @nvanheuverzwijn \n> `compactor` did not delete the chunk. why?\n> \n> compactor log:\n> ```\n> level=info ts=2023-08-03T06:50:12.634846248Z caller=compactor.go:497 msg=\"compactor started\"\n> level=info ts=2023-08-03T06:50:12.634865722Z caller=compactor.go:454 msg=\"applying retention with compaction\"\n> level=info ts=2023-08-03T06:50:12.634865349Z caller=marker.go:177 msg=\"mark processor started\" workers=150 delay=2h0m0s\n> level=info ts=2023-08-03T06:50:12.634955656Z caller=expiration.go:78 msg=\"overall smallest retention period 1690440612.634, default smallest retention period 1690440612.634\"\n> ts=2023-08-03T06:50:12.635021334Z caller=spanlogger.go:85 level=info msg=\"building index list cache\"\n> level=info ts=2023-08-03T06:50:12.635046761Z caller=marker.go:202 msg=\"no marks file found\"\n> ```\n> \n> config:\n> ```\n> storage_config:\n> aws:\n> access_key_id: xxxxxx\n> bucketnames: loki\n> endpoint: https://s3.xxxx.com\n> s3forcepathstyle: true\n> secret_access_key: xxxxx\n> boltdb_shipper:\n> active_index_directory: /var/loki/index\n> cache_location: /var/loki/cache\n> cache_ttl: 24h\n> index_gateway_client:\n> server_address: dns:///loki-distributed-index-gateway:9095\n> shared_store: s3\n> \n> compactor:\n> retention_enabled: true\n> shared_store: s3\n> working_directory: /var/loki/compactor\n> retention_delete_delay: 2h\n> delete_request_cancel_period: 10m\n> \n> limits_config:\n> enforce_metric_name: false\n> ingestion_burst_size_mb: 1024\n> ingestion_rate_mb: 1024\n> max_cache_freshness_per_query: 10m\n> max_global_streams_per_user: 0\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> retention_period: 1h\n> split_queries_by_interval: 15m\n> ```\n> ----\n> **update**:\n> It was caused by my incorrect configuration.\n> \n> The storage configuration needs to be placed in the `common`.\n> \n> ```\n> common:\n> compactor_address: http://loki-distributed-compactor:3100\n> storage:\n> s3:\n> access_key_id: xxxxxx\n> bucketnames: loki\n> endpoint: https://s3.xxxx.com\n> s3forcepathstyle: true\n> secret_access_key: xxxxxx\n> ```\n> \n> \n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**yangfan-witcher** commented on 2023-08-15T09:20:10Z:\n\n> @nvanheuverzwijn so beautiful\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**ningyougang** commented on 2023-09-05T05:41:47Z:\n\n> @stringang can you share the whole loki.yaml?\n> \n> I am also testing, log files are not deleted from S3, only index compacted,\n> 1. index compacted, e.g.\n> image\n> 2. log files are not deleted, e.g.\n> image\n> \n> My whole configuartion\n> ```\n> auth_enabled: false\n> chunk_store_config:\n> max_look_back_period: 0s\n> compactor:\n> shared_store: s3\n> working_directory: /data/loki/boltdb-shipper-compactor\n> retention_enabled: true\n> compaction_interval: 10m\n> retention_delete_delay: 2h\n> distributor:\n> ring:\n> kvstore:\n> store: memberlist\n> ingester:\n> chunk_block_size: 262144\n> chunk_idle_period: 3m\n> chunk_retain_period: 1m\n> lifecycler:\n> ring:\n> kvstore:\n> store: memberlist\n> replication_factor: 1\n> max_transfer_retries: 0\n> query_store_max_look_back_period: 0\n> wal:\n> enabled: true\n> dir: /data/wal\n> querier:\n> max_concurrent: 20\n> limits_config:\n> ingestion_rate_mb: 8\n> ingestion_burst_size_mb: 16\n> per_stream_rate_limit: 5MB\n> per_stream_rate_limit_burst: 15MB\n> enforce_metric_name: false\n> reject_old_samples: true\n> reject_old_samples_max_age: 24h\n> retention_period: 24h\n> memberlist:\n> join_members:\n> - loki-headless\n> schema_config:\n> configs:\n> - from: \"2022-11-20\"\n> store: boltdb-shipper\n> object_store: s3\n> schema: v11\n> index:\n> period: 24h\n> prefix: index_\n> chunks:\n> period: 24h\n> prefix: chunks_\n> server:\n> http_listen_port: 3100\n> log_level: debug\n> storage_config:\n> object_prefix: test-nyg\n> boltdb_shipper:\n> active_index_directory: /data/loki/boltdb-shipper-active\n> cache_location: /data/loki/boltdb-shipper-cache\n> cache_ttl: 24h\n> shared_store: s3\n> common:\n> storage:\n> s3:\n> s3: s3://test-admin:test-admin@s3Address:10000/$bucketName\n> s3forcepathstyle: true\n> ```\n> \n> Do i miss something?\n\n- stringang mentioned\n\n- stringang subscribed\n\n**stringang** commented on 2023-09-05T07:02:40Z:\n\n> @ningyougang \n> ```\n> auth_enabled: false\n> chunk_store_config:\n> max_look_back_period: 0s\n> common:\n> compactor_address: http://loki-distributed-compactor:3100\n> storage:\n> s3:\n> access_key_id: xxxxxxxxxxx\n> bucketnames: loki\n> endpoint: https://s3.xxxxxx.com\n> s3forcepathstyle: true\n> secret_access_key: xxxxxxxxxxx\n> compactor:\n> delete_request_cancel_period: 10m\n> retention_delete_delay: 1h\n> retention_enabled: true\n> shared_store: s3\n> working_directory: /var/loki/compactor\n> distributor:\n> ring:\n> kvstore:\n> store: memberlist\n> frontend:\n> compress_responses: true\n> log_queries_longer_than: 5s\n> tail_proxy_url: http://loki-distributed-querier:3100\n> frontend_worker:\n> frontend_address: loki-distributed-query-frontend-headless:9095\n> ingester:\n> chunk_block_size: 262144\n> chunk_encoding: snappy\n> chunk_idle_period: 1h\n> chunk_retain_period: 1m\n> chunk_target_size: 8388608\n> lifecycler:\n> join_after: 10s\n> observe_period: 5s\n> ring:\n> heartbeat_timeout: 10m\n> kvstore:\n> store: memberlist\n> replication_factor: 3\n> max_transfer_retries: 0\n> wal:\n> dir: /var/loki/wal\n> ingester_client:\n> grpc_client_config:\n> grpc_compression: gzip\n> limits_config:\n> enforce_metric_name: false\n> ingestion_burst_size_mb: 1024\n> ingestion_rate_mb: 1024\n> max_cache_freshness_per_query: 10m\n> max_global_streams_per_user: 0\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> retention_period: 1d\n> split_queries_by_interval: 15m\n> memberlist:\n> join_members:\n> - loki-distributed-memberlist\n> query_range:\n> align_queries_with_step: true\n> cache_results: true\n> max_retries: 5\n> results_cache:\n> cache:\n> embedded_cache:\n> enabled: true\n> ttl: 24h\n> ruler:\n> alertmanager_url: http://am.xxxxxxxxxxx.com/\n> enable_alertmanager_v2: true\n> enable_api: true\n> enable_sharding: true\n> ring:\n> kvstore:\n> store: memberlist\n> rule_path: /tmp/loki/scratch\n> storage:\n> local:\n> directory: /etc/loki/rules\n> type: local\n> runtime_config:\n> file: /var/loki-distributed-runtime/runtime.yaml\n> schema_config:\n> configs:\n> - from: \"2023-08-12\"\n> index:\n> period: 24h\n> prefix: loki_index_\n> object_store: s3\n> schema: v11\n> store: boltdb-shipper\n> server:\n> grpc_server_max_recv_msg_size: 8388608\n> http_listen_port: 3100\n> log_level: debug\n> storage_config:\n> boltdb_shipper:\n> active_index_directory: /var/loki/index\n> cache_location: /var/loki/cache\n> cache_ttl: 24h\n> index_gateway_client:\n> server_address: dns:///loki-distributed-index-gateway:9095\n> shared_store: s3\n> table_manager:\n> retention_deletes_enabled: false\n> retention_period: 0s\n> ```\n\n- ningyougang mentioned\n\n- ningyougang subscribed\n\n**ben5556** commented on 2023-09-11T05:29:15Z:\n\n> @nvanheuverzwijn I do see mark file created but then a few mins later the logs show\n> ```\n> level=info ts=2023-09-11T05:23:41.019592474Z caller=compactor.go:364 msg=\"applying retention with compaction\"\n> level=info ts=2023-09-11T05:23:41.020937376Z caller=expiration.go:60 msg=\"overall smallest retention period 1691817821.02, default smallest retention period 1691817821.02\"\n> level=info ts=2023-09-11T05:23:41.065287615Z caller=marker.go:78 msg=\"mark file created\" file=/data/loki/boltdb-shipper-compactor/retention/markers/1694409821056046054\n> ```\n> \n> Few secs later\n> ```\n> level=info ts=2023-09-11T05:24:41.019702032Z caller=marker.go:203 msg=\"no marks file found\"\n> level=info ts=2023-09-11T05:25:41.020103387Z caller=marker.go:203 msg=\"no marks file found\"\n> level=info ts=2023-09-11T05:26:41.020436386Z caller=marker.go:203 msg=\"no marks file found\"\n> level=info ts=2023-09-11T05:27:41.020020721Z caller=marker.go:203 msg=\"no marks file found\"\n> level=info ts=2023-09-11T05:28:41.01973026Z caller=marker.go:203 msg=\"no marks file found\"\n> level=info ts=2023-09-11T05:30:41.020528317Z caller=marker.go:203 msg=\"no marks file found\"\n> ```\n> \n> So looks like even after 5 mins (retention_delete_delay) it still cannot find the mark file. I verified that the mark file exists in that location\n> Below is my loki config\n> \n> ```\n> auth_enabled: false\n> chunk_store_config:\n> max_look_back_period: 0s\n> compactor:\n> delete_request_cancel_period: 10m\n> retention_delete_delay: 5m\n> retention_delete_worker_count: 150\n> retention_enabled: true\n> shared_store: filesystem\n> working_directory: /data/loki/boltdb-shipper-compactor\n> ingester:\n> chunk_block_size: 262144\n> chunk_idle_period: 3m\n> chunk_retain_period: 1m\n> lifecycler:\n> ring:\n> replication_factor: 1\n> max_transfer_retries: 0\n> wal:\n> dir: /data/loki/wal\n> limits_config:\n> enforce_metric_name: false\n> max_entries_limit_per_query: 5000\n> max_query_lookback: 720h\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> retention_period: 720h\n> memberlist:\n> join_members:\n> - 'loki-memberlist'\n> schema_config:\n> configs:\n> - from: \"2020-10-24\"\n> index:\n> period: 24h\n> prefix: index_\n> object_store: filesystem\n> schema: v11\n> store: boltdb-shipper\n> server:\n> grpc_listen_port: 9095\n> http_listen_port: 3100\n> http_server_read_timeout: 120s\n> ```\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**kirannhegde** commented on 2023-09-21T11:40:14Z:\n\n> This is not working for me even with v2.8.4 version of Grafana Loki\n> \n> Loki version: v2.8.4\n> AKS version: 1.23.x\n> Storage backend: azure blob storage\n> \n> From reading the documenation for compactor, i get the impression that compactor is capable of deletion of old chunks from the blob storage.\n> However, i see that the old chunks of Loki are not getting deleted from the blob stroage even though the necessary configuration is in place.\n> Could somone be kind enough to tell me what could be wrong in my configuration?\n> When i inspect the logs for the compactor, i see that the marker file is being created. I also see a lot of API calls to: GET /loki/api/v1/delete.\n> However, i dont see any POST calls to /loki/api/v1/delete. So this gives me the impression that no deletion is happening now.\n> I confirmed the same that chunks from several months ago are still lying in my blob storage.\n> \n> ```\n> auth_enabled: false\n> \n> server:\n> http_listen_port: {{ .Values.loki.containerPorts.http }}\n> log_level: debug\n> common:\n> compactor_address: http://{{ include \"grafana-loki.compactor.fullname\" . }}:{{ .Values.compactor.service.ports.http }}\n> storage:\n> azure:\n> account_name: abc \n> account_key: abc\n> container_name: abc\n> use_managed_identity: false\n> request_timeout: 0 \n> \n> \n> distributor:\n> ring:\n> kvstore:\n> store: memberlist\n> \n> memberlist:\n> join_members:\n> - {{ include \"grafana-loki.gossip-ring.fullname\" . }}\n> \n> ingester:\n> lifecycler:\n> ring:\n> kvstore:\n> store: memberlist\n> replication_factor: 1\n> chunk_idle_period: 2h # Any chunk not receiving new logs in this time will be flushed\n> chunk_block_size: 262144\n> chunk_encoding: snappy\n> chunk_retain_period: 1m\n> max_chunk_age: 2h # All chunks will be flushed when they hit this age, default is 1h\n> max_transfer_retries: 0\n> autoforget_unhealthy: true\n> wal:\n> dir: {{ .Values.loki.dataDir }}/wal\n> \n> limits_config:\n> retention_period: 48h\n> enforce_metric_name: false\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> max_cache_freshness_per_query: 10m\n> split_queries_by_interval: 15m\n> per_stream_rate_limit: 10MB\n> per_stream_rate_limit_burst: 20MB\n> ingestion_rate_mb: 100\n> ingestion_burst_size_mb: 30\n> \n> schema_config:\n> configs:\n> - from: 2020-10-24\n> store: boltdb-shipper\n> object_store: azure\n> schema: v11\n> index:\n> prefix: index_\n> period: 24h\n> chunks:\n> period: 24h\n> \n> storage_config: \n> boltdb_shipper:\n> shared_store: azure\n> active_index_directory: {{ .Values.loki.dataDir }}/loki/index\n> cache_location: {{ .Values.loki.dataDir }}/loki/cache\n> cache_ttl: 168h\n> {{- if .Values.indexGateway.enabled }}\n> index_gateway_client:\n> server_address: {{ (printf \"dns:///%s:9095\" (include \"grafana-loki.index-gateway.fullname\" .)) }}\n> {{- end }}\n> filesystem:\n> directory: {{ .Values.loki.dataDir }}/chunks\n> index_queries_cache_config:\n> {{- if .Values.memcachedindexqueries.enabled }}\n> memcached:\n> batch_size: 100\n> parallelism: 100\n> memcached_client:\n> consistent_hash: true\n> addresses: dns+{{ include \"grafana-loki.memcached-index-queries.host\" . }}\n> service: http\n> {{- end }}\n> \n> chunk_store_config:\n> max_look_back_period: 2d\n> {{- if .Values.memcachedchunks.enabled }}\n> chunk_cache_config:\n> memcached:\n> batch_size: 100\n> parallelism: 100\n> memcached_client:\n> consistent_hash: true\n> addresses: dns+{{ include \"grafana-loki.memcached-chunks.host\" . }}\n> {{- end }}\n> {{- if .Values.memcachedindexwrites.enabled }}\n> write_dedupe_cache_config:\n> memcached:\n> batch_size: 100\n> parallelism: 100\n> memcached_client:\n> consistent_hash: true\n> addresses: dns+{{ include \"grafana-loki.memcached-index-writes.host\" . }}\n> {{- end }}\n> \n> table_manager:\n> retention_deletes_enabled: true\n> retention_period: 2d\n> \n> query_range:\n> align_queries_with_step: true\n> max_retries: 5\n> cache_results: true\n> results_cache:\n> cache:\n> {{- if .Values.memcachedfrontend.enabled }}\n> memcached_client:\n> consistent_hash: true\n> addresses: dns+{{ include \"grafana-loki.memcached-frontend.host\" . }}\n> max_idle_conns: 16\n> timeout: 500ms\n> update_interval: 1m\n> {{- else }}\n> enable_fifocache: true\n> fifocache:\n> max_size_items: 1024\n> validity: 24h\n> {{- end }}\n> {{- if not .Values.queryScheduler.enabled }}\n> frontend_worker:\n> frontend_address: {{ include \"grafana-loki.query-frontend.fullname\" . }}:{{ .Values.queryFrontend.service.ports.grpc }}\n> {{- end }}\n> \n> frontend:\n> log_queries_longer_than: 5s\n> compress_responses: true\n> tail_proxy_url: http://{{ include \"grafana-loki.querier.fullname\" . }}:{{ .Values.querier.service.ports.http }}\n> \n> compactor:\n> working_directory: {{ .Values.loki.dataDir }}/retention\n> shared_store: azure\n> compaction_interval: 10m\n> retention_enabled: true\n> retention_delete_delay: 2h\n> retention_delete_worker_count: 150\n> \n> ruler:\n> storage:\n> type: local\n> local:\n> directory: {{ .Values.loki.dataDir }}/conf/rules\n> ring:\n> kvstore:\n> store: memberlist\n> rule_path: /tmp/loki/scratch\n> alertmanager_url: http://abc.bdc.com/alertmanager\n> external_url: https://abc.bdc.com/alertmanager\n> ```\n\n**tomasz-kazmierczak** commented on 2023-09-30T19:39:45Z:\n\n> Hi,\n> I had a similar issue with recent 2.9.1 version of loki. It appears that recently there has been some work with the property `deletion_mode` (https://grafana.com/docs/loki/latest/operations/storage/logs-deletion/). This property is now a per tenant configurable within the runtime config, the default value is not documented but I had to enforce `filter-and-delete` mode and it started to delete chunks from my object storage.\n> \n> The helm values config for that setting is:\n> ```\n> loki:\n> runtimeConfig:\n> overrides:\n> fake:\n> deletion_mode: filter-and-delete\n> ```\n> I hope this solves your issues.\n\n- Referenced by issue #5: set a scheduled reminder to run every month\n\n**alexmeise** commented on 2024-01-03T09:39:14Z:\n\n> As far as I understood from https://github.com/grafana/loki/issues/7068#issuecomment-1347131945 chunks are never going to get deleted from s3 by the compactor. It is not possible to configure retention so that the compactor actually deletes the chunks from S3. This needs to be done via lifecyclePolicy or some other mechanism. What the compactor will do is manage the chunk/index relationship so that you dont receive issues for \"deleted chunks/indexes\" when running queries. I guess it will actually delete references to chunks in the indexes but not the chunk files themselves. Am I right?? It's a bit conter-intuitive and would help if this is clarified in the documentation. \n\n**szthanatos** commented on 2024-01-13T07:42:54Z:\n\n> > @Mastedont, I don't use S3, I store my chunks directly on disk. My current configuration:\n> > \n> > ```\n> > server:\n> > http_listen_port: 3100\n> > grpc_listen_port: 9096\n> > \n> > common:\n> > path_prefix: /var/lib/loki\n> > storage:\n> > filesystem:\n> > chunks_directory: /var/lib/loki/chunks\n> > rules_directory: /var/lib/loki/rules\n> > replication_factor: 1\n> > ring:\n> > instance_addr: 127.0.0.1\n> > kvstore:\n> > store: inmemory\n> > \n> > schema_config:\n> > configs:\n> > - from: 2020-10-24\n> > store: boltdb-shipper\n> > object_store: filesystem\n> > schema: v11\n> > index:\n> > prefix: index_\n> > period: 24h\n> > \n> > chunk_store_config:\n> > max_look_back_period: 168h\n> > \n> > compactor:\n> > working_directory: /var/lib/loki/retention\n> > shared_store: filesystem\n> > compaction_interval: 10m\n> > retention_enabled: true\n> > retention_delete_delay: 2h\n> > retention_delete_worker_count: 150\n> > \n> > limits_config:\n> > retention_period: 168h\n> > \n> > ruler:\n> > alertmanager_url: http://127.0.0.1:9093\n> > ```\n> \n> mark\n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n**otaku-bowei** commented on 2024-01-31T02:49:11Z:\n\n> > For everyone wondering what's going with the retention, I've tested the feature _a lot_ in the past days so here are what will work.\n> > \n> > ### Minimal Configuration Needed\n> > First of all, you absolutely need those config setup\n> > \n> > ```\n> > limits_config:\n> > retention_period: 10d # Keep 10 days\n> > compactor:\n> > delete_request_cancel_period: 10m # don't wait 24h before processing the delete_request\n> > retention_enabled: true # actually do the delete\n> > retention_delete_delay: 2h # wait 2 hours before actually deleting stuff\n> > ```\n> > \n> > You can tweak those config to delete faster or slower.\n> > \n> > ### Check If It's Working\n> > Once you got those config up and running, check that the logs are actually reporting that the retention is being applied : `msg=\"applying retention with compaction\"`. The \"caller\" for this log is `compactor.go`.\n> > \n> > Next, check that the retention manager is actually doing it's job in the logs: `msg=\"mark file created\"` and `msg=\"no marks file found\"` from the caller `marker.go`.\n> > \n> > The `mark file created` means that loki did found some chunks to be deleted and it has created a file to keep track of it. The `no marks file found` means that while performing the chunk delete routine, there was no file that matched it's filters, the filters mainly being the delay.\n> > \n> > Whenever you see the `mark file created` logs, you can go into the working directory of the compactor and check for the mark files. The path should be something like `/var/loki/compactor/retention/markers`. These files are kept there for 2 hours or whatever is set in `retention_delete_delay`. After `retention_delete_delay` is passed, loki _will_ delete the chunks.\n> > \n> > Not having any of the logs mentionned above means that the retention process is not started.\n> > \n> > ### Important Notes\n> > Loki will _only delete chunks that are indexed_. The indexes are actually being purged before deleting the chunks. This means that if you lose files from the compactor's working directory, whatever chunks that were marked there won't be deleted ever so it is still worth to have a lifecycle policy to cover for this OR have persistent storage for this particular folder.\n> \n> @nvanheuverzwijn learn a lot, how can i know which chunks are indexed?\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n**myaswanth03** commented on 2024-05-30T07:15:04Z:\n\n> > I got the same issue. Logs older than 7 days are deleted and they're not visible in Grafana. Only the chunk files won't be deleted on the filesystem.\n> > \n> > ```\n> > loki, version 2.5.0 (branch: HEAD, revision: 2d9d0ee23)\n> > build user: root@4779f4b48f3a\n> > build date: 2022-04-07T21:50:00Z\n> > go version: go1.17.6\n> > platform: linux/amd64\n> > ```\n> > \n> > ```\n> > server:\n> > http_listen_port: 3100\n> > grpc_listen_port: 9096\n> > \n> > common:\n> > path_prefix: /var/lib/loki\n> > storage:\n> > filesystem:\n> > chunks_directory: /var/lib/loki/chunks\n> > rules_directory: /var/lib/loki/rules\n> > replication_factor: 1\n> > ring:\n> > instance_addr: 127.0.0.1\n> > kvstore:\n> > store: inmemory\n> > \n> > schema_config:\n> > configs:\n> > - from: 2020-10-24\n> > store: boltdb-shipper\n> > object_store: filesystem\n> > schema: v11\n> > index:\n> > prefix: index_\n> > period: 24h\n> > \n> > chunk_store_config:\n> > max_look_back_period: 168h\n> > \n> > table_manager:\n> > retention_deletes_enabled: true\n> > retention_period: 168h\n> > ```\n> \n> Hi, i used the same file, loki is up and running but retention is not working.\n> \n> permissions are also fine.\n> \n> \n> level=info ts=2024-05-30T07:12:05.009458014Z caller=metrics.go:159 component=frontend org_id=fake traceID=6cc7b11248ffd6f2 latency=fast query=\"sum by (level) (count_over_time({job=\\\"containerlogs\\\"} | drop __error__[1s]))\" query_hash=1978880347 query_type=metric range_type=range length=5m1s start_delta=5m2.009446978s end_delta=1.009448479s step=1s duration=930.872366ms status=200 limit=100 returned_lines=0 throughput=12kB total_bytes=11kB total_bytes_structured_metadata=0B lines_per_second=82 total_lines=77 post_filter_lines=77 total_entries=1 store_chunks_download_time=0s queue_time=100.027997ms splits=0 shards=16 cache_chunk_req=0 cache_chunk_hit=0 cache_chunk_bytes_stored=0 cache_chunk_bytes_fetched=0 cache_chunk_download_time=0s cache_index_req=0 cache_index_hit=0 cache_index_download_time=0s cache_stats_results_req=0 cache_stats_results_hit=0 cache_stats_results_download_time=0s cache_result_req=0 cache_result_hit=0 cache_result_download_time=0s source=logvolhist\n> level=info ts=2024-05-30T07:12:05.180281106Z caller=roundtrip.go:241 org_id=fake traceID=7306103002fd206d msg=\"executing query\" type=range query=\"{job=\\\"containerlogs\\\"}\" length=5m0s step=5m0s query_hash=3605303691\n> level=info ts=2024-05-30T07:12:05.180937762Z caller=engine.go:234 component=querier org_id=fake traceID=7306103002fd206d msg=\"executing query\" type=range query=\"{job=\\\"containerlogs\\\"}\" length=5m0s step=5m0s query_hash=3605303691\n\n**krishgu** commented on 2024-08-08T20:12:56Z:\n\n> > > For everyone wondering what's going with the retention, I've tested the feature _a lot_ in the past days so here are what will work.\n> > > ### Minimal Configuration Needed\n> > > First of all, you absolutely need those config setup\n> > > ```\n> > > limits_config:\n> > > retention_period: 10d # Keep 10 days\n> > > compactor:\n> > > delete_request_cancel_period: 10m # don't wait 24h before processing the delete_request\n> > > retention_enabled: true # actually do the delete\n> > > retention_delete_delay: 2h # wait 2 hours before actually deleting stuff\n> > > ```\n> > > \n> > > \n> > > \n> > > \n> > > \n> > > \n> > > \n> > > \n> > > \n> > > \n> > > \n> > > You can tweak those config to delete faster or slower.\n> > > ### Check If It's Working\n> > > Once you got those config up and running, check that the logs are actually reporting that the retention is being applied : `msg=\"applying retention with compaction\"`. The \"caller\" for this log is `compactor.go`.\n> > > Next, check that the retention manager is actually doing it's job in the logs: `msg=\"mark file created\"` and `msg=\"no marks file found\"` from the caller `marker.go`.\n> > > The `mark file created` means that loki did found some chunks to be deleted and it has created a file to keep track of it. The `no marks file found` means that while performing the chunk delete routine, there was no file that matched it's filters, the filters mainly being the delay.\n> > > Whenever you see the `mark file created` logs, you can go into the working directory of the compactor and check for the mark files. The path should be something like `/var/loki/compactor/retention/markers`. These files are kept there for 2 hours or whatever is set in `retention_delete_delay`. After `retention_delete_delay` is passed, loki _will_ delete the chunks.\n> > > Not having any of the logs mentionned above means that the retention process is not started.\n> > > ### Important Notes\n> > > Loki will _only delete chunks that are indexed_. The indexes are actually being purged before deleting the chunks. This means that if you lose files from the compactor's working directory, whatever chunks that were marked there won't be deleted ever so it is still worth to have a lifecycle policy to cover for this OR have persistent storage for this particular folder.\n> > \n> > @nvanheuverzwijn learn a lot, how can i know which chunks are indexed?\n> \n> The above article by @nvanheuverzwijn is so on point. Thank you!\n> There are a lot of docs of setting Lifecycle Policies as the \"only\" way to purge, and those are outdated. This setup seems to be working fine. \n> \n> In the `compactor` or the `backend` pod, the `working_dir`/retention/`storage`/markers folder will have these marker files. \n> ```text\n> /var/loki/compactor/retention/aws/markers $ ls -la\n> total 312\n> drwxr-sr-x 2 loki loki 4096 Aug 8 19:50 .\n> drwxr-sr-x 3 loki loki 4096 Aug 7 19:59 ..\n> -rw-r--r-- 1 loki loki 32768 Aug 8 18:09 1723140578748104859\n> -rw-r--r-- 1 loki loki 32768 Aug 8 18:19 1723141178696907357\n> ...\n> -rw-r--r-- 1 loki loki 32768 Aug 8 19:49 1723146578638477113\n> -rw-r--r-- 1 loki loki 32768 Aug 8 19:59 1723147178354528360\n> ```\n> \n> If the compactor cycle is running every 10 minutes (default), you will see a new file created and the oldest file processed and deleted every 10 minutes. And in S3 or your storage providers these objects no longer exist!\n> \n> To find out what objects are about to be deleted, use the `strings` or `od -c` on the market file. So doing this on the oldest marker file will tell us about the next-in-line objects that are purged\n> \n> ```sh\n> /var/loki/compactor/retention/aws/markers $ strings 1723140578748104859\n> chunks\n> fake/65ff478cf0700326:190eb0ab615:190eb125142:ee83e028\n> fake/36bfb27dc259bf11:190eaa1db48:190eb0fef22:7101872a\n> fake/eecc8a1a1bba16ea:190eb0a8a31:190eb122448:156be59e\n> fake/dd094d6bff631bd5:190eaa581d0:190eb13688f:62c6862c\n> fake/f78ea3e78078c811:190eaa51fb0:190eb12fcfd:41bb1a13\n> fake/225757be61ef1d7a:190eaa50dad:190eb12f961:48b0c78c\n> fake/f4a7b9aef3c86224:190eb0c4cb2:190eb13a35e:a2919ec1\n> ```\n> \n> 1. To prove there is no old data, use the `aws s3api` command as below to list the oldest object.. You should not see any objects older than your retention_period if all went per plan\n> 2. you see that this is the oldest object is `fake/36bfb27dc259bf1...`, and this was in the output of the previous `strings 1723140578748104859` command (2nd of the fake/... objects). 10 minutes later you will see this deleted. This tallies correctly with the 14d retention period.\n> \n> ```sh\n> $ aws s3api list-objects-v2 --bucket dframe-loki- --prefix fake --query 'sort_by(Contents, &LastModified)[0]' --output json\n> {\n> \"Key\": \"fake/36bfb27dc259bf11:190eaa1db48:190eb0fef22:7101872a\",\n> \"LastModified\": \"2024-07-25T18:03:45.000Z\",\n> \"ETag\": \"\\\"606ec603a5cb748a96a3ea3e4fb11b87\\\"\",\n> \"Size\": 7000,\n> \"StorageClass\": \"STANDARD\"\n> \n> }\n> ```\n> \n> This ticket can be closed, not sure why it is still open...\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**kdvermagojoko** commented on 2024-08-14T07:20:00Z:\n\n> Hi, I have below conf in my helm override file for having retention period of 24hr, but still i see old index file in S3. I am using loki-stack-2.10.2 chart. Any idea what i am missing here?\n> \n> ```\n> loki:\n> serviceAccount:\n> name: loki-service-account\n> create: false\n> config:\n> schema_config:\n> configs:\n> - from: 2020-10-24\n> store: boltdb-shipper\n> object_store: s3\n> schema: v11\n> index:\n> prefix: loki_index_\n> period: 24h\n> storage_config:\n> aws:\n> s3: s3://aws_region/s3-bucket\n> s3forcepathstyle: true\n> bucketnames: s3-bucket\n> region: aws_region\n> insecure: false\n> sse_encryption: false\n> boltdb_shipper:\n> shared_store: s3\n> cache_ttl: 24h\n> limits_config:\n> enforce_metric_name: false\n> reject_old_samples: true\n> reject_old_samples_max_age: 24h\n> max_entries_limit_per_query: 5000\n> retention_period: 24h\n> max_query_lookback: 24h\n> compactor:\n> working_directory: /data/loki/boltdb-shipper-compactor\n> shared_store: filesystem\n> retention_enabled: true\n> delete_request_cancel_period: 24h\n> retention_delete_delay: 2h\n> retention_delete_worker_count: 150\n> compaction_interval: 24h\n> table_manager:\n> retention_deletes_enabled: true\n> retention_period: 24h\n> ```\n\n**younsl** commented on 2024-08-28T00:49:33Z:\n\n> Here's my `loki-distributed` chart configuration backed by S3 storage. Need to set `delete_request_store` in compactor config, too.\n> \n> > [!NOTE]\n> > `compactor.delete_request_store` should be set to configure the store for delete requests. This is required when retention is enabled. See loki's retention doc.\n> \n> ```yaml\n> # charts/loki-distributed/values.yaml\n> loki:\n> config: |\n> compactor:\n> shared_store: s3\n> working_directory: /var/loki/compactor\n> compaction_interval: 10m\n> retention_enabled: true\n> retention_delete_delay: 2h\n> retention_delete_worker_count: 150\n> delete_request_store: s3\n> \n> limits_config:\n> enforce_metric_name: false\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> max_cache_freshness_per_query: 10m\n> split_queries_by_interval: 15m\n> retention_period: 7d\n> ingestion_rate_mb: 20\n> ingestion_burst_size_mb: 30\n> ```\n> \n> ## Reference\n> \n> issue #9207\n\n- karakuraizer subscribed\n\n- karakuraizer unsubscribed\n\n- paulojmdias subscribed\n\n**adityamandke23** commented on 2024-12-30T07:12:33Z:\n\n> > @nvanheuverzwijn I do see mark file created but then a few mins later the logs show\n> > \n> > ```\n> > level=info ts=2023-09-11T05:23:41.019592474Z caller=compactor.go:364 msg=\"applying retention with compaction\"\n> > level=info ts=2023-09-11T05:23:41.020937376Z caller=expiration.go:60 msg=\"overall smallest retention period 1691817821.02, default smallest retention period 1691817821.02\"\n> > level=info ts=2023-09-11T05:23:41.065287615Z caller=marker.go:78 msg=\"mark file created\" file=/data/loki/boltdb-shipper-compactor/retention/markers/1694409821056046054\n> > ```\n> > \n> > Few secs later\n> > \n> > ```\n> > level=info ts=2023-09-11T05:24:41.019702032Z caller=marker.go:203 msg=\"no marks file found\"\n> > level=info ts=2023-09-11T05:25:41.020103387Z caller=marker.go:203 msg=\"no marks file found\"\n> > level=info ts=2023-09-11T05:26:41.020436386Z caller=marker.go:203 msg=\"no marks file found\"\n> > level=info ts=2023-09-11T05:27:41.020020721Z caller=marker.go:203 msg=\"no marks file found\"\n> > level=info ts=2023-09-11T05:28:41.01973026Z caller=marker.go:203 msg=\"no marks file found\"\n> > level=info ts=2023-09-11T05:30:41.020528317Z caller=marker.go:203 msg=\"no marks file found\"\n> > ```\n> > \n> > So looks like even after 5 mins (retention_delete_delay) it still cannot find the mark file. I verified that the mark file exists in that location Below is my loki config\n> > \n> > ```\n> > auth_enabled: false\n> > chunk_store_config:\n> > max_look_back_period: 0s\n> > compactor:\n> > delete_request_cancel_period: 10m\n> > retention_delete_delay: 5m\n> > retention_delete_worker_count: 150\n> > retention_enabled: true\n> > shared_store: filesystem\n> > working_directory: /data/loki/boltdb-shipper-compactor\n> > ingester:\n> > chunk_block_size: 262144\n> > chunk_idle_period: 3m\n> > chunk_retain_period: 1m\n> > lifecycler:\n> > ring:\n> > replication_factor: 1\n> > max_transfer_retries: 0\n> > wal:\n> > dir: /data/loki/wal\n> > limits_config:\n> > enforce_metric_name: false\n> > max_entries_limit_per_query: 5000\n> > max_query_lookback: 720h\n> > reject_old_samples: true\n> > reject_old_samples_max_age: 168h\n> > retention_period: 720h\n> > memberlist:\n> > join_members:\n> > - 'loki-memberlist'\n> > schema_config:\n> > configs:\n> > - from: \"2020-10-24\"\n> > index:\n> > period: 24h\n> > prefix: index_\n> > object_store: filesystem\n> > schema: v11\n> > store: boltdb-shipper\n> > server:\n> > grpc_listen_port: 9095\n> > http_listen_port: 3100\n> > http_server_read_timeout: 120s\n> > ```\n> \n> any fix for this? facing same issue.\n\n**rknightion** commented on 2025-01-26T19:17:33Z:\n\n> > Hi, I had a similar issue with recent 2.9.1 version of loki. It appears that recently there has been some work with the property `deletion_mode` (https://grafana.com/docs/loki/latest/operations/storage/logs-deletion/). This property is now a per tenant configurable within the runtime config, the default value is not documented but I had to enforce `filter-and-delete` mode and it started to delete chunks from my object storage.\n> > \n> > The helm values config for that setting is:\n> > \n> > ```\n> > loki:\n> > runtimeConfig:\n> > overrides:\n> > fake:\n> > deletion_mode: filter-and-delete\n> > ```\n> > \n> > I hope this solves your issues.\n> \n> THIS is what did it for me after following everything else in the thread. Despite a default limits_config being set to filter-and-delete I had to apply a per-tenant override for every tenant I have and now its actually deleting chunks!!\n\n- banschikovde subscribed\n\n**zzhura** commented on 2025-06-18T08:42:06Z:\n\n> sorry for offtopic but can comeone help with opposite problem - logs being deleted from my disk storage in ~11 days and no config changes helps :(\n> here's detailed description: https://community.grafana.com/t/logs-disappearing-after-11-days-in-storage/144618\n\n**Codecaver** commented on 2025-06-26T02:39:26Z:\n\n> > > Hi, I had a similar issue with recent 2.9.1 version of loki. It appears that recently there has been some work with the property `deletion_mode` (https://grafana.com/docs/loki/latest/operations/storage/logs-deletion/). This property is now a per tenant configurable within the runtime config, the default value is not documented but I had to enforce `filter-and-delete` mode and it started to delete chunks from my object storage.\n> > > The helm values config for that setting is:\n> > > ```\n> > > loki:\n> > > runtimeConfig:\n> > > overrides:\n> > > fake:\n> > > deletion_mode: filter-and-delete\n> > > ```\n> > > \n> > > \n> > > \n> > > \n> > > I hope this solves your issues.\n> > \n> > THIS is what did it for me after following everything else in the thread. Despite a default limits_config being set to filter-and-delete I had to apply a per-tenant override for every tenant I have and now its actually deleting chunks!!\n> \n> LGTM. and this is my config file:\n> Loki: 2.9.2\n> install method: Docker\n> ```\n> auth_enabled: false\n> \n> server:\n> http_listen_port: 3100\n> grpc_listen_port: 9096\n> \n> common:\n> instance_addr: 127.0.0.1\n> path_prefix: /tmp/loki\n> storage:\n> filesystem:\n> chunks_directory: /tmp/loki/chunks\n> rules_directory: /tmp/loki/rules\n> replication_factor: 1\n> ring:\n> kvstore:\n> store: inmemory\n> \n> compactor:\n> retention_enabled: true\n> retention_delete_delay: 0s\n> working_directory: /tmp/loki/compactor\n> #working_directory: /tmp/loki/chunks\n> shared_store: filesystem\n> \n> limits_config:\n> enforce_metric_name: false\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> ingestion_rate_mb: 50\n> ingestion_burst_size_mb: 100\n> per_stream_rate_limit: 256MB\n> per_stream_rate_limit_burst: 512MB\n> deletion_mode: filter-and-delete\n> retention_period: 168h\n> \n> table_manager:\n> retention_deletes_enabled: true\n> retention_period: 168h\n> \n> query_range:\n> results_cache:\n> cache:\n> embedded_cache:\n> enabled: true\n> max_size_mb: 1000\n> \n> schema_config:\n> configs:\n> - from: 2020-10-24\n> store: tsdb\n> object_store: filesystem\n> schema: v13\n> index:\n> prefix: index_\n> period: 24h\n> \n> ruler:\n> alertmanager_url: http://localhost:9093\n> ```\n\n**JStickler** commented on 2026-04-22T00:46:55Z:\n\n> Closing as stale. This issue was opened against a version of Loki that is no longer supported. If this issues still exists in more recent versions of Loki, please leave a comment and we can reopen the issue.\n\n- JStickler closed\n\n- ivankovnatsky unsubscribed",
      "content_chars": 56719,
      "published_date": null
    },
    {
      "rank": 5,
      "url": "https://github.com/grafana/loki/blob/main/operator/internal/manifests/internal/config/loki-config.yaml",
      "title": "operator/internal/manifests/internal/config/loki-config.yaml at main \u00b7 grafana/loki",
      "content": "# operator/internal/manifests/internal/config/loki-config.yaml\n\n- Branch: main\n- Repository: grafana/loki\n\n---\n\n{{- /*gotype: github.com/grafana/loki/operator/internal/manifests/internal/config.Options*/ -}}\n---\nauth_enabled: true\nchunk_store_config:\n chunk_cache_config:\n embedded_cache:\n enabled: true\n max_size_mb: 500\ncommon:\n storage:\n object_store:\n {{- with .ObjectStorage.Azure }}\n azure:\n container_name: {{ .Container }}\n account_name: ${AZURE_STORAGE_ACCOUNT_NAME}\n endpoint_suffix: {{ .EndpointSuffix }}\n {{- if not .WorkloadIdentity }}\n account_key: ${AZURE_STORAGE_ACCOUNT_KEY}\n {{- end }}\n {{- end }}\n {{- with .ObjectStorage.GCS }}\n gcs:\n bucket_name: {{ .Bucket }}\n {{- end }}\n {{- with .ObjectStorage.S3 }}\n s3:\n {{- if .STS }}\n bucket_name: {{ .Buckets }}\n region: {{ .Region }}\n endpoint: s3.{{.Region}}.amazonaws.com\n native_aws_auth_enabled: true\n {{- else }}\n endpoint: {{ .Endpoint }}\n bucket_name: {{ .Buckets }}\n region: {{ .Region }}\n access_key_id: ${AWS_ACCESS_KEY_ID}\n secret_access_key: ${AWS_ACCESS_KEY_SECRET}\n {{- if .Insecure }}\n insecure: true\n {{- end}}\n {{- if .ForcePathStyle }}\n bucket_lookup_type: path\n {{- end}}\n {{- end }}\n {{- with .SSE }}\n {{- if .Type }}\n sse:\n type: {{ .Type }}\n {{- if eq .Type \"SSE-KMS\" }}\n kms_key_id: {{ .KMSKeyID }}\n {{- with .KMSEncryptionContext }}\n kms_encryption_context: |\n ${AWS_SSE_KMS_ENCRYPTION_CONTEXT}\n {{- end }}\n {{- end}}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- with .ObjectStorage.Swift }}\n swift:\n auth_url: {{ .AuthURL }}\n username: ${SWIFT_USERNAME}\n user_domain_name: {{ .UserDomainName }}\n user_domain_id: {{ .UserDomainID }}\n user_id: {{ .UserID }}\n password: ${SWIFT_PASSWORD}\n domain_id: {{ .DomainID }}\n domain_name: {{ .DomainName }}\n project_id: {{ .ProjectID }}\n project_name: {{ .ProjectName }}\n project_domain_id: {{ .ProjectDomainID }}\n project_domain_name: {{ .ProjectDomainName }}\n region_name: {{ .Region }}\n container_name: {{ .Container }}\n {{- end }}\n {{- with .ObjectStorage.AlibabaCloud}}\n alibaba:\n bucket: {{ .Bucket }}\n endpoint: {{ .Endpoint }}\n access_key_id: ${ALIBABA_CLOUD_ACCESS_KEY_ID}\n access_key_secret: ${ALIBABA_CLOUD_ACCESS_KEY_SECRET}\n {{- end }}\n compactor_grpc_address: {{ .Compactor.FQDN }}:{{ .Compactor.Port }}\n {{- with .GossipRing }}\n ring:\n kvstore:\n store: memberlist\n heartbeat_period: 5s\n heartbeat_timeout: 1m\n {{- with .InstanceAddr }}\n instance_addr: {{ . }}\n {{- end }}\n instance_port: {{ .InstancePort }}\n {{- if .EnableInstanceAvailabilityZone }}\n zone_awareness_enabled: true\n instance_availability_zone: ${INSTANCE_AVAILABILITY_ZONE}\n {{- end }}\n {{- end }}\ncompactor:\n compaction_interval: 2h\n working_directory: {{ .StorageDirectory }}/compactor\n{{- if .Retention.Enabled }}\n{{- with .Retention }}\n retention_enabled: true\n retention_delete_delay: 4h\n retention_delete_worker_count: {{.DeleteWorkerCount}}\n{{- end }}\n delete_request_store: {{.ObjectStorage.SharedStore}}\n{{- end }}\n{{- if .OTLPAttributes.RemoveDefaultLabels }}\ndistributor:\n otlp_config:\n default_resource_attributes_as_index_labels: []\n{{- end }}\nfrontend:\n tail_proxy_url: {{ .Querier.Protocol }}://{{ .Querier.FQDN }}:{{ .Querier.Port }}\n{{- if .Gates.HTTPEncryption }}\n tail_tls_config:\n tls_cert_path: {{ .TLS.Paths.HTTP.Certificate }}\n tls_key_path: {{ .TLS.Paths.HTTP.Key }}\n tls_ca_path: {{ .TLS.Paths.CA }}\n tls_server_name: {{ .TLS.ServerNames.HTTP.Querier }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n tls_min_version: {{ .TLS.MinTLSVersion }}\n{{- end }}\n compress_responses: true\n max_outstanding_per_tenant: 4096\n log_queries_longer_than: 5s\nfrontend_worker:\n frontend_address: {{ .FrontendWorker.FQDN }}:{{ .FrontendWorker.Port }}\n grpc_client_config:\n max_send_msg_size: 104857600\n{{- if .Gates.GRPCEncryption }}\n tls_enabled: true\n tls_cert_path: {{ .TLS.Paths.GRPC.Certificate }}\n tls_key_path: {{ .TLS.Paths.GRPC.Key }}\n tls_ca_path: {{ .TLS.Paths.CA }}\n tls_server_name: {{ .TLS.ServerNames.GRPC.QueryFrontend }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n tls_min_version: {{ .TLS.MinTLSVersion }}\n{{- end }}\ningester:\n chunk_block_size: 262144\n chunk_encoding: snappy\n chunk_idle_period: 1h\n chunk_retain_period: 5m\n chunk_target_size: 2097152\n flush_op_timeout: 10m\n max_chunk_age: 2h\n autoforget_unhealthy: true\n lifecycler:\n final_sleep: 0s\n join_after: 30s\n num_tokens: 512\n tokens_file_path: {{ .StorageDirectory }}/ring-tokens\n {{- if .GossipRing.EnableIPv6 }}\n enable_inet6: true\n {{- end}}\n ring:\n replication_factor: {{ .Stack.Replication.Factor }}\n wal:\n enabled: true\n dir: {{ .WriteAheadLog.Directory }}\n replay_memory_ceiling: {{ .WriteAheadLog.ReplayMemoryCeiling }}\ningester_client:\n grpc_client_config:\n max_recv_msg_size: 67108864\n{{- if .Gates.GRPCEncryption }}\n tls_enabled: true\n tls_cert_path: {{ .TLS.Paths.GRPC.Certificate }}\n tls_key_path: {{ .TLS.Paths.GRPC.Key }}\n tls_ca_path: {{ .TLS.Paths.CA }}\n tls_server_name: {{ .TLS.ServerNames.GRPC.Ingester }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n tls_min_version: {{ .TLS.MinTLSVersion }}\n{{- end }}\n remote_timeout: 5s\n# NOTE: Keep the order of keys as in Loki docs\n# to enable easy diffs when vendoring newer\n# Loki releases.\n# (See https://grafana.com/docs/loki/latest/configuration/#limits_config)\n#\n# Values for not exposed fields are taken from the grafana/loki production\n# configuration manifests.\n# (See https://github.com/grafana/loki/blob/main/production/ksonnet/loki/config.libsonnet)\nlimits_config:\n ingestion_rate_strategy: global\n ingestion_rate_mb: {{ .Stack.Limits.Global.IngestionLimits.IngestionRate }}\n ingestion_burst_size_mb: {{ .Stack.Limits.Global.IngestionLimits.IngestionBurstSize }}\n max_label_name_length: {{ .Stack.Limits.Global.IngestionLimits.MaxLabelNameLength }}\n max_label_value_length: {{ .Stack.Limits.Global.IngestionLimits.MaxLabelValueLength }}\n max_label_names_per_series: {{ .Stack.Limits.Global.IngestionLimits.MaxLabelNamesPerSeries }}\n reject_old_samples: true\n reject_old_samples_max_age: 168h\n creation_grace_period: 10m\n # Keep max_streams_per_user always to 0 to default\n # using max_global_streams_per_user always.\n # (See https://github.com/grafana/loki/blob/main/pkg/ingester/limiter.go#L73)\n max_streams_per_user: 0\n max_line_size: {{ .Stack.Limits.Global.IngestionLimits.MaxLineSize }}\n max_entries_limit_per_query: {{ .Stack.Limits.Global.QueryLimits.MaxEntriesLimitPerQuery }}\n discover_service_name: []\n discover_log_levels: {{ .DiscoverLogLevels }}\n max_global_streams_per_user: {{ .Stack.Limits.Global.IngestionLimits.MaxGlobalStreamsPerTenant }}\n max_chunks_per_query: {{ .Stack.Limits.Global.QueryLimits.MaxChunksPerQuery }}\n max_query_length: 721h\n max_query_parallelism: 32\n tsdb_max_query_parallelism: 512\n max_query_series: {{ .Stack.Limits.Global.QueryLimits.MaxQuerySeries }}\n cardinality_limit: {{ .Stack.Limits.Global.QueryLimits.CardinalityLimit }}\n max_streams_matchers_per_query: 1000\n query_timeout: {{ .Stack.Limits.Global.QueryLimits.QueryTimeout }}\n volume_enabled: true\n volume_max_series: {{ .Stack.Limits.Global.QueryLimits.MaxVolumeSeries }}\n{{- if .Retention.Enabled }}{{- with .Stack.Limits.Global.Retention }}\n retention_period: {{.Days}}d\n{{- with .Streams }}\n retention_stream:\n{{- range . }}\n - selector: '{{ .Selector }}'\n priority: {{ .Priority }}\n period: {{ .Days }}d\n{{- end }}\n{{- end }}\n{{- end }}{{- end }}\n max_cache_freshness_per_query: 10m\n per_stream_rate_limit: {{ .Stack.Limits.Global.IngestionLimits.PerStreamRateLimit }}MB\n per_stream_rate_limit_burst: {{ .Stack.Limits.Global.IngestionLimits.PerStreamRateLimitBurst }}MB\n split_queries_by_interval: 30m\n{{- with .Stack.Limits.Global.IngestionLimits.PerStreamDesiredRate }}\n shard_streams:\n enabled: true\n desired_rate: {{ . }}MB\n time_sharding_enabled: true\n{{- end }}\n{{- with .OTLPAttributes.Global }}\n otlp_config:\n {{- if .ResourceAttributes }}\n resource_attributes:\n {{- with .ResourceAttributes}}\n attributes_config:\n {{- range . }}\n - action: {{ .Action }}\n {{- with .Regex }}\n regex: {{ . }}\n {{- end }}\n {{- with .Names }}\n attributes:\n {{- range . }}\n - {{ . }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- with .ScopeAttributes }}\n scope_attributes:\n {{- range . }}\n - action: {{ .Action }}\n {{- with .Regex }}\n regex: {{ . }}\n {{- end }}\n {{- with .Names }}\n attributes:\n {{- range . }}\n - {{ . }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- with .LogAttributes }}\n log_attributes:\n {{- range . }}\n - action: {{ .Action }}\n {{- with .Regex }}\n regex: {{ . }}\n {{- end }}\n {{- with .Names }}\n attributes:\n {{- range . }}\n - {{ . }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- end }}\n{{- end }}\n allow_structured_metadata: {{ .ObjectStorage.AllowStructuredMetadata }}\n{{- with .GossipRing }}\nmemberlist:\n abort_if_cluster_join_fails: true\n rejoin_interval: 90s\n {{- with .InstanceAddr }}\n advertise_addr: {{ . }}\n {{- end }}\n advertise_port: {{ .BindPort }}\n bind_port: {{ .BindPort }}\n join_members:\n - {{ .MembersDiscoveryAddr }}:{{ .BindPort }}\n max_join_backoff: 1m\n max_join_retries: 10\n min_join_backoff: 1s\n{{- end }}\nquerier:\n engine:\n max_look_back_period: 30s\n extra_query_delay: 0s\n query_ingesters_within: 3h\n tail_max_duration: 1h\n max_concurrent: {{ .MaxConcurrent.AvailableQuerierCPUCores }}\n{{- if .Gates.GRPCEncryption }}\ncompactor_grpc_client:\n tls_enabled: true\n tls_cert_path: {{ .TLS.Paths.GRPC.Certificate }}\n tls_key_path: {{ .TLS.Paths.GRPC.Key }}\n tls_ca_path: {{ .TLS.Paths.CA }}\n tls_server_name: {{ .TLS.ServerNames.GRPC.Compactor }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n tls_min_version: {{ .TLS.MinTLSVersion }}\n{{- end }}\nquery_range:\n align_queries_with_step: true\n cache_results: true\n max_retries: 5\n results_cache:\n cache:\n embedded_cache:\n enabled: true\n max_size_mb: 500\n parallelise_shardable_queries: true\nschema_config:\n configs:\n {{- $store := .ObjectStorage.SharedStore }}\n {{- range .ObjectStorage.Schemas }}\n - from: \"{{ .EffectiveDate }}\"\n index:\n period: 24h\n prefix: index_\n object_store: {{ $store }}\n schema: {{ .Version }}\n {{- if or (eq .Version \"v11\") (eq .Version \"v12\")}}\n store: boltdb-shipper\n {{- else }}\n store: tsdb\n {{- end}}\n {{- end }}\n{{ if .Ruler.Enabled }}\nruler_storage:\n backend: local\n local:\n directory: {{ .Ruler.RulesStorageDirectory }}\nruler:\n enable_api: true\n enable_sharding: true\n {{- with .Ruler.EvaluationInterval }}\n evaluation_interval: {{ . }}\n {{- end }}\n {{- with .Ruler.PollInterval }}\n poll_interval: {{ . }}\n {{- end }}\n {{- with .Ruler.AlertManager }}\n {{- with .ExternalURL }}\n external_url: {{ . }}\n {{- end}}\n {{- with .ExternalLabels }}\n external_labels:\n {{- range $name, $value := . }}\n {{ $name }}: {{ $value }}\n {{- end }}\n {{- end}}\n alertmanager_url: {{ .Hosts }}\n {{- if .EnableV2 }}\n enable_alertmanager_v2: {{ .EnableV2 }}\n {{- end }}\n {{- if .EnableDiscovery }}\n enable_alertmanager_discovery: {{ .EnableDiscovery }}\n alertmanager_refresh_interval: {{ .RefreshInterval }}\n {{- end }}\n {{- if .QueueCapacity }}\n notification_queue_capacity: {{ .QueueCapacity }}\n {{- end }}\n {{- if .Timeout }}\n notification_timeout: {{ .Timeout }}\n {{- end }}\n {{- if .Notifier }}\n {{- with .Notifier }}\n alertmanager_client:\n {{- if .TLS.CertPath }}\n tls_cert_path: {{ .TLS.CertPath }}\n {{- end }}\n {{- if .TLS.KeyPath }}\n tls_key_path: {{ .TLS.KeyPath }}\n {{- end }}\n {{- if .TLS.CAPath }}\n tls_ca_path: {{ .TLS.CAPath }}\n {{- end }}\n {{- if .TLS.ServerName }}\n tls_server_name: {{ .TLS.ServerName }}\n {{- end }}\n {{- if .TLS.InsecureSkipVerify }}\n tls_insecure_skip_verify: {{ .TLS.InsecureSkipVerify }}\n {{- end }}\n {{- if .TLS.CipherSuites }}\n tls_cipher_suites: {{ .TLS.CipherSuites }}\n {{- end }}\n {{- if .TLS.MinVersion }}\n tls_min_version: {{ .TLS.MinVersion }}\n {{- end }}\n {{- if .BasicAuth.Username }}\n basic_auth_username: {{ .BasicAuth.Username }}\n {{- end }}\n {{- if .BasicAuth.Password }}\n basic_auth_password: {{ .BasicAuth.Password }}\n {{- end }}\n {{- if .HeaderAuth.Type }}\n type: {{ .HeaderAuth.Type }}\n {{- end }}\n {{- if .HeaderAuth.Credentials }}\n credentials: {{ .HeaderAuth.Credentials }}\n {{- end }}\n {{- if .HeaderAuth.CredentialsFile }}\n credentials_file: {{ .HeaderAuth.CredentialsFile }}\n {{- end }}\n {{- end }}\n {{- end }}\n\n {{- with .RelabelConfigs }}\n alert_relabel_configs:\n {{- range $k, $cfg := . }}\n - {{ if $cfg.SourceLabels}}\n source_labels: {{ $cfg.SourceLabelsString }}\n {{- end }}\n {{- if $cfg.Regex }}\n regex: {{ $cfg.Regex }}\n {{- end }}\n {{- if $cfg.Action }}\n action: {{ $cfg.Action }}\n {{- end }}\n separator: {{ $cfg.SeparatorString }}\n {{- if $cfg.Replacement }}\n replacement: {{ $cfg.Replacement }}\n {{- end }}\n {{- if $cfg.TargetLabel }}\n target_label: {{ $cfg.TargetLabel }}\n {{- end }}\n {{- if $cfg.Modulus }}\n modulus: {{ $cfg.Modulus }}\n {{- end }}\n {{- end }}\n {{- end }}\n\n {{- if .ForOutageTolerance }}\n for_outage_tolerance: {{ .ForOutageTolerance }}\n {{- end }}\n {{- if .ForGracePeriod }}\n for_grace_period: {{ .ForGracePeriod }}\n {{- end }}\n {{- if .ResendDelay }}\n resend_delay: {{ .ResendDelay }}\n {{- end }}\n {{- end}}\n {{- with .Ruler.RemoteWrite }}\n {{- if .Enabled }}\n remote_write:\n enabled: {{ .Enabled }}\n config_refresh_period: {{ .RefreshPeriod }}\n clients:\n {{- with .Client }}\n default:\n name: {{ .Name }}\n url: {{ .URL }}\n remote_timeout: {{ .RemoteTimeout }}\n proxy_url: {{ .ProxyURL }}\n follow_redirects: {{ .FollowRedirects }}\n headers:\n {{- range $key, $val := .Headers }}\n \"{{ $key }}\": \"{{ $val }}\"\n {{- end }}\n {{- if and .BasicAuthUsername .BasicAuthPassword }}\n basic_auth:\n username: {{ .BasicAuthUsername }}\n password: {{ .BasicAuthPassword }}\n {{- end }}\n {{- if .BearerToken }}\n authorization:\n type: bearer\n credentials: {{ .BearerToken }}\n {{- end }}\n {{- end}}\n {{- with .RelabelConfigs }}\n write_relabel_configs:\n {{- range $k, $cfg := . }}\n - {{- if $cfg.SourceLabels}}\n source_labels: {{ $cfg.SourceLabelsString }}\n {{- end }}\n {{- if $cfg.Regex }}\n regex: {{ $cfg.Regex }}\n {{- end }}\n {{- if $cfg.Action }}\n action: {{ $cfg.Action }}\n {{- end }}\n separator: {{ $cfg.SeparatorString }}\n {{- if $cfg.Replacement }}\n replacement: {{ $cfg.Replacement }}\n {{- end }}\n {{- if $cfg.TargetLabel }}\n target_label: {{ $cfg.TargetLabel }}\n {{- end }}\n {{- if $cfg.Modulus }}\n modulus: {{ $cfg.Modulus }}\n {{- end }}\n {{- end}}\n {{- end }}\n {{- with .Queue }}\n queue_config:\n {{- if .Capacity }}\n capacity: {{ .Capacity }}\n {{- end }}\n {{- if .MaxShards }}\n max_shards: {{ .MaxShards }}\n {{- end }}\n {{- if .MinShards }}\n min_shards: {{ .MinShards }}\n {{- end }}\n {{- if .MaxSamplesPerSend }}\n max_samples_per_send: {{ .MaxSamplesPerSend }}\n {{- end }}\n {{- if .BatchSendDeadline }}\n batch_send_deadline: {{ .BatchSendDeadline }}\n {{- end }}\n {{- if .MinBackOffPeriod }}\n min_backoff: {{ .MinBackOffPeriod }}\n {{- end }}\n {{- if .MaxBackOffPeriod }}\n max_backoff: {{ .MaxBackOffPeriod }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- end }}\n wal:\n dir: {{ .WriteAheadLog.Directory }}\n truncate_frequency: 60m\n min_age: 5m\n max_age: 4h\n rule_path: {{ .StorageDirectory }}\n ring:\n kvstore:\n store: memberlist\n{{- if .Gates.GRPCEncryption }}\n ruler_client:\n tls_enabled: true\n tls_cert_path: {{ .TLS.Paths.GRPC.Certificate }}\n tls_key_path: {{ .TLS.Paths.GRPC.Key }}\n tls_ca_path: {{ .TLS.Paths.CA }}\n tls_server_name: {{ .TLS.ServerNames.GRPC.Ruler }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n tls_min_version: {{ .TLS.MinTLSVersion }}\n{{- end }}\n{{ end }}\n{{- if .Gates.HTTPEncryption }}\ninternal_server:\n enable: true\n http_listen_address: \"\"\n tls_min_version: {{ .TLS.MinTLSVersion }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n http_tls_config:\n cert_file: {{ .TLS.Paths.HTTP.Certificate }}\n key_file: {{ .TLS.Paths.HTTP.Key }}\n{{- end }}\nserver:\n graceful_shutdown_timeout: 5s\n grpc_server_min_time_between_pings: '10s'\n grpc_server_ping_without_stream_allowed: true\n grpc_server_max_concurrent_streams: 1000\n grpc_server_max_recv_msg_size: 104857600\n grpc_server_max_send_msg_size: 104857600\n http_listen_port: 3100\n http_server_idle_timeout: {{ .HTTPTimeouts.IdleTimeout }}\n http_server_read_timeout: {{ .HTTPTimeouts.ReadTimeout }}\n http_server_write_timeout: {{ .HTTPTimeouts.WriteTimeout }}\n{{- if or .Gates.HTTPEncryption .Gates.GRPCEncryption }}\n tls_min_version: {{ .TLS.MinTLSVersion }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n{{- if .Gates.HTTPEncryption }}\n http_tls_config:\n cert_file: {{ .TLS.Paths.HTTP.Certificate }}\n key_file: {{ .TLS.Paths.HTTP.Key }}\n client_auth_type: RequireAndVerifyClientCert\n client_ca_file: {{ .TLS.Paths.CA }}\n{{- end }}\n{{- if .Gates.GRPCEncryption }}\n grpc_tls_config:\n cert_file: {{ .TLS.Paths.GRPC.Certificate }}\n key_file: {{ .TLS.Paths.GRPC.Key }}\n client_auth_type: RequireAndVerifyClientCert\n client_ca_file: {{ .TLS.Paths.CA }}\n{{- end }}\n{{- end }}\n log_level: info\nstorage_config:\n use_thanos_objstore: true\n{{- range $_, $ship := .Shippers }}\n{{- if eq $ship \"boltdb\" }}\n boltdb_shipper:\n active_index_directory: {{ $.StorageDirectory }}/index\n cache_location: {{ $.StorageDirectory }}/index_cache\n{{- end }}\n{{- if eq $ship \"tsdb\" }}\n tsdb_shipper:\n active_index_directory: {{ $.StorageDirectory }}/tsdb-index\n cache_location: {{ $.StorageDirectory }}/tsdb-cache\n{{- end }}\n cache_ttl: 24h\n resync_interval: 5m\n index_gateway_client:\n server_address: dns:///{{ $.IndexGateway.FQDN }}:{{ $.IndexGateway.Port }}\n{{- if $.Gates.GRPCEncryption }}\n grpc_client_config:\n tls_enabled: true\n tls_cert_path: {{ $.TLS.Paths.GRPC.Certificate }}\n tls_key_path: {{ $.TLS.Paths.GRPC.Key }}\n tls_ca_path: {{ $.TLS.Paths.CA }}\n tls_server_name: {{ $.TLS.ServerNames.GRPC.IndexGateway }}\n tls_cipher_suites: {{ $.TLS.CipherSuitesString }}\n tls_min_version: {{ $.TLS.MinTLSVersion }}\n{{- end }}\n{{- end }}\ntracing:\n enabled: false\nanalytics:\n reporting_enabled: {{ .EnableRemoteReporting }}\n",
      "content_chars": 17751,
      "published_date": null
    },
    {
      "rank": 6,
      "url": "https://grafana.com/docs/loki/v2.6.x/operations/storage/retention",
      "title": "Grafana Loki Storage Retention",
      "content": "Retention | Grafana Loki documentation\n\nTry using Grot AI for this query ->\n\nMenu\n\nImportant: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.\n\nDocumentation Grafana Loki Operations Storage Retention\n\nOpen source\n\n# Grafana Loki Storage Retention\n\nRetention in Grafana Loki is achieved either through the Table Manager or the Compactor.\n\nRetention through the Table Manager is achieved by relying on the object store TTL feature, and will work for both boltdb-shipper store and chunk/index store. However retention through the Compactor is supported only with the boltdb-shipper store.\n\nThe Compactor retention will become the default and have long term support. It supports more granular retention policies on per tenant and per stream use cases.\n\n## Compactor\n\nThe Compactor can deduplicate index entries. It can also apply granular retention. When applying retention with the Compactor, the Table Manager is unnecessary.\n\nRun the compactor as a singleton (a single instance).\n\nCompaction and retention are idempotent. If the compactor restarts, it will continue from where it left off.\n\nThe Compactor loops to apply compaction and retention at every`compaction_interval`, or as soon as possible if running behind.\n\nThe compactor\u2019s algorithm to update the index:\n\nFor each table within each day:\n\n- Compact the table into a single index file.\n- Traverse the entire index. Use the tenant configuration to identify and mark chunks that need to be removed.\n- Remove marked chunks from the index and save their reference in a file on disk.\n- Upload the new modified index files.\n\nThe retention algorithm is applied to the index. Chunks are not deleted while applying the retention algorithm. The chunks will be deleted by the compactor asynchronously when swept.\n\nMarked chunks will only be deleted after`retention_delete_delay` configured is expired because:\n\nboltdb-shipper indexes are refreshed from the shared store on components using it (querier and ruler) at a specific interval. This means deleting chunks instantly could lead to components still having reference to old chunks and so they could fails to execute queries. Having a delay allows for components to refresh their store and so remove gracefully their reference of those chunks.\n\nIt provides a short window of time in which to cancel chunk deletion in the case of a configuration mistake.\n\nMarker files (containing chunks to delete) should be stored on a persistent disk, since the disk will be the sole reference to them.\n\n### Retention Configuration\n\nThis compactor configuration example activates retention.\n\nYAML Copy\n\n```\ncompactor:\n  working_directory: /data/retention\n  shared_store: gcs\n  compaction_interval: 10m\n  retention_enabled: true\n  retention_delete_delay: 2h\n  retention_delete_worker_count: 150\nschema_config:\n    configs:\n      - from: \"2020-07-31\"\n        index:\n            period: 24h\n            prefix: loki_index_\n        object_store: gcs\n        schema: v11\n        store: boltdb-shipper\nstorage_config:\n    boltdb_shipper:\n        active_index_directory: /data/index\n        cache_location: /data/boltdb-cache\n        shared_store: gcs\n    gcs:\n        bucket_name: loki\n```\n\nNote that retention is only available if the index period is 24h.\n\nSet`retention_enabled` to true. Without this, the Compactor will only compact tables.\n\nDefine`schema_config` and`storage_config` to access the storage.\n\nThe index period must be 24h.\n\n`working_directory` is the directory where marked chunks and temporary tables will be saved.\n\n`compaction_interval` dictates how often compaction and/or retention is applied. If the Compactor falls behind, compaction and/or retention occur as soon as possible.\n\n`retention_delete_delay` is the delay after which the compactor will delete marked chunks.\n\n`retention_delete_worker_count` specifies the maximum quantity of goroutine workers instantiated to delete chunks.\n\n#### Configuring the retention period\n\nRetention period is configured within the limits_config configuration section.\n\nThere are two ways of setting retention policies:\n\n- `retention_period` which is applied globally.\n- `retention_stream` which is only applied to chunks matching the selector\n\nThe minimum retention period is 24h.\n\nThis example configures global retention:\n\nYAML Copy\n\n```\n...\nlimits_config:\n  retention_period: 744h\n  retention_stream:\n  - selector: '{namespace=\"dev\"}'\n    priority: 1\n    period: 24h\n  per_tenant_override_config: /etc/overrides.yaml\n...\n```\n\nNOTE: You can only use label matchers in the`selector` field of a`retention_stream` definition. Arbitrary LogQL expressions are not supported.\n\nPer tenant retention can be defined using the`/etc/overrides.yaml` files. For example:\n\nYAML Copy\n\n```\noverrides:\n    \"29\":\n        retention_period: 168h\n        retention_stream:\n        - selector: '{namespace=\"prod\", container=~\"(nginx|loki)\"}'\n          priority: 2\n          period: 336h\n        - selector: '{container=\"loki\"}'\n          priority: 1\n          period: 72h\n    \"30\":\n        retention_stream:\n        - selector: '{container=\"nginx\", level=\"debug\"}'\n          priority: 1\n          period: 24h\n```\n\nA rule to apply is selected by choosing the first in this list that matches:\n\n1. If a per-tenant`retention_stream` matches the current stream, the highest priority is picked.\n2. If a global`retention_stream` matches the current stream, the highest priority is picked.\n3. If a per-tenant`retention_period` is specified, it will be applied.\n4. The global`retention_period` will be selected if nothing else matched.\n5. If no global`retention_period` is specified, the default value of`744h`(30days) retention is used.\n\nStream matching uses the same syntax as Prometheus label matching:\n\n- `=`: Select labels that are exactly equal to the provided string.\n- `!=`: Select labels that are not equal to the provided string.\n- `=~`: Select labels that regex-match the provided string.\n- `!~`: Select labels that do not regex-match the provided string.\n\nThe example configurations will set these rules:\n\nFor tenant`29`:\n\n- All streams except those in the container`loki` or in the namespace`prod` will have retention period of`168h`(1 week).\n- All streams in the`prod` namespace will have a retention period of`336h`(2 weeks), even if the container label is`loki`, since the priority of the`prod` rule is higher.\n- Streams that have the container label`loki` but are not in the namespace`prod` will have a`72h` retention period.\n\nFor tenant`30`:\n\n- All streams except those having the container label`nginx` will have the global retention period of`744h`, since there is no override specified.\n- Streams that have the label`nginx` will have a retention period of`24h`.\n\n## Table Manager\n\nIn order to enable the retention support, the Table Manager needs to be configured to enable deletions and a retention period. Please refer to the table_manager section of the Loki configuration reference for all available options. Alternatively, the`table-manager.retention-period` and`table-manager.retention-deletes-enabled` command line flags can be used. The provided retention period needs to be a duration represented as a string that can be parsed using the Prometheus common model ParseDuration. Examples:`7d`,`1w`,`168h`.\n\nWARNING: The retention period must be a multiple of the index and chunks table`period`, configured in the period_config block. See the Table Manager documentation for more information.\n\nNOTE: To avoid querying of data beyond the retention period,`max_look_back_period` config in chunk_store_config must be set to a value less than or equal to what is set in`table_manager.retention_period`.\n\nWhen using S3 or GCS, the bucket storing the chunks needs to have the expiry policy set correctly. For more details check S3\u2019s documentation or GCS\u2019s documentation.\n\nCurrently, the retention policy can only be set globally. A per-tenant retention policy with an API to delete ingested logs is still under development.\n\nSince a design goal of Loki is to make storing logs cheap, a volume-based deletion API is deprioritized. Until this feature is released, if you suddenly must delete ingested logs, you can delete old chunks in your object store. Note, however, that this only deletes the log content and keeps the label index intact; you will still be able to see related labels but will be unable to retrieve the deleted log content.\n\nFor further details on the Table Manager internals, refer to the Table Manager documentation.\n\n## Example Configuration\n\nExample configuration with GCS with a 28 day retention:\n\nYAML Copy\n\n```\nschema_config:\n  configs:\n  - from: 2018-04-15\n    store: bigtable\n    object_store: gcs\n    schema: v11\n    index:\n      prefix: loki_index_\n      period: 168h\n\nstorage_config:\n  bigtable:\n    instance: BIGTABLE_INSTANCE\n    project: BIGTABLE_PROJECT\n  gcs:\n    bucket_name: GCS_BUCKET_NAME\n\nchunk_store_config:\n  max_look_back_period: 672h\n\ntable_manager:\n  retention_deletes_enabled: true\n  retention_period: 672h\n```\n\n## Was this page helpful?\n\nYes No\n\nSuggest an edit in GitHub\n\nCreate a GitHub issue\n\nEmail docs@grafana.com\n\nHelp and support\n\nCommunity\n\n## Related resources from Grafana Labs\n\nAdditional helpful documentation, links, and articles:",
      "content_chars": 9362,
      "published_date": null
    },
    {
      "rank": 7,
      "url": "https://github.com/grafana/loki/blob/v1.3.0/docs/configuration/README.md",
      "title": "docs/configuration/README.md",
      "content": "# docs/configuration/README.md\n\n- Branch: v1.3.0\n- Repository: grafana/loki\n\n---\n\n# Configuring Loki\n\nLoki is configured in a YAML file (usually referred to as `loki.yaml`)\nwhich contains information on the Loki server and its individual components,\ndepending on which mode Loki is launched in.\n\nConfiguration examples can be found in the Configuration Examples document.\n\n* Configuration File Reference\n* server_config\n* distributor_config\n* querier_config\n* ingester_client_config\n * grpc_client_config\n* ingester_config\n * lifecycler_config\n * ring_config\n* storage_config\n * cache_config\n* chunk_store_config\n* schema_config\n * period_config\n* limits_config\n* table_manager_config\n * provision_config\n * auto_scaling_config\n\n## Configuration File Reference\n\nTo specify which configuration file to load, pass the `-config.file` flag at the\ncommand line. The file is written in YAML format,\ndefined by the scheme below. Brackets indicate that a parameter is optional. For\nnon-list parameters the value is set to the specified default.\n\nGeneric placeholders are defined as follows:\n\n* ` `: a boolean that can take the values `true` or `false`\n* ` `: any integer matching the regular expression `[1-9]+[0-9]*`\n* ` `: a duration matching the regular expression `[0-9]+(ns|us|\u00b5s|ms|[smh])`\n* ` `: a string matching the regular expression `[a-zA-Z_][a-zA-Z0-9_]*`\n* ` `: a string of unicode characters\n* ` `: a valid path relative to current working directory or an\n absolute path.\n* ` `: a valid string consisting of a hostname or IP followed by an optional port number\n* ` `: a regular string\n* ` `: a regular string that is a secret, such as a password\n\nSupported contents and default values of `loki.yaml`:\n\n```yaml\n# The module to run Loki with. Supported values\n# all, querier, table-manager, ingester, distributor\n[target: <string> | default = \"all\"]\n\n# Enables authentication through the X-Scope-OrgID header, which must be present\n# if true. If false, the OrgID will always be set to \"fake\".\n[auth_enabled: <boolean> | default = true]\n\n# Configures the server of the launched module(s).\n[server: <server_config>]\n\n# Configures the distributor.\n[distributor: <distributor_config>]\n\n# Configures the querier. Only appropriate when running all modules or\n# just the querier.\n[querier: <querier_config>]\n\n# Configures how the distributor will connect to ingesters. Only appropriate\n# when running all modules, the distributor, or the querier.\n[ingester_client: <ingester_client_config>]\n\n# Configures the ingester and how the ingester will register itself to a\n# key value store.\n[ingester: <ingester_config>]\n\n# Configures where Loki will store data.\n[storage_config: <storage_config>]\n\n# Configures how Loki will store data in the specific store.\n[chunk_store_config: <chunk_store_config>]\n\n# Configures the chunk index schema and where it is stored.\n[schema_config: <schema_config>]\n\n# Configures limits per-tenant or globally\n[limits_config: <limits_config>]\n\n# Configures the table manager for retention\n[table_manager: <table_manager_config>]\n```\n\n## server_config\n\nThe `server_config` block configures Promtail's behavior as an HTTP server:\n\n```yaml\n# HTTP server listen host\n[http_listen_address: <string>]\n\n# HTTP server listen port\n[http_listen_port: <int> | default = 80]\n\n# gRPC server listen host\n[grpc_listen_address: <string>]\n\n# gRPC server listen port\n[grpc_listen_port: <int> | default = 9095]\n\n# Register instrumentation handlers (/metrics, etc.)\n[register_instrumentation: <boolean> | default = true]\n\n# Timeout for graceful shutdowns\n[graceful_shutdown_timeout: <duration> | default = 30s]\n\n# Read timeout for HTTP server\n[http_server_read_timeout: <duration> | default = 30s]\n\n# Write timeout for HTTP server\n[http_server_write_timeout: <duration> | default = 30s]\n\n# Idle timeout for HTTP server\n[http_server_idle_timeout: <duration> | default = 120s]\n\n# Max gRPC message size that can be received\n[grpc_server_max_recv_msg_size: <int> | default = 4194304]\n\n# Max gRPC message size that can be sent\n[grpc_server_max_send_msg_size: <int> | default = 4194304]\n\n# Limit on the number of concurrent streams for gRPC calls (0 = unlimited)\n[grpc_server_max_concurrent_streams: <int> | default = 100]\n\n# Log only messages with the given severity or above. Supported values [debug,\n# info, warn, error]\n[log_level: <string> | default = \"info\"]\n\n# Base path to server all API routes from (e.g., /v1/).\n[http_path_prefix: <string>]\n```\n\n## distributor_config\n\nThe `distributor_config` block configures the Loki Distributor.\n\n```yaml\n# Configures the distributors ring, used when the \"global\" ingestion rate\n# strategy is enabled.\n[ring: <ring_config>]\n```\n\n## querier_config\n\nThe `querier_config` block configures the Loki Querier.\n\n```yaml\n# Timeout when querying ingesters or storage during the execution of a\n# query request.\n[query_timeout: <duration> | default = 1m]\n\n# Limit of the duration for which live tailing requests should be\n# served.\n[tail_max_duration: <duration> | default = 1h]\n\n# Time to wait before sending more than the minimum successful query\n# requests.\n[extra_query_delay: <duration> | default = 0s]\n\n# Configuration options for the LogQL engine.\nengine:\n  # Timeout for query execution\n  [timeout: <duration> | default = 3m]\n\n  # The maximum amount of time to look back for log lines. Only\n  # applicable for instant log queries.\n  [max_look_back_period: <duration> | default = 30s]\n```\n\n## ingester_client_config\n\nThe `ingester_client_config` block configures how connections to ingesters\noperate.\n\n```yaml\n# Configures how connections are pooled\npool_config:\n  # Whether or not to do health checks.\n  [health_check_ingesters: <boolean> | default = false]\n\n  # How frequently to clean up clients for servers that have gone away after\n  # a health check.\n  [client_cleanup_period: <duration> | default = 15s]\n\n  # How quickly a dead client will be removed after it has been detected\n  # to disappear. Set this to a value to allow time for a secondary\n  # health check to recover the missing client.\n  [remotetimeout: <duration>]\n\n# The remote request timeout on the client side.\n[remote_timeout: <duration> | default = 5s]\n\n# Configures how the gRPC connection to ingesters work as a\n# client.\n[grpc_client_config: <grpc_client_config>]\n```\n\n### grpc_client_config\n\nThe `grpc_client_config` block configures a client connection to a gRPC service.\n\n```yaml\n# The maximum size in bytes the client can receive\n[max_recv_msg_size: <int> | default = 104857600]\n\n# The maximum size in bytes the client can send\n[max_send_msg_size: <int> | default = 16777216]\n\n# Whether or not messages should be compressed\n[use_gzip_compression: <bool> | default = false]\n\n# Rate limit for gRPC client. 0 is disabled\n[rate_limit: <float> | default = 0]\n\n# Rate limit burst for gRPC client.\n[rate_limit_burst: <int> | default = 0]\n\n# Enable backoff and retry when a rate limit is hit.\n[backoff_on_ratelimits: <bool> | default = false]\n\n# Configures backoff when enbaled.\nbackoff_config:\n  # Minimum delay when backing off.\n  [minbackoff: <duration> | default = 100ms]\n\n  # The maximum delay when backing off.\n  [maxbackoff: <duration> | default = 10s]\n\n  # Number of times to backoff and retry before failing.\n  [maxretries: <int> | default = 10]\n```\n\n## ingester_config\n\nThe `ingester_config` block configures Ingesters.\n\n```yaml\n# Configures how the lifecycle of the ingester will operate\n# and where it will register for discovery.\n[lifecycler: <lifecycler_config>]\n\n# Number of times to try and transfer chunks when leaving before\n# falling back to flushing to the store. Zero = no transfers are done.\n[max_transfer_retries: <int> | default = 10]\n\n# How many flushes can happen concurrently from each stream.\n[concurrent_flushes: <int> | default = 16]\n\n# How often should the ingester see if there are any blocks\n# to flush\n[flush_check_period: <duration> | default = 30s]\n\n# The timeout before a flush is cancelled\n[flush_op_timeout: <duration> | default = 10s]\n\n# How long chunks should be retained in-memory after they've\n# been flushed.\n[chunk_retain_period: <duration> | default = 15m]\n\n# How long chunks should sit in-memory with no updates before\n# being flushed if they don't hit the max block size. This means\n# that half-empty chunks will still be flushed after a certain\n# period as long as they receieve no further activity.\n[chunk_idle_period: <duration> | default = 30m]\n\n# The targeted _uncompressed_ size in bytes of a chunk block\n# When this threshold is exceeded the head block will be cut and compressed inside the chunk\n[chunk_block_size: <int> | default = 262144]\n\n# A target _compressed_ size in bytes for chunks.\n# This is a desired size not an exact size, chunks may be slightly bigger\n# or significantly smaller if they get flushed for other reasons (e.g. chunk_idle_period)\n# The default value of 0 for this will create chunks with a fixed 10 blocks,\n# A non zero value will create chunks with a variable number of blocks to meet the target size.\n[chunk_target_size: <int> | default = 0]\n\n# The compression algorithm to use for chunks. (supported: gzip, lz4, snappy)\n# You should choose your algorithm depending on your need:\n# - `gzip` highest compression ratio but also slowest decompression speed. (144 kB per chunk)\n# - `lz4` fastest compression speed (188 kB per chunk)\n# - `snappy` fast and popular compression algorithm (272 kB per chunk)\n[chunk_encoding: <string> | default = gzip]\n\n# Parameters used to synchronize ingesters to cut chunks at the same moment.\n# Sync period is used to roll over incoming entry to a new chunk. If chunk's utilization\n# isn't high enough (eg. less than 50% when sync_min_utilization is set to 0.5), then\n# this chunk rollover doesn't happen.\n[sync_period: <duration> | default = 0]\n[sync_min_utilization: <float> | Default = 0]\n\n# The maximum number of errors a stream will report to the user\n# when a push fails. 0 to make unlimited.\n[max_returned_stream_errors: <int> | default = 10]\n```\n\n### lifecycler_config\n\nThe `lifecycler_config` is used by the Ingester to control how that ingester\nregisters itself into the ring and manages its lifecycle during its stay in the\nring.\n\n```yaml\n# Configures the ring the lifecycler connects to\n[ring: <ring_config>]\n\n# The number of tokens the lifecycler will generate and put into the ring if\n# it joined without transferring tokens from another lifecycler.\n[num_tokens: <int> | default = 128]\n\n# Period at which to heartbeat to the underlying ring.\n[heartbeat_period: <duration> | default = 5s]\n\n# How long to wait to claim tokens and chunks from another member when\n# that member is leaving. Will join automatically after the duration expires.\n[join_after: <duration> | default = 0s]\n\n# Minimum duration to wait before becoming ready. This is to work around race\n# conditions with ingesters exiting and updating the ring.\n[min_ready_duration: <duration> | default = 1m]\n\n# Store tokens in a normalised fashion to reduce the number of allocations.\n[normalise_tokens: <boolean> | default = false]\n\n# Name of network interfaces to read addresses from.\ninterface_names:\n  - [<string> ... | default = [\"eth0\", \"en0\"]]\n\n# Duration to sleep before exiting to ensure metrics are scraped.\n[final_sleep: <duration> | default = 30s]\n```\n\n### ring_config\n\nThe `ring_config` is used to discover and connect to Ingesters.\n\n```yaml\nkvstore:\n  # The backend storage to use for the ring. Supported values are\n  # consul, etcd, inmemory\n  store: <string>\n\n  # The prefix for the keys in the store. Should end with a /.\n  [prefix: <string> | default = \"collectors/\"]\n\n  # Configuration for a Consul client. Only applies if store\n  # is \"consul\"\n  consul:\n    # The hostname and port of Consul.\n    [host: <string> | duration = \"localhost:8500\"]\n\n    # The ACL Token used to interact with Consul.\n    [acltoken: <string>]\n\n    # The HTTP timeout when communicating with Consul\n    [httpclienttimeout: <duration> | default = 20s]\n\n    # Whether or not consistent reads to Consul are enabled.\n    [consistentreads: <boolean> | default = true]\n\n  # Configuration for an ETCD v3 client. Only applies if\n  # store is \"etcd\"\n  etcd:\n    # The ETCD endpoints to connect to.\n    endpoints:\n      - <string>\n\n    # The Dial timeout for the ETCD connection.\n    [dial_tmeout: <duration> | default = 10s]\n\n    # The maximum number of retries to do for failed ops to ETCD.\n    [max_retries: <int> | default = 10]\n\n# The heartbeat timeout after which ingesters are skipped for\n# reading and writing.\n[heartbeat_timeout: <duration> | default = 1m]\n\n# The number of ingesters to write to and read from. Must be at least\n# 1.\n[replication_factor: <int> | default = 3]\n```\n\n## storage_config\n\nThe `storage_config` block configures one of many possible stores for both the\nindex and chunks. Which configuration is read from depends on the schema_config\nblock and what is set for the store value.\n\n```yaml\n# Configures storing chunks in AWS. Required options only required when aws is\n# present.\naws:\n  # S3 or S3-compatible URL to connect to. If only region is specified as a\n  # host, the proper endpoint will be deduced. Use inmemory:///<bucket-name> to\n  # use a mock in-memory implementation.\n  s3: <string>\n\n  # Set to true to force the request to use path-style addressing\n  [s3forcepathstyle: <boolean> | default = false]\n\n  # Configure the DynamoDB connection\n  dynamodbconfig:\n    # URL for DynamoDB with escaped Key and Secret encoded. If only region is specified as a\n    # host, the proper endpoint will be deduced. Use inmemory:///<bucket-name> to\n    # use a mock in-memory implementation.\n    dynamodb: <string>\n\n    # DynamoDB table management requests per-second limit.\n    [apilimit: <float> | default = 2.0]\n\n    # DynamoDB rate cap to back off when throttled.\n    [throttlelimit: <float> | default = 10.0]\n\n    # Application Autoscaling endpoint URL with escaped Key and Secret\n    # encoded.\n    [applicationautoscaling: <string>]\n\n    # Metics-based autoscaling configuration.\n    metrics:\n      # Use metrics-based autoscaling via this Prometheus query URL.\n      [url: <string>]\n\n      # Queue length above which we will scale up capacity.\n      [targetqueuelen: <int> | default = 100000]\n\n      # Scale up capacity by this multiple\n      [scaleupfactor: <float64> | default = 1.3]\n\n      # Ignore throttling below this level (rate per second)\n      [minthrottling: <float64> | default = 1]\n\n      # Query to fetch ingester queue length\n      [queuelengthquery: <string> | default = \"sum(avg_over_time(cortex_ingester_flush_queue_length{job=\"cortex/ingester\"}[2m]))\"]\n\n      # Query to fetch throttle rates per table\n      [throttlequery: <string> | default = \"sum(rate(cortex_dynamo_throttled_total{operation=\"DynamoDB.BatchWriteItem\"}[1m])) by (table) > 0\"]\n\n      # Quer to fetch write capacity usage per table\n      [usagequery: <string> | default = \"sum(rate(cortex_dynamo_consumed_capacity_total{operation=\"DynamoDB.BatchWriteItem\"}[15m])) by (table) > 0\"]\n\n      # Query to fetch read capacity usage per table\n      [readusagequery: <string> | default = \"sum(rate(cortex_dynamo_consumed_capacity_total{operation=\"DynamoDB.QueryPages\"}[1h])) by (table) > 0\"]\n\n      # Query to fetch read errors per table\n      [readerrorquery: <string> | default = \"sum(increase(cortex_dynamo_failures_total{operation=\"DynamoDB.QueryPages\",error=\"ProvisionedThroughputExceededException\"}[1m])) by (table) > 0\"]\n\n    # Number of chunks to group together to parallelise fetches (0 to disable)\n    [chunkgangsize: <int> | default = 10]\n\n    # Max number of chunk get operations to start in parallel.\n    [chunkgetmaxparallelism: <int> | default = 32]\n\n# Configures storing chunks in Bigtable. Required fields only required\n# when bigtable is defined in config.\nbigtable:\n  # BigTable project ID\n  project: <string>\n\n  # BigTable instance ID\n  instance: <string>\n\n  # Configures the gRPC client used to connect to Bigtable.\n  [grpc_client_config: <grpc_client_config>]\n\n# Configures storing index in GCS. Required fields only required\n# when gcs is defined in config.\ngcs:\n  # Name of GCS bucket to put chunks in.\n  bucket_name: <string>\n\n  # The size of the buffer that the GCS client uses for each PUT request. 0\n  # to disable buffering.\n  [chunk_buffer_size: <int> | default = 0]\n\n  # The duration after which the requests to GCS should be timed out.\n  [request_timeout: <duration> | default = 0s]\n\n# Configures storing chunks in Cassandra\ncassandra:\n  # Comma-separated hostnames or IPs of Cassandra instances\n  addresses: <string>\n\n  # Port that cassandra is running on\n  [port: <int> | default = 9042]\n\n  # Keyspace to use in Cassandra\n  keyspace: <string>\n\n  # Consistency level for Cassandra\n  [consistency: <string> | default = \"QUORUM\"]\n\n  # Replication factor to use in Cassandra.\n  [replication_factor: <int> | default = 1]\n\n  # Instruct the Cassandra driver to not attempt to get host\n  # info from the system.peers table.\n  [disable_initial_host_lookup: <bool> | default = false]\n\n  # Use SSL when connecting to Cassandra instances.\n  [SSL: <boolean> | default = false]\n\n  # Require SSL certificate validation when SSL is enabled.\n  [host_verification: <bool> | default = true]\n\n  # Path to certificate file to verify the peer when SSL is\n  # enabled.\n  [CA_path: <string>]\n\n  # Enable password authentication when connecting to Cassandra.\n  [auth: <bool> | default = false]\n\n  # Username for password authentication when auth is true.\n  [username: <string>]\n\n  # Password for password authentication when auth is true.\n  [password: <string>]\n\n  # Timeout when connecting to Cassandra.\n  [timeout: <duration> | default = 600ms]\n\n  # Initial connection timeout during initial dial to server.\n  [connect_timeout: <duration> | default = 600ms]\n\n# Configures storing index in BoltDB. Required fields only\n# required when boltdb is present in config.\nboltdb:\n  # Location of BoltDB index files.\n  directory: <string>\n\n# Configures storing the chunks on the local filesystem. Required\n# fields only required when filesystem is present in config.\nfilesystem:\n  # Directory to store chunks in.\n  directory: <string>\n\n# Cache validity for active index entries. Should be no higher than\n# the chunk_idle_period in the ingester settings.\n[indexcachevalidity: <duration> | default = 5m]\n\n# The maximum number of chunks to fetch per batch.\n[max_chunk_batch_size: <int> | default = 50]\n\n# Config for how the cache for index queries should\n# be built.\nindex_queries_cache_config: <cache_config>\n```\n\n### cache_config\n\nThe `cache_config` block configures how Loki will cache requests, chunks, and\nthe index to a backing cache store.\n\n```yaml\n# Enable in-memory cache.\n[enable_fifocache: <boolean>]\n\n# The default validity of entries for caches unless overridden.\n# \"defaul\" is correct.\n[defaul_validity: <duration>]\n\n# Configures the background cache when memcached is used.\nbackground:\n  # How many goroutines to use to write back to memcached.\n  [writeback_goroutines: <int> | default = 10]\n\n  # How many chunks to buffer for background write back to memcached.\n  [writeback_buffer: <int> = 10000]\n\n# Configures memcached settings.\nmemcached:\n  # Configures how long keys stay in memcached.\n  expiration: <duration>\n\n  # Configures how many keys to fetch in each batch request.\n  batch_size: <int>\n\n  # Maximum active requests to memcached.\n  [parallelism: <int> | default = 100]\n\n# Configures how to connect to one or more memcached servers.\nmemcached_client:\n  # The hostname to use for memcached services when caching chunks. If\n  # empty, no memcached will be used. A SRV lookup will be used.\n  [host: <string>]\n\n  # SRV service used to discover memcached servers.\n  [service: <string> | default = \"memcached\"]\n\n  # Maximum time to wait before giving up on memcached requests.\n  [timeout: <duration> | default = 100ms]\n\n  # The maximum number of idle connections in the memcached client\n  # pool.\n  [max_idle_conns: <int> | default = 100]\n\n  # The period with which to poll the DNS for memcached servers.\n  [update_interval: <duration> | default = 1m]\n\n  # Whether or not to use a consistent hash to discover multiple memcached\n  # servers.\n  [consistent_hash: <bool>]\n\nredis:\n  # Redis service endpoint to use when caching chunks. If empty, no redis will be used.\n  [endpoint: <string>]\n  # Maximum time to wait before giving up on redis requests.\n  [timeout: <duration> | default = 100ms]\n  # How long keys stay in the redis.\n  [expiration: <duration> | default = 0s]\n  # Maximum number of idle connections in pool.\n  [max_idle_conns: <int> | default = 80]\n  # Maximum number of active connections in pool.\n  [max_active_conns: <int> | default = 0]\n\nfifocache:\n  # Number of entries to cache in-memory.\n  [size: <int> | default = 0]\n\n  # The expiry duration for the in-memory cache.\n  [validity: <duration> | default = 0s]\n```\n\n## chunk_store_config\n\nThe `chunk_store_config` block configures how chunks will be cached and how long\nto wait before saving them to the backing store.\n\n```yaml\n# The cache configuration for storing chunks\n[chunk_cache_config: <cache_config>]\n\n# The cache configuration for deduplicating writes\n[write_dedupe_cache_config: <cache_config>]\n\n# The minimum time between a chunk update and being saved\n# to the store.\n[min_chunk_age: <duration>]\n\n# Cache index entries older than this period. Default is\n# disabled.\n[cache_lookups_older_than: <duration>]\n\n# Limit how long back data can be queried. Default is disabled.\n# This should always be set to a value less than or equal to\n# what is set in `table_manager.retention_period`.\n[max_look_back_period: <duration>]\n```\n\n## schema_config\n\nThe `schema_config` block configures schemas from given dates.\n\n```yaml\n# The configuration for chunk index schemas.\nconfigs:\n  - [<period_config>]\n```\n\n### period_config\n\nThe `period_config` block configures what index schemas should be used\nfor from specific time periods.\n\n```yaml\n# The date of the first day that index buckets should be created. Use\n# a date in the past if this is your only period_config, otherwise\n# use a date when you want the schema to switch over.\n[from: <daytime>]\n\n# store and object_store below affect which <storage_config> key is\n# used.\n\n# Which store to use for the index. Either cassandra, bigtable, dynamodb, or\n# boltdb\nstore: <string>\n\n# Which store to use for the chunks. Either gcs, s3, inmemory, filesystem,\n# cassandra. If omitted, defaults to same value as store.\n[object_store: <string>]\n\n# The schema to use. Set to v9 or v10.\nschema: <string>\n\n# Configures how the index is updated and stored.\nindex:\n  # Table prefix for all period tables.\n  prefix: <string>\n  # Table period.\n  [period: <duration> | default = 168h]\n  # A map to be added to all managed tables.\n  tags:\n    [<string>: <string> ...]\n\n# Configured how the chunks are updated and stored.\nchunks:\n  # Table prefix for all period tables.\n  prefix: <string>\n  # Table period.\n  [period: <duration> | default = 168h]\n  # A map to be added to all managed tables.\n  tags:\n    [<string>: <string> ...]\n\n# How many shards will be created. Only used if schema is v10.\n[row_shards: <int> | default = 16]\n```\n\nWhere `daytime` is a value in the format of `yyyy-mm-dd` like `2006-01-02`.\n\n## limits_config\n\nThe `limits_config` block configures global and per-tenant limits for ingesting\nlogs in Loki.\n\n```yaml\n# Whether the ingestion rate limit should be applied individually to each\n# distributor instance (local), or evenly shared across the cluster (global).\n# The ingestion rate strategy cannot be overridden on a per-tenant basis.\n#\n# - local: enforces the limit on a per distributor basis. The actual effective\n#   rate limit will be N times higher, where N is the number of distributor\n#   replicas.\n# - global: enforces the limit globally, configuring a per-distributor local\n#   rate limiter as \"ingestion_rate / N\", where N is the number of distributor\n#   replicas (it's automatically adjusted if the number of replicas change).\n#   The global strategy requires the distributors to form their own ring, which\n#   is used to keep track of the current number of healthy distributor replicas.\n[ingestion_rate_strategy: <string> | default = \"local\"]\n\n# Per-user ingestion rate limit in sample size per second. Units in MB.\n[ingestion_rate_mb: <float> | default = 4]\n\n# Per-user allowed ingestion burst size (in sample size). Units in MB.\n# The burst size refers to the per-distributor local rate limiter even in the\n# case of the \"global\" strategy, and should be set at least to the maximum logs\n# size expected in a single push request.\n[ingestion_burst_size_mb: <int> | default = 6]\n\n# Maximum length of a label name.\n[max_label_name_length: <int> | default = 1024]\n\n# Maximum length of a label value.\n[max_label_value_length: <int> | default = 2048]\n\n# Maximum number of label names per series.\n[max_label_names_per_series: <int> | default = 30]\n\n# Whether or not old samples will be rejected.\n[reject_old_samples: <bool> | default = false]\n\n# Maximum accepted sample age before rejecting.\n[reject_old_samples_max_age: <duration> | default = 336h]\n\n# Duration for a table to be created/deleted before/after it's\n# needed. Samples won't be accepted before this time.\n[creation_grace_period: <duration> | default = 10m]\n\n# Enforce every sample has a metric name.\n[enforce_metric_name: <boolean> | default = true]\n\n# Maximum number of active streams per user, per ingester. 0 to disable.\n[max_streams_per_user: <int> | default = 10000]\n\n# Maximum number of active streams per user, across the cluster. 0 to disable.\n# When the global limit is enabled, each ingester is configured with a dynamic\n# local limit based on the replication factor and the current number of healthy\n# ingesters, and is kept updated whenever the number of ingesters change.\n[max_global_streams_per_user: <int> | default = 0]\n\n# Maximum number of chunks that can be fetched by a single query.\n[max_chunks_per_query: <int> | default = 2000000]\n\n# The limit to length of chunk store queries. 0 to disable.\n[max_query_length: <duration> | default = 0]\n\n# Maximum number of queries that will be scheduled in parallel by the\n# frontend.\n[max_query_parallelism: <int> | default = 14]\n\n# Cardinality limit for index queries\n[cardinality_limit: <int> | default = 100000]\n\n# Maximum number of stream matchers per query.\n[max_streams_matchers_per_query: <int> | default = 1000]\n\n# Filename of per-user overrides file\n[per_tenant_override_config: <string>]\n\n# Period with which to reload the overrides file if configured.\n[per_tenant_override_period: <duration> | default = 10s]\n```\n\n## table_manager_config\n\nThe `table_manager_config` block configures how the table manager operates\nand how to provision tables when DynamoDB is used as the backing store.\n\n```yaml\n# Master 'off-switch' for table capacity updates, e.g. when troubleshooting\n[throughput_updates_disabled: <boolean> | default = false]\n\n# Master 'on-switch' for table retention deletions\n[retention_deletes_enabled: <boolean> | default = false]\n\n# How far back tables will be kept before they are deleted. 0s disables\n# deletion. The retention period must be a multiple of the index / chunks\n# table \"period\" (see period_config).\n[retention_period: <duration> | default = 0s]\n\n# Period with which the table manager will poll for tables.\n[dynamodb_poll_interval: <duration> | default = 2m]\n\n# duration a table will be created before it is needed.\n[creation_grace_period: <duration> | default = 10m]\n\n# Configures management of the index tables for DynamoDB.\nindex_tables_provisioning: <provision_config>\n\n# Configures management of the chunk tables for DynamoDB.\nchunk_tables_provisioning: <provision_config>\n```\n\n### provision_config\n\nThe `provision_config` block configures provisioning capacity for DynamoDB.\n\n```yaml\n# Enables on-demand throughput provisioning for the storage\n# provider, if supported. Applies only to tables which are not autoscaled.\n[provisioned_throughput_on_demand_mode: <boolean> | default = false]\n\n# DynamoDB table default write throughput.\n[provisioned_write_throughput: <int> | default = 3000]\n\n# DynamoDB table default read throughput.\n[provisioned_read_throughput: <int> | default = 300]\n\n# Enables on-demand throughput provisioning for the storage provide,\n# if supported. Applies only to tables which are not autoscaled.\n[inactive_throughput_on_demand_mode: <boolean> | default = false]\n\n# DynamoDB table write throughput for inactive tables.\n[inactive_write_throughput: <int> | default = 1]\n\n# DynamoDB table read throughput for inactive tables.\n[inactive_read_throughput: <int> | Default = 300]\n\n# Active table write autoscale config.\n[write_scale: <auto_scaling_config>]\n\n# Inactive table write autoscale config.\n[inactive_write_scale: <auto_scaling_config>]\n\n# Number of last inactive tables to enable write autoscale.\n[inactive_write_scale_lastn: <int>]\n\n# Active table read autoscale config.\n[read_scale: <auto_scaling_config>]\n\n# Inactive table read autoscale config.\n[inactive_read_scale: <auto_scaling_config>]\n\n# Number of last inactive tables to enable read autoscale.\n[inactive_read_scale_lastn: <int>]\n```\n\n#### auto_scaling_config\n\nThe `auto_scaling_config` block configures autoscaling for DynamoDB.\n\n```yaml\n# Whether or not autoscaling should be enabled.\n[enabled: <boolean>: default = false]\n\n# AWS AutoScaling role ARN\n[role_arn: <string>]\n\n# DynamoDB minimum provision capacity.\n[min_capacity: <int> | default = 3000]\n\n# DynamoDB maximum provision capacity.\n[max_capacity: <int> | default = 6000]\n\n# DynamoDB minimum seconds between each autoscale up.\n[out_cooldown: <int> | default = 1800]\n\n# DynamoDB minimum seconds between each autoscale down.\n[in_cooldown: <int> | default = 1800]\n\n# DynamoDB target ratio of consumed capacity to provisioned capacity.\n[target: <float> | default = 80]\n```\n",
      "content_chars": 29804,
      "published_date": null
    },
    {
      "rank": 8,
      "url": "https://grafana.com/docs/enterprise-logs/latest/manage/storage/retention/",
      "title": "Log retention | Grafana Enterprise Logs documentation",
      "content": "Log retention | Grafana Enterprise Logs documentation\n\nSave the Date!\n\nSign up to get the latest GrafanaCON 2026 updates, agenda drops, and first access to early-bird tickets when they\u2019re first available.\n\nWe have our sightson Barcelona\n\nSave the Date\n\nWatch the keynote again and signup for more on-demand sessions.\n\n\ud83d\udce2 Registration + agenda now live Explore the latest Grafana Cloud and AI solutions, learn tips & tricks from demos and hands-on workshops, and get actionable advice to advance your observability strategy. Register now and get 50% off - limited tickets available (while they last!).\n\nLog retention\n\nEnterprise\n\n# Log retention\n\nRetention in Grafana Loki is achieved through the Compactor. By default the`compactor.retention-enabled` flag is not set, so the logs sent to Loki live forever.\n\nNote\n\nIf you have a lifecycle policy configured on the object store, please ensure that it is longer than the retention period.\n\nGranular retention policies to apply retention at per tenant or per stream level are also supported by the Compactor.\n\nNote\n\nThe Compactor does not support retention on legacy index types. Please use the Table Manager when using legacy index types. Both the Table manager and legacy index types are deprecated and may be removed in future major versions of Loki.\n\n## Compactor\n\nThe Compactor is responsible for compaction of index files and applying log retention.\n\nNote\n\nRun the Compactor as a singleton (a single instance).\n\nThe Compactor loops to apply compaction and retention at every`compactor.compaction-interval`, or as soon as possible if running behind. Both compaction and retention are idempotent, which means once the action has been performed, if the action is performed multiple times, it has no further effect on logs after the first time it is performed. If the Compactor restarts, it continues from where it left off.\n\nNote\n\nChanges to your retention period are not retroactive, that is, they are not applied to logs that have already been ingested.\n\nThe Compactor\u2019s algorithm to apply retention is as follows:\n\nFor each day or table (one table per day with 24h index period):\n\n- Compact multiple index files in the table into per-tenant index files. Result of compaction is a single index file per tenant per day.\n- Traverse the per-tenant index. Use the tenant configuration to identify the chunks that need to be removed.\n- Remove the references to the matching chunks from the index and add the chunk references to a marker file on disk.\n- Upload the new modified index files.\n\nChunks are not deleted while applying the retention algorithm on the index. They are deleted asynchronously by a sweeper process and this delay can be configured by setting`-compactor.retention-delete-delay`. Marker files are used to keep track of the chunks pending for deletion.\n\nChunks cannot be deleted immediately for the following reasons:\n\nIndex Gateway downloads a copy of the index files to serve queries and refreshes them at a regular interval. Having a delay allows the index gateways to pull the modified index file which would not contain any reference to the chunks marked for deletion. Without the delay, index files (that are stale) on the gateways could refer to already deleted chunks leading to query failures.\n\nIt provides a short window of time in which to cancel chunk deletion in the case of a configuration mistake.\n\nMarker files should be stored on a persistent disk to ensure that the chunks pending for deletion are processed even if the Compactor process restarts.\n\nNote\n\nGrafana Labs recommends running Compactor as a stateful deployment (StatefulSet when using Kubernetes) with a persistent storage for storing marker files.\n\n### Retention Configuration\n\nThis Compactor configuration example activates retention.\n\nYAML Copy\n\nExpand code\n\n```yaml\ncompactor:\n  working_directory: /data/retention\n  compaction_interval: 10m\n  retention_enabled: true\n  retention_delete_delay: 2h\n  retention_delete_worker_count: 150\n  delete_request_store: gcs\nschema_config:\n  configs:\n    - from: \"2020-07-31\"\n      index:\n        period: 24h\n        prefix: index_\n      object_store: gcs\n      schema: v13\n      store: tsdb\nstorage_config:\n  tsdb_shipper:\n    active_index_directory: /data/index\n    cache_location: /data/index_cache\n  gcs:\n    bucket_name: loki\n```\n\nNote\n\nRetention is only available if the index period is 24h. Single store TSDB and single store BoltDB require 24h index period.\n\n`retention_enabled` should be set to true. Without this, the Compactor will only compact tables.\n\n`delete_request_store` should be set to configure the store for delete requests. This is required when retention is enabled.\n\n`working_directory` is the directory where marked chunks and temporary tables will be saved.\n\n`compaction_interval` dictates how often compaction and/or retention is applied. If the Compactor falls behind, compaction and/or retention occur as soon as possible.\n\n`retention_delete_delay` is the delay after which the Compactor will delete marked chunks.\n\n`retention_delete_worker_count` specifies the maximum quantity of goroutine workers instantiated to delete chunks.\n\n#### Configuring the retention period\n\nRetention period is configured within the limits_config configuration section.\n\nThere are two ways of setting retention policies:\n\n- `retention_period` which is applied globally for all log streams.\n- `retention_stream` which is only applied to log streams matching the selector.\n\nNote\n\nThe minimum retention period is 24h.\n\nThis example configures global retention that applies to all tenants (unless overridden by configuring per-tenant overrides):\n\nYAML Copy\n\n```yaml\n...\nlimits_config:\n  retention_period: 744h\n  retention_stream:\n  - selector: '{namespace=\"dev\"}'\n    priority: 1\n    period: 24h\n  per_tenant_override_config: /etc/overrides.yaml\n...\n```\n\nNote\n\nYou can only use label matchers in the`selector` field of a`retention_stream` definition. Arbitrary LogQL expressions are not supported.\n\nPer tenant retention can be defined by configuring runtime overrides. For example:\n\nYAML Copy\n\n```yaml\noverrides:\n    \"29\":\n        retention_period: 168h\n        retention_stream:\n        - selector: '{namespace=\"prod\"}'\n          priority: 2\n          period: 336h\n        - selector: '{container=\"loki\"}'\n          priority: 1\n          period: 72h\n    \"30\":\n        retention_stream:\n        - selector: '{container=\"nginx\", level=\"debug\"}'\n          priority: 1\n          period: 24h\n```\n\nRetention period for a given stream is decided based on the first match in this list:\n\n1. If multiple per-tenant`retention_stream` selectors match the stream, retention period with the highest priority is picked.\n2. If multiple global`retention_stream` selectors match the stream, retention period with the highest priority is picked. This value is not considered if per-tenant`retention_stream` is set.\n3. If a per-tenant`retention_period` is specified, it will be applied.\n4. The global`retention_period` will be applied if none of the above match.\n5. If no global`retention_period` is specified, the default value of`0s` is used, which means logs are kept indefinitely.\n\nNote\n\nThe larger the priority value, the higher the priority.\n\nStream matching uses the same syntax as Prometheus label matching:\n\n- `=`: Select labels that are exactly equal to the provided string.\n- `!=`: Select labels that are not equal to the provided string.\n- `=~`: Select labels that regex-match the provided string.\n- `!~`: Select labels that do not regex-match the provided string.\n\nThe example configurations defined above will result in the following retention periods:\n\nFor tenant`29`:\n\n- Streams that have the namespace label`prod` will have a retention period of`336h`(2 weeks), even if the container label is`loki`, since the priority of the`prod` rule is higher.\n- Streams that have the container label`loki` but are not in the namespace`prod` will have a`72h` retention period.\n- For the rest of the streams in this tenant, per-tenant override`retention_period` value of`168h` is applied.\n\nFor tenant`30`:\n\n- Streams that have the label`nginx` and level`debug` will have a retention period of`24h`.\n- For the rest of the streams in this tenant the global retention period of`744h`, since there is no override specified.\n\nAll tenants except`29` and`30`:\n\n- Streams that have the namespace label`dev` will have a retention period of`24h` hours.\n- Streams except those with the namespace label`dev` will have the retention period of`744h`.\n\nNote\n\nIf you are a Grafana Cloud customer, you can use the config self-serve API to configure your tenant retention.\n\n## Table Manager (deprecated)\n\nRetention through the Table Manager is achieved by relying on the object store TTL feature, and will work for both boltdb-shipper store and chunk/index stores.\n\nIn order to enable the retention support, the Table Manager needs to be configured to enable deletions and a retention period. Please refer to the table_manager section of the Loki configuration reference for all available options. Alternatively, the`table-manager.retention-period` and`table-manager.retention-deletes-enabled` command line flags can be used. The provided retention period needs to be a duration represented as a string that can be parsed using the Prometheus common model ParseDuration. Examples:`7d`,`1w`,`168h`.\n\nWarning\n\nThe retention period must be a multiple of the index and chunks table`period`, configured in the period_config block. See the Table Manager documentation for more information.\n\nNote\n\nTo avoid querying of data beyond the retention period,`max_query_lookback` config in limits_config must be set to a value less than or equal to what is set in`table_manager.retention_period`.\n\nWhen using S3 or GCS, the bucket storing the chunks needs to have the expiry policy set correctly. For more details check S3\u2019s documentation or GCS\u2019s documentation.\n\nIf you must delete ingested logs, you can delete old chunks in your object store. Note, however, that this only deletes the log content and keeps the label index intact; you will still be able to see related labels but will be unable to retrieve the deleted log content.\n\nFor further details on the Table Manager internals, refer to the Table Manager documentation.\n\nAlternatively, if the BoltDB Shipper is configured for the index store, you can enable Log entry deletion to delete log entries from a specific stream.\n\n## Example Configuration\n\nExample configuration with GCS with a 28 day retention:\n\nYAML Copy\n\nExpand code\n\n```yaml\nschema_config:\n  configs:\n    - from: 2018-04-15\n      store: tsdb\n      object_store: gcs\n      schema: v13\n      index:\n        prefix: loki_index_\n        period: 24h\n\nstorage_config:\n  tsdb_shipper:\n    active_index_directory: /loki/index\n    cache_location: /loki/index_cache\n  gcs:\n    bucket_name: GCS_BUCKET_NAME\n\nlimits_config:\n  max_query_lookback: 672h # 28 days\n  retention_period: 672h   # 28 days\n\ncompactor:\n  working_directory: /data/retention\n  delete_request_store: gcs\n  retention_enabled: true\n```\n\n## Object store lifecycle policies\n\nLoki stores chunks and indexes as objects in the configured object store (S3, GCS, Azure Blob Storage, and so on). Chunks are deleted by the Compactor according to your configured retention, but the Compactor only removes chunk objects: it never deletes the objects that hold cluster state, such as the index or the cluster seed.\n\nIf you also configure an object store lifecycle policy on the bucket, scope it carefully. A blanket \u201cdelete everything older than N days\u201d rule will eventually remove objects that Loki must keep, which corrupts the store and causes query failures. The note at the top of this page applies here as well: any lifecycle expiration must be longer than your retention period.\n\nWarning\n\nNever apply a lifecycle rule with an empty prefix (one that targets the whole bucket). Always scope lifecycle rules to the per-tenant chunk prefixes described below.\n\n### Bucket object layout\n\nThe following objects are written to the configured bucket. The exact prefixes depend on your`schema_config` and on whether multi-tenancy is enabled, so confirm them against your own configuration before writing a lifecycle rule.\n\nExpand table\n\n| Object or prefix | Content | Safe to expire with a lifecycle policy? |\n| --- | --- | --- |\n| `<tenant_id>/`(for example,`fake/` in single-tenant mode, or your org ID per tenant) | Chunk objects (the log data). | Yes. These are the only objects a lifecycle rule should target. |\n| Index objects (under the index path prefix,`index/` by default, set by`index.path_prefix` in`schema_config`) | TSDB or BoltDB index files, written by ingesters and rewritten by the Compactor. The`index.prefix` value (for example`index_` or`loki_index_`) is the table-name prefix used inside this path, not the path itself, so match a lifecycle rule against the path prefix. | No. Loki manages the index lifecycle internally. Deleting index objects removes references to live chunks and breaks queries. |\n| `loki_cluster_seed.json` | A small file at the bucket root holding the cluster seed used by usage reporting. It is written once and never rotated. | No. A blanket age-based rule will delete it once it ages past the time to live (TTL). |\n| Compactor delete-request store (the`delete_request_store` you configure, such as`markers/` and the delete-request objects) | The Compactor\u2019s record of chunks pending deletion and of in-flight delete requests. | No. Removing these makes the Compactor lose track of pending deletions. |\n| Ruler store objects (if the Ruler is backed by the same bucket) | Recording and alerting rule files. | No. These are configuration, not time-series data. |\n\n### Compactor retention versus object store lifecycle policies\n\nCompactor retention and object store lifecycle policies are two independent mechanisms, and they should not be configured in ways that conflict:\n\n- The Compactor is index-aware. It only deletes a chunk after it has removed every reference to that chunk from the index, and it waits`compactor.retention-delete-delay`(default`2h`) before the sweeper deletes the marked chunk, so that index gateways pick up the rewritten index first.\n- An object store lifecycle policy is index-unaware. It deletes objects purely by age and prefix, with no knowledge of whether a chunk is still referenced by the index.\n\nFor most deployments, enabling Compactor retention is sufficient and an object store lifecycle policy is not required. If you do add a lifecycle policy as a cost safety net, set its expiration longer than your retention period plus`compactor.retention-delete-delay`, so the Compactor always deletes chunks first and the lifecycle rule only ever catches objects the Compactor has already orphaned.\n\n### Example: Amazon S3 lifecycle policy\n\nThis policy expires only chunk objects under a single tenant prefix. Replace`fake/` with your tenant prefix (use one rule per tenant, or your org ID prefix, when multi-tenancy is enabled). The`Days` value must be larger than your retention period plus the delete delay.\n\nJSON Copy\n\n```json\n{\n  \"Rules\": [\n    {\n      \"ID\": \"loki-chunk-expiration\",\n      \"Status\": \"Enabled\",\n      \"Filter\": {\n        \"Prefix\": \"fake/\"\n      },\n      \"Expiration\": {\n        \"Days\": 395\n      }\n    }\n  ]\n}\n```\n\nApply it with the AWS CLI:\n\nBash Copy\n\n```bash\naws s3api put-bucket-lifecycle-configuration \\\n  --bucket YOUR_LOKI_BUCKET \\\n  --lifecycle-configuration file://lifecycle.json\n```\n\n### Example: Google Cloud Storage lifecycle rule\n\nThe equivalent GCS rule expires objects by age and prefix. As with S3, scope`matchesPrefix` to the tenant chunk prefix and keep`age` larger than your retention period plus the delete delay.\n\nJSON Copy\n\n```json\n{\n  \"rule\": [\n    {\n      \"action\": {\"type\": \"Delete\"},\n      \"condition\": {\n        \"age\": 395,\n        \"matchesPrefix\": [\"fake/\"]\n      }\n    }\n  ]\n}\n```\n\nApply it with the Google Cloud CLI:\n\nBash Copy\n\n```bash\ngcloud storage buckets update gs://YOUR_LOKI_BUCKET --lifecycle-file=lifecycle.json\n```\n\nFor Azure Blob Storage, use a management policy with a`prefixMatch` set to the tenant chunk prefix and the same \u201cexpiration must exceed retention plus delete delay\u201d rule.\n\n## Was this page helpful?\n\nYes No\n\nHelp and support\n\n## Related resources from Grafana Labs\n\nAdditional helpful documentation, links, and articles:\n\nVideoScaling and securing your logs with Grafana LokiThis webinar covers the challenges of scaling and securing logs, and how Grafana Cloud Logs powered by Grafana Loki can help, cost-effectively.\n\nVideoManaging privacy in log data with Grafana LokiLaws for data privacy are complex and rapidly changing. During this webinar, we will show how Grafana Loki can help organizations meet these requirements.\n\nBlogThe concise guide to Grafana Loki: Everything you need to know about labelsIn Part 2 of \"The concise guide to Loki,\" you'll learn about how to properly use labels in our favorite logging database.\n\nAsk Grafana Assistant",
      "content_chars": 17004,
      "published_date": null
    },
    {
      "rank": 9,
      "url": "https://community.grafana.com/t/loki-retention-isnt-working-as-expected-logs-older-than-24-hours-are-not-getting-deleted/142440/3",
      "title": "Loki retention isn't working as expected\u2014logs older than 24 hours are not getting deleted - Grafana Loki - Grafana Labs Community Forums",
      "content": "Loki retention isn't working as expected\u2014logs older than 24 hours are not getting deleted - Grafana Loki - Grafana Labs Community Forums\n\n# Loki retention isn\u2019t working as expected\u2014logs older than 24 hours are not getting deleted \n\nCheck Grafana events next to you this September From Austin to London to Kenya to Nagpur - 27 locations, 27 opportunities to meet the community \n\n## post by sivaprasad298 on Feb 4, 2025 \n\n 1 Feb 2025 \n\nHi, I have below configuration for grafana loki . I am expecting that the chunks will be deleted after every 24hrs. But it is not working as expected.\n\nauth_enabled: false\n\nserver: http_listen_port: 3100 http_server_read_timeout: 600s http_server_write_timeout: 600s grpc_server_max_recv_msg_size: 18388608 grpc_server_max_send_msg_size: 18388608\n\ncommon: path_prefix: /loki storage: filesystem: chunks_directory: /loki/chunks rules_directory: /loki/rules replication_factor: 1 ring: kvstore: store: inmemory\n\nschema_config: configs: - from: 2020-10-24 store: tsdb object_store: filesystem schema: v11 index: prefix: index_ period: 24h\n\nstorage_config: tsdb_shipper: active_index_directory: /loki/index cache_location: /loki/index_cache cache_ttl: 24h\n\nlimits_config: enforce_metric_name: false reject_old_samples: true reject_old_samples_max_age: 24h ingestion_rate_mb: 50 ingestion_burst_size_mb: 100 max_global_streams_per_user: 5000 per_stream_rate_limit: 50MB retention_period: 24h\n\ncompactor: retention_enabled: true shared_store: filesystem working_directory: /loki/compactor-work\n\nchunk_store_config: max_look_back_period: 0s\n\ntable_manager: retention_deletes_enabled: true retention_period: 24h\n\ningester_client: remote_timeout: 15s\n\n## post by tonyswumac on Feb 4, 2025 \n\nTry disabling table manager (see Log retention | Grafana Loki documentation).\n\n## post by sivaprasad298 on Feb 5, 2025 \n\n 1 Feb 2025 \n\nThanks for the response, tried that but still not working\n\nThis is my updated configuration:\n\nauth_enabled: false\n\nserver: http_listen_port: 3100 http_server_read_timeout: 600s http_server_write_timeout: 600s grpc_server_max_recv_msg_size: 18388608 grpc_server_max_send_msg_size: 18388608\n\ncommon: path_prefix: /loki storage: filesystem: chunks_directory: /loki/chunks rules_directory: /loki/rules replication_factor: 1 ring: kvstore: store: inmemory\n\nschema_config: configs: - from: 2020-10-24 store: tsdb object_store: filesystem schema: v11 index: prefix: index_ period: 24h\n\nstorage_config: tsdb_shipper: active_index_directory: /loki/index cache_location: /loki/index_cache cache_ttl: 24h\n\nlimits_config: enforce_metric_name: false reject_old_samples: true reject_old_samples_max_age: 24h ingestion_rate_mb: 50 ingestion_burst_size_mb: 100 max_global_streams_per_user: 5000 per_stream_rate_limit: 50MB\n\ncompactor: working_directory: /loki/compactor-work compaction_interval: 10m retention_enabled: true retention_delete_delay: 1h shared_store: filesystem retention_delete_worker_count: 5\n\ningester_client: remote_timeout: 15s\n\n## post by tonyswumac on Feb 5, 2025 \n\n Feb 2025 \n\n1. You are missing `retention_period` on your latest config.\n2. You may want to set `retention_period` to 48h. The minimum index period for Loki is 24h, and there is a chance compactor won\u2019t delete anything until 48h is up. I don\u2019t set my retention this low, so I am not entirely sure what the behavior is here.\n\n## Closed on Feb 5 \n\nThis topic was automatically closed 365 days after the last reply. New replies are no longer allowed.",
      "content_chars": 3469,
      "published_date": "2025-02-04T00:00:00.000Z"
    },
    {
      "rank": 10,
      "url": "https://github.com/grafana/loki/blob/06ce74b7/docs/sources/shared/configuration.md",
      "title": "docs/sources/shared/configuration.md",
      "content": "# docs/sources/shared/configuration.md\n\n- Branch: 06ce74b7\n- Repository: grafana/loki\n\n---\n\n---\ndescription: Configuration reference for the parameters used to configure Grafana Loki.\ntitle: Grafana Loki configuration parameters\n---\n\n \n\n## Printing Loki config at runtime\n\nIf you pass Loki the flag `-print-config-stderr` or `-log-config-reverse-order`, (or `-print-config-stderr=true`)\nLoki will dump the entire config object it has created from the built-in defaults combined first with\noverrides from config file, and second by overrides from flags.\n\nThe result is the value for every config object in the Loki config struct, which is very large...\n\nMany values will not be relevant to your install such as storage configs which you are not using and which you did not define,\nthis is expected as every option has a default value if it is being used or not.\n\nThis config is what Loki will use to run, it can be invaluable for debugging issues related to configuration and\nis especially useful in making sure your config files and flags are being read and loaded properly.\n\n`-print-config-stderr` is nice when running Loki directly e.g. `./loki ` as you can get a quick output of the entire Loki config.\n\n`-log-config-reverse-order` is the flag we run Loki with in all our environments, the config entries are reversed so\nthat the order of configs reads correctly top to bottom when viewed in Grafana's Explore.\n\n## Configuration file reference\n\nTo specify which configuration file to load, pass the `-config.file` flag at the\ncommand line. The value can be a list of comma separated paths, then the first\nfile that exists will be used.\nIf no `-config.file` argument is specified, Loki will look up the `config.yaml` in the\ncurrent working directory and the `config/` subdirectory and try to use that.\n\nThe file is written in YAML\nformat, defined by the scheme below.\nBrackets indicate that a parameter is optional. For non-list parameters the\nvalue is set to the specified default.\n\n### Use environment variables in the configuration\n\n> **Note:** This feature is only available in Loki 2.1+.\n\nYou can use environment variable references in the configuration file to set values that need to be configurable during deployment.\nTo do this, pass `-config.expand-env=true` and use:\n\n```bash\n${VAR}\n```\n\nWhere VAR is the name of the environment variable.\n\nEach variable reference is replaced at startup by the value of the environment variable.\nThe replacement is case-sensitive and occurs before the YAML file is parsed.\nReferences to undefined variables are replaced by empty strings unless you specify a default value or custom error text.\n\nTo specify a default value, use:\n\n```bash\n${VAR:-default_value}\n```\n\nWhere default_value is the value to use if the environment variable is undefined.\n\nPass the `-config.expand-env` flag at the command line to enable this way of setting configs.\n\n### Generic placeholders\n\n- ` ` : a boolean that can take the values `true` or `false`\n- ` ` : any integer matching the regular expression `[1-9]+[0-9]*`\n- ` ` : a duration matching the regular expression `[0-9]+(ns|us|\u00b5s|ms|[smh])`\n- ` ` : a string matching the regular expression `[a-zA-Z_][a-zA-Z0-9_]*`\n- ` ` : a string of unicode characters\n- ` ` : a valid path relative to current working directory or an absolute path.\n- ` ` : a valid string consisting of a hostname or IP followed by an optional port number\n- ` ` : a string\n- ` ` : a string that represents a secret, such as a password\n\n### Supported contents and default values of `loki.yaml`\n\n \n\n```yaml\n# A comma-separated list of components to run. The default value 'all' runs Loki\n# in single binary mode. The value 'read' is an alias to run only read-path\n# related components such as the querier and query-frontend, but all in the same\n# process. The value 'write' is an alias to run only write-path related\n# components such as the distributor and compactor, but all in the same process.\n# Supported values: all, compactor, distributor, ingester, querier,\n# query-scheduler, ingester-querier, query-frontend, index-gateway, ruler,\n# table-manager, read, write. A full list of available targets can be printed\n# when running Loki with the '-list-targets' command line flag.\n# CLI flag: -target\n[target: <string> | default = \"all\"]\n\n# Enables authentication through the X-Scope-OrgID header, which must be present\n# if true. If false, the OrgID will always be set to 'fake'.\n# CLI flag: -auth.enabled\n[auth_enabled: <boolean> | default = true]\n\n# The amount of virtual memory in bytes to reserve as ballast in order to\n# optimize garbage collection. Larger ballasts result in fewer garbage\n# collection passes, reducing CPU overhead at the cost of heap size. The ballast\n# will not consume physical memory, because it is never read from. It will,\n# however, distort metrics, because it is counted as live memory.\n# CLI flag: -config.ballast-bytes\n[ballast_bytes: <int> | default = 0]\n\n# Configures the server of the launched module(s).\n[server: <server>]\n\nui:\n  # Enable the experimental Loki UI.\n  # CLI flag: -ui.enabled\n  [enabled: <boolean> | default = false]\n\n  # Enable debug logging for the UI.\n  # CLI flag: -ui.debug\n  [debug: <boolean> | default = false]\n\n  goldfish:\n    # Enable the Goldfish query comparison feature.\n    # CLI flag: -ui.goldfish.enable\n    [enable: <boolean> | default = false]\n\n    storage:\n      # Storage backend type (cloudsql, rds, or empty for no storage)\n      # CLI flag: -ui.goldfish.storage.type\n      [type: <string> | default = \"\"]\n\n      # CloudSQL host for Goldfish database.\n      # CLI flag: -ui.goldfish.storage.cloudsql.host\n      [cloudsql_host: <string> | default = \"127.0.0.1\"]\n\n      # CloudSQL port for Goldfish database.\n      # CLI flag: -ui.goldfish.storage.cloudsql.port\n      [cloudsql_port: <int> | default = 3306]\n\n      # CloudSQL database name for Goldfish.\n      # CLI flag: -ui.goldfish.storage.cloudsql.database\n      [cloudsql_database: <string> | default = \"goldfish\"]\n\n      # CloudSQL username for Goldfish database.\n      # CLI flag: -ui.goldfish.storage.cloudsql.user\n      [cloudsql_user: <string> | default = \"\"]\n\n      # RDS endpoint (host:port)\n      # CLI flag: -ui.goldfish.storage.rds.endpoint\n      [rds_endpoint: <string> | default = \"\"]\n\n      # RDS database name\n      # CLI flag: -ui.goldfish.storage.rds.database\n      [rds_database: <string> | default = \"\"]\n\n      # RDS database user\n      # CLI flag: -ui.goldfish.storage.rds.user\n      [rds_user: <string> | default = \"\"]\n\n      # Maximum number of database connections for Goldfish.\n      # CLI flag: -ui.goldfish.max-connections\n      [max_connections: <int> | default = 10]\n\n      # Maximum idle time for database connections in seconds.\n      # CLI flag: -ui.goldfish.max-idle-time\n      [max_idle_time_seconds: <int> | default = 300]\n\n    # Base URL of Grafana instance for explore links.\n    # CLI flag: -ui.goldfish.grafana-url\n    [grafana_url: <string> | default = \"\"]\n\n    # UID of the traces datasource in Grafana.\n    # CLI flag: -ui.goldfish.traces-datasource-uid\n    [traces_datasource_uid: <string> | default = \"\"]\n\n    # UID of the Loki datasource in Grafana.\n    # CLI flag: -ui.goldfish.logs-datasource-uid\n    [logs_datasource_uid: <string> | default = \"\"]\n\n    # Namespace for Cell A logs.\n    # CLI flag: -ui.goldfish.cell-a-namespace\n    [cell_a_namespace: <string> | default = \"\"]\n\n    # Namespace for Cell B logs.\n    # CLI flag: -ui.goldfish.cell-b-namespace\n    [cell_b_namespace: <string> | default = \"\"]\n\n    # Results storage backend (gcs, s3) for fetching stored query results.\n    # CLI flag: -ui.goldfish.results-backend\n    [results_backend: <string> | default = \"\"]\n\n    # The thanos_object_store_config block configures the connection to object\n    # storage backend using thanos-io/objstore clients. This will become the\n    # default way of configuring object store clients in future releases.\n    # Currently this is opt-in and takes effect only when `-use-thanos-objstore`\n    # is set to true.\n    # The CLI flags prefix for this block configuration is: ui.goldfish.results\n    [results_bucket: <thanos_object_store_config>]\n\n  ring:\n    kvstore:\n      # Backend storage to use for the ring. Supported values are: consul, etcd,\n      # inmemory, memberlist, multi.\n      # CLI flag: -ui.ring.store\n      [store: <string> | default = \"consul\"]\n\n      # The prefix for the keys in the store. Should end with a /.\n      # CLI flag: -ui.ring.prefix\n      [prefix: <string> | default = \"collectors/\"]\n\n      # Configuration for a Consul client. Only applies if the selected kvstore\n      # is consul.\n      # The CLI flags prefix for this block configuration is: ui.ring\n      [consul: <consul>]\n\n      # Configuration for an ETCD v3 client. Only applies if the selected\n      # kvstore is etcd.\n      # The CLI flags prefix for this block configuration is: ui.ring\n      [etcd: <etcd>]\n\n      multi:\n        # Primary backend storage used by multi-client.\n        # CLI flag: -ui.ring.multi.primary\n        [primary: <string> | default = \"\"]\n\n        # Secondary backend storage used by multi-client.\n        # CLI flag: -ui.ring.multi.secondary\n        [secondary: <string> | default = \"\"]\n\n        # Mirror writes to the secondary store.\n        # CLI flag: -ui.ring.multi.mirror-enabled\n        [mirror_enabled: <boolean> | default = false]\n\n        # Timeout for storing a value to the secondary store.\n        # CLI flag: -ui.ring.multi.mirror-timeout\n        [mirror_timeout: <duration> | default = 2s]\n\n    # Period at which to heartbeat to the ring.\n    # CLI flag: -ui.ring.heartbeat-period\n    [heartbeat_period: <duration> | default = 15s]\n\n    # The heartbeat timeout after which compactors are considered unhealthy\n    # within the ring. 0 = never (timeout disabled).\n    # CLI flag: -ui.ring.heartbeat-timeout\n    [heartbeat_timeout: <duration> | default = 1m]\n\n    # File path where tokens are stored. If empty, tokens are not stored at\n    # shutdown and restored at startup.\n    # CLI flag: -ui.ring.tokens-file-path\n    [tokens_file_path: <string> | default = \"\"]\n\n    # True to enable zone-awareness and replicate blocks across different\n    # availability zones.\n    # CLI flag: -ui.ring.zone-awareness-enabled\n    [zone_awareness_enabled: <boolean> | default = false]\n\n    # Number of tokens to own in the ring.\n    # CLI flag: -ui.ring.num-tokens\n    [num_tokens: <int> | default = 128]\n\n    # Factor for data replication.\n    # CLI flag: -ui.ring.replication-factor\n    [replication_factor: <int> | default = 3]\n\n    # Instance ID to register in the ring.\n    # CLI flag: -ui.ring.instance-id\n    [instance_id: <string> | default = \"<hostname>\"]\n\n    # Name of network interface to read address from.\n    # CLI flag: -ui.ring.instance-interface-names\n    [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n    # Port to advertise in the ring (defaults to server.grpc-listen-port).\n    # CLI flag: -ui.ring.instance-port\n    [instance_port: <int> | default = 0]\n\n    # IP address to advertise in the ring.\n    # CLI flag: -ui.ring.instance-addr\n    [instance_addr: <string> | default = \"\"]\n\n    # The availability zone where this instance is running. Required if\n    # zone-awareness is enabled.\n    # CLI flag: -ui.ring.instance-availability-zone\n    [instance_availability_zone: <string> | default = \"\"]\n\n    # Enable using a IPv6 instance address.\n    # CLI flag: -ui.ring.instance-enable-ipv6\n    [instance_enable_ipv6: <boolean> | default = false]\n\n# Configures the distributor.\n[distributor: <distributor>]\n\n# Configures the querier. Only appropriate when running all modules or just the\n# querier.\n[querier: <querier>]\n\nquery_engine:\n  # Experimental: Enable next generation query engine for supported queries.\n  # CLI flag: -query-engine.enable\n  [enable: <boolean> | default = false]\n\n  # Experimental: Enable distributed query execution.\n  # CLI flag: -query-engine.distributed\n  [distributed: <boolean> | default = false]\n\n  # Experimental: Name of network interface to read an advertise address from\n  # for accepting incoming traffic from query-engine-worker instances when\n  # distributed execution is enabled.\n  # CLI flag: -query-engine.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # Experimental: Batch size of the next generation query engine.\n  # CLI flag: -query-engine.batch-size\n  [batch_size: <int> | default = 100]\n\n  # Experimental: The number of inputs that are prefetched simultaneously by any\n  # Merge node. A value of 0 means that only the currently processed input is\n  # prefetched, 1 means that only the next input is prefetched, and so on. A\n  # negative value means that all inputs are be prefetched in parallel.\n  # CLI flag: -query-engine.merge-prefetch-count\n  [merge_prefetch_count: <int> | default = 0]\n\n  # Configures how to read byte ranges from object storage when using the V2\n  # engine.\n  range_reads:\n    # Experimental: maximum number of parallel reads\n    # CLI flag: -query-engine.range-reads.max-parallelism\n    [max_parallelism: <int> | default = 10]\n\n    # Experimental: maximum distance (in bytes) between ranges that causes them\n    # to be coalesced into a single range\n    # CLI flag: -query-engine.range-reads.coalesce-size\n    [coalesce_size: <int> | default = 1048576]\n\n    # Experimental: maximum size of a byte range\n    # CLI flag: -query-engine.range-reads.max-range-size\n    [max_range_size: <int> | default = 8388608]\n\n    # Experimental: minimum size of a byte range\n    # CLI flag: -query-engine.range-reads.min-range-size\n    [min_range_size: <int> | default = 1048576]\n\n  # Experimental: Number of worker threads to spawn. Each worker thread runs one\n  # task at a time. 0 means to use GOMAXPROCS value.\n  # CLI flag: -query-engine.worker-threads\n  [worker_threads: <int> | default = 0]\n\n  # Experimental: Address holding DNS SRV records of schedulers to connect to.\n  # CLI flag: -query-engine.scheduler-lookup-address\n  [scheduler_lookup_address: <string> | default = \"\"]\n\n  # Experimental: Interval at which to lookup new schedulers by DNS SRV records.\n  # CLI flag: -query-engine.scheduler-lookup-interval\n  [scheduler_lookup_interval: <duration> | default = 10s]\n\n  # Amount of time until data objects are available.\n  # CLI flag: -query-engine.storage-lag\n  [storage_lag: <duration> | default = 1h]\n\n  # Initial date when data objects became available. Format YYYY-MM-DD. If not\n  # set, assume data objects are always available no matter how far back.\n  # CLI flag: -query-engine.storage-start-date\n  [storage_start_date: <time> | default = 0]\n\n  # Enable routing of query splits in the query frontend to the next generation\n  # engine when they fall within the configured time range.\n  # CLI flag: -query-engine.enable-engine-router\n  [enable_engine_router: <boolean> | default = false]\n\n  # Downstream address to send query splits to. This is the HTTP handler address\n  # of the query engine scheduler.\n  # CLI flag: -query-engine.downstream-address\n  [downstream_address: <string> | default = \"\"]\n\n  # When enabled, query results exclude log lines that match overlapping delete\n  # requests (not just pending requests). Disable to return all logs without\n  # considering delete requests.\n  # CLI flag: -query-engine.enable-delete-req-filtering\n  [enable_delete_req_filtering: <boolean> | default = true]\n\n# The query_scheduler block configures the Loki query scheduler. When configured\n# it separates the tenant query queues from the query-frontend.\n[query_scheduler: <query_scheduler>]\n\n# The frontend block configures the Loki query-frontend.\n[frontend: <frontend>]\n\n# The query_range block configures the query splitting and caching in the Loki\n# query-frontend.\n[query_range: <query_range>]\n\n# The ruler block configures the Loki ruler.\n[ruler: <ruler>]\n\nruler_storage:\n  # The thanos_object_store_config block configures the connection to object\n  # storage backend using thanos-io/objstore clients. This will become the\n  # default way of configuring object store clients in future releases.\n  # Currently this is opt-in and takes effect only when `-use-thanos-objstore`\n  # is set to true.\n  # The CLI flags prefix for this block configuration is: ruler-storage\n  [<thanos_object_store_config>]\n\n  # Backend storage to use. Supported backends are: local, s3, gcs, azure,\n  # swift, filesystem, alibabacloud, bos\n  # CLI flag: -ruler-storage.backend\n  [backend: <string> | default = \"filesystem\"]\n\n  local:\n    # Directory to scan for rules\n    # CLI flag: -ruler-storage.local.directory\n    [directory: <string> | default = \"\"]\n\n# The ingester_client block configures how the distributor will connect to\n# ingesters. Only appropriate when running all components, the distributor, or\n# the querier.\n[ingester_client: <ingester_client>]\n\n# The ingester block configures the ingester and how the ingester will register\n# itself to a key value store.\n[ingester: <ingester>]\n\npattern_ingester:\n  # Whether the pattern ingester is enabled.\n  # CLI flag: -pattern-ingester.enabled\n  [enabled: <boolean> | default = false]\n\n  # Configures how the lifecycle of the pattern ingester will operate and where\n  # it will register for discovery.\n  lifecycler:\n    ring:\n      kvstore:\n        # Backend storage to use for the ring. Supported values are: consul,\n        # etcd, inmemory, memberlist, multi.\n        # CLI flag: -pattern-ingester.store\n        [store: <string> | default = \"consul\"]\n\n        # The prefix for the keys in the store. Should end with a /.\n        # CLI flag: -pattern-ingester.prefix\n        [prefix: <string> | default = \"collectors/\"]\n\n        # Configuration for a Consul client. Only applies if the selected\n        # kvstore is consul.\n        # The CLI flags prefix for this block configuration is: pattern-ingester\n        [consul: <consul>]\n\n        # Configuration for an ETCD v3 client. Only applies if the selected\n        # kvstore is etcd.\n        # The CLI flags prefix for this block configuration is: pattern-ingester\n        [etcd: <etcd>]\n\n        multi:\n          # Primary backend storage used by multi-client.\n          # CLI flag: -pattern-ingester.multi.primary\n          [primary: <string> | default = \"\"]\n\n          # Secondary backend storage used by multi-client.\n          # CLI flag: -pattern-ingester.multi.secondary\n          [secondary: <string> | default = \"\"]\n\n          # Mirror writes to the secondary store.\n          # CLI flag: -pattern-ingester.multi.mirror-enabled\n          [mirror_enabled: <boolean> | default = false]\n\n          # Timeout for storing a value to the secondary store.\n          # CLI flag: -pattern-ingester.multi.mirror-timeout\n          [mirror_timeout: <duration> | default = 2s]\n\n      # The heartbeat timeout after which ingesters are skipped for\n      # reads/writes.\n      # CLI flag: -pattern-ingester.ring.heartbeat-timeout\n      [heartbeat_timeout: <duration> | default = 1m]\n\n      # The number of ingesters to write to and read from.\n      # CLI flag: -pattern-ingester.distributor.replication-factor\n      [replication_factor: <int> | default = 1]\n\n      # True to enable the zone-awareness and replicate ingested samples across\n      # different availability zones.\n      # CLI flag: -pattern-ingester.distributor.zone-awareness-enabled\n      [zone_awareness_enabled: <boolean> | default = false]\n\n      # Comma-separated list of zones to exclude from the ring. Instances in\n      # excluded zones will be filtered out from the ring.\n      # CLI flag: -pattern-ingester.distributor.excluded-zones\n      [excluded_zones: <string> | default = \"\"]\n\n    # Number of tokens for each ingester.\n    # CLI flag: -pattern-ingester.num-tokens\n    [num_tokens: <int> | default = 128]\n\n    # Period at which to heartbeat to consul.\n    # CLI flag: -pattern-ingester.heartbeat-period\n    [heartbeat_period: <duration> | default = 5s]\n\n    # Heartbeat timeout after which instance is assumed to be unhealthy.\n    # CLI flag: -pattern-ingester.heartbeat-timeout\n    [heartbeat_timeout: <duration> | default = 1m]\n\n    # Observe tokens after generating to resolve collisions. Useful when using\n    # gossiping ring.\n    # CLI flag: -pattern-ingester.observe-period\n    [observe_period: <duration> | default = 0s]\n\n    # Period to wait for a claim from another member; will join automatically\n    # after this.\n    # CLI flag: -pattern-ingester.join-after\n    [join_after: <duration> | default = 0s]\n\n    # Minimum duration to wait after the internal readiness checks have passed\n    # but before succeeding the readiness endpoint. This is used to slowdown\n    # deployment controllers (eg. Kubernetes) after an instance is ready and\n    # before they proceed with a rolling update, to give the rest of the cluster\n    # instances enough time to receive ring updates.\n    # CLI flag: -pattern-ingester.min-ready-duration\n    [min_ready_duration: <duration> | default = 15s]\n\n    # Name of network interface to read address from.\n    # CLI flag: -pattern-ingester.lifecycler.interface\n    [interface_names: <list of strings> | default = [<private network interfaces>]]\n\n    # Enable IPv6 support. Required to make use of IP addresses from IPv6\n    # interfaces.\n    # CLI flag: -pattern-ingester.enable-inet6\n    [enable_inet6: <boolean> | default = false]\n\n    # Duration to sleep for before exiting, to ensure metrics are scraped.\n    # CLI flag: -pattern-ingester.final-sleep\n    [final_sleep: <duration> | default = 0s]\n\n    # File path where tokens are stored. If empty, tokens are not stored at\n    # shutdown and restored at startup.\n    # CLI flag: -pattern-ingester.tokens-file-path\n    [tokens_file_path: <string> | default = \"\"]\n\n    # The availability zone where this instance is running.\n    # CLI flag: -pattern-ingester.availability-zone\n    [availability_zone: <string> | default = \"\"]\n\n    # Unregister from the ring upon clean shutdown. It can be useful to disable\n    # for rolling restarts with consistent naming in conjunction with\n    # -distributor.extend-writes=false.\n    # CLI flag: -pattern-ingester.unregister-on-shutdown\n    [unregister_on_shutdown: <boolean> | default = true]\n\n    # When enabled the readiness probe succeeds only after all instances are\n    # ACTIVE and healthy in the ring, otherwise only the instance itself is\n    # checked. This option should be disabled if in your cluster multiple\n    # instances can be rolled out simultaneously, otherwise rolling updates may\n    # be slowed down.\n    # CLI flag: -pattern-ingester.readiness-check-ring-health\n    [readiness_check_ring_health: <boolean> | default = true]\n\n    # IP address to advertise in the ring.\n    # CLI flag: -pattern-ingester.lifecycler.addr\n    [address: <string> | default = \"\"]\n\n    # port to advertise in consul (defaults to server.grpc-listen-port).\n    # CLI flag: -pattern-ingester.lifecycler.port\n    [port: <int> | default = 0]\n\n    # ID to register in the ring.\n    # CLI flag: -pattern-ingester.lifecycler.ID\n    [id: <string> | default = \"<hostname>\"]\n\n  # Configures how the pattern ingester will connect to the ingesters.\n  client_config:\n    # Configures how connections are pooled.\n    pool_config:\n      # How frequently to clean up clients for ingesters that have gone away.\n      # CLI flag: -pattern-ingester.client-cleanup-period\n      [client_cleanup_period: <duration> | default = 15s]\n\n      # Run a health check on each ingester client during periodic cleanup.\n      # CLI flag: -pattern-ingester.health-check-ingesters\n      [health_check_ingesters: <boolean> | default = true]\n\n      # Timeout for the health check.\n      # CLI flag: -pattern-ingester.remote-timeout\n      [remote_timeout: <duration> | default = 1s]\n\n    # The remote request timeout on the client side.\n    # CLI flag: -pattern-ingester.client.timeout\n    [remote_timeout: <duration> | default = 5s]\n\n    # Configures how the gRPC connection to ingesters work as a client.\n    # The CLI flags prefix for this block configuration is:\n    # pattern-ingester.client\n    [grpc_client_config: <grpc_client>]\n\n  # How many flushes can happen concurrently from each stream.\n  # CLI flag: -pattern-ingester.concurrent-flushes\n  [concurrent_flushes: <int> | default = 32]\n\n  # How often should the ingester see if there are any blocks to flush. The\n  # first flush check is delayed by a random time up to 0.8x the flush check\n  # period. Additionally, there is +/- 1% jitter added to the interval.\n  # CLI flag: -pattern-ingester.flush-check-period\n  [flush_check_period: <duration> | default = 1m]\n\n  # The maximum number of detected pattern clusters that can be created by\n  # streams.\n  # CLI flag: -pattern-ingester.max-clusters\n  [max_clusters: <int> | default = 300]\n\n  # The maximum eviction ratio of patterns per stream. Once that ratio is\n  # reached, the stream will throttled pattern detection.\n  # CLI flag: -pattern-ingester.max-eviction-ratio\n  [max_eviction_ratio: <float> | default = 0.25]\n\n  # Configures the metric aggregation and storage behavior of the pattern\n  # ingester.\n  metric_aggregation:\n    # How often to sample metrics and patterns from raw push observations.\n    # CLI flag: -pattern-ingester.metric-aggregation.downsample-period\n    [sample_period: <duration> | default = 10s]\n\n    # The address of the Loki instance to push aggregated metrics to.\n    # CLI flag: -pattern-ingester.metric-aggregation.loki-address\n    [loki_address: <string> | default = \"\"]\n\n    # The timeout for writing to Loki.\n    # CLI flag: -pattern-ingester.metric-aggregation.timeout\n    [timeout: <duration> | default = 10s]\n\n    # How long to wait in between pushes to Loki.\n    # CLI flag: -pattern-ingester.metric-aggregation.push-period\n    [push_period: <duration> | default = 30s]\n\n    # The HTTP client configuration for pushing metrics to Loki.\n    http_client_config:\n      basic_auth:\n        [username: <string> | default = \"\"]\n\n        [username_file: <string> | default = \"\"]\n\n        [username_ref: <string> | default = \"\"]\n\n        [password: <string> | default = \"\"]\n\n        [password_file: <string> | default = \"\"]\n\n        [password_ref: <string> | default = \"\"]\n\n      authorization:\n        [type: <string> | default = \"\"]\n\n        [credentials: <string> | default = \"\"]\n\n        [credentials_file: <string> | default = \"\"]\n\n        [credentials_ref: <string> | default = \"\"]\n\n      oauth2:\n        [client_id: <string> | default = \"\"]\n\n        [client_secret: <string> | default = \"\"]\n\n        [client_secret_file: <string> | default = \"\"]\n\n        [client_secret_ref: <string> | default = \"\"]\n\n        [client_certificate_key_id: <string> | default = \"\"]\n\n        [client_certificate_key: <string> | default = \"\"]\n\n        [client_certificate_key_file: <string> | default = \"\"]\n\n        [client_certificate_key_ref: <string> | default = \"\"]\n\n        [grant_type: <string> | default = \"\"]\n\n        [signature_algorithm: <string> | default = \"\"]\n\n        [iss: <string> | default = \"\"]\n\n        [audience: <string> | default = \"\"]\n\n        [claims: <map of string to >]\n\n        [scopes: <list of strings>]\n\n        [token_url: <string> | default = \"\"]\n\n        [endpoint_params: <map of string to string>]\n\n        tls_config:\n          [ca: <string> | default = \"\"]\n\n          [cert: <string> | default = \"\"]\n\n          [key: <string> | default = \"\"]\n\n          [ca_file: <string> | default = \"\"]\n\n          [cert_file: <string> | default = \"\"]\n\n          [key_file: <string> | default = \"\"]\n\n          [ca_ref: <string> | default = \"\"]\n\n          [cert_ref: <string> | default = \"\"]\n\n          [key_ref: <string> | default = \"\"]\n\n          [server_name: <string> | default = \"\"]\n\n          [insecure_skip_verify: <boolean>]\n\n          [min_version: <int>]\n\n          [max_version: <int>]\n\n        proxy_url:\n          [url: <url>]\n\n        [no_proxy: <string> | default = \"\"]\n\n        [proxy_from_environment: <boolean>]\n\n        [proxy_connect_header: <map of string to list of strings>]\n\n      [bearer_token: <string> | default = \"\"]\n\n      [bearer_token_file: <string> | default = \"\"]\n\n      tls_config:\n        [ca: <string> | default = \"\"]\n\n        [cert: <string> | default = \"\"]\n\n        [key: <string> | default = \"\"]\n\n        [ca_file: <string> | default = \"\"]\n\n        [cert_file: <string> | default = \"\"]\n\n        [key_file: <string> | default = \"\"]\n\n        [ca_ref: <string> | default = \"\"]\n\n        [cert_ref: <string> | default = \"\"]\n\n        [key_ref: <string> | default = \"\"]\n\n        [server_name: <string> | default = \"\"]\n\n        [insecure_skip_verify: <boolean>]\n\n        [min_version: <int>]\n\n        [max_version: <int>]\n\n      [follow_redirects: <boolean>]\n\n      [enable_http2: <boolean>]\n\n      proxy_url:\n        [url: <url>]\n\n      [no_proxy: <string> | default = \"\"]\n\n      [proxy_from_environment: <boolean>]\n\n      [proxy_connect_header: <map of string to list of strings>]\n\n      http_headers:\n        [: <map of string to Header>]\n\n    # Whether to use TLS for pushing metrics to Loki.\n    # CLI flag: -pattern-ingester.metric-aggregation.tls\n    [use_tls: <boolean> | default = false]\n\n    # The basic auth configuration for pushing metrics to Loki.\n    basic_auth:\n      # Basic auth username for sending aggregations back to Loki.\n      # CLI flag: -pattern-ingester.metric-aggregation..basic-auth.username\n      [username: <string> | default = \"\"]\n\n      # Basic auth password for sending aggregations back to Loki.\n      # CLI flag: -pattern-ingester.metric-aggregation..basic-auth.password\n      [password: <string> | default = \"\"]\n\n    # The backoff configuration for pushing metrics to Loki.\n    backoff_config:\n      # Minimum delay when backing off.\n      # CLI flag: -pattern-ingester.metric-aggregation...backoff-min-period\n      [min_period: <duration> | default = 100ms]\n\n      # Maximum delay when backing off.\n      # CLI flag: -pattern-ingester.metric-aggregation...backoff-max-period\n      [max_period: <duration> | default = 10s]\n\n      # Number of times to backoff and retry before failing.\n      # CLI flag: -pattern-ingester.metric-aggregation...backoff-retries\n      [max_retries: <int> | default = 10]\n\n  # Configures how detected patterns are pushed back to Loki for persistence.\n  pattern_persistence:\n    # The address of the Loki instance to push patterns to.\n    # CLI flag: -pattern-ingester.pattern-persistence.loki-address\n    [loki_address: <string> | default = \"\"]\n\n    # The timeout for writing patterns to Loki.\n    # CLI flag: -pattern-ingester.pattern-persistence.timeout\n    [timeout: <duration> | default = 10s]\n\n    # How long to wait between pattern pushes to Loki.\n    # CLI flag: -pattern-ingester.pattern-persistence.push-period\n    [push_period: <duration> | default = 1m]\n\n    # The HTTP client configuration for pushing patterns to Loki.\n    http_client_config:\n      basic_auth:\n        [username: <string> | default = \"\"]\n\n        [username_file: <string> | default = \"\"]\n\n        [username_ref: <string> | default = \"\"]\n\n        [password: <string> | default = \"\"]\n\n        [password_file: <string> | default = \"\"]\n\n        [password_ref: <string> | default = \"\"]\n\n      authorization:\n        [type: <string> | default = \"\"]\n\n        [credentials: <string> | default = \"\"]\n\n        [credentials_file: <string> | default = \"\"]\n\n        [credentials_ref: <string> | default = \"\"]\n\n      oauth2:\n        [client_id: <string> | default = \"\"]\n\n        [client_secret: <string> | default = \"\"]\n\n        [client_secret_file: <string> | default = \"\"]\n\n        [client_secret_ref: <string> | default = \"\"]\n\n        [client_certificate_key_id: <string> | default = \"\"]\n\n        [client_certificate_key: <string> | default = \"\"]\n\n        [client_certificate_key_file: <string> | default = \"\"]\n\n        [client_certificate_key_ref: <string> | default = \"\"]\n\n        [grant_type: <string> | default = \"\"]\n\n        [signature_algorithm: <string> | default = \"\"]\n\n        [iss: <string> | default = \"\"]\n\n        [audience: <string> | default = \"\"]\n\n        [claims: <map of string to >]\n\n        [scopes: <list of strings>]\n\n        [token_url: <string> | default = \"\"]\n\n        [endpoint_params: <map of string to string>]\n\n        tls_config:\n          [ca: <string> | default = \"\"]\n\n          [cert: <string> | default = \"\"]\n\n          [key: <string> | default = \"\"]\n\n          [ca_file: <string> | default = \"\"]\n\n          [cert_file: <string> | default = \"\"]\n\n          [key_file: <string> | default = \"\"]\n\n          [ca_ref: <string> | default = \"\"]\n\n          [cert_ref: <string> | default = \"\"]\n\n          [key_ref: <string> | default = \"\"]\n\n          [server_name: <string> | default = \"\"]\n\n          [insecure_skip_verify: <boolean>]\n\n          [min_version: <int>]\n\n          [max_version: <int>]\n\n        proxy_url:\n          [url: <url>]\n\n        [no_proxy: <string> | default = \"\"]\n\n        [proxy_from_environment: <boolean>]\n\n        [proxy_connect_header: <map of string to list of strings>]\n\n      [bearer_token: <string> | default = \"\"]\n\n      [bearer_token_file: <string> | default = \"\"]\n\n      tls_config:\n        [ca: <string> | default = \"\"]\n\n        [cert: <string> | default = \"\"]\n\n        [key: <string> | default = \"\"]\n\n        [ca_file: <string> | default = \"\"]\n\n        [cert_file: <string> | default = \"\"]\n\n        [key_file: <string> | default = \"\"]\n\n        [ca_ref: <string> | default = \"\"]\n\n        [cert_ref: <string> | default = \"\"]\n\n        [key_ref: <string> | default = \"\"]\n\n        [server_name: <string> | default = \"\"]\n\n        [insecure_skip_verify: <boolean>]\n\n        [min_version: <int>]\n\n        [max_version: <int>]\n\n      [follow_redirects: <boolean>]\n\n      [enable_http2: <boolean>]\n\n      proxy_url:\n        [url: <url>]\n\n      [no_proxy: <string> | default = \"\"]\n\n      [proxy_from_environment: <boolean>]\n\n      [proxy_connect_header: <map of string to list of strings>]\n\n      http_headers:\n        [: <map of string to Header>]\n\n    # Whether to use TLS for pushing patterns to Loki.\n    # CLI flag: -pattern-ingester.pattern-persistence.tls\n    [use_tls: <boolean> | default = false]\n\n    # The basic auth configuration for pushing patterns to Loki.\n    basic_auth:\n      # Basic auth username for sending patterns back to Loki.\n      # CLI flag: -pattern-ingester.pattern-persistence..basic-auth.username\n      [username: <string> | default = \"\"]\n\n      # Basic auth password for sending patterns back to Loki.\n      # CLI flag: -pattern-ingester.pattern-persistence..basic-auth.password\n      [password: <string> | default = \"\"]\n\n    # The backoff configuration for pushing patterns to Loki.\n    backoff_config:\n      # Minimum delay when backing off.\n      # CLI flag: -pattern-ingester.pattern-persistence...backoff-min-period\n      [min_period: <duration> | default = 100ms]\n\n      # Maximum delay when backing off.\n      # CLI flag: -pattern-ingester.pattern-persistence...backoff-max-period\n      [max_period: <duration> | default = 10s]\n\n      # Number of times to backoff and retry before failing.\n      # CLI flag: -pattern-ingester.pattern-persistence...backoff-retries\n      [max_retries: <int> | default = 10]\n\n    # The maximum number of patterns to accumulate before pushing.\n    # CLI flag: -pattern-ingester.pattern-persistence.batch-size\n    [batch_size: <int> | default = 1000]\n\n  # Configures the pattern tee which forwards requests to the pattern ingester.\n  tee_config:\n    # The size of the batch of raw logs to send for template mining\n    # CLI flag: -pattern-ingester.tee.batch-size\n    [batch_size: <int> | default = 5000]\n\n    # The max time between batches of raw logs to send for template mining\n    # CLI flag: -pattern-ingester.tee.batch-flush-interval\n    [batch_flush_interval: <duration> | default = 1s]\n\n    # The number of log flushes to queue before dropping\n    # CLI flag: -pattern-ingester.tee.flush-queue-size\n    [flush_queue_size: <int> | default = 1000]\n\n    # the number of concurrent workers sending logs to the template service\n    # CLI flag: -pattern-ingester.tee.flush-worker-count\n    [flush_worker_count: <int> | default = 100]\n\n    # The max time we will try to flush any remaining logs to be mined when the\n    # service is stopped\n    # CLI flag: -pattern-ingester.tee.stop-flush-timeout\n    [stop_flush_timeout: <duration> | default = 30s]\n\n  # Timeout for connections between the Loki and the pattern ingester.\n  # CLI flag: -pattern-ingester.connection-timeout\n  [connection_timeout: <duration> | default = 2s]\n\n  # The maximum length of log lines that can be used for pattern detection.\n  # CLI flag: -pattern-ingester.max-allowed-line-length\n  [max_allowed_line_length: <int> | default = 3000]\n\n  # How long to retain patterns in the pattern ingester after they are pushed.\n  # CLI flag: -pattern-ingester.retain-for\n  [retain_for: <duration> | default = 3h]\n\n  # The maximum time span for a single pattern chunk.\n  # CLI flag: -pattern-ingester.max-chunk-age\n  [max_chunk_age: <duration> | default = 1h]\n\n  # The time resolution for pattern samples within chunks.\n  # CLI flag: -pattern-ingester.sample-interval\n  [pattern_sample_interval: <duration> | default = 10s]\n\n  # The threshold for filtering patterns by volume. Only patterns representing\n  # the top X% of log volume will be persisted (0-1).\n  # CLI flag: -pattern-ingester.volume-threshold\n  [volume_threshold: <float> | default = 0.99]\n\n# The index_gateway block configures the Loki index gateway server, responsible\n# for serving index queries without the need to constantly interact with the\n# object store.\n[index_gateway: <index_gateway>]\n\n# Experimental: The bloom_build block configures the Loki bloom planner and\n# builder servers, responsible for building bloom filters.\n[bloom_build: <bloom_build>]\n\n# Experimental: The bloom_gateway block configures the Loki bloom gateway\n# server, responsible for serving queries for filtering chunks based on filter\n# expressions.\n[bloom_gateway: <bloom_gateway>]\n\n# The storage_config block configures one of many possible stores for both the\n# index and chunks. Which configuration to be picked should be defined in\n# schema_config block.\n[storage_config: <storage_config>]\n\n# The chunk_store_config block configures how chunks will be cached and how long\n# to wait before saving them to the backing store.\n[chunk_store_config: <chunk_store_config>]\n\n# Configures the chunk index schema and where it is stored.\n[schema_config: <schema_config>]\n\n# The compactor block configures the compactor component, which compacts index\n# shards for performance.\n[compactor: <compactor>]\n\ncompactor_grpc_client:\n  # The grpc_client block configures the gRPC client used to communicate between\n  # a client and server component in Loki.\n  # The CLI flags prefix for this block configuration is: compactor.grpc-client\n  [<grpc_client>]\n\n# The limits_config block configures global and per-tenant limits in Loki. The\n# values here can be overridden in the `overrides` section of the runtime_config\n# file\n[limits_config: <limits_config>]\n\n# The frontend_worker configures the worker - running within the Loki querier -\n# picking up and executing queries enqueued by the query-frontend.\n[frontend_worker: <frontend_worker>]\n\n# The table_manager block configures the table manager for retention.\n[table_manager: <table_manager>]\n\n# Configuration for memberlist client. Only applies if the selected kvstore is\n# memberlist.\n# \n# When a memberlist config with atleast 1 join_members is defined, kvstore of\n# type memberlist is automatically selected for all the components that require\n# a ring unless otherwise specified in the component's configuration section.\n[memberlist: <memberlist>]\n\nkafka_config:\n  # The Kafka topic name.\n  # CLI flag: -kafka.topic\n  [topic: <string> | default = \"\"]\n\n  # The maximum time allowed to open a connection to a Kafka broker.\n  # CLI flag: -kafka.dial-timeout\n  [dial_timeout: <duration> | default = 2s]\n\n  # How long to wait for an incoming write request to be successfully committed\n  # to the Kafka backend.\n  # CLI flag: -kafka.write-timeout\n  [write_timeout: <duration> | default = 10s]\n\n  reader_config:\n    # The Kafka backend address.\n    # CLI flag: -kafka.reader.address\n    [address: <string> | default = \"localhost:9092\"]\n\n    # The Kafka client ID.\n    # CLI flag: -kafka.reader.client-id\n    [client_id: <string> | default = \"\"]\n\n  writer_config:\n    # The Kafka backend address.\n    # CLI flag: -kafka.writer.address\n    [address: <string> | default = \"localhost:9092\"]\n\n    # The Kafka client ID.\n    # CLI flag: -kafka.writer.client-id\n    [client_id: <string> | default = \"\"]\n\n  # The SASL username for authentication to Kafka using the PLAIN mechanism.\n  # Both username and password must be set.\n  # CLI flag: -kafka.sasl-username\n  [sasl_username: <string> | default = \"\"]\n\n  # The SASL password for authentication to Kafka using the PLAIN mechanism.\n  # Both username and password must be set.\n  # CLI flag: -kafka.sasl-password\n  [sasl_password: <string> | default = \"\"]\n\n  # The consumer group used by the consumer to track the last consumed offset.\n  # The consumer group must be different for each ingester zone.When empty, Loki\n  # uses the ingester instance ID.\n  # CLI flag: -kafka.consumer-group\n  [consumer_group: <string> | default = \"\"]\n\n  # How frequently a consumer should commit the consumed offset to Kafka. The\n  # last committed offset is used at startup to continue the consumption from\n  # where it was left.\n  # CLI flag: -kafka.consumer-group-offset-commit-interval\n  [consumer_group_offset_commit_interval: <duration> | default = 1s]\n\n  # How long to retry a failed request to get the last produced offset.\n  # CLI flag: -kafka.last-produced-offset-retry-timeout\n  [last_produced_offset_retry_timeout: <duration> | default = 10s]\n\n  # Enable auto-creation of Kafka topic if it doesn't exist.\n  # CLI flag: -kafka.auto-create-topic-enabled\n  [auto_create_topic_enabled: <boolean> | default = true]\n\n  # When auto-creation of Kafka topic is enabled and this value is positive,\n  # Kafka's num.partitions configuration option is set on Kafka brokers with\n  # this value when Loki component that uses Kafka starts. This configuration\n  # option specifies the default number of partitions that the Kafka broker uses\n  # for auto-created topics. Note that this is a Kafka-cluster wide setting, and\n  # applies to any auto-created topic. If the setting of num.partitions fails,\n  # Loki proceeds anyways, but auto-created topics could have an incorrect\n  # number of partitions.\n  # CLI flag: -kafka.auto-create-topic-default-partitions\n  [auto_create_topic_default_partitions: <int> | default = 1000]\n\n  # The maximum size of a Kafka record data that should be generated by the\n  # producer. An incoming write request larger than this size is split into\n  # multiple Kafka records. We strongly recommend to not change this setting\n  # unless for testing purposes.\n  # CLI flag: -kafka.producer-max-record-size-bytes\n  [producer_max_record_size_bytes: <int> | default = 15983616]\n\n  # The maximum size of (uncompressed) buffered and unacknowledged produced\n  # records sent to Kafka. The produce request fails once this limit is reached.\n  # This limit is per Kafka client. 0 to disable the limit.\n  # CLI flag: -kafka.producer-max-buffered-bytes\n  [producer_max_buffered_bytes: <int> | default = 1073741824]\n\n  # The guaranteed maximum lag before a consumer is considered to have caught up\n  # reading from a partition at startup, becomes ACTIVE in the hash ring and\n  # passes the readiness check. Set -kafka.max-consumer-lag-at-startup to 0 to\n  # disable waiting for maximum consumer lag being honored at startup.\n  # CLI flag: -kafka.max-consumer-lag-at-startup\n  [max_consumer_lag_at_startup: <duration> | default = 15s]\n\n  # The maximum number of workers to use for processing records from Kafka.\n  # CLI flag: -kafka.max-consumer-workers\n  [max_consumer_workers: <int> | default = 1]\n\n  # Enable collection of the following kafka latency histograms: read-wait,\n  # read-timing, write-wait, write-timing\n  # CLI flag: -kafka.enable-kafka-histograms\n  [enable_kafka_histograms: <boolean> | default = false]\n\ndataobj:\n  consumer:\n    builderconfig:\n      # The target maximum amount of uncompressed data to hold in data pages\n      # (for columnar sections). Uncompressed size is used for consistent I/O\n      # and planning.\n      # CLI flag: -dataobj-consumer.target-page-size\n      [target_page_size: <int> | default = 2MiB]\n\n      # The maximum row count for pages to use for the data object builder. A\n      # value of 0 means no limit.\n      # CLI flag: -dataobj-consumer.max-page-rows\n      [max_page_rows: <int> | default = 0]\n\n      # The target maximum size of the encoded object and all of its encoded\n      # sections (after compression), to limit memory usage of a builder.\n      # CLI flag: -dataobj-consumer.target-builder-memory-limit\n      [target_object_size: <int> | default = 1GiB]\n\n      # The target maximum amount of uncompressed data to hold in sections, for\n      # sections that support being limited by size. Uncompressed size is used\n      # for consistent I/O and planning.\n      # CLI flag: -dataobj-consumer.target-section-size\n      [target_section_size: <int> | default = 128MiB]\n\n      # The size of logs to buffer in memory before adding into columnar\n      # builders, used to reduce CPU load of sorting.\n      # CLI flag: -dataobj-consumer.buffer-size\n      [buffer_size: <int> | default = 16MiB]\n\n      # The maximum number of dataobj section stripes to merge into a section at\n      # once. Must be greater than 1.\n      # CLI flag: -dataobj-consumer.section-stripe-merge-limit\n      [section_stripe_merge_limit: <int> | default = 2]\n\n    lifecycler:\n      ring:\n        kvstore:\n          # Backend storage to use for the ring. Supported values are: consul,\n          # etcd, inmemory, memberlist, multi.\n          # CLI flag: -dataobj-consumer.store\n          [store: <string> | default = \"consul\"]\n\n          # The prefix for the keys in the store. Should end with a /.\n          # CLI flag: -dataobj-consumer.prefix\n          [prefix: <string> | default = \"collectors/\"]\n\n          # Configuration for a Consul client. Only applies if the selected\n          # kvstore is consul.\n          # The CLI flags prefix for this block configuration is:\n          # dataobj-consumer\n          [consul: <consul>]\n\n          # Configuration for an ETCD v3 client. Only applies if the selected\n          # kvstore is etcd.\n          # The CLI flags prefix for this block configuration is:\n          # dataobj-consumer\n          [etcd: <etcd>]\n\n          multi:\n            # Primary backend storage used by multi-client.\n            # CLI flag: -dataobj-consumer.multi.primary\n            [primary: <string> | default = \"\"]\n\n            # Secondary backend storage used by multi-client.\n            # CLI flag: -dataobj-consumer.multi.secondary\n            [secondary: <string> | default = \"\"]\n\n            # Mirror writes to the secondary store.\n            # CLI flag: -dataobj-consumer.multi.mirror-enabled\n            [mirror_enabled: <boolean> | default = false]\n\n            # Timeout for storing a value to the secondary store.\n            # CLI flag: -dataobj-consumer.multi.mirror-timeout\n            [mirror_timeout: <duration> | default = 2s]\n\n        # The heartbeat timeout after which ingesters are skipped for\n        # reads/writes.\n        # CLI flag: -dataobj-consumer.ring.heartbeat-timeout\n        [heartbeat_timeout: <duration> | default = 1m]\n\n        # The number of ingesters to write to and read from.\n        # CLI flag: -dataobj-consumer.distributor.replication-factor\n        [replication_factor: <int> | default = 3]\n\n        # True to enable the zone-awareness and replicate ingested samples\n        # across different availability zones.\n        # CLI flag: -dataobj-consumer.distributor.zone-awareness-enabled\n        [zone_awareness_enabled: <boolean> | default = false]\n\n        # Comma-separated list of zones to exclude from the ring. Instances in\n        # excluded zones will be filtered out from the ring.\n        # CLI flag: -dataobj-consumer.distributor.excluded-zones\n        [excluded_zones: <string> | default = \"\"]\n\n      # Number of tokens for each ingester.\n      # CLI flag: -dataobj-consumer.num-tokens\n      [num_tokens: <int> | default = 128]\n\n      # Period at which to heartbeat to consul.\n      # CLI flag: -dataobj-consumer.heartbeat-period\n      [heartbeat_period: <duration> | default = 5s]\n\n      # Heartbeat timeout after which instance is assumed to be unhealthy.\n      # CLI flag: -dataobj-consumer.heartbeat-timeout\n      [heartbeat_timeout: <duration> | default = 1m]\n\n      # Observe tokens after generating to resolve collisions. Useful when using\n      # gossiping ring.\n      # CLI flag: -dataobj-consumer.observe-period\n      [observe_period: <duration> | default = 0s]\n\n      # Period to wait for a claim from another member; will join automatically\n      # after this.\n      # CLI flag: -dataobj-consumer.join-after\n      [join_after: <duration> | default = 0s]\n\n      # Minimum duration to wait after the internal readiness checks have passed\n      # but before succeeding the readiness endpoint. This is used to slowdown\n      # deployment controllers (eg. Kubernetes) after an instance is ready and\n      # before they proceed with a rolling update, to give the rest of the\n      # cluster instances enough time to receive ring updates.\n      # CLI flag: -dataobj-consumer.min-ready-duration\n      [min_ready_duration: <duration> | default = 15s]\n\n      # Name of network interface to read address from.\n      # CLI flag: -dataobj-consumer.lifecycler.interface\n      [interface_names: <list of strings> | default = [<private network interfaces>]]\n\n      # Enable IPv6 support. Required to make use of IP addresses from IPv6\n      # interfaces.\n      # CLI flag: -dataobj-consumer.enable-inet6\n      [enable_inet6: <boolean> | default = false]\n\n      # Duration to sleep for before exiting, to ensure metrics are scraped.\n      # CLI flag: -dataobj-consumer.final-sleep\n      [final_sleep: <duration> | default = 0s]\n\n      # File path where tokens are stored. If empty, tokens are not stored at\n      # shutdown and restored at startup.\n      # CLI flag: -dataobj-consumer.tokens-file-path\n      [tokens_file_path: <string> | default = \"\"]\n\n      # The availability zone where this instance is running.\n      # CLI flag: -dataobj-consumer.availability-zone\n      [availability_zone: <string> | default = \"\"]\n\n      # Unregister from the ring upon clean shutdown. It can be useful to\n      # disable for rolling restarts with consistent naming in conjunction with\n      # -distributor.extend-writes=false.\n      # CLI flag: -dataobj-consumer.unregister-on-shutdown\n      [unregister_on_shutdown: <boolean> | default = true]\n\n      # When enabled the readiness probe succeeds only after all instances are\n      # ACTIVE and healthy in the ring, otherwise only the instance itself is\n      # checked. This option should be disabled if in your cluster multiple\n      # instances can be rolled out simultaneously, otherwise rolling updates\n      # may be slowed down.\n      # CLI flag: -dataobj-consumer.readiness-check-ring-health\n      [readiness_check_ring_health: <boolean> | default = true]\n\n      # IP address to advertise in the ring.\n      # CLI flag: -dataobj-consumer.lifecycler.addr\n      [address: <string> | default = \"\"]\n\n      # port to advertise in consul (defaults to server.grpc-listen-port).\n      # CLI flag: -dataobj-consumer.lifecycler.port\n      [port: <int> | default = 0]\n\n      # ID to register in the ring.\n      # CLI flag: -dataobj-consumer.lifecycler.ID\n      [id: <string> | default = \"<hostname>\"]\n\n    partition_ring:\n      # The key-value store used to share the hash ring across multiple\n      # instances. This option needs be set on ingesters, distributors,\n      # queriers, and rulers when running in microservices mode.\n      kvstore:\n        # Backend storage to use for the ring. Supported values are: consul,\n        # etcd, inmemory, memberlist, multi.\n        # CLI flag: -dataobj-consumer.partition-ring.store\n        [store: <string> | default = \"memberlist\"]\n\n        # The prefix for the keys in the store. Should end with a /.\n        # CLI flag: -dataobj-consumer.partition-ring.prefix\n        [prefix: <string> | default = \"collectors/\"]\n\n        # Configuration for a Consul client. Only applies if the selected\n        # kvstore is consul.\n        # The CLI flags prefix for this block configuration is:\n        # dataobj-consumer.partition-ring\n        [consul: <consul>]\n\n        # Configuration for an ETCD v3 client. Only applies if the selected\n        # kvstore is etcd.\n        # The CLI flags prefix for this block configuration is:\n        # dataobj-consumer.partition-ring\n        [etcd: <etcd>]\n\n        multi:\n          # Primary backend storage used by multi-client.\n          # CLI flag: -dataobj-consumer.partition-ring.multi.primary\n          [primary: <string> | default = \"\"]\n\n          # Secondary backend storage used by multi-client.\n          # CLI flag: -dataobj-consumer.partition-ring.multi.secondary\n          [secondary: <string> | default = \"\"]\n\n          # Mirror writes to the secondary store.\n          # CLI flag: -dataobj-consumer.partition-ring.multi.mirror-enabled\n          [mirror_enabled: <boolean> | default = false]\n\n          # Timeout for storing a value to the secondary store.\n          # CLI flag: -dataobj-consumer.partition-ring.multi.mirror-timeout\n          [mirror_timeout: <duration> | default = 2s]\n\n      # Minimum number of owners to wait before a PENDING partition gets\n      # switched to ACTIVE.\n      # CLI flag: -dataobj-consumer.partition-ring.min-partition-owners-count\n      [min_partition_owners_count: <int> | default = 1]\n\n      # How long the minimum number of owners are enforced before a PENDING\n      # partition gets switched to ACTIVE.\n      # CLI flag: -dataobj-consumer.partition-ring.min-partition-owners-duration\n      [min_partition_owners_duration: <duration> | default = 10s]\n\n      # How long to wait before an INACTIVE partition is eligible for deletion.\n      # The partition is deleted only if it has been in INACTIVE state for at\n      # least the configured duration and it has no owners registered. A value\n      # of 0 disables partitions deletion.\n      # CLI flag: -dataobj-consumer.partition-ring.delete-inactive-partition-after\n      [delete_inactive_partition_after: <duration> | default = 13h]\n\n    uploader:\n      # The size of the SHA prefix to use for generating object storage keys for\n      # data objects.\n      # CLI flag: -dataobj-consumer.sha-prefix-size\n      [shaprefixsize: <int> | default = 2]\n\n    # The maximum amount of time to wait in seconds before flushing an object\n    # that is no longer receiving new writes\n    # CLI flag: -dataobj-consumer.idle-flush-timeout\n    [idle_flush_timeout: <duration> | default = 1h]\n\n    # The maximum amount of time to accumulate data in a builder before flushing\n    # it. Defaults to 1 hour.\n    # CLI flag: -dataobj-consumer.max-builder-age\n    [max_builder_age: <duration> | default = 1h]\n\n    # The name of the Kafka topic\n    # CLI flag: -dataobj-consumer.topic\n    [topic: <string> | default = \"\"]\n\n  index:\n    # The target maximum amount of uncompressed data to hold in data pages (for\n    # columnar sections). Uncompressed size is used for consistent I/O and\n    # planning.\n    # CLI flag: -dataobj-index-builder.target-page-size\n    [target_page_size: <int> | default = 128KiB]\n\n    # The maximum row count for pages to use for the data object builder. A\n    # value of 0 means no limit.\n    # CLI flag: -dataobj-index-builder.max-page-rows\n    [max_page_rows: <int> | default = 0]\n\n    # The target maximum size of the encoded object and all of its encoded\n    # sections (after compression), to limit memory usage of a builder.\n    # CLI flag: -dataobj-index-builder.target-builder-memory-limit\n    [target_object_size: <int> | default = 64MiB]\n\n    # The target maximum amount of uncompressed data to hold in sections, for\n    # sections that support being limited by size. Uncompressed size is used for\n    # consistent I/O and planning.\n    # CLI flag: -dataobj-index-builder.target-section-size\n    [target_section_size: <int> | default = 16MiB]\n\n    # The size of logs to buffer in memory before adding into columnar builders,\n    # used to reduce CPU load of sorting.\n    # CLI flag: -dataobj-index-builder.buffer-size\n    [buffer_size: <int> | default = 2MiB]\n\n    # The maximum number of dataobj section stripes to merge into a section at\n    # once. Must be greater than 1.\n    # CLI flag: -dataobj-index-builder.section-stripe-merge-limit\n    [section_stripe_merge_limit: <int> | default = 2]\n\n    # Experimental: The number of events to batch before building an index\n    # CLI flag: -dataobj-index-builder.events-per-index\n    [events_per_index: <int> | default = 32]\n\n    # Experimental: How often to check for stale partitions to flush\n    # CLI flag: -dataobj-index-builder.flush-interval\n    [flush_interval: <duration> | default = 1m]\n\n    # Experimental: Maximum time to wait before flushing buffered events\n    # CLI flag: -dataobj-index-builder.max-idle-time\n    [max_idle_time: <duration> | default = 30m]\n\n  metastore:\n    # Experimental: A prefix to use for storing indexes in object storage. Used\n    # for testing only.\n    # CLI flag: -dataobj-metastore.index-storage-prefix\n    [index_storage_prefix: <string> | default = \"index/v0\"]\n\n    # Experimental: The ratio of log partitions to metastore partitions. For\n    # example, a value of 10 means there is 1 metastore partition for every 10\n    # log partitions.\n    # CLI flag: -dataobj-metastore.partition-ratio\n    [partition_ratio: <int> | default = 10]\n\n  # The prefix to use for the storage bucket.\n  # CLI flag: -dataobj-storage-bucket-prefix\n  [storage_bucket_prefix: <string> | default = \"dataobj/\"]\n\n  # Enable data objects.\n  # CLI flag: -dataobj.enabled\n  [enabled: <boolean> | default = false]\n\ningest_limits:\n  # Enable the ingest limits service.\n  # CLI flag: -ingest-limits.enabled\n  [enabled: <boolean> | default = false]\n\n  # The duration for which which streams are considered active. Streams that\n  # have not been updated within this window are considered inactive and not\n  # counted towards limits.\n  # CLI flag: -ingest-limits.active-window\n  [active_window: <duration> | default = 2h]\n\n  # The time window for rate calculation. This should match the window used in\n  # Prometheus rate() queries for consistency.\n  # CLI flag: -ingest-limits.rate-window\n  [rate_window: <duration> | default = 5m]\n\n  # The size of the buckets used to calculate stream rates. Smaller buckets\n  # provide more precise rates but require more memory.\n  # CLI flag: -ingest-limits.bucket-size\n  [bucket_size: <duration> | default = 1m]\n\n  # The interval at which old streams are evicted.\n  # CLI flag: -ingest-limits.eviction-interval\n  [eviction_interval: <duration> | default = 10m]\n\n  # The number of partitions for the Kafka topic used to read and write stream\n  # metadata. It is fixed, not a maximum.\n  # CLI flag: -ingest-limits.num-partitions\n  [num_partitions: <int> | default = 64]\n\n  lifecycler:\n    ring:\n      kvstore:\n        # Backend storage to use for the ring. Supported values are: consul,\n        # etcd, inmemory, memberlist, multi.\n        # CLI flag: -ingest-limits.store\n        [store: <string> | default = \"consul\"]\n\n        # The prefix for the keys in the store. Should end with a /.\n        # CLI flag: -ingest-limits.prefix\n        [prefix: <string> | default = \"collectors/\"]\n\n        # Configuration for a Consul client. Only applies if the selected\n        # kvstore is consul.\n        # The CLI flags prefix for this block configuration is: ingest-limits\n        [consul: <consul>]\n\n        # Configuration for an ETCD v3 client. Only applies if the selected\n        # kvstore is etcd.\n        # The CLI flags prefix for this block configuration is: ingest-limits\n        [etcd: <etcd>]\n\n        multi:\n          # Primary backend storage used by multi-client.\n          # CLI flag: -ingest-limits.multi.primary\n          [primary: <string> | default = \"\"]\n\n          # Secondary backend storage used by multi-client.\n          # CLI flag: -ingest-limits.multi.secondary\n          [secondary: <string> | default = \"\"]\n\n          # Mirror writes to the secondary store.\n          # CLI flag: -ingest-limits.multi.mirror-enabled\n          [mirror_enabled: <boolean> | default = false]\n\n          # Timeout for storing a value to the secondary store.\n          # CLI flag: -ingest-limits.multi.mirror-timeout\n          [mirror_timeout: <duration> | default = 2s]\n\n      # The heartbeat timeout after which ingesters are skipped for\n      # reads/writes.\n      # CLI flag: -ingest-limits.ring.heartbeat-timeout\n      [heartbeat_timeout: <duration> | default = 1m]\n\n      # The number of ingesters to write to and read from.\n      # CLI flag: -ingest-limits.distributor.replication-factor\n      [replication_factor: <int> | default = 3]\n\n      # True to enable the zone-awareness and replicate ingested samples across\n      # different availability zones.\n      # CLI flag: -ingest-limits.distributor.zone-awareness-enabled\n      [zone_awareness_enabled: <boolean> | default = false]\n\n      # Comma-separated list of zones to exclude from the ring. Instances in\n      # excluded zones will be filtered out from the ring.\n      # CLI flag: -ingest-limits.distributor.excluded-zones\n      [excluded_zones: <string> | default = \"\"]\n\n    # Number of tokens for each ingester.\n    # CLI flag: -ingest-limits.num-tokens\n    [num_tokens: <int> | default = 128]\n\n    # Period at which to heartbeat to consul.\n    # CLI flag: -ingest-limits.heartbeat-period\n    [heartbeat_period: <duration> | default = 5s]\n\n    # Heartbeat timeout after which instance is assumed to be unhealthy.\n    # CLI flag: -ingest-limits.heartbeat-timeout\n    [heartbeat_timeout: <duration> | default = 1m]\n\n    # Observe tokens after generating to resolve collisions. Useful when using\n    # gossiping ring.\n    # CLI flag: -ingest-limits.observe-period\n    [observe_period: <duration> | default = 0s]\n\n    # Period to wait for a claim from another member; will join automatically\n    # after this.\n    # CLI flag: -ingest-limits.join-after\n    [join_after: <duration> | default = 0s]\n\n    # Minimum duration to wait after the internal readiness checks have passed\n    # but before succeeding the readiness endpoint. This is used to slowdown\n    # deployment controllers (eg. Kubernetes) after an instance is ready and\n    # before they proceed with a rolling update, to give the rest of the cluster\n    # instances enough time to receive ring updates.\n    # CLI flag: -ingest-limits.min-ready-duration\n    [min_ready_duration: <duration> | default = 15s]\n\n    # Name of network interface to read address from.\n    # CLI flag: -ingest-limits.lifecycler.interface\n    [interface_names: <list of strings> | default = [<private network interfaces>]]\n\n    # Enable IPv6 support. Required to make use of IP addresses from IPv6\n    # interfaces.\n    # CLI flag: -ingest-limits.enable-inet6\n    [enable_inet6: <boolean> | default = false]\n\n    # Duration to sleep for before exiting, to ensure metrics are scraped.\n    # CLI flag: -ingest-limits.final-sleep\n    [final_sleep: <duration> | default = 0s]\n\n    # File path where tokens are stored. If empty, tokens are not stored at\n    # shutdown and restored at startup.\n    # CLI flag: -ingest-limits.tokens-file-path\n    [tokens_file_path: <string> | default = \"\"]\n\n    # The availability zone where this instance is running.\n    # CLI flag: -ingest-limits.availability-zone\n    [availability_zone: <string> | default = \"\"]\n\n    # Unregister from the ring upon clean shutdown. It can be useful to disable\n    # for rolling restarts with consistent naming in conjunction with\n    # -distributor.extend-writes=false.\n    # CLI flag: -ingest-limits.unregister-on-shutdown\n    [unregister_on_shutdown: <boolean> | default = true]\n\n    # When enabled the readiness probe succeeds only after all instances are\n    # ACTIVE and healthy in the ring, otherwise only the instance itself is\n    # checked. This option should be disabled if in your cluster multiple\n    # instances can be rolled out simultaneously, otherwise rolling updates may\n    # be slowed down.\n    # CLI flag: -ingest-limits.readiness-check-ring-health\n    [readiness_check_ring_health: <boolean> | default = true]\n\n    # IP address to advertise in the ring.\n    # CLI flag: -ingest-limits.lifecycler.addr\n    [address: <string> | default = \"\"]\n\n    # port to advertise in consul (defaults to server.grpc-listen-port).\n    # CLI flag: -ingest-limits.lifecycler.port\n    [port: <int> | default = 0]\n\n    # ID to register in the ring.\n    # CLI flag: -ingest-limits.lifecycler.ID\n    [id: <string> | default = \"<hostname>\"]\n\n  # The consumer group for the Kafka topic used to read stream metadata records.\n  # CLI flag: -ingest-limits.consumer-group\n  [consumer_group: <string> | default = \"ingest-limits\"]\n\n  # The topic for the Kafka topic used to read and write stream metadata\n  # records.\n  # CLI flag: -ingest-limits.topic\n  [topic: <string> | default = \"\"]\n\ningest_limits_frontend:\n  client_config:\n    # Configures client gRPC connections to limits service.\n    # The CLI flags prefix for this block configuration is:\n    # ingest-limits-frontend.limits-client\n    [grpc_client_config: <grpc_client>]\n\n    # Configures client gRPC connections pool to limits service.\n    pool_config:\n      # How frequently to clean up clients for ingest-limits that have gone\n      # away.\n      # CLI flag: -ingest-limits-frontend.client-cleanup-period\n      [client_cleanup_period: <duration> | default = 15s]\n\n      # Run a health check on each ingest-limits client during periodic cleanup.\n      # CLI flag: -ingest-limits-frontend.health-check-ingest-limits\n      [health_check_ingest_limits: <boolean> | default = true]\n\n      # Timeout for the health check.\n      # CLI flag: -ingest-limits-frontend.remote-timeout\n      [remote_timeout: <duration> | default = 1s]\n\n  lifecycler:\n    ring:\n      kvstore:\n        # Backend storage to use for the ring. Supported values are: consul,\n        # etcd, inmemory, memberlist, multi.\n        # CLI flag: -ingest-limits-frontend.store\n        [store: <string> | default = \"consul\"]\n\n        # The prefix for the keys in the store. Should end with a /.\n        # CLI flag: -ingest-limits-frontend.prefix\n        [prefix: <string> | default = \"collectors/\"]\n\n        # Configuration for a Consul client. Only applies if the selected\n        # kvstore is consul.\n        # The CLI flags prefix for this block configuration is:\n        # ingest-limits-frontend\n        [consul: <consul>]\n\n        # Configuration for an ETCD v3 client. Only applies if the selected\n        # kvstore is etcd.\n        # The CLI flags prefix for this block configuration is:\n        # ingest-limits-frontend\n        [etcd: <etcd>]\n\n        multi:\n          # Primary backend storage used by multi-client.\n          # CLI flag: -ingest-limits-frontend.multi.primary\n          [primary: <string> | default = \"\"]\n\n          # Secondary backend storage used by multi-client.\n          # CLI flag: -ingest-limits-frontend.multi.secondary\n          [secondary: <string> | default = \"\"]\n\n          # Mirror writes to the secondary store.\n          # CLI flag: -ingest-limits-frontend.multi.mirror-enabled\n          [mirror_enabled: <boolean> | default = false]\n\n          # Timeout for storing a value to the secondary store.\n          # CLI flag: -ingest-limits-frontend.multi.mirror-timeout\n          [mirror_timeout: <duration> | default = 2s]\n\n      # The heartbeat timeout after which ingesters are skipped for\n      # reads/writes.\n      # CLI flag: -ingest-limits-frontend.ring.heartbeat-timeout\n      [heartbeat_timeout: <duration> | default = 1m]\n\n      # The number of ingesters to write to and read from.\n      # CLI flag: -ingest-limits-frontend.distributor.replication-factor\n      [replication_factor: <int> | default = 3]\n\n      # True to enable the zone-awareness and replicate ingested samples across\n      # different availability zones.\n      # CLI flag: -ingest-limits-frontend.distributor.zone-awareness-enabled\n      [zone_awareness_enabled: <boolean> | default = false]\n\n      # Comma-separated list of zones to exclude from the ring. Instances in\n      # excluded zones will be filtered out from the ring.\n      # CLI flag: -ingest-limits-frontend.distributor.excluded-zones\n      [excluded_zones: <string> | default = \"\"]\n\n    # Number of tokens for each ingester.\n    # CLI flag: -ingest-limits-frontend.num-tokens\n    [num_tokens: <int> | default = 128]\n\n    # Period at which to heartbeat to consul.\n    # CLI flag: -ingest-limits-frontend.heartbeat-period\n    [heartbeat_period: <duration> | default = 5s]\n\n    # Heartbeat timeout after which instance is assumed to be unhealthy.\n    # CLI flag: -ingest-limits-frontend.heartbeat-timeout\n    [heartbeat_timeout: <duration> | default = 1m]\n\n    # Observe tokens after generating to resolve collisions. Useful when using\n    # gossiping ring.\n    # CLI flag: -ingest-limits-frontend.observe-period\n    [observe_period: <duration> | default = 0s]\n\n    # Period to wait for a claim from another member; will join automatically\n    # after this.\n    # CLI flag: -ingest-limits-frontend.join-after\n    [join_after: <duration> | default = 0s]\n\n    # Minimum duration to wait after the internal readiness checks have passed\n    # but before succeeding the readiness endpoint. This is used to slowdown\n    # deployment controllers (eg. Kubernetes) after an instance is ready and\n    # before they proceed with a rolling update, to give the rest of the cluster\n    # instances enough time to receive ring updates.\n    # CLI flag: -ingest-limits-frontend.min-ready-duration\n    [min_ready_duration: <duration> | default = 15s]\n\n    # Name of network interface to read address from.\n    # CLI flag: -ingest-limits-frontend.lifecycler.interface\n    [interface_names: <list of strings> | default = [<private network interfaces>]]\n\n    # Enable IPv6 support. Required to make use of IP addresses from IPv6\n    # interfaces.\n    # CLI flag: -ingest-limits-frontend.enable-inet6\n    [enable_inet6: <boolean> | default = false]\n\n    # Duration to sleep for before exiting, to ensure metrics are scraped.\n    # CLI flag: -ingest-limits-frontend.final-sleep\n    [final_sleep: <duration> | default = 0s]\n\n    # File path where tokens are stored. If empty, tokens are not stored at\n    # shutdown and restored at startup.\n    # CLI flag: -ingest-limits-frontend.tokens-file-path\n    [tokens_file_path: <string> | default = \"\"]\n\n    # The availability zone where this instance is running.\n    # CLI flag: -ingest-limits-frontend.availability-zone\n    [availability_zone: <string> | default = \"\"]\n\n    # Unregister from the ring upon clean shutdown. It can be useful to disable\n    # for rolling restarts with consistent naming in conjunction with\n    # -distributor.extend-writes=false.\n    # CLI flag: -ingest-limits-frontend.unregister-on-shutdown\n    [unregister_on_shutdown: <boolean> | default = true]\n\n    # When enabled the readiness probe succeeds only after all instances are\n    # ACTIVE and healthy in the ring, otherwise only the instance itself is\n    # checked. This option should be disabled if in your cluster multiple\n    # instances can be rolled out simultaneously, otherwise rolling updates may\n    # be slowed down.\n    # CLI flag: -ingest-limits-frontend.readiness-check-ring-health\n    [readiness_check_ring_health: <boolean> | default = true]\n\n    # IP address to advertise in the ring.\n    # CLI flag: -ingest-limits-frontend.lifecycler.addr\n    [address: <string> | default = \"\"]\n\n    # port to advertise in consul (defaults to server.grpc-listen-port).\n    # CLI flag: -ingest-limits-frontend.lifecycler.port\n    [port: <int> | default = 0]\n\n    # ID to register in the ring.\n    # CLI flag: -ingest-limits-frontend.lifecycler.ID\n    [id: <string> | default = \"<hostname>\"]\n\n  # The number of partitions to use for the ring.\n  # CLI flag: -ingest-limits-frontend.num-partitions\n  [num_partitions: <int> | default = 64]\n\n  # The TTL for the assigned partitions cache. 0 disables the cache.\n  # CLI flag: -ingest-limits-frontend.assigned-partitions-cache-ttl\n  [assigned_partitions_cache_ttl: <duration> | default = 1m]\n\ningest_limits_frontend_client:\n  # Configures client gRPC connections to limits service.\n  # The CLI flags prefix for this block configuration is:\n  # ingest-limits-frontend-client\n  [grpc_client_config: <grpc_client>]\n\n  # Configures client gRPC connections pool to limits service.\n  pool_config:\n    # How frequently to clean up clients for ingest-limits-frontend that have\n    # gone away.\n    # CLI flag: -ingest-limits-frontend-client.client-cleanup-period\n    [client_cleanup_period: <duration> | default = 15s]\n\n    # Run a health check on each ingest-limits-frontend client during periodic\n    # cleanup.\n    # CLI flag: -ingest-limits-frontend-client.health-check-ingest-limits\n    [health_check_ingest_limits: <boolean> | default = true]\n\n    # Timeout for the health check.\n    # CLI flag: -ingest-limits-frontend-client.remote-timeout\n    [remote_timeout: <duration> | default = 1s]\n\n# Configuration for 'runtime config' module, responsible for reloading runtime\n# configuration file.\n[runtime_config: <runtime_config>]\n\n# These are values which allow you to control aspects of Loki's operation, most\n# commonly used for controlling types of higher verbosity logging, the values\n# here can be overridden in the `configs` section of the `runtime_config` file.\n[operational_config: <operational_config>]\n\n# Configuration for tracing.\n[tracing: <tracing>]\n\n# Configuration for analytics.\n[analytics: <analytics>]\n\n# Configuration for profiling options.\n[profiling: <profiling>]\n\n# List of limit fields to publish from the tenant limits endpoint. If empty, all\n# fields are returned. Use YAML field names (e.g., 'retention_period',\n# 'max_query_series').\n# CLI flag: -limits.tenant-limits-allow-publish\n[tenant_limits_allow_publish: <list of strings> | default = [discover_log_levels discover_service_name log_level_fields max_entries_limit_per_query max_line_size_truncate max_query_bytes_read max_query_length max_query_lookback max_query_range max_query_series metric_aggregation_enabled otlp_config pattern_persistence_enabled query_timeout retention_period retention_stream volume_enabled volume_max_series]]\n\n# Common configuration to be shared between multiple modules. If a more specific\n# configuration is given in other sections, the related configuration within\n# this section will be ignored.\n[common: <common>]\n\n# How long to wait between SIGTERM and shutdown. After receiving SIGTERM, Loki\n# will report 503 Service Unavailable status via /ready endpoint.\n# CLI flag: -shutdown-delay\n[shutdown_delay: <duration> | default = 0s]\n\n# Namespace of the metrics that in previous releases had cortex as namespace.\n# This setting is deprecated and will be removed in the next minor release.\n# CLI flag: -metrics-namespace\n[metrics_namespace: <string> | default = \"loki\"]\n```\n\n### alibabacloud_storage_config\n\nThe `alibabacloud_storage_config` block configures the connection to Alibaba Cloud Storage object storage backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n\u00a0\n\n```yaml\n# Name of OSS bucket.\n# CLI flag: -<prefix>.oss.bucketname\n[bucket: <string> | default = \"\"]\n\n# oss Endpoint to connect to.\n# CLI flag: -<prefix>.oss.endpoint\n[endpoint: <string> | default = \"\"]\n\n# alibabacloud Access Key ID\n# CLI flag: -<prefix>.oss.access-key-id\n[access_key_id: <string> | default = \"\"]\n\n# alibabacloud Secret Access Key\n# CLI flag: -<prefix>.oss.secret-access-key\n[secret_access_key: <string> | default = \"\"]\n\n# Connection timeout in seconds\n# CLI flag: -<prefix>.oss.conn-timeout-sec\n[conn_timeout_sec: <int> | default = 30]\n\n# Read/Write timeout in seconds\n# CLI flag: -<prefix>.oss.read-write-timeout-sec\n[read_write_timeout_sec: <int> | default = 60]\n```\n\n### analytics\n\nConfiguration for `analytics`.\n\n```yaml\n# Enable anonymous usage reporting.\n# CLI flag: -reporting.enabled\n[reporting_enabled: <boolean> | default = true]\n\n# URL to which reports are sent\n# CLI flag: -reporting.usage-stats-url\n[usage_stats_url: <string> | default = \"https://stats.grafana.org/loki-usage-report\"]\n\n# URL to the proxy server\n# CLI flag: -reporting.proxy-url\n[proxy_url: <string> | default = \"\"]\n\n# The TLS configuration.\n# The CLI flags prefix for this block configuration is: reporting.tls-config\n[tls_config: <tls_config>]\n```\n\n### attributes_config\n\nDefine actions for matching OpenTelemetry (OTEL) attributes.\n\n```yaml\n# Configures action to take on matching attributes. It allows one of\n# [structured_metadata, drop] for all attribute types. It additionally allows\n# index_label action for resource attributes\n[action: <string> | default = \"\"]\n\n# List of attributes to configure how to store them or drop them altogether\n[attributes: <list of strings>]\n\n# Regex to choose attributes to configure how to store them or drop them\n# altogether\n[regex: <Regexp>]\n```\n\n### aws_storage_config\n\nThe `aws_storage_config` block configures the connection to dynamoDB and S3 object storage. Either one of them or both can be configured.\n\n```yaml\n# Deprecated: Configures storing indexes in DynamoDB.\ndynamodb:\n  # DynamoDB endpoint URL with escaped Key and Secret encoded. If only region is\n  # specified as a host, proper endpoint will be deduced. Use\n  # inmemory:///<table-name> to use a mock in-memory implementation.\n  # CLI flag: -dynamodb.url\n  [dynamodb_url: <url>]\n\n  # DynamoDB table management requests per second limit.\n  # CLI flag: -dynamodb.api-limit\n  [api_limit: <float> | default = 2]\n\n  # DynamoDB rate cap to back off when throttled.\n  # CLI flag: -dynamodb.throttle-limit\n  [throttle_limit: <float> | default = 10]\n\n  metrics:\n    # Use metrics-based autoscaling, via this query URL\n    # CLI flag: -metrics.url\n    [url: <string> | default = \"\"]\n\n    # Queue length above which we will scale up capacity\n    # CLI flag: -metrics.target-queue-length\n    [target_queue_length: <int> | default = 100000]\n\n    # Scale up capacity by this multiple\n    # CLI flag: -metrics.scale-up-factor\n    [scale_up_factor: <float> | default = 1.3]\n\n    # Ignore throttling below this level (rate per second)\n    # CLI flag: -metrics.ignore-throttle-below\n    [ignore_throttle_below: <float> | default = 1]\n\n    # query to fetch ingester queue length\n    # CLI flag: -metrics.queue-length-query\n    [queue_length_query: <string> | default = \"sum(avg_over_time(loki_ingester_flush_queue_length{job=\\\"cortex/ingester\\\"}[2m])) or sum(avg_over_time(cortex_ingester_flush_queue_length{job=\\\"cortex/ingester\\\"}[2m]))\"]\n\n    # query to fetch throttle rates per table\n    # CLI flag: -metrics.write-throttle-query\n    [write_throttle_query: <string> | default = \"sum(rate(cortex_dynamo_throttled_total{operation=\\\"DynamoDB.BatchWriteItem\\\"}[1m])) by (table) > 0\"]\n\n    # query to fetch write capacity usage per table\n    # CLI flag: -metrics.usage-query\n    [write_usage_query: <string> | default = \"sum(rate(cortex_dynamo_consumed_capacity_total{operation=\\\"DynamoDB.BatchWriteItem\\\"}[15m])) by (table) > 0\"]\n\n    # query to fetch read capacity usage per table\n    # CLI flag: -metrics.read-usage-query\n    [read_usage_query: <string> | default = \"sum(rate(cortex_dynamo_consumed_capacity_total{operation=\\\"DynamoDB.QueryPages\\\"}[1h])) by (table) > 0\"]\n\n    # query to fetch read errors per table\n    # CLI flag: -metrics.read-error-query\n    [read_error_query: <string> | default = \"sum(increase(cortex_dynamo_failures_total{operation=\\\"DynamoDB.QueryPages\\\",error=\\\"ProvisionedThroughputExceededException\\\"}[1m])) by (table) > 0\"]\n\n  # Number of chunks to group together to parallelise fetches (zero to disable)\n  # CLI flag: -dynamodb.chunk-gang-size\n  [chunk_gang_size: <int> | default = 10]\n\n  # Max number of chunk-get operations to start in parallel\n  # CLI flag: -dynamodb.chunk.get-max-parallelism\n  [chunk_get_max_parallelism: <int> | default = 32]\n\n  backoff_config:\n    # Minimum backoff time\n    # CLI flag: -dynamodb.min-backoff\n    [min_period: <duration> | default = 100ms]\n\n    # Maximum backoff time\n    # CLI flag: -dynamodb.max-backoff\n    [max_period: <duration> | default = 50s]\n\n    # Maximum number of times to retry an operation\n    # CLI flag: -dynamodb.max-retries\n    [max_retries: <int> | default = 20]\n\n  # KMS key used for encrypting DynamoDB items.  DynamoDB will use an Amazon\n  # owned KMS key if not provided.\n  # CLI flag: -dynamodb.kms-key-id\n  [kms_key_id: <string> | default = \"\"]\n\n# The s3_storage_config block configures the connection to Amazon S3 object\n# storage backend.\n[<s3_storage_config>]\n```\n\n### azure_storage_config\n\nThe `azure_storage_config` block configures the connection to Azure object storage backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n\u00a0\n\n```yaml\n# Azure Cloud environment. Supported values are: AzureGlobal, AzureChinaCloud,\n# AzureGermanCloud, AzureUSGovernment.\n# CLI flag: -<prefix>.azure.environment\n[environment: <string> | default = \"AzureGlobal\"]\n\n# Azure storage account name.\n# CLI flag: -<prefix>.azure.account-name\n[account_name: <string> | default = \"\"]\n\n# Azure storage account key.\n# CLI flag: -<prefix>.azure.account-key\n[account_key: <string> | default = \"\"]\n\n# If `connection-string` is set, the values of `account-name` and\n# `endpoint-suffix` values will not be used. Use this method over `account-key`\n# if you need to authenticate via a SAS token. Or if you use the Azurite\n# emulator.\n# CLI flag: -<prefix>.azure.connection-string\n[connection_string: <string> | default = \"\"]\n\n# Name of the storage account blob container used to store chunks. This\n# container must be created before running cortex.\n# CLI flag: -<prefix>.azure.container-name\n[container_name: <string> | default = \"loki\"]\n\n# Azure active directory endpoint override. Use when the Azure SDK does not\n# support your environment.\n# CLI flag: -<prefix>.azure.active-directory-endpoint\n[active_directory_endpoint: <string> | default = \"\"]\n\n# Azure storage endpoint suffix without schema. The storage account name will be\n# prefixed to this value to create the FQDN.\n# CLI flag: -<prefix>.azure.endpoint-suffix\n[endpoint_suffix: <string> | default = \"\"]\n\n# Use Managed Identity to authenticate to the Azure storage account.\n# CLI flag: -<prefix>.azure.use-managed-identity\n[use_managed_identity: <boolean> | default = false]\n\n# Use Federated Token to authenticate to the Azure storage account.\n# CLI flag: -<prefix>.azure.use-federated-token\n[use_federated_token: <boolean> | default = false]\n\n# User assigned identity ID to authenticate to the Azure storage account.\n# CLI flag: -<prefix>.azure.user-assigned-id\n[user_assigned_id: <string> | default = \"\"]\n\n# Use Service Principal to authenticate through Azure OAuth.\n# CLI flag: -<prefix>.azure.use-service-principal\n[use_service_principal: <boolean> | default = false]\n\n# Azure Service Principal ID(GUID).\n# CLI flag: -<prefix>.azure.client-id\n[client_id: <string> | default = \"\"]\n\n# Azure Service Principal secret key.\n# CLI flag: -<prefix>.azure.client-secret\n[client_secret: <string> | default = \"\"]\n\n# Azure Tenant ID is used to authenticate through Azure OAuth.\n# CLI flag: -<prefix>.azure.tenant-id\n[tenant_id: <string> | default = \"\"]\n\n# Chunk delimiter for blob ID to be used\n# CLI flag: -<prefix>.azure.chunk-delimiter\n[chunk_delimiter: <string> | default = \"-\"]\n\n# Preallocated buffer size for downloads.\n# CLI flag: -<prefix>.azure.download-buffer-size\n[download_buffer_size: <int> | default = 512000]\n\n# Preallocated buffer size for uploads.\n# CLI flag: -<prefix>.azure.upload-buffer-size\n[upload_buffer_size: <int> | default = 256000]\n\n# Number of buffers used to used to upload a chunk.\n# CLI flag: -<prefix>.azure.download-buffer-count\n[upload_buffer_count: <int> | default = 1]\n\n# Timeout for requests made against azure blob storage.\n# CLI flag: -<prefix>.azure.request-timeout\n[request_timeout: <duration> | default = 30s]\n\n# Number of retries for a request which times out.\n# CLI flag: -<prefix>.azure.max-retries\n[max_retries: <int> | default = 5]\n\n# Minimum time to wait before retrying a request.\n# CLI flag: -<prefix>.azure.min-retry-delay\n[min_retry_delay: <duration> | default = 10ms]\n\n# Maximum time to wait before retrying a request.\n# CLI flag: -<prefix>.azure.max-retry-delay\n[max_retry_delay: <duration> | default = 500ms]\n```\n\n### bloom_build\n\nExperimental: The `bloom_build` block configures the Loki bloom planner and builder servers, responsible for building bloom filters.\n\n```yaml\n# Flag to enable or disable the usage of the bloom-planner and bloom-builder\n# components.\n# CLI flag: -bloom-build.enabled\n[enabled: <boolean> | default = false]\n\nplanner:\n  # Interval at which to re-run the bloom creation planning.\n  # CLI flag: -bloom-build.planner.interval\n  [planning_interval: <duration> | default = 8h]\n\n  # Newest day-table offset (from today, inclusive) to build blooms for. 0 start\n  # building from today, 1 from yesterday and so on. Increase to lower cost by\n  # not re-writing data to object storage too frequently since recent data\n  # changes more often at the cost of not having blooms available as quickly.\n  # CLI flag: -bloom-build.planner.min-table-offset\n  [min_table_offset: <int> | default = 0]\n\n  # Oldest day-table offset (from today, inclusive) to build blooms for. 1 till\n  # yesterday, 2 till day before yesterday and so on. This can be used to lower\n  # cost by not trying to build blooms for older data which doesn't change. This\n  # can be optimized by aligning it with the maximum\n  # `reject_old_samples_max_age` setting of any tenant.\n  # CLI flag: -bloom-build.planner.max-table-offset\n  [max_table_offset: <int> | default = 1]\n\n  retention:\n    # Enable bloom retention.\n    # CLI flag: -bloom-build.planner.retention.enabled\n    [enabled: <boolean> | default = false]\n\n  queue:\n    # Maximum number of tasks to queue per tenant.\n    # CLI flag: -bloom-build.planner.queue.max-tasks-per-tenant\n    [max_queued_tasks_per_tenant: <int> | default = 30000]\n\n    # Whether to store tasks on disk.\n    # CLI flag: -bloom-build.planner.queue.store-tasks-on-disk\n    [store_tasks_on_disk: <boolean> | default = false]\n\n    # Directory to store tasks on disk.\n    # CLI flag: -bloom-build.planner.queue.tasks-disk-directory\n    [tasks_disk_directory: <string> | default = \"/tmp/bloom-planner-queue\"]\n\n    # Whether to clean the tasks directory on startup.\n    # CLI flag: -bloom-build.planner.queue.clean-tasks-directory\n    [clean_tasks_directory: <boolean> | default = false]\n\nbuilder:\n  # The grpc_client block configures the gRPC client used to communicate between\n  # a client and server component in Loki.\n  # The CLI flags prefix for this block configuration is:\n  # bloom-build.builder.grpc\n  [grpc_config: <grpc_client>]\n\n  # Hostname (and port) of the bloom planner\n  # CLI flag: -bloom-build.builder.planner-address\n  [planner_address: <string> | default = \"\"]\n\n  backoff_config:\n    # Minimum delay when backing off.\n    # CLI flag: -bloom-build.builder.backoff.backoff-min-period\n    [min_period: <duration> | default = 100ms]\n\n    # Maximum delay when backing off.\n    # CLI flag: -bloom-build.builder.backoff.backoff-max-period\n    [max_period: <duration> | default = 10s]\n\n    # Number of times to backoff and retry before failing.\n    # CLI flag: -bloom-build.builder.backoff.backoff-retries\n    [max_retries: <int> | default = 10]\n```\n\n### bloom_gateway\n\nExperimental: The `bloom_gateway` block configures the Loki bloom gateway server, responsible for serving queries for filtering chunks based on filter expressions.\n\n```yaml\n# Flag to enable or disable the bloom gateway component globally.\n# CLI flag: -bloom-gateway.enabled\n[enabled: <boolean> | default = false]\n\nclient:\n  # Configures the behavior of the connection pool.\n  pool_config:\n    # How frequently to update the list of servers.\n    # CLI flag: -bloom-gateway-client.pool.check-interval\n    [check_interval: <duration> | default = 15s]\n\n  # The grpc_client block configures the gRPC client used to communicate between\n  # a client and server component in Loki.\n  # The CLI flags prefix for this block configuration is:\n  # bloom-gateway-client.grpc\n  [grpc_client_config: <grpc_client>]\n\n  # Comma separated addresses list in DNS Service Discovery format:\n  # https://grafana.com/docs/mimir/latest/configure/about-dns-service-discovery/#supported-discovery-modes\n  # CLI flag: -bloom-gateway-client.addresses\n  [addresses: <string> | default = \"\"]\n\n# Number of workers to use for filtering chunks concurrently. Usually set to 1x\n# number of CPU cores.\n# CLI flag: -bloom-gateway.worker-concurrency\n[worker_concurrency: <int> | default = 4]\n\n# Number of blocks processed concurrently on a single worker. Usually set to 2x\n# number of CPU cores.\n# CLI flag: -bloom-gateway.block-query-concurrency\n[block_query_concurrency: <int> | default = 8]\n\n# Maximum number of outstanding tasks per tenant.\n# CLI flag: -bloom-gateway.max-outstanding-per-tenant\n[max_outstanding_per_tenant: <int> | default = 1024]\n\n# How many tasks are multiplexed at once.\n# CLI flag: -bloom-gateway.num-multiplex-tasks\n[num_multiplex_tasks: <int> | default = 512]\n```\n\n### bos_storage_config\n\nThe `bos_storage_config` block configures the connection to Baidu Object Storage (BOS) object storage backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n\u00a0\n\n```yaml\n# Name of BOS bucket.\n# CLI flag: -<prefix>.bos.bucket-name\n[bucket_name: <string> | default = \"\"]\n\n# BOS endpoint to connect to.\n# CLI flag: -<prefix>.bos.endpoint\n[endpoint: <string> | default = \"bj.bcebos.com\"]\n\n# Baidu Cloud Engine (BCE) Access Key ID.\n# CLI flag: -<prefix>.bos.access-key-id\n[access_key_id: <string> | default = \"\"]\n\n# Baidu Cloud Engine (BCE) Secret Access Key.\n# CLI flag: -<prefix>.bos.secret-access-key\n[secret_access_key: <string> | default = \"\"]\n```\n\n### cache_config\n\nThe `cache_config` block configures the cache backend for a specific Loki component. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `bloom.metas-cache`\n- `frontend`\n- `frontend.index-stats-results-cache`\n- `frontend.instant-metric-results-cache`\n- `frontend.label-results-cache`\n- `frontend.series-results-cache`\n- `frontend.volume-results-cache`\n- `store.chunks-cache`\n- `store.chunks-cache-l2`\n- `store.index-cache-read`\n- `store.index-cache-write`\n\n\u00a0\n\n```yaml\n# The default validity of entries for caches unless overridden.\n# CLI flag: -<prefix>.default-validity\n[default_validity: <duration> | default = 1h]\n\nbackground:\n  # At what concurrency to write back to cache.\n  # CLI flag: -<prefix>.background.write-back-concurrency\n  [writeback_goroutines: <int> | default = 1]\n\n  # How many key batches to buffer for background write-back. Default is large\n  # to prefer size based limiting.\n  # CLI flag: -<prefix>.background.write-back-buffer\n  [writeback_buffer: <int> | default = 500000]\n\n  # Size limit in bytes for background write-back.\n  # CLI flag: -<prefix>.background.write-back-size-limit\n  [writeback_size_limit: <int> | default = 500MB]\n\nmemcached:\n  # How long keys stay in the memcache.\n  # CLI flag: -<prefix>.memcached.expiration\n  [expiration: <duration> | default = 0s]\n\n  # How many keys to fetch in each batch.\n  # CLI flag: -<prefix>.memcached.batchsize\n  [batch_size: <int> | default = 4]\n\n  # Maximum active requests to memcache.\n  # CLI flag: -<prefix>.memcached.parallelism\n  [parallelism: <int> | default = 5]\n\nmemcached_client:\n  # Hostname for memcached service to use. If empty and if addresses is unset,\n  # no memcached will be used.\n  # CLI flag: -<prefix>.memcached.hostname\n  [host: <string> | default = \"\"]\n\n  # SRV service used to discover memcache servers.\n  # CLI flag: -<prefix>.memcached.service\n  [service: <string> | default = \"memcached\"]\n\n  # Comma separated addresses list in DNS Service Discovery format:\n  # https://grafana.com/docs/mimir/latest/configure/about-dns-service-discovery/#supported-discovery-modes\n  # CLI flag: -<prefix>.memcached.addresses\n  [addresses: <string> | default = \"\"]\n\n  # Maximum time to wait before giving up on memcached requests.\n  # CLI flag: -<prefix>.memcached.timeout\n  [timeout: <duration> | default = 100ms]\n\n  # Maximum number of idle connections in pool.\n  # CLI flag: -<prefix>.memcached.max-idle-conns\n  [max_idle_conns: <int> | default = 16]\n\n  # The maximum size of an item stored in memcached. Bigger items are not\n  # stored. If set to 0, no maximum size is enforced.\n  # CLI flag: -<prefix>.memcached.max-item-size\n  [max_item_size: <int> | default = 0]\n\n  # Period with which to poll DNS for memcache servers.\n  # CLI flag: -<prefix>.memcached.update-interval\n  [update_interval: <duration> | default = 1m]\n\n  # Use consistent hashing to distribute to memcache servers.\n  # CLI flag: -<prefix>.memcached.consistent-hash\n  [consistent_hash: <boolean> | default = true]\n\n  # Trip circuit-breaker after this number of consecutive dial failures (if zero\n  # then circuit-breaker is disabled).\n  # CLI flag: -<prefix>.memcached.circuit-breaker-consecutive-failures\n  [circuit_breaker_consecutive_failures: <int> | default = 10]\n\n  # Duration circuit-breaker remains open after tripping (if zero then 60\n  # seconds is used).\n  # CLI flag: -<prefix>.memcached.circuit-breaker-timeout\n  [circuit_breaker_timeout: <duration> | default = 10s]\n\n  # Reset circuit-breaker counts after this long (if zero then never reset).\n  # CLI flag: -<prefix>.memcached.circuit-breaker-interval\n  [circuit_breaker_interval: <duration> | default = 10s]\n\n  # Enable connecting to Memcached with TLS.\n  # CLI flag: -<prefix>.memcached.tls-enabled\n  [tls_enabled: <boolean> | default = false]\n\n  # The TLS configuration.\n  # The CLI flags prefix for this block configuration is:\n  # store.index-cache-write.memcached\n  [<tls_config>]\n\nredis:\n  # Redis Server or Cluster configuration endpoint to use for caching. A\n  # comma-separated list of endpoints for Redis Cluster or Redis Sentinel. If\n  # empty, no redis will be used.\n  # CLI flag: -<prefix>.redis.endpoint\n  [endpoint: <string> | default = \"\"]\n\n  # Redis Sentinel master name. An empty string for Redis Server or Redis\n  # Cluster.\n  # CLI flag: -<prefix>.redis.master-name\n  [master_name: <string> | default = \"\"]\n\n  # Maximum time to wait before giving up on redis requests.\n  # CLI flag: -<prefix>.redis.timeout\n  [timeout: <duration> | default = 500ms]\n\n  # How long keys stay in the redis.\n  # CLI flag: -<prefix>.redis.expiration\n  [expiration: <duration> | default = 0s]\n\n  # Database index.\n  # CLI flag: -<prefix>.redis.db\n  [db: <int> | default = 0]\n\n  # Maximum number of connections in the pool.\n  # CLI flag: -<prefix>.redis.pool-size\n  [pool_size: <int> | default = 0]\n\n  # Username to use when connecting to redis.\n  # CLI flag: -<prefix>.redis.username\n  [username: <string> | default = \"\"]\n\n  # Password to use when connecting to redis.\n  # CLI flag: -<prefix>.redis.password\n  [password: <string> | default = \"\"]\n\n  # Enable connecting to redis with TLS.\n  # CLI flag: -<prefix>.redis.tls-enabled\n  [tls_enabled: <boolean> | default = false]\n\n  # Skip validating server certificate.\n  # CLI flag: -<prefix>.redis.tls-insecure-skip-verify\n  [tls_insecure_skip_verify: <boolean> | default = false]\n\n  # Close connections after remaining idle for this duration. If the value is\n  # zero, then idle connections are not closed.\n  # CLI flag: -<prefix>.redis.idle-timeout\n  [idle_timeout: <duration> | default = 0s]\n\n  # Close connections older than this duration. If the value is zero, then the\n  # pool does not close connections based on age.\n  # CLI flag: -<prefix>.redis.max-connection-age\n  [max_connection_age: <duration> | default = 0s]\n\n  # By default, the Redis client only reads from the master node. Enabling this\n  # option can lower pressure on the master node by randomly routing read-only\n  # commands to the master and any available replicas.\n  # CLI flag: -<prefix>.redis.route-randomly\n  [route_randomly: <boolean> | default = false]\n\nembedded_cache:\n  # Whether embedded cache is enabled.\n  # CLI flag: -<prefix>.embedded-cache.enabled\n  [enabled: <boolean> | default = false]\n\n  # Maximum memory size of the cache in MB.\n  # CLI flag: -<prefix>.embedded-cache.max-size-mb\n  [max_size_mb: <int> | default = 100]\n\n  # Maximum number of entries in the cache.\n  # CLI flag: -<prefix>.embedded-cache.max-size-items\n  [max_size_items: <int> | default = 0]\n\n  # The time to live for items in the cache before they get purged.\n  # CLI flag: -<prefix>.embedded-cache.ttl\n  [ttl: <duration> | default = 1h]\n```\n\n### chunk_store_config\n\nThe `chunk_store_config` block configures how chunks will be cached and how long to wait before saving them to the backing store.\n\n```yaml\n# The cache_config block configures the cache backend for a specific Loki\n# component.\n# The CLI flags prefix for this block configuration is: store.chunks-cache\n[chunk_cache_config: <cache_config>]\n\n# The cache_config block configures the cache backend for a specific Loki\n# component.\n# The CLI flags prefix for this block configuration is: store.chunks-cache-l2\n[chunk_cache_config_l2: <cache_config>]\n\n# Write dedupe cache is deprecated along with legacy index types (aws,\n# aws-dynamo, bigtable, bigtable-hashed, cassandra, gcp, gcp-columnkey,\n# grpc-store).\n# Consider using TSDB index which does not require a write dedupe cache.\n# The CLI flags prefix for this block configuration is: store.index-cache-write\n[write_dedupe_cache_config: <cache_config>]\n\n# Chunks fetched from queriers before this duration will not be written to the\n# cache. A value of 0 will write all chunks to the cache\n# CLI flag: -store.skip-query-writeback-older-than\n[skip_query_writeback_cache_older_than: <duration> | default = 0s]\n\n# Chunks will be handed off to the L2 cache after this duration. 0 to disable L2\n# cache.\n# CLI flag: -store.chunks-cache-l2.handoff\n[l2_chunk_cache_handoff: <duration> | default = 0s]\n\n# Cache index entries older than this period. 0 to disable.\n# CLI flag: -store.cache-lookups-older-than\n[cache_lookups_older_than: <duration> | default = 0s]\n```\n\n### common\n\nCommon configuration to be shared between multiple modules. If a more specific configuration is given in other sections, the related configuration within this section will be ignored.\n\n```yaml\n# prefix for the path\n# CLI flag: -common.path-prefix\n[path_prefix: <string> | default = \"\"]\n\nstorage:\n  # The s3_storage_config block configures the connection to Amazon S3 object\n  # storage backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [s3: <s3_storage_config>]\n\n  # The gcs_storage_config block configures the connection to Google Cloud\n  # Storage object storage backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [gcs: <gcs_storage_config>]\n\n  # The azure_storage_config block configures the connection to Azure object\n  # storage backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [azure: <azure_storage_config>]\n\n  # The alibabacloud_storage_config block configures the connection to Alibaba\n  # Cloud Storage object storage backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [alibabacloud: <alibabacloud_storage_config>]\n\n  # The bos_storage_config block configures the connection to Baidu Object\n  # Storage (BOS) object storage backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [bos: <bos_storage_config>]\n\n  # The swift_storage_config block configures the connection to OpenStack Object\n  # Storage (Swift) object storage backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [swift: <swift_storage_config>]\n\n  filesystem:\n    # Directory to store chunks in.\n    # CLI flag: -common.storage.filesystem.chunk-directory\n    [chunks_directory: <string> | default = \"\"]\n\n    # Directory to store rules in.\n    # CLI flag: -common.storage.filesystem.rules-directory\n    [rules_directory: <string> | default = \"\"]\n\n  hedging:\n    # If set to a non-zero value a second request will be issued at the provided\n    # duration. Default is 0 (disabled)\n    # CLI flag: -common.storage.hedge-requests-at\n    [at: <duration> | default = 0s]\n\n    # The maximum of hedge requests allowed.\n    # CLI flag: -common.storage.hedge-requests-up-to\n    [up_to: <int> | default = 2]\n\n    # The maximum of hedge requests allowed per seconds.\n    # CLI flag: -common.storage.hedge-max-per-second\n    [max_per_second: <int> | default = 5]\n\n  # The cos_storage_config block configures the connection to IBM Cloud Object\n  # Storage (COS) backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [cos: <cos_storage_config>]\n\n  congestion_control:\n    # Use storage congestion control (default: disabled).\n    # CLI flag: -common.storage.congestion-control.enabled\n    [enabled: <boolean> | default = false]\n\n    controller:\n      # Congestion control strategy to use (default: none, options: 'aimd').\n      # CLI flag: -common.storage.congestion-control.strategy\n      [strategy: <string> | default = \"\"]\n\n      aimd:\n        # AIMD starting throughput window size: how many requests can be sent\n        # per second (default: 2000).\n        # CLI flag: -common.storage.congestion-control.strategy.aimd.start\n        [start: <int> | default = 2000]\n\n        # AIMD maximum throughput window size: upper limit of requests sent per\n        # second (default: 10000).\n        # CLI flag: -common.storage.congestion-control.strategy.aimd.upper-bound\n        [upper_bound: <int> | default = 10000]\n\n        # AIMD backoff factor when upstream service is throttled to decrease\n        # number of requests sent per second (default: 0.5).\n        # CLI flag: -common.storage.congestion-control.strategy.aimd.backoff-factor\n        [backoff_factor: <float> | default = 0.5]\n\n    retry:\n      # Congestion control retry strategy to use (default: none, options:\n      # 'limited').\n      # CLI flag: -common.storage.congestion-control.retry.strategy\n      [strategy: <string> | default = \"\"]\n\n      # Maximum number of retries allowed.\n      # CLI flag: -common.storage.congestion-control.retry.strategy.limited.limit\n      [limit: <int> | default = 2]\n\n    hedging:\n      config:\n        [at: <duration>]\n\n        [up_to: <int>]\n\n        [max_per_second: <int>]\n\n      # Congestion control hedge strategy to use (default: none, options:\n      # 'limited').\n      # CLI flag: -common.storage.congestion-control.hedge.strategy\n      [strategy: <string> | default = \"\"]\n\n  # The thanos_object_store_config block configures the connection to object\n  # storage backend using thanos-io/objstore clients. This will become the\n  # default way of configuring object store clients in future releases.\n  # Currently this is opt-in and takes effect only when `-use-thanos-objstore`\n  # is set to true.\n  # The CLI flags prefix for this block configuration is:\n  # common.storage.object-store\n  [object_store: <thanos_object_store_config>]\n\n[persist_tokens: <boolean>]\n\n[replication_factor: <int>]\n\nring:\n  kvstore:\n    # Backend storage to use for the ring. Supported values are: consul, etcd,\n    # inmemory, memberlist, multi.\n    # CLI flag: -common.storage.ring.store\n    [store: <string> | default = \"consul\"]\n\n    # The prefix for the keys in the store. Should end with a /.\n    # CLI flag: -common.storage.ring.prefix\n    [prefix: <string> | default = \"collectors/\"]\n\n    # Configuration for a Consul client. Only applies if the selected kvstore is\n    # consul.\n    # The CLI flags prefix for this block configuration is: common.storage.ring\n    [consul: <consul>]\n\n    # Configuration for an ETCD v3 client. Only applies if the selected kvstore\n    # is etcd.\n    # The CLI flags prefix for this block configuration is: common.storage.ring\n    [etcd: <etcd>]\n\n    multi:\n      # Primary backend storage used by multi-client.\n      # CLI flag: -common.storage.ring.multi.primary\n      [primary: <string> | default = \"\"]\n\n      # Secondary backend storage used by multi-client.\n      # CLI flag: -common.storage.ring.multi.secondary\n      [secondary: <string> | default = \"\"]\n\n      # Mirror writes to the secondary store.\n      # CLI flag: -common.storage.ring.multi.mirror-enabled\n      [mirror_enabled: <boolean> | default = false]\n\n      # Timeout for storing a value to the secondary store.\n      # CLI flag: -common.storage.ring.multi.mirror-timeout\n      [mirror_timeout: <duration> | default = 2s]\n\n  # Period at which to heartbeat to the ring.\n  # CLI flag: -common.storage.ring.heartbeat-period\n  [heartbeat_period: <duration> | default = 15s]\n\n  # The heartbeat timeout after which compactors are considered unhealthy within\n  # the ring. 0 = never (timeout disabled).\n  # CLI flag: -common.storage.ring.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # File path where tokens are stored. If empty, tokens are not stored at\n  # shutdown and restored at startup.\n  # CLI flag: -common.storage.ring.tokens-file-path\n  [tokens_file_path: <string> | default = \"\"]\n\n  # True to enable zone-awareness and replicate blocks across different\n  # availability zones.\n  # CLI flag: -common.storage.ring.zone-awareness-enabled\n  [zone_awareness_enabled: <boolean> | default = false]\n\n  # Number of tokens to own in the ring.\n  # CLI flag: -common.storage.ring.num-tokens\n  [num_tokens: <int> | default = 128]\n\n  # Factor for data replication.\n  # CLI flag: -common.storage.ring.replication-factor\n  [replication_factor: <int> | default = 3]\n\n  # Instance ID to register in the ring.\n  # CLI flag: -common.storage.ring.instance-id\n  [instance_id: <string> | default = \"<hostname>\"]\n\n  # Name of network interface to read address from.\n  # CLI flag: -common.storage.ring.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # Port to advertise in the ring (defaults to server.grpc-listen-port).\n  # CLI flag: -common.storage.ring.instance-port\n  [instance_port: <int> | default = 0]\n\n  # IP address to advertise in the ring.\n  # CLI flag: -common.storage.ring.instance-addr\n  [instance_addr: <string> | default = \"\"]\n\n  # The availability zone where this instance is running. Required if\n  # zone-awareness is enabled.\n  # CLI flag: -common.storage.ring.instance-availability-zone\n  [instance_availability_zone: <string> | default = \"\"]\n\n  # Enable using a IPv6 instance address.\n  # CLI flag: -common.storage.ring.instance-enable-ipv6\n  [instance_enable_ipv6: <boolean> | default = false]\n\n[instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n[instance_addr: <string> | default = \"\"]\n\n# the http address of the compactor in the form http://host:port\n# CLI flag: -common.compactor-address\n[compactor_address: <string> | default = \"\"]\n\n# the grpc address of the compactor in the form host:port\n# CLI flag: -common.compactor-grpc-address\n[compactor_grpc_address: <string> | default = \"\"]\n\n# Experimental: path to use for temporary data, where scratch data is supported.\n# CLI flag: -common.scratch-path\n[scratch_path: <string> | default = \"\"]\n```\n\n### compactor\n\nThe `compactor` block configures the compactor component, which compacts index shards for performance.\n\n```yaml\n# Directory where files can be downloaded for compaction.\n# CLI flag: -compactor.working-directory\n[working_directory: <string> | default = \"/var/loki/compactor\"]\n\n# Interval at which to re-run the compaction operation.\n# CLI flag: -compactor.compaction-interval\n[compaction_interval: <duration> | default = 10m]\n\n# Interval at which to apply/enforce retention. 0 means run at same interval as\n# compaction. If non-zero, it should always be a multiple of compaction\n# interval.\n# CLI flag: -compactor.apply-retention-interval\n[apply_retention_interval: <duration> | default = 0s]\n\n# Activate custom (per-stream,per-tenant) retention.\n# CLI flag: -compactor.retention-enabled\n[retention_enabled: <boolean> | default = false]\n\n# Delay after which chunks will be fully deleted during retention.\n# CLI flag: -compactor.retention-delete-delay\n[retention_delete_delay: <duration> | default = 2h]\n\n# The total amount of worker to use to delete chunks.\n# CLI flag: -compactor.retention-delete-worker-count\n[retention_delete_worker_count: <int> | default = 150]\n\n# The maximum amount of time to spend running retention and deletion on any\n# given table in the index.\n# CLI flag: -compactor.retention-table-timeout\n[retention_table_timeout: <duration> | default = 0s]\n\nretention_backoff_config:\n  # Minimum delay when backing off.\n  # CLI flag: -compactor.retention-backoff-config.backoff-min-period\n  [min_period: <duration> | default = 100ms]\n\n  # Maximum delay when backing off.\n  # CLI flag: -compactor.retention-backoff-config.backoff-max-period\n  [max_period: <duration> | default = 10s]\n\n  # Number of times to backoff and retry before failing.\n  # CLI flag: -compactor.retention-backoff-config.backoff-retries\n  [max_retries: <int> | default = 10]\n\n# Store used for managing delete requests.\n# CLI flag: -compactor.delete-request-store\n[delete_request_store: <string> | default = \"\"]\n\n# Path prefix for storing delete requests.\n# CLI flag: -compactor.delete-request-store.key-prefix\n[delete_request_store_key_prefix: <string> | default = \"index/\"]\n\n# Type of DB to use for storing delete requests. Supported types: boltdb, sqlite\n# CLI flag: -compactor.delete-request-store.db-type\n[delete_request_store_db_type: <string> | default = \"boltdb\"]\n\n# Type of DB to use as backup for storing delete requests. Backup DB should\n# ideally be used while migrating from one DB type to another. Supported\n# type(s): boltdb\n# CLI flag: -compactor.delete-request-store.backup-db-type\n[backup_delete_request_store_db_type: <string> | default = \"\"]\n\n# The max number of delete requests to run per compaction cycle.\n# CLI flag: -compactor.delete-batch-size\n[delete_batch_size: <int> | default = 70]\n\n# Allow cancellation of delete request until duration after they are created.\n# Data would be deleted only after delete requests have been older than this\n# duration. Ideally this should be set to at least 24h.\n# CLI flag: -compactor.delete-request-cancel-period\n[delete_request_cancel_period: <duration> | default = 24h]\n\n# Constrain the size of any single delete request with line filters. When a\n# delete request > delete_max_interval is input, the request is sharded into\n# smaller requests of no more than delete_max_interval\n# CLI flag: -compactor.delete-max-interval\n[delete_max_interval: <duration> | default = 24h]\n\n# Maximum number of tables to compact in parallel. While increasing this value,\n# please make sure compactor has enough disk space allocated to be able to store\n# and compact as many tables.\n# CLI flag: -compactor.max-compaction-parallelism\n[max_compaction_parallelism: <int> | default = 1]\n\n# Number of upload/remove operations to execute in parallel when finalizing a\n# compaction. NOTE: This setting is per compaction operation, which can be\n# executed in parallel. The upper bound on the number of concurrent uploads is\n# upload_parallelism * max_compaction_parallelism.\n# CLI flag: -compactor.upload-parallelism\n[upload_parallelism: <int> | default = 10]\n\n# The hash ring configuration used by compactors to elect a single instance for\n# running compactions. The CLI flags prefix for this block config is:\n# compactor.ring\ncompactor_ring:\n  kvstore:\n    # Backend storage to use for the ring. Supported values are: consul, etcd,\n    # inmemory, memberlist, multi.\n    # CLI flag: -compactor.ring.store\n    [store: <string> | default = \"consul\"]\n\n    # The prefix for the keys in the store. Should end with a /.\n    # CLI flag: -compactor.ring.prefix\n    [prefix: <string> | default = \"collectors/\"]\n\n    # Configuration for a Consul client. Only applies if the selected kvstore is\n    # consul.\n    # The CLI flags prefix for this block configuration is: compactor.ring\n    [consul: <consul>]\n\n    # Configuration for an ETCD v3 client. Only applies if the selected kvstore\n    # is etcd.\n    # The CLI flags prefix for this block configuration is: compactor.ring\n    [etcd: <etcd>]\n\n    multi:\n      # Primary backend storage used by multi-client.\n      # CLI flag: -compactor.ring.multi.primary\n      [primary: <string> | default = \"\"]\n\n      # Secondary backend storage used by multi-client.\n      # CLI flag: -compactor.ring.multi.secondary\n      [secondary: <string> | default = \"\"]\n\n      # Mirror writes to the secondary store.\n      # CLI flag: -compactor.ring.multi.mirror-enabled\n      [mirror_enabled: <boolean> | default = false]\n\n      # Timeout for storing a value to the secondary store.\n      # CLI flag: -compactor.ring.multi.mirror-timeout\n      [mirror_timeout: <duration> | default = 2s]\n\n  # Period at which to heartbeat to the ring.\n  # CLI flag: -compactor.ring.heartbeat-period\n  [heartbeat_period: <duration> | default = 15s]\n\n  # The heartbeat timeout after which compactors are considered unhealthy within\n  # the ring. 0 = never (timeout disabled).\n  # CLI flag: -compactor.ring.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # File path where tokens are stored. If empty, tokens are not stored at\n  # shutdown and restored at startup.\n  # CLI flag: -compactor.ring.tokens-file-path\n  [tokens_file_path: <string> | default = \"\"]\n\n  # True to enable zone-awareness and replicate blocks across different\n  # availability zones.\n  # CLI flag: -compactor.ring.zone-awareness-enabled\n  [zone_awareness_enabled: <boolean> | default = false]\n\n  # Instance ID to register in the ring.\n  # CLI flag: -compactor.ring.instance-id\n  [instance_id: <string> | default = \"<hostname>\"]\n\n  # Name of network interface to read address from.\n  # CLI flag: -compactor.ring.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # Port to advertise in the ring (defaults to server.grpc-listen-port).\n  # CLI flag: -compactor.ring.instance-port\n  [instance_port: <int> | default = 0]\n\n  # IP address to advertise in the ring.\n  # CLI flag: -compactor.ring.instance-addr\n  [instance_addr: <string> | default = \"\"]\n\n  # The availability zone where this instance is running. Required if\n  # zone-awareness is enabled.\n  # CLI flag: -compactor.ring.instance-availability-zone\n  [instance_availability_zone: <string> | default = \"\"]\n\n  # Enable using a IPv6 instance address.\n  # CLI flag: -compactor.ring.instance-enable-ipv6\n  [instance_enable_ipv6: <boolean> | default = false]\n\n# Number of tables that compactor will try to compact. Newer tables are chosen\n# when this is less than the number of tables available.\n# CLI flag: -compactor.tables-to-compact\n[tables_to_compact: <int> | default = 0]\n\n# Do not compact N latest tables. Together with -compactor.run-once and\n# -compactor.tables-to-compact, this is useful when clearing compactor backlogs.\n# CLI flag: -compactor.skip-latest-n-tables\n[skip_latest_n_tables: <int> | default = 0]\n\n# Experimental: Configuration to turn on and run horizontally scalable\n# compactor. Supported modes - [disabled]: Keeps the horizontal scaling mode\n# disabled. Locally runs all the functions of the compactor.[main]: Runs all\n# functions of the compactor. Distributes work to workers where\n# possible.[worker]: Runs the compactor in worker mode, only working on jobs\n# built by the main compactor.\n# CLI flag: -compactor.horizontal-scaling-mode\n[horizontal_scaling_mode: <string> | default = \"disabled\"]\n\nworker_config:\n  # Number of sub-workers to run for concurrent processing of jobs.\n  # CLI flag: -compactor.worker.num-sub-workers\n  [num_sub_workers: <int> | default = 4]\n\njobs_config:\n  deletion:\n    # Object storage path prefix for storing deletion manifests.\n    # CLI flag: -compactor.jobs.deletion.deletion-manifest-store-prefix\n    [deletion_manifest_store_prefix: <string> | default = \"__deletion_manifest__/\"]\n\n    # Maximum number of chunks to process concurrently in each worker.\n    # CLI flag: -compactor.jobs.deletion.chunk-processing-concurrency\n    [chunk_processing_concurrency: <int> | default = 3]\n\n    # Maximum time to wait for a job before considering it failed and retrying.\n    # CLI flag: -compactor.jobs.deletion.timeout\n    [timeout: <duration> | default = 15m]\n\n    # Maximum number of times to retry a failed or timed out job.\n    # CLI flag: -compactor.jobs.deletion.max-retries\n    [max_retries: <int> | default = 3]\n\n# Object storage path prefix for storing deletion markers. The prefix must end\n# with a forward slash(/). Leave empty to continue to store deletion markers on\n# the local disk.\n# CLI flag: -compactor.deletion-marker-object-store-prefix\n[deletion_marker_object_store_prefix: <string> | default = \"\"]\n```\n\n### consul\n\nConfiguration for a Consul client. Only applies if the selected kvstore is `consul`. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage.ring`\n- `compactor.ring`\n- `dataobj-consumer`\n- `dataobj-consumer.partition-ring`\n- `distributor.ring`\n- `index-gateway.ring`\n- `ingest-limits`\n- `ingest-limits-frontend`\n- `ingester.partition-ring`\n- `pattern-ingester`\n- `query-scheduler.ring`\n- `ruler.ring`\n- `ui.ring`\n\n\u00a0\n\n```yaml\n# Hostname and port of Consul.\n# CLI flag: -<prefix>.consul.hostname\n[host: <string> | default = \"localhost:8500\"]\n\n# ACL Token used to interact with Consul.\n# CLI flag: -<prefix>.consul.acl-token\n[acl_token: <string> | default = \"\"]\n\n# HTTP timeout when talking to Consul\n# CLI flag: -<prefix>.consul.client-timeout\n[http_client_timeout: <duration> | default = 20s]\n\n# Enable consistent reads to Consul.\n# CLI flag: -<prefix>.consul.consistent-reads\n[consistent_reads: <boolean> | default = false]\n\n# Rate limit when watching key or prefix in Consul, in requests per second. 0\n# disables the rate limit.\n# CLI flag: -<prefix>.consul.watch-rate-limit\n[watch_rate_limit: <float> | default = 1]\n\n# Burst size used in rate limit. Values less than 1 are treated as 1.\n# CLI flag: -<prefix>.consul.watch-burst-size\n[watch_burst_size: <int> | default = 1]\n\n# Maximum duration to wait before retrying a Compare And Swap (CAS) operation.\n# CLI flag: -<prefix>.consul.cas-retry-delay\n[cas_retry_delay: <duration> | default = 1s]\n```\n\n### cos_storage_config\n\nThe `cos_storage_config` block configures the connection to IBM Cloud Object Storage (COS) backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n\u00a0\n\n```yaml\n# Set this to `true` to force the request to use path-style addressing.\n# CLI flag: -<prefix>.cos.force-path-style\n[forcepathstyle: <boolean> | default = false]\n\n# Comma separated list of bucket names to evenly distribute chunks over.\n# CLI flag: -<prefix>.cos.buckets\n[bucketnames: <string> | default = \"\"]\n\n# COS Endpoint to connect to.\n# CLI flag: -<prefix>.cos.endpoint\n[endpoint: <string> | default = \"\"]\n\n# COS region to use.\n# CLI flag: -<prefix>.cos.region\n[region: <string> | default = \"\"]\n\n# COS HMAC Access Key ID.\n# CLI flag: -<prefix>.cos.access-key-id\n[access_key_id: <string> | default = \"\"]\n\n# COS HMAC Secret Access Key.\n# CLI flag: -<prefix>.cos.secret-access-key\n[secret_access_key: <string> | default = \"\"]\n\nhttp_config:\n  # The maximum amount of time an idle connection will be held open.\n  # CLI flag: -<prefix>.cos.http.idle-conn-timeout\n  [idle_conn_timeout: <duration> | default = 1m30s]\n\n  # If non-zero, specifies the amount of time to wait for a server's response\n  # headers after fully writing the request.\n  # CLI flag: -<prefix>.cos.http.response-header-timeout\n  [response_header_timeout: <duration> | default = 0s]\n\n# Configures back off when cos get Object.\nbackoff_config:\n  # Minimum backoff time when cos get Object.\n  # CLI flag: -<prefix>.cos.min-backoff\n  [min_period: <duration> | default = 100ms]\n\n  # Maximum backoff time when cos get Object.\n  # CLI flag: -<prefix>.cos.max-backoff\n  [max_period: <duration> | default = 3s]\n\n  # Maximum number of times to retry when cos get Object.\n  # CLI flag: -<prefix>.cos.max-retries\n  [max_retries: <int> | default = 5]\n\n# IAM API key to access COS.\n# CLI flag: -<prefix>.cos.api-key\n[api_key: <string> | default = \"\"]\n\n# COS service instance id to use.\n# CLI flag: -<prefix>.cos.service-instance-id\n[service_instance_id: <string> | default = \"\"]\n\n# IAM Auth Endpoint for authentication.\n# CLI flag: -<prefix>.cos.auth-endpoint\n[auth_endpoint: <string> | default = \"https://iam.cloud.ibm.com/identity/token\"]\n\n# Compute resource token file path.\n# CLI flag: -<prefix>.cos.cr-token-file-path\n[cr_token_file_path: <string> | default = \"\"]\n\n# Name of the trusted profile.\n# CLI flag: -<prefix>.cos.trusted-profile-name\n[trusted_profile_name: <string> | default = \"\"]\n\n# ID of the trusted profile.\n# CLI flag: -<prefix>.cos.trusted-profile-id\n[trusted_profile_id: <string> | default = \"\"]\n```\n\n### distributor\n\nConfigures the `distributor`.\n\n```yaml\nring:\n  kvstore:\n    # Backend storage to use for the ring. Supported values are: consul, etcd,\n    # inmemory, memberlist, multi.\n    # CLI flag: -distributor.ring.store\n    [store: <string> | default = \"consul\"]\n\n    # The prefix for the keys in the store. Should end with a /.\n    # CLI flag: -distributor.ring.prefix\n    [prefix: <string> | default = \"collectors/\"]\n\n    # Configuration for a Consul client. Only applies if the selected kvstore is\n    # consul.\n    # The CLI flags prefix for this block configuration is: distributor.ring\n    [consul: <consul>]\n\n    # Configuration for an ETCD v3 client. Only applies if the selected kvstore\n    # is etcd.\n    # The CLI flags prefix for this block configuration is: distributor.ring\n    [etcd: <etcd>]\n\n    multi:\n      # Primary backend storage used by multi-client.\n      # CLI flag: -distributor.ring.multi.primary\n      [primary: <string> | default = \"\"]\n\n      # Secondary backend storage used by multi-client.\n      # CLI flag: -distributor.ring.multi.secondary\n      [secondary: <string> | default = \"\"]\n\n      # Mirror writes to the secondary store.\n      # CLI flag: -distributor.ring.multi.mirror-enabled\n      [mirror_enabled: <boolean> | default = false]\n\n      # Timeout for storing a value to the secondary store.\n      # CLI flag: -distributor.ring.multi.mirror-timeout\n      [mirror_timeout: <duration> | default = 2s]\n\n  # Period at which to heartbeat to the ring.\n  # CLI flag: -distributor.ring.heartbeat-period\n  [heartbeat_period: <duration> | default = 5s]\n\n  # The heartbeat timeout after which distributors are considered unhealthy\n  # within the ring. 0 = never (timeout disabled).\n  # CLI flag: -distributor.ring.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # Name of network interface to read address from.\n  # CLI flag: -distributor.ring.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n# Number of workers to push batches to ingesters.\n# CLI flag: -distributor.push-worker-count\n[push_worker_count: <int> | default = 256]\n\n# The maximum size of a received message.\n# CLI flag: -distributor.max-recv-msg-size\n[max_recv_msg_size: <int> | default = 104857600]\n\n# The maximum size of a decompressed message. Defaults to 50x max-recv-msg-size.\n# CLI flag: -distributor.max-decompressed-size\n[max_decompressed_size: <int> | default = 5242880000]\n\nrate_store:\n  # The max number of concurrent requests to make to ingester stream apis\n  # CLI flag: -distributor.rate-store.max-request-parallelism\n  [max_request_parallelism: <int> | default = 200]\n\n  # The interval on which distributors will update current stream rates from\n  # ingesters\n  # CLI flag: -distributor.rate-store.stream-rate-update-interval\n  [stream_rate_update_interval: <duration> | default = 1s]\n\n  # Timeout for communication between distributors and any given ingester when\n  # updating rates\n  # CLI flag: -distributor.rate-store.ingester-request-timeout\n  [ingester_request_timeout: <duration> | default = 500ms]\n\n  # If enabled, detailed logs and spans will be emitted.\n  # CLI flag: -distributor.rate-store.debug\n  [debug: <boolean> | default = false]\n\n# Customize the logging of write failures.\nwrite_failures_logging:\n  # Log volume allowed (per second). Default: 1KB.\n  # CLI flag: -distributor.write-failures-logging.rate\n  [rate: <int> | default = 1KB]\n\n  # Whether a insight=true key should be logged or not. Default: false.\n  # CLI flag: -distributor.write-failures-logging.add-insights-label\n  [add_insights_label: <boolean> | default = false]\n\notlp_config:\n  # List of default otlp resource attributes to be picked as index labels\n  # CLI flag: -distributor.otlp.default_resource_attributes_as_index_labels\n  [default_resource_attributes_as_index_labels: <list of strings> | default = [service.name service.namespace service.instance.id deployment.environment deployment.environment.name cloud.region cloud.availability_zone k8s.cluster.name k8s.namespace.name k8s.pod.name k8s.container.name container.name k8s.replicaset.name k8s.deployment.name k8s.statefulset.name k8s.daemonset.name k8s.cronjob.name k8s.job.name]]\n\n# Default policy stream mappings that are merged with per-tenant mappings.\n[default_policy_stream_mappings: <map of string to list of PriorityStreams>]\n\n# Enable writes to Kafka during Push requests.\n# CLI flag: -distributor.kafka-writes-enabled\n[kafka_writes_enabled: <boolean> | default = false]\n\n# Enable writes to Ingesters during Push requests. Defaults to true.\n# CLI flag: -distributor.ingester-writes-enabled\n[ingester_writes_enabled: <boolean> | default = true]\n\n# Enable checking limits against the ingest-limits service. Defaults to false.\n# CLI flag: -distributor.ingest-limits-enabled\n[ingest_limits_enabled: <boolean> | default = false]\n\n# Enable dry-run mode where limits are checked the ingest-limits service, but\n# not enforced. Defaults to false.\n# CLI flag: -distributor.ingest-limits-dry-run-enabled\n[ingest_limits_dry_run_enabled: <boolean> | default = false]\n\ndataobj_tee:\n  # Enable data object tee.\n  # CLI flag: -distributor.dataobj-tee.enabled\n  [enabled: <boolean> | default = false]\n\n  # Topic for data object tee.\n  # CLI flag: -distributor.dataobj-tee.topic\n  [topic: <string> | default = \"\"]\n\n  # Maximum number of bytes to buffer.\n  # CLI flag: -distributor.dataobj-tee.max-buffered-bytes\n  [max_buffered_bytes: <int> | default = 104857600]\n\n  # The per-tenant partition rate (bytes/sec).\n  # CLI flag: -distributor.dataobj-tee.per-partition-rate-bytes\n  [per_partition_rate_bytes: <int> | default = 1048576]\n\n  # Enables optional debug metrics.\n  # CLI flag: -distributor.dataobj-tee.debug-metrics-enabled\n  [debug_metrics_enabled: <boolean> | default = false]\n```\n\n### etcd\n\nConfiguration for an ETCD v3 client. Only applies if the selected kvstore is `etcd`. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage.ring`\n- `compactor.ring`\n- `dataobj-consumer`\n- `dataobj-consumer.partition-ring`\n- `distributor.ring`\n- `index-gateway.ring`\n- `ingest-limits`\n- `ingest-limits-frontend`\n- `ingester.partition-ring`\n- `pattern-ingester`\n- `query-scheduler.ring`\n- `ruler.ring`\n- `ui.ring`\n\n\u00a0\n\n```yaml\n# The etcd endpoints to connect to.\n# CLI flag: -<prefix>.etcd.endpoints\n[endpoints: <list of strings> | default = []]\n\n# The dial timeout for the etcd connection.\n# CLI flag: -<prefix>.etcd.dial-timeout\n[dial_timeout: <duration> | default = 10s]\n\n# The maximum number of retries to do for failed ops.\n# CLI flag: -<prefix>.etcd.max-retries\n[max_retries: <int> | default = 10]\n\n# Enable TLS.\n# CLI flag: -<prefix>.etcd.tls-enabled\n[tls_enabled: <boolean> | default = false]\n\n# The TLS configuration.\n# The CLI flags prefix for this block configuration is: ui.ring.etcd\n[<tls_config>]\n\n# Etcd username.\n# CLI flag: -<prefix>.etcd.username\n[username: <string> | default = \"\"]\n\n# Etcd password.\n# CLI flag: -<prefix>.etcd.password\n[password: <string> | default = \"\"]\n```\n\n### frontend\n\nThe `frontend` block configures the Loki query-frontend.\n\n```yaml\n# Log queries that are slower than the specified duration. Set to 0 to disable.\n# Set to < 0 to enable on all queries.\n# CLI flag: -frontend.log-queries-longer-than\n[log_queries_longer_than: <duration> | default = 0s]\n\n# Comma-separated list of request header names to include in query logs. Applies\n# to both query stats and slow queries logs.\n# CLI flag: -frontend.log-query-request-headers\n[log_query_request_headers: <string> | default = \"\"]\n\n# Max body size for downstream prometheus.\n# CLI flag: -frontend.max-body-size\n[max_body_size: <int> | default = 10485760]\n\n# True to enable query statistics tracking. When enabled, a message with some\n# statistics is logged for every query.\n# CLI flag: -frontend.query-stats-enabled\n[query_stats_enabled: <boolean> | default = false]\n\n# Maximum number of outstanding requests per tenant per frontend; requests\n# beyond this error with HTTP 429.\n# CLI flag: -querier.max-outstanding-requests-per-tenant\n[max_outstanding_per_tenant: <int> | default = 2048]\n\n# In the event a tenant is repeatedly sending queries that lead the querier to\n# crash or be killed due to an out-of-memory error, the crashed querier will be\n# disconnected from the query frontend and a new querier will be immediately\n# assigned to the tenant\u2019s shard. This invalidates the assumption that shuffle\n# sharding can be used to reduce the impact on tenants. This option mitigates\n# the impact by configuring a delay between when a querier disconnects because\n# of a crash and when the crashed querier is actually removed from the tenant's\n# shard.\n# CLI flag: -query-frontend.querier-forget-delay\n[querier_forget_delay: <duration> | default = 0s]\n\n# DNS hostname used for finding query-schedulers.\n# CLI flag: -frontend.scheduler-address\n[scheduler_address: <string> | default = \"\"]\n\n# How often to resolve the scheduler-address, in order to look for new\n# query-scheduler instances. Also used to determine how often to poll the\n# scheduler-ring for addresses if the scheduler-ring is configured.\n# CLI flag: -frontend.scheduler-dns-lookup-period\n[scheduler_dns_lookup_period: <duration> | default = 10s]\n\n# Number of concurrent workers forwarding queries to single query-scheduler.\n# CLI flag: -frontend.scheduler-worker-concurrency\n[scheduler_worker_concurrency: <int> | default = 5]\n\n# The grpc_client block configures the gRPC client used to communicate between a\n# client and server component in Loki.\n# The CLI flags prefix for this block configuration is:\n# frontend.grpc-client-config\n[grpc_client_config: <grpc_client>]\n\n# Time to wait for inflight requests to finish before forcefully shutting down.\n# This needs to be aligned with the query timeout and the graceful termination\n# period of the process orchestrator.\n# CLI flag: -frontend.graceful-shutdown-timeout\n[graceful_shutdown_timeout: <duration> | default = 5m]\n\n# Name of network interface to read address from. This address is sent to\n# query-scheduler and querier, which uses it to send the query response back to\n# query-frontend.\n# CLI flag: -frontend.instance-interface-names\n[instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n# Enable using a IPv6 instance address (default false).\n# CLI flag: -frontend.instance-enable-ipv6\n[instance_enable_ipv6: <boolean> | default = false]\n\n# Defines the encoding for requests to and responses from the scheduler and\n# querier. Can be 'json' or 'protobuf' (defaults to 'json').\n# CLI flag: -frontend.encoding\n[encoding: <string> | default = \"json\"]\n\n# Compress HTTP responses.\n# CLI flag: -querier.compress-http-responses\n[compress_responses: <boolean> | default = true]\n\n# URL of downstream Loki.\n# CLI flag: -frontend.downstream-url\n[downstream_url: <string> | default = \"\"]\n\n# URL of querier for tail proxy.\n# CLI flag: -frontend.tail-proxy-url\n[tail_proxy_url: <string> | default = \"\"]\n\n# The TLS configuration.\n# The CLI flags prefix for this block configuration is: frontend.tail-tls-config\n[tail_tls_config: <tls_config>]\n\n# Support 'application/vnd.apache.parquet' content type in HTTP responses.\n[support_parquet_encoding: <boolean>]\n```\n\n### frontend_worker\n\nThe `frontend_worker` configures the worker - running within the Loki querier - picking up and executing queries enqueued by the query-frontend.\n\n```yaml\n# Address of query frontend service, in host:port format. If\n# -querier.scheduler-address is set as well, querier will use scheduler instead.\n# Only one of -querier.frontend-address or -querier.scheduler-address can be\n# set. If neither is set, queries are only received via HTTP endpoint.\n# CLI flag: -querier.frontend-address\n[frontend_address: <string> | default = \"\"]\n\n# Hostname (and port) of scheduler that querier will periodically resolve,\n# connect to and receive queries from. Only one of -querier.frontend-address or\n# -querier.scheduler-address can be set. If neither is set, queries are only\n# received via HTTP endpoint.\n# CLI flag: -querier.scheduler-address\n[scheduler_address: <string> | default = \"\"]\n\n# How often to query DNS for query-frontend or query-scheduler address. Also\n# used to determine how often to poll the scheduler-ring for addresses if the\n# scheduler-ring is configured.\n# CLI flag: -querier.dns-lookup-period\n[dns_lookup_duration: <duration> | default = 3s]\n\n# Querier ID, sent to frontend service to identify requests from the same\n# querier. Defaults to hostname.\n# CLI flag: -querier.id\n[id: <string> | default = \"\"]\n\n# Configures the querier gRPC client used to communicate with the\n# query-frontend. This can't be used in conjunction with 'grpc_client_config'.\n# The CLI flags prefix for this block configuration is:\n# querier.frontend-grpc-client\n[query_frontend_grpc_client: <grpc_client>]\n\n# Configures the querier gRPC client used to communicate with the query-frontend\n# and with the query-scheduler. This can't be used in conjunction with\n# 'query_frontend_grpc_client' or 'query_scheduler_grpc_client'.\n# The CLI flags prefix for this block configuration is: querier.frontend-client\n[grpc_client_config: <grpc_client>]\n\n# Configures the querier gRPC client used to communicate with the\n# query-scheduler. This can't be used in conjunction with 'grpc_client_config'.\n# The CLI flags prefix for this block configuration is:\n# querier.scheduler-grpc-client\n[query_scheduler_grpc_client: <grpc_client>]\n```\n\n### gcs_storage_config\n\nThe `gcs_storage_config` block configures the connection to Google Cloud Storage object storage backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n\u00a0\n\n```yaml\n# Name of GCS bucket. Please refer to\n# https://cloud.google.com/docs/authentication/production for more information\n# about how to configure authentication.\n# CLI flag: -<prefix>.gcs.bucketname\n[bucket_name: <string> | default = \"\"]\n\n# Custom GCS endpoint URL.\n# CLI flag: -<prefix>.gcs.endpoint\n[endpoint: <string> | default = \"\"]\n\n# Service account key content in JSON format, refer to\n# https://cloud.google.com/iam/docs/creating-managing-service-account-keys for\n# creation.\n# CLI flag: -<prefix>.gcs.service-account\n[service_account: <string> | default = \"\"]\n\n# The size of the buffer that GCS client for each PUT request. 0 to disable\n# buffering.\n# CLI flag: -<prefix>.gcs.chunk-buffer-size\n[chunk_buffer_size: <int> | default = 0]\n\n# The duration after which the requests to GCS should be timed out.\n# CLI flag: -<prefix>.gcs.request-timeout\n[request_timeout: <duration> | default = 0s]\n\n# Enable OpenCensus (OC) instrumentation for all requests.\n# CLI flag: -<prefix>.gcs.enable-opencensus\n[enable_opencensus: <boolean> | default = true]\n\n# Enable HTTP2 connections.\n# CLI flag: -<prefix>.gcs.enable-http2\n[enable_http2: <boolean> | default = true]\n\n# Enable automatic retries of failed idempotent requests.\n# CLI flag: -<prefix>.gcs.enable-retries\n[enable_retries: <boolean> | default = true]\n```\n\n### grpc_client\n\nThe `grpc_client` block configures the gRPC client used to communicate between a client and server component in Loki. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `bigtable`\n- `bloom-build.builder.grpc`\n- `bloom-gateway-client.grpc`\n- `boltdb.shipper.index-gateway-client.grpc`\n- `compactor.grpc-client`\n- `frontend.grpc-client-config`\n- `ingest-limits-frontend-client`\n- `ingest-limits-frontend.limits-client`\n- `ingester.client`\n- `pattern-ingester.client`\n- `querier.frontend-client`\n- `querier.frontend-grpc-client`\n- `querier.scheduler-grpc-client`\n- `query-scheduler.grpc-client-config`\n- `ruler.client`\n- `tsdb.shipper.index-gateway-client.grpc`\n\n\u00a0\n\n```yaml\n# gRPC client max receive message size (bytes).\n# CLI flag: -<prefix>.grpc-max-recv-msg-size\n[max_recv_msg_size: <int> | default = 104857600]\n\n# gRPC client max send message size (bytes).\n# CLI flag: -<prefix>.grpc-max-send-msg-size\n[max_send_msg_size: <int> | default = 104857600]\n\n# Use compression when sending messages. Supported values are: 'gzip', 'snappy'\n# and '' (disable compression)\n# CLI flag: -<prefix>.grpc-compression\n[grpc_compression: <string> | default = \"\"]\n\n# Rate limit for gRPC client; 0 means disabled.\n# CLI flag: -<prefix>.grpc-client-rate-limit\n[rate_limit: <float> | default = 0]\n\n# Rate limit burst for gRPC client.\n# CLI flag: -<prefix>.grpc-client-rate-limit-burst\n[rate_limit_burst: <int> | default = 0]\n\n# Enable backoff and retry when we hit rate limits.\n# CLI flag: -<prefix>.backoff-on-ratelimits\n[backoff_on_ratelimits: <boolean> | default = false]\n\nbackoff_config:\n  # Minimum delay when backing off.\n  # CLI flag: -<prefix>.backoff-min-period\n  [min_period: <duration> | default = 100ms]\n\n  # Maximum delay when backing off.\n  # CLI flag: -<prefix>.backoff-max-period\n  [max_period: <duration> | default = 10s]\n\n  # Number of times to backoff and retry before failing.\n  # CLI flag: -<prefix>.backoff-retries\n  [max_retries: <int> | default = 10]\n\n# Initial stream window size. Values less than the default are not supported and\n# are ignored. Setting this to a value other than the default disables the BDP\n# estimator.\n# CLI flag: -<prefix>.initial-stream-window-size\n[initial_stream_window_size: <int> | default = 63KiB1023B]\n\n# Initial connection window size. Values less than the default are not supported\n# and are ignored. Setting this to a value other than the default disables the\n# BDP estimator.\n# CLI flag: -<prefix>.initial-connection-window-size\n[initial_connection_window_size: <int> | default = 63KiB1023B]\n\n# Enable TLS in the gRPC client. This flag needs to be enabled when any other\n# TLS flag is set. If set to false, insecure connection to gRPC server will be\n# used.\n# CLI flag: -<prefix>.tls-enabled\n[tls_enabled: <boolean> | default = false]\n\n# The TLS configuration.\n# The CLI flags prefix for this block configuration is:\n# tsdb.shipper.index-gateway-client.grpc\n[<tls_config>]\n\n# The maximum amount of time to establish a connection. A value of 0 means\n# default gRPC client connect timeout and backoff.\n# CLI flag: -<prefix>.connect-timeout\n[connect_timeout: <duration> | default = 5s]\n\n# Initial backoff delay after first connection failure. Only relevant if\n# ConnectTimeout > 0.\n# CLI flag: -<prefix>.connect-backoff-base-delay\n[connect_backoff_base_delay: <duration> | default = 1s]\n\n# Maximum backoff delay when establishing a connection. Only relevant if\n# ConnectTimeout > 0.\n# CLI flag: -<prefix>.connect-backoff-max-delay\n[connect_backoff_max_delay: <duration> | default = 5s]\n\ncluster_validation:\n  # Primary cluster validation label.\n  # CLI flag: -<prefix>.cluster-validation.label\n  [label: <string> | default = \"\"]\n```\n\n### index_gateway\n\nThe `index_gateway` block configures the Loki index gateway server, responsible for serving index queries without the need to constantly interact with the object store.\n\n```yaml\n# Defines in which mode the index gateway server will operate (default to\n# 'simple'). It supports two modes:\n# - 'simple': an index gateway server instance is responsible for handling,\n# storing and returning requests for all indices for all tenants.\n# - 'ring': an index gateway server instance is responsible for a subset of\n# tenants instead of all tenants.\n# CLI flag: -index-gateway.mode\n[mode: <string> | default = \"simple\"]\n\n# Defines the ring to be used by the index gateway servers and clients in case\n# the servers are configured to run in 'ring' mode. In case this isn't\n# configured, this block supports inheriting configuration from the common ring\n# section.\nring:\n  kvstore:\n    # Backend storage to use for the ring. Supported values are: consul, etcd,\n    # inmemory, memberlist, multi.\n    # CLI flag: -index-gateway.ring.store\n    [store: <string> | default = \"consul\"]\n\n    # The prefix for the keys in the store. Should end with a /.\n    # CLI flag: -index-gateway.ring.prefix\n    [prefix: <string> | default = \"collectors/\"]\n\n    # Configuration for a Consul client. Only applies if the selected kvstore is\n    # consul.\n    # The CLI flags prefix for this block configuration is: index-gateway.ring\n    [consul: <consul>]\n\n    # Configuration for an ETCD v3 client. Only applies if the selected kvstore\n    # is etcd.\n    # The CLI flags prefix for this block configuration is: index-gateway.ring\n    [etcd: <etcd>]\n\n    multi:\n      # Primary backend storage used by multi-client.\n      # CLI flag: -index-gateway.ring.multi.primary\n      [primary: <string> | default = \"\"]\n\n      # Secondary backend storage used by multi-client.\n      # CLI flag: -index-gateway.ring.multi.secondary\n      [secondary: <string> | default = \"\"]\n\n      # Mirror writes to the secondary store.\n      # CLI flag: -index-gateway.ring.multi.mirror-enabled\n      [mirror_enabled: <boolean> | default = false]\n\n      # Timeout for storing a value to the secondary store.\n      # CLI flag: -index-gateway.ring.multi.mirror-timeout\n      [mirror_timeout: <duration> | default = 2s]\n\n  # Period at which to heartbeat to the ring.\n  # CLI flag: -index-gateway.ring.heartbeat-period\n  [heartbeat_period: <duration> | default = 15s]\n\n  # The heartbeat timeout after which compactors are considered unhealthy within\n  # the ring. 0 = never (timeout disabled).\n  # CLI flag: -index-gateway.ring.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # File path where tokens are stored. If empty, tokens are not stored at\n  # shutdown and restored at startup.\n  # CLI flag: -index-gateway.ring.tokens-file-path\n  [tokens_file_path: <string> | default = \"\"]\n\n  # True to enable zone-awareness and replicate blocks across different\n  # availability zones.\n  # CLI flag: -index-gateway.ring.zone-awareness-enabled\n  [zone_awareness_enabled: <boolean> | default = false]\n\n  # Deprecated: How many index gateway instances are assigned to each tenant.\n  # Use -index-gateway.shard-size instead. The shard size is also a per-tenant\n  # setting.\n  # CLI flag: -replication-factor\n  [replication_factor: <int> | default = 3]\n\n  # Instance ID to register in the ring.\n  # CLI flag: -index-gateway.ring.instance-id\n  [instance_id: <string> | default = \"<hostname>\"]\n\n  # Name of network interface to read address from.\n  # CLI flag: -index-gateway.ring.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # Port to advertise in the ring (defaults to server.grpc-listen-port).\n  # CLI flag: -index-gateway.ring.instance-port\n  [instance_port: <int> | default = 0]\n\n  # IP address to advertise in the ring.\n  # CLI flag: -index-gateway.ring.instance-addr\n  [instance_addr: <string> | default = \"\"]\n\n  # The availability zone where this instance is running. Required if\n  # zone-awareness is enabled.\n  # CLI flag: -index-gateway.ring.instance-availability-zone\n  [instance_availability_zone: <string> | default = \"\"]\n\n  # Enable using a IPv6 instance address.\n  # CLI flag: -index-gateway.ring.instance-enable-ipv6\n  [instance_enable_ipv6: <boolean> | default = false]\n```\n\n### ingester\n\nThe `ingester` block configures the ingester and how the ingester will register itself to a key value store.\n\n```yaml\n# Configures how the lifecycle of the ingester will operate and where it will\n# register for discovery.\nlifecycler:\n  ring:\n    kvstore:\n      # Backend storage to use for the ring. Supported values are: consul, etcd,\n      # inmemory, memberlist, multi.\n      # CLI flag: -ring.store\n      [store: <string> | default = \"consul\"]\n\n      # The prefix for the keys in the store. Should end with a /.\n      # CLI flag: -ring.prefix\n      [prefix: <string> | default = \"collectors/\"]\n\n      # Configuration for a Consul client. Only applies if the selected kvstore\n      # is consul.\n      [consul: <consul>]\n\n      # Configuration for an ETCD v3 client. Only applies if the selected\n      # kvstore is etcd.\n      [etcd: <etcd>]\n\n      multi:\n        # Primary backend storage used by multi-client.\n        # CLI flag: -multi.primary\n        [primary: <string> | default = \"\"]\n\n        # Secondary backend storage used by multi-client.\n        # CLI flag: -multi.secondary\n        [secondary: <string> | default = \"\"]\n\n        # Mirror writes to the secondary store.\n        # CLI flag: -multi.mirror-enabled\n        [mirror_enabled: <boolean> | default = false]\n\n        # Timeout for storing a value to the secondary store.\n        # CLI flag: -multi.mirror-timeout\n        [mirror_timeout: <duration> | default = 2s]\n\n    # The heartbeat timeout after which ingesters are skipped for reads/writes.\n    # CLI flag: -ring.heartbeat-timeout\n    [heartbeat_timeout: <duration> | default = 1m]\n\n    # The number of ingesters to write to and read from.\n    # CLI flag: -distributor.replication-factor\n    [replication_factor: <int> | default = 3]\n\n    # True to enable the zone-awareness and replicate ingested samples across\n    # different availability zones.\n    # CLI flag: -distributor.zone-awareness-enabled\n    [zone_awareness_enabled: <boolean> | default = false]\n\n    # Comma-separated list of zones to exclude from the ring. Instances in\n    # excluded zones will be filtered out from the ring.\n    # CLI flag: -distributor.excluded-zones\n    [excluded_zones: <string> | default = \"\"]\n\n  # Number of tokens for each ingester.\n  # CLI flag: -ingester.num-tokens\n  [num_tokens: <int> | default = 128]\n\n  # Period at which to heartbeat to consul.\n  # CLI flag: -ingester.heartbeat-period\n  [heartbeat_period: <duration> | default = 5s]\n\n  # Heartbeat timeout after which instance is assumed to be unhealthy.\n  # CLI flag: -ingester.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # Observe tokens after generating to resolve collisions. Useful when using\n  # gossiping ring.\n  # CLI flag: -ingester.observe-period\n  [observe_period: <duration> | default = 0s]\n\n  # Period to wait for a claim from another member; will join automatically\n  # after this.\n  # CLI flag: -ingester.join-after\n  [join_after: <duration> | default = 0s]\n\n  # Minimum duration to wait after the internal readiness checks have passed but\n  # before succeeding the readiness endpoint. This is used to slowdown\n  # deployment controllers (eg. Kubernetes) after an instance is ready and\n  # before they proceed with a rolling update, to give the rest of the cluster\n  # instances enough time to receive ring updates.\n  # CLI flag: -ingester.min-ready-duration\n  [min_ready_duration: <duration> | default = 15s]\n\n  # Name of network interface to read address from.\n  # CLI flag: -ingester.lifecycler.interface\n  [interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # Enable IPv6 support. Required to make use of IP addresses from IPv6\n  # interfaces.\n  # CLI flag: -ingester.enable-inet6\n  [enable_inet6: <boolean> | default = false]\n\n  # Duration to sleep for before exiting, to ensure metrics are scraped.\n  # CLI flag: -ingester.final-sleep\n  [final_sleep: <duration> | default = 0s]\n\n  # File path where tokens are stored. If empty, tokens are not stored at\n  # shutdown and restored at startup.\n  # CLI flag: -ingester.tokens-file-path\n  [tokens_file_path: <string> | default = \"\"]\n\n  # The availability zone where this instance is running.\n  # CLI flag: -ingester.availability-zone\n  [availability_zone: <string> | default = \"\"]\n\n  # Unregister from the ring upon clean shutdown. It can be useful to disable\n  # for rolling restarts with consistent naming in conjunction with\n  # -distributor.extend-writes=false.\n  # CLI flag: -ingester.unregister-on-shutdown\n  [unregister_on_shutdown: <boolean> | default = true]\n\n  # When enabled the readiness probe succeeds only after all instances are\n  # ACTIVE and healthy in the ring, otherwise only the instance itself is\n  # checked. This option should be disabled if in your cluster multiple\n  # instances can be rolled out simultaneously, otherwise rolling updates may be\n  # slowed down.\n  # CLI flag: -ingester.readiness-check-ring-health\n  [readiness_check_ring_health: <boolean> | default = true]\n\n  # IP address to advertise in the ring.\n  # CLI flag: -ingester.lifecycler.addr\n  [address: <string> | default = \"\"]\n\n  # port to advertise in consul (defaults to server.grpc-listen-port).\n  # CLI flag: -ingester.lifecycler.port\n  [port: <int> | default = 0]\n\n  # ID to register in the ring.\n  # CLI flag: -ingester.lifecycler.ID\n  [id: <string> | default = \"<hostname>\"]\n\n# How many flushes can happen concurrently from each stream.\n# CLI flag: -ingester.concurrent-flushes\n[concurrent_flushes: <int> | default = 32]\n\n# How often should the ingester see if there are any blocks to flush. The first\n# flush check is delayed by a random time up to 0.8x the flush check period.\n# Additionally, there is +/- 1% jitter added to the interval.\n# CLI flag: -ingester.flush-check-period\n[flush_check_period: <duration> | default = 30s]\n\nflush_op_backoff:\n  # Minimum backoff period when a flush fails. Each concurrent flush has its own\n  # backoff, see `ingester.concurrent-flushes`.\n  # CLI flag: -ingester.flush-op-backoff-min-period\n  [min_period: <duration> | default = 10s]\n\n  # Maximum backoff period when a flush fails. Each concurrent flush has its own\n  # backoff, see `ingester.concurrent-flushes`.\n  # CLI flag: -ingester.flush-op-backoff-max-period\n  [max_period: <duration> | default = 1m]\n\n  # Maximum retries for failed flushes.\n  # CLI flag: -ingester.flush-op-backoff-retries\n  [max_retries: <int> | default = 10]\n\n# The timeout for an individual flush. Will be retried up to\n# `flush-op-backoff-retries` times.\n# CLI flag: -ingester.flush-op-timeout\n[flush_op_timeout: <duration> | default = 10m]\n\n# How long chunks should be retained in-memory after they've been flushed.\n# CLI flag: -ingester.chunks-retain-period\n[chunk_retain_period: <duration> | default = 0s]\n\n# How long chunks should sit in-memory with no updates before being flushed if\n# they don't hit the max block size. This means that half-empty chunks will\n# still be flushed after a certain period as long as they receive no further\n# activity.\n# CLI flag: -ingester.chunks-idle-period\n[chunk_idle_period: <duration> | default = 30m]\n\n# The targeted _uncompressed_ size in bytes of a chunk block When this threshold\n# is exceeded the head block will be cut and compressed inside the chunk.\n# CLI flag: -ingester.chunks-block-size\n[chunk_block_size: <int> | default = 262144]\n\n# A target _compressed_ size in bytes for chunks. This is a desired size not an\n# exact size, chunks may be slightly bigger or significantly smaller if they get\n# flushed for other reasons (e.g. chunk_idle_period). A value of 0 creates\n# chunks with a fixed 10 blocks, a non zero value will create chunks with a\n# variable number of blocks to meet the target size.\n# CLI flag: -ingester.chunk-target-size\n[chunk_target_size: <int> | default = 1572864]\n\n# The algorithm to use for compressing chunk. (none, gzip, lz4-64k, snappy,\n# lz4-256k, lz4-1M, lz4, flate, zstd)\n# CLI flag: -ingester.chunk-encoding\n[chunk_encoding: <string> | default = \"gzip\"]\n\n# The maximum duration of a timeseries chunk in memory. If a timeseries runs for\n# longer than this, the current chunk will be flushed to the store and a new\n# chunk created.\n# CLI flag: -ingester.max-chunk-age\n[max_chunk_age: <duration> | default = 2h]\n\n# Forget about ingesters having heartbeat timestamps older than\n# `ring.kvstore.heartbeat_timeout`. This is equivalent to clicking on the\n# `/ring` `forget` button in the UI: the ingester is removed from the ring. This\n# is a useful setting when you are sure that an unhealthy node won't return. An\n# example is when not using stateful sets or the equivalent. Use\n# `memberlist.rejoin_interval` > 0 to handle network partition cases when using\n# a memberlist.\n# CLI flag: -ingester.autoforget-unhealthy\n[autoforget_unhealthy: <boolean> | default = false]\n\n# Parameters used to synchronize ingesters to cut chunks at the same moment.\n# Sync period is used to roll over incoming entry to a new chunk. If chunk's\n# utilization isn't high enough (eg. less than 50% when sync_min_utilization is\n# set to 0.5), then this chunk rollover doesn't happen.\n# CLI flag: -ingester.sync-period\n[sync_period: <duration> | default = 1h]\n\n# Minimum utilization of chunk when doing synchronization.\n# CLI flag: -ingester.sync-min-utilization\n[sync_min_utilization: <float> | default = 0.1]\n\n# The maximum number of errors a stream will report to the user when a push\n# fails. 0 to make unlimited.\n# CLI flag: -ingester.max-ignored-stream-errors\n[max_returned_stream_errors: <int> | default = 10]\n\n# How far back should an ingester be allowed to query the store for data, for\n# use only with boltdb-shipper/tsdb index and filesystem object store. -1 for\n# infinite.\n# CLI flag: -ingester.query-store-max-look-back-period\n[query_store_max_look_back_period: <duration> | default = 0s]\n\n# The ingester WAL (Write Ahead Log) records incoming logs and stores them on\n# the local file systems in order to guarantee persistence of acknowledged data\n# in the event of a process crash.\nwal:\n  # Enable writing of ingested data into WAL.\n  # CLI flag: -ingester.wal-enabled\n  [enabled: <boolean> | default = true]\n\n  # Directory where the WAL data is stored and/or recovered from.\n  # CLI flag: -ingester.wal-dir\n  [dir: <string> | default = \"wal\"]\n\n  # Interval at which checkpoints should be created.\n  # CLI flag: -ingester.checkpoint-duration\n  [checkpoint_duration: <duration> | default = 5m]\n\n  # When WAL is enabled, should chunks be flushed to long-term storage on\n  # shutdown.\n  # CLI flag: -ingester.flush-on-shutdown\n  [flush_on_shutdown: <boolean> | default = false]\n\n  # Maximum memory size the WAL may use during replay. After hitting this, it\n  # will flush data to storage before continuing. A unit suffix (KB, MB, GB) may\n  # be applied.\n  # CLI flag: -ingester.wal-replay-memory-ceiling\n  [replay_memory_ceiling: <int> | default = 4GB]\n\n  # Threshold for disk usage (0.0 to 1.0) at which the WAL will throttle\n  # incoming writes. Set to 0 to disable throttling.\n  # CLI flag: -ingester.wal-disk-full-threshold\n  [disk_full_threshold: <float> | default = 0.9]\n\n# Shard factor used in the ingesters for the in process reverse index. This MUST\n# be evenly divisible by ALL schema shard factors or Loki will not start.\n# CLI flag: -ingester.index-shards\n[index_shards: <int> | default = 32]\n\n# Maximum number of dropped streams to keep in memory during tailing.\n# CLI flag: -ingester.tailer.max-dropped-streams\n[max_dropped_streams: <int> | default = 10]\n\n# Path where the shutdown marker file is stored. If not set and\n# common.path_prefix is set then common.path_prefix will be used.\n# CLI flag: -ingester.shutdown-marker-path\n[shutdown_marker_path: <string> | default = \"\"]\n\n# Interval at which the ingester ownedStreamService checks for changes in the\n# ring to recalculate owned streams.\n# CLI flag: -ingester.owned-streams-check-interval\n[owned_streams_check_interval: <duration> | default = 30s]\n\nkafka_ingestion:\n  # Whether the kafka ingester is enabled.\n  # CLI flag: -ingester.kafka-ingestion-enabled\n  [enabled: <boolean> | default = false]\n\n  partition_ring:\n    # The key-value store used to share the hash ring across multiple instances.\n    # This option needs be set on ingesters, distributors, queriers, and rulers\n    # when running in microservices mode.\n    kvstore:\n      # Backend storage to use for the ring. Supported values are: consul, etcd,\n      # inmemory, memberlist, multi.\n      # CLI flag: -ingester.partition-ring.store\n      [store: <string> | default = \"memberlist\"]\n\n      # The prefix for the keys in the store. Should end with a /.\n      # CLI flag: -ingester.partition-ring.prefix\n      [prefix: <string> | default = \"collectors/\"]\n\n      # Configuration for a Consul client. Only applies if the selected kvstore\n      # is consul.\n      # The CLI flags prefix for this block configuration is:\n      # ingester.partition-ring\n      [consul: <consul>]\n\n      # Configuration for an ETCD v3 client. Only applies if the selected\n      # kvstore is etcd.\n      # The CLI flags prefix for this block configuration is:\n      # ingester.partition-ring\n      [etcd: <etcd>]\n\n      multi:\n        # Primary backend storage used by multi-client.\n        # CLI flag: -ingester.partition-ring.multi.primary\n        [primary: <string> | default = \"\"]\n\n        # Secondary backend storage used by multi-client.\n        # CLI flag: -ingester.partition-ring.multi.secondary\n        [secondary: <string> | default = \"\"]\n\n        # Mirror writes to the secondary store.\n        # CLI flag: -ingester.partition-ring.multi.mirror-enabled\n        [mirror_enabled: <boolean> | default = false]\n\n        # Timeout for storing a value to the secondary store.\n        # CLI flag: -ingester.partition-ring.multi.mirror-timeout\n        [mirror_timeout: <duration> | default = 2s]\n\n    # Minimum number of owners to wait before a PENDING partition gets switched\n    # to ACTIVE.\n    # CLI flag: -ingester.partition-ring.min-partition-owners-count\n    [min_partition_owners_count: <int> | default = 1]\n\n    # How long the minimum number of owners are enforced before a PENDING\n    # partition gets switched to ACTIVE.\n    # CLI flag: -ingester.partition-ring.min-partition-owners-duration\n    [min_partition_owners_duration: <duration> | default = 10s]\n\n    # How long to wait before an INACTIVE partition is eligible for deletion.\n    # The partition is deleted only if it has been in INACTIVE state for at\n    # least the configured duration and it has no owners registered. A value of\n    # 0 disables partitions deletion.\n    # CLI flag: -ingester.partition-ring.delete-inactive-partition-after\n    [delete_inactive_partition_after: <duration> | default = 13h]\n```\n\n### ingester_client\n\nThe `ingester_client` block configures how the distributor will connect to ingesters. Only appropriate when running all components, the distributor, or the querier.\n\n```yaml\n# Configures how connections are pooled.\npool_config:\n  # How frequently to clean up clients for ingesters that have gone away.\n  # CLI flag: -distributor.client-cleanup-period\n  [client_cleanup_period: <duration> | default = 15s]\n\n  # Run a health check on each ingester client during periodic cleanup.\n  # CLI flag: -distributor.health-check-ingesters\n  [health_check_ingesters: <boolean> | default = true]\n\n  # How quickly a dead client will be removed after it has been detected to\n  # disappear. Set this to a value to allow time for a secondary health check to\n  # recover the missing client.\n  # CLI flag: -ingester.client.healthcheck-timeout\n  [remote_timeout: <duration> | default = 1s]\n\n# The remote request timeout on the client side.\n# CLI flag: -ingester.client.timeout\n[remote_timeout: <duration> | default = 5s]\n\n# Configures how the gRPC connection to ingesters work as a client.\n# The CLI flags prefix for this block configuration is: ingester.client\n[grpc_client_config: <grpc_client>]\n```\n\n### limits_config\n\nThe `limits_config` block configures global and per-tenant limits in Loki. The values here can be overridden in the `overrides` section of the runtime_config file\n\n```yaml\n# Whether the ingestion rate limit should be applied individually to each\n# distributor instance (local), or evenly shared across the cluster (global).\n# The ingestion rate strategy cannot be overridden on a per-tenant basis.\n# - local: enforces the limit on a per distributor basis. The actual effective\n# rate limit will be N times higher, where N is the number of distributor\n# replicas.\n# - global: enforces the limit globally, configuring a per-distributor local\n# rate limiter as 'ingestion_rate / N', where N is the number of distributor\n# replicas (it's automatically adjusted if the number of replicas change). The\n# global strategy requires the distributors to form their own ring, which is\n# used to keep track of the current number of healthy distributor replicas.\n# CLI flag: -distributor.ingestion-rate-limit-strategy\n[ingestion_rate_strategy: <string> | default = \"global\"]\n\n# Per-user ingestion rate limit in sample size per second. Sample size includes\n# size of the logs line and the size of structured metadata labels. Units in MB.\n# CLI flag: -distributor.ingestion-rate-limit-mb\n[ingestion_rate_mb: <float> | default = 4]\n\n# Per-user allowed ingestion burst size (in sample size). Units in MB. The burst\n# size refers to the per-distributor local rate limiter even in the case of the\n# 'global' strategy, and should be set at least to the maximum logs size\n# expected in a single push request.\n# CLI flag: -distributor.ingestion-burst-size-mb\n[ingestion_burst_size_mb: <float> | default = 6]\n\n# Maximum length accepted for label names.\n# CLI flag: -validation.max-length-label-name\n[max_label_name_length: <int> | default = 1024]\n\n# Maximum length accepted for label value. This setting also applies to the\n# metric name.\n# CLI flag: -validation.max-length-label-value\n[max_label_value_length: <int> | default = 2048]\n\n# Maximum number of label names per series.\n# CLI flag: -validation.max-label-names-per-series\n[max_label_names_per_series: <int> | default = 15]\n\n# Whether or not old samples will be rejected.\n# CLI flag: -validation.reject-old-samples\n[reject_old_samples: <boolean> | default = true]\n\n# Maximum accepted sample age before rejecting.\n# CLI flag: -validation.reject-old-samples.max-age\n[reject_old_samples_max_age: <duration> | default = 1w]\n\n# Duration which table will be created/deleted before/after it's needed; we\n# won't accept sample from before this time.\n# CLI flag: -validation.create-grace-period\n[creation_grace_period: <duration> | default = 10m]\n\n# Maximum line size on ingestion path. Example: 256kb. Any log line exceeding\n# this limit will be discarded unless `distributor.max-line-size-truncate` is\n# set, in which case it is truncated rather than discarded completely. There is\n# no limit when set to 0.\n# CLI flag: -distributor.max-line-size\n[max_line_size: <int> | default = 256KB]\n\n# Whether to truncate lines that exceed max_line_size.\n# CLI flag: -distributor.max-line-size-truncate\n[max_line_size_truncate: <boolean> | default = false]\n\n# Identifier that is added at the end of a truncated log line.\n# CLI flag: -distributor.max-line-size-truncate-identifier\n[max_line_size_truncate_identifier: <string> | default = \"\"]\n\n# Alter the log line timestamp during ingestion when the timestamp is the same\n# as the previous entry for the same stream. When enabled, if a log line in a\n# push request has the same timestamp as the previous line for the same stream,\n# one nanosecond is added to the log line. This will preserve the received order\n# of log lines with the exact same timestamp when they are queried, by slightly\n# altering their stored timestamp. NOTE: This is imperfect, because Loki accepts\n# out of order writes, and another push request for the same stream could\n# contain duplicate timestamps to existing entries and they will not be\n# incremented.\n# CLI flag: -validation.increment-duplicate-timestamps\n[increment_duplicate_timestamp: <boolean> | default = false]\n\n# Simulated latency to add to push requests. Used for testing. Set to 0s to\n# disable.\n# CLI flag: -limits.simulated-push-latency\n[simulated_push_latency: <duration> | default = 0s]\n\n# Enable experimental support for running multiple query variants over the same\n# underlying data. For example, running both a rate() and count_over_time()\n# query over the same range selector.\n# CLI flag: -limits.enable-multi-variant-queries\n[enable_multi_variant_queries: <boolean> | default = false]\n\n# Experimental: Detect fields from stream labels, structured metadata, or\n# json/logfmt formatted log line and put them into structured metadata of the\n# log entry.\ndiscover_generic_fields:\n  [fields: <map of string to list of strings>]\n\n# If no service_name label exists, Loki maps a single label from the configured\n# list to service_name. If none of the configured labels exist in the stream,\n# label is set to unknown_service. Empty list disables setting the label.\n# CLI flag: -validation.discover-service-name\n[discover_service_name: <list of strings> | default = [service app application app_name name app_kubernetes_io_name container container_name k8s_container_name component workload job k8s_job_name]]\n\n# Discover and add log levels during ingestion, if not present already. Levels\n# would be added to Structured Metadata with name\n# level/LEVEL/Level/Severity/severity/SEVERITY/lvl/LVL/Lvl (case-sensitive) and\n# one of the values from 'trace', 'debug', 'info', 'warn', 'error', 'critical',\n# 'fatal' (case insensitive).\n# CLI flag: -validation.discover-log-levels\n[discover_log_levels: <boolean> | default = true]\n\n# Field name to use for log levels. If not set, log level would be detected\n# based on pre-defined labels as mentioned above.\n# CLI flag: -validation.log-level-fields\n[log_level_fields: <list of strings> | default = [level LEVEL Level log.level severity SEVERITY Severity SeverityText lvl LVL Lvl severity_text Severity_Text SEVERITY_TEXT]]\n\n# Maximum depth to search for log level fields in JSON logs. A value of 0 or\n# less means unlimited depth. Default is 2 which searches the first 2 levels of\n# the JSON object.\n# CLI flag: -validation.log-level-from-json-max-depth\n[log_level_from_json_max_depth: <int> | default = 2]\n\n# When true an ingester takes into account only the streams that it owns\n# according to the ring while applying the stream limit.\n# CLI flag: -ingester.use-owned-stream-count\n[use_owned_stream_count: <boolean> | default = false]\n\n# Maximum number of active streams per user, per ingester. 0 to disable.\n# CLI flag: -ingester.max-streams-per-user\n[max_streams_per_user: <int> | default = 0]\n\n# Maximum number of active streams per user, across the cluster. 0 to disable.\n# When the global limit is enabled, each ingester is configured with a dynamic\n# local limit based on the replication factor and the current number of healthy\n# ingesters, and is kept updated whenever the number of ingesters change.\n# CLI flag: -ingester.max-global-streams-per-user\n[max_global_streams_per_user: <int> | default = 5000]\n\n# Deprecated. When true, out-of-order writes are accepted.\n# CLI flag: -ingester.unordered-writes\n[unordered_writes: <boolean> | default = true]\n\n# Maximum byte rate per second per stream, also expressible in human readable\n# forms (1MB, 256KB, etc).\n# CLI flag: -ingester.per-stream-rate-limit\n[per_stream_rate_limit: <int> | default = 3MB]\n\n# Maximum burst bytes per stream, also expressible in human readable forms (1MB,\n# 256KB, etc). This is how far above the rate limit a stream can 'burst' before\n# the stream is limited.\n# CLI flag: -ingester.per-stream-rate-limit-burst\n[per_stream_rate_limit_burst: <int> | default = 15MB]\n\n# Maximum number of chunks that can be fetched in a single query.\n# CLI flag: -store.query-chunk-limit\n[max_chunks_per_query: <int> | default = 2000000]\n\n# Limit the maximum of unique series that is returned by a metric query. When\n# the limit is reached an error is returned.\n# CLI flag: -querier.max-query-series\n[max_query_series: <int> | default = 500]\n\n# Limit how far back in time series data and metadata can be queried, up until\n# lookback duration ago. This limit is enforced in the query frontend, the\n# querier and the ruler. If the requested time range is outside the allowed\n# range, the request will not fail, but will be modified to only query data\n# within the allowed time range. The default value of 0 does not set a limit.\n# CLI flag: -querier.max-query-lookback\n[max_query_lookback: <duration> | default = 0s]\n\n# The limit to length of chunk store queries. 0 to disable.\n# CLI flag: -store.max-query-length\n[max_query_length: <duration> | default = 30d1h]\n\n# Limit the length of the [range] inside a range query. Default is 0 or\n# unlimited\n# CLI flag: -querier.max-query-range\n[max_query_range: <duration> | default = 0s]\n\n# Maximum number of queries that will be scheduled in parallel by the frontend.\n# CLI flag: -querier.max-query-parallelism\n[max_query_parallelism: <int> | default = 32]\n\n# Maximum number of queries will be scheduled in parallel by the frontend for\n# TSDB schemas.\n# CLI flag: -querier.tsdb-max-query-parallelism\n[tsdb_max_query_parallelism: <int> | default = 128]\n\n# Target maximum number of bytes assigned to a single sharded query. Also\n# expressible in human readable forms (1GB, etc). Note: This is a _target_ and\n# not an absolute limit. The actual limit can be higher, but the query planner\n# will try to build shards up to this limit.\n# CLI flag: -querier.tsdb-max-bytes-per-shard\n[tsdb_max_bytes_per_shard: <int> | default = 600MB]\n\n# sharding strategy to use in query planning. Suggested to use bounded once all\n# nodes can recognize it.\n# CLI flag: -limits.tsdb-sharding-strategy\n[tsdb_sharding_strategy: <string> | default = \"power_of_two\"]\n\n# Precompute chunks for TSDB queries. This can improve query performance at the\n# cost of increased memory usage by computing chunks once during planning,\n# reducing index calls.\n# CLI flag: -querier.tsdb-precompute-chunks\n[tsdb_precompute_chunks: <boolean> | default = false]\n\n# Cardinality limit for index queries.\n# CLI flag: -store.cardinality-limit\n[cardinality_limit: <int> | default = 100000]\n\n# Maximum number of stream matchers per query.\n# CLI flag: -querier.max-streams-matcher-per-query\n[max_streams_matchers_per_query: <int> | default = 1000]\n\n# Maximum number of concurrent tail requests.\n# CLI flag: -querier.max-concurrent-tail-requests\n[max_concurrent_tail_requests: <int> | default = 10]\n\n# Maximum number of log entries that will be returned for a query.\n# CLI flag: -validation.max-entries-limit\n[max_entries_limit_per_query: <int> | default = 5000]\n\n# Most recent allowed cacheable result per-tenant, to prevent caching very\n# recent results that might still be in flux.\n# CLI flag: -frontend.max-cache-freshness\n[max_cache_freshness_per_query: <duration> | default = 10m]\n\n# Do not cache metadata request if the end time is within the\n# frontend.max-metadata-cache-freshness window. Set this to 0 to apply no such\n# limits. Defaults to 24h.\n# CLI flag: -frontend.max-metadata-cache-freshness\n[max_metadata_cache_freshness: <duration> | default = 1d]\n\n# Do not cache requests with an end time that falls within Now minus this\n# duration. 0 disables this feature (default).\n# CLI flag: -frontend.max-stats-cache-freshness\n[max_stats_cache_freshness: <duration> | default = 10m]\n\n# Maximum number of queriers that can handle requests for a single tenant. If\n# set to 0 or value higher than number of available queriers, *all* queriers\n# will handle requests for the tenant. Each frontend (or query-scheduler, if\n# used) will select the same set of queriers for the same tenant (given that all\n# queriers are connected to all frontends / query-schedulers). This option only\n# works with queriers connecting to the query-frontend / query-scheduler, not\n# when using downstream URL.\n# CLI flag: -frontend.max-queriers-per-tenant\n[max_queriers_per_tenant: <int> | default = 0]\n\n# How much of the available query capacity (\"querier\" components in distributed\n# mode, \"read\" components in SSD mode) can be used by a single tenant. Allowed\n# values are 0.0 to 1.0. For example, setting this to 0.5 would allow a tenant\n# to use half of the available queriers for processing the query workload. If\n# set to 0, query capacity is determined by frontend.max-queriers-per-tenant.\n# When both frontend.max-queriers-per-tenant and frontend.max-query-capacity are\n# configured, smaller value of the resulting querier replica count is\n# considered: min(frontend.max-queriers-per-tenant, ceil(querier_replicas *\n# frontend.max-query-capacity)). *All* queriers will handle requests for the\n# tenant if neither limits are applied. This option only works with queriers\n# connecting to the query-frontend / query-scheduler, not when using downstream\n# URL. Use this feature in a multi-tenant setup where you need to limit query\n# capacity for certain tenants.\n# CLI flag: -frontend.max-query-capacity\n[max_query_capacity: <float> | default = 0]\n\n# Number of days of index to be kept always downloaded for queries. Applies only\n# to per user index in boltdb-shipper index store. 0 to disable.\n# CLI flag: -store.query-ready-index-num-days\n[query_ready_index_num_days: <int> | default = 0]\n\n# Timeout when querying backends (ingesters or storage) during the execution of\n# a query request. When a specific per-tenant timeout is used, the global\n# timeout is ignored.\n# CLI flag: -querier.query-timeout\n[query_timeout: <duration> | default = 1m]\n\n# Split queries by a time interval and execute in parallel. The value 0 disables\n# splitting by time. This also determines how cache keys are chosen when result\n# caching is enabled.\n# CLI flag: -querier.split-queries-by-interval\n[split_queries_by_interval: <duration> | default = 1h]\n\n# Split metadata queries by a time interval and execute in parallel. The value 0\n# disables splitting metadata queries by time. This also determines how cache\n# keys are chosen when label/series result caching is enabled.\n# CLI flag: -querier.split-metadata-queries-by-interval\n[split_metadata_queries_by_interval: <duration> | default = 1d]\n\n# Experimental. Split interval to use for the portion of metadata request that\n# falls within `recent_metadata_query_window`. Rest of the request which is\n# outside the window still uses `split_metadata_queries_by_interval`. If set to\n# 0, the entire request defaults to using a split interval of\n# `split_metadata_queries_by_interval.`.\n# CLI flag: -experimental.querier.split-recent-metadata-queries-by-interval\n[split_recent_metadata_queries_by_interval: <duration> | default = 1h]\n\n# Experimental. Metadata query window inside which\n# `split_recent_metadata_queries_by_interval` gets applied, portion of the\n# metadata request that falls in this window is split using\n# `split_recent_metadata_queries_by_interval`. The value 0 disables using a\n# different split interval for recent metadata queries.\n# \n# This is added to improve cacheability of recent metadata queries. Query split\n# interval also determines the interval used in cache key. The default split\n# interval of 24h is useful for caching long queries, each cache key holding 1\n# day's results. But metadata queries are often shorter than 24h, to cache them\n# effectively we need a smaller split interval. `recent_metadata_query_window`\n# along with `split_recent_metadata_queries_by_interval` help configure a\n# shorter split interval for recent metadata queries.\n# CLI flag: -experimental.querier.recent-metadata-query-window\n[recent_metadata_query_window: <duration> | default = 0s]\n\n# Split instant metric queries by a time interval and execute in parallel. The\n# value 0 disables splitting instant metric queries by time. This also\n# determines how cache keys are chosen when instant metric query result caching\n# is enabled.\n# CLI flag: -querier.split-instant-metric-queries-by-interval\n[split_instant_metric_queries_by_interval: <duration> | default = 1h]\n\n# Interval to use for time-based splitting when a request is within the\n# `query_ingesters_within` window; defaults to `split-queries-by-interval` by\n# setting to 0.\n# CLI flag: -querier.split-ingester-queries-by-interval\n[split_ingester_queries_by_interval: <duration> | default = 0s]\n\n# Limit queries that can be sharded. Queries within the time range of now and\n# now minus this sharding lookback are not sharded. The default value of 0s\n# disables the lookback, causing sharding of all queries at all times.\n# CLI flag: -frontend.min-sharding-lookback\n[min_sharding_lookback: <duration> | default = 0s]\n\n# Max number of bytes a query can fetch. Enforced in log and metric queries only\n# when TSDB is used. This limit is not enforced on log queries without filters.\n# The default value of 0 disables this limit.\n# CLI flag: -frontend.max-query-bytes-read\n[max_query_bytes_read: <int> | default = 0B]\n\n# Max number of bytes a query can fetch after splitting and sharding. Enforced\n# in log and metric queries only when TSDB is used. This limit is not enforced\n# on log queries without filters. The default value of 0 disables this limit.\n# CLI flag: -frontend.max-querier-bytes-read\n[max_querier_bytes_read: <int> | default = 150GB]\n\n# Enable log-volume endpoints.\n# CLI flag: -limits.volume-enabled\n[volume_enabled: <boolean> | default = true]\n\n# The maximum number of aggregated series in a log-volume response\n# CLI flag: -limits.volume-max-series\n[volume_max_series: <int> | default = 1000]\n\n# Maximum number of rules per rule group per-tenant. 0 to disable.\n# CLI flag: -ruler.max-rules-per-rule-group\n[ruler_max_rules_per_rule_group: <int> | default = 0]\n\n# Maximum number of rule groups per-tenant. 0 to disable.\n# CLI flag: -ruler.max-rule-groups-per-tenant\n[ruler_max_rule_groups_per_tenant: <int> | default = 0]\n\n# The default tenant's shard size when shuffle-sharding is enabled in the ruler.\n# When this setting is specified in the per-tenant overrides, a value of 0\n# disables shuffle sharding for the tenant.\n# CLI flag: -ruler.tenant-shard-size\n[ruler_tenant_shard_size: <int> | default = 0]\n\n# Enable WAL replay on ruler startup. Disabling this can reduce memory usage on\n# startup at the cost of not recovering in-memory WAL metrics on restart.\n# CLI flag: -ruler.enable-wal-replay\n[ruler_enable_wal_replay: <boolean> | default = true]\n\n# Disable recording rules remote-write.\n[ruler_remote_write_disabled: <boolean>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. The URL of the endpoint\n# to send samples to.\n[ruler_remote_write_url: <string> | default = \"\"]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Timeout for requests to\n# the remote write endpoint.\n[ruler_remote_write_timeout: <duration>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Custom HTTP headers to be\n# sent along with each remote write request. Be aware that headers that are set\n# by Loki itself can't be overwritten.\n[ruler_remote_write_headers: <headers>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. List of remote write\n# relabel configurations.\n[ruler_remote_write_relabel_configs: <relabel_config...>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Number of samples to\n# buffer per shard before we block reading of more samples from the WAL. It is\n# recommended to have enough capacity in each shard to buffer several requests\n# to keep throughput up while processing occasional slow remote requests.\n[ruler_remote_write_queue_capacity: <int>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Minimum number of shards,\n# i.e. amount of concurrency.\n[ruler_remote_write_queue_min_shards: <int>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Maximum number of shards,\n# i.e. amount of concurrency.\n[ruler_remote_write_queue_max_shards: <int>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Maximum number of samples\n# per send.\n[ruler_remote_write_queue_max_samples_per_send: <int>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Maximum time a sample\n# will wait in buffer.\n[ruler_remote_write_queue_batch_send_deadline: <duration>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Initial retry delay. Gets\n# doubled for every retry.\n[ruler_remote_write_queue_min_backoff: <duration>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Maximum retry delay.\n[ruler_remote_write_queue_max_backoff: <duration>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Retry upon receiving a\n# 429 status code from the remote-write storage. This is experimental and might\n# change in the future.\n[ruler_remote_write_queue_retry_on_ratelimit: <boolean>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Configures AWS's\n# Signature Verification 4 signing process to sign every remote write request.\nruler_remote_write_sigv4_config:\n  [region: <string> | default = \"\"]\n\n  [access_key: <string> | default = \"\"]\n\n  [secret_key: <string> | default = \"\"]\n\n  [profile: <string> | default = \"\"]\n\n  [role_arn: <string> | default = \"\"]\n\n# Configures global and per-tenant limits for remote write clients. A map with\n# remote client id as key.\n[ruler_remote_write_config: <map of string to RemoteWriteConfig>]\n\n# Timeout for a remote rule evaluation. Defaults to the value of\n# 'querier.query-timeout'.\n[ruler_remote_evaluation_timeout: <duration>]\n\n# Maximum size (in bytes) of the allowable response size from a remote rule\n# evaluation. Set to 0 to allow any response size (default).\n[ruler_remote_evaluation_max_response_size: <int>]\n\n# Deletion mode. Can be one of 'disabled', 'filter-only', or\n# 'filter-and-delete'. When set to 'filter-only' or 'filter-and-delete', and if\n# retention_enabled is true, then the log entry deletion API endpoints are\n# available.\n# CLI flag: -compactor.deletion-mode\n[deletion_mode: <string> | default = \"filter-and-delete\"]\n\n# Retention period to apply to stored data, only applies if retention_enabled is\n# true in the compactor config. As of version 2.8.0, a zero value of 0 or 0s\n# disables retention. In previous releases, Loki did not properly honor a zero\n# value to disable retention and a really large value should be used instead.\n# CLI flag: -store.retention\n[retention_period: <duration> | default = 0s]\n\n# Per-stream retention to apply, if the retention is enabled on the compactor\n# side.\n# Example:\n#  retention_stream:\n#  - selector: '{namespace=\"dev\"}'\n#  priority: 1\n#  period: 24h\n# - selector: '{container=\"nginx\"}'\n#  priority: 1\n#  period: 744h\n# Selector is a Prometheus labels matchers that will apply the 'period'\n# retention only if the stream is matching. In case multiple streams are\n# matching, the highest priority will be picked. If no rule is matched the\n# 'retention_period' is used.\n[retention_stream: <list of StreamRetentions>]\n\n# Feature renamed to 'runtime configuration', flag deprecated in favor of\n# -runtime-config.file (runtime_config.file in YAML).\n# CLI flag: -limits.per-user-override-config\n[per_tenant_override_config: <string> | default = \"\"]\n\n# Feature renamed to 'runtime configuration'; flag deprecated in favor of\n# -runtime-config.reload-period (runtime_config.period in YAML).\n# CLI flag: -limits.per-user-override-period\n[per_tenant_override_period: <duration> | default = 10s]\n\n# Deprecated: Use deletion_mode per tenant configuration instead.\n[allow_deletes: <boolean>]\n\n# Define streams sharding behavior.\nshard_streams:\n  # Automatically shard streams to keep them under the per-stream rate limit.\n  # Sharding is dictated by the desired rate.\n  # CLI flag: -shard-streams.enabled\n  [enabled: <boolean> | default = true]\n\n  # Automatically shard streams by adding a __time_shard__ label, with values\n  # calculated from the log timestamps divided by MaxChunkAge/2. This allows the\n  # out-of-order ingestion of very old logs. If both flags are enabled,\n  # time-based sharding will happen before rate-based sharding.\n  # CLI flag: -shard-streams.time-sharding-enabled\n  [time_sharding_enabled: <boolean> | default = false]\n\n  # Logs with timestamps that are newer than this value will not be\n  # time-sharded.\n  # CLI flag: -shard-streams.time-sharding-ignore-recent\n  [time_sharding_ignore_recent: <duration> | default = 40m]\n\n  # Whether to log sharding streams behavior or not. Not recommended for\n  # production environments.\n  # CLI flag: -shard-streams.logging-enabled\n  [logging_enabled: <boolean> | default = false]\n\n  # Threshold used to cut a new shard. Default (1536KB) means if a rate is above\n  # 1536KB/s, it will be sharded into two streams.\n  # CLI flag: -shard-streams.desired-rate\n  [desired_rate: <int> | default = 1536KB]\n\n[blocked_queries: <blocked_query...>]\n\n# Define a list of required selector labels.\n[required_labels: <list of strings>]\n\n# Minimum number of label matchers a query should contain.\n[minimum_labels_number: <int>]\n\n# The shard size defines how many index gateways should be used by a tenant for\n# querying. If the global shard factor is 0, the global shard factor is set to\n# the deprecated -replication-factor for backwards compatibility reasons.\n# CLI flag: -index-gateway.shard-size\n[index_gateway_shard_size: <int> | default = 0]\n\n# Experimental. Defines a fraction (between 0.0 and 1.0) of the total index\n# gateways available for a each tenant. A value of 0.0 has the same effect as\n# 1.0, meaning all available index gateways. This setting only applies to simple\n# mode.\n# CLI flag: -index-gateway.max-capacity\n[index_gateway_max_capacity: <float> | default = 1]\n\n# Experimental. Whether to use the bloom gateway component in the read path to\n# filter chunks.\n# CLI flag: -bloom-gateway.enable-filtering\n[bloom_gateway_enable_filtering: <boolean> | default = false]\n\n# Experimental. Maximum number of builders to use when building blooms. 0 allows\n# unlimited builders.\n# CLI flag: -bloom-build.max-builders\n[bloom_build_max_builders: <int> | default = 0]\n\n# Experimental. Maximum number of retries for a failed task. If a task fails\n# more than this number of times, it is considered failed and will not be\n# retried. A value of 0 disables this limit.\n# CLI flag: -bloom-build.task-max-retries\n[bloom_build_task_max_retries: <int> | default = 3]\n\n# Experimental. Timeout for a builder to finish a task. If a builder does not\n# respond within this time, it is considered failed and the task will be\n# requeued. 0 disables the timeout.\n# CLI flag: -bloom-build.builder-response-timeout\n[bloom_build_builder_response_timeout: <duration> | default = 0s]\n\n# Experimental. Whether to create blooms for the tenant.\n# CLI flag: -bloom-build.enable\n[bloom_creation_enabled: <boolean> | default = false]\n\n# Experimental. Bloom planning strategy to use in bloom creation. Can be one of:\n# 'split_keyspace_by_factor', 'split_by_series_chunks_size'\n# CLI flag: -bloom-build.planning-strategy\n[bloom_planning_strategy: <string> | default = \"split_keyspace_by_factor\"]\n\n# Experimental. Only if `bloom-build.planning-strategy` is 'split'. Number of\n# splits to create for the series keyspace when building blooms. The series\n# keyspace is split into this many parts to parallelize bloom creation.\n# CLI flag: -bloom-build.split-keyspace-by\n[bloom_split_series_keyspace_by: <int> | default = 256]\n\n# Experimental. Target chunk size in bytes for bloom tasks. Default is 20GB.\n# CLI flag: -bloom-build.split-target-series-chunk-size\n[bloom_task_target_series_chunk_size: <int> | default = 20GB]\n\n# Experimental. Compression algorithm for bloom block pages.\n# CLI flag: -bloom-build.block-encoding\n[bloom_block_encoding: <string> | default = \"none\"]\n\n# Experimental. Prefetch blocks on bloom gateways as soon as they are built.\n# CLI flag: -bloom-build.prefetch-blocks\n[bloom_prefetch_blocks: <boolean> | default = false]\n\n# Experimental. The maximum bloom block size. A value of 0 sets an unlimited\n# size. Default is 200MB. The actual block size might exceed this limit since\n# blooms will be added to blocks until the block exceeds the maximum block size.\n# CLI flag: -bloom-build.max-block-size\n[bloom_max_block_size: <int> | default = 200MB]\n\n# Experimental. The maximum bloom size per log stream. A log stream whose\n# generated bloom filter exceeds this size will be discarded. A value of 0 sets\n# an unlimited size. Default is 128MB.\n# CLI flag: -bloom-build.max-bloom-size\n[bloom_max_bloom_size: <int> | default = 128MB]\n\n# Allow user to send structured metadata in push payload.\n# CLI flag: -validation.allow-structured-metadata\n[allow_structured_metadata: <boolean> | default = true]\n\n# Maximum size accepted for structured metadata per log line.\n# CLI flag: -limits.max-structured-metadata-size\n[max_structured_metadata_size: <int> | default = 64KB]\n\n# Maximum number of structured metadata entries per log line.\n# CLI flag: -limits.max-structured-metadata-entries-count\n[max_structured_metadata_entries_count: <int> | default = 128]\n\n# OTLP log ingestion configurations\notlp_config:\n  # Configuration for resource attributes to store them as index labels or\n  # Structured Metadata or drop them altogether\n  resource_attributes:\n    # Configure whether to ignore the default list of resource attributes set in\n    # 'distributor.otlp.default_resource_attributes_as_index_labels' to be\n    # stored as index labels and only use the given resource attributes config\n    [ignore_defaults: <boolean> | default = false]\n\n    [attributes_config: <list of attributes_configs>]\n\n  # Configuration for scope attributes to store them as Structured Metadata or\n  # drop them altogether\n  [scope_attributes: <list of attributes_configs>]\n\n  # Configuration for log attributes to store them as index labels or Structured\n  # Metadata or drop them altogether\n  [log_attributes: <list of attributes_configs>]\n\n  # When true, the severity_text field from log records will be stored as an\n  # index label. It is recommended not to use this option unless absolutely\n  # necessary\n  [severity_text_as_label: <boolean> | default = false]\n\n# Block ingestion for policy until the configured date. The policy '*' is the\n# global policy, which is applied to all streams not matching a policy and can\n# be overridden by other policies. The time should be in RFC3339 format. The\n# policy is based on the policy_stream_mapping configuration.\n[block_ingestion_policy_until: <map of string to Time>]\n\n# Block ingestion until the configured date. The time should be in RFC3339\n# format.\n# CLI flag: -limits.block-ingestion-until\n[block_ingestion_until: <time> | default = 0]\n\n# HTTP status code to return when ingestion is blocked. If 200, the ingestion\n# will be blocked without returning an error to the client. By Default, a custom\n# status code (260) is returned to the client along with an error message.\n# CLI flag: -limits.block-ingestion-status-code\n[block_ingestion_status_code: <int> | default = 260]\n\n# List of labels that must be present in the stream. If any of the labels are\n# missing, the stream will be discarded. This flag configures it globally for\n# all tenants. Experimental.\n# CLI flag: -validation.enforced-labels\n[enforced_labels: <list of strings> | default = []]\n\n# Map of policies to enforced labels. The policy '*' is the global policy, which\n# is applied to all streams and can be extended by other policies. Example:\n#  policy_enforced_labels: \n#   policy1: \n#     - label1 \n#     - label2 \n#   policy2: \n#     - label3 \n#     - label4\n#   '*':\n#     - label5\n[policy_enforced_labels: <map of string to list of strings>]\n\n# Map of policies to stream selectors with a priority. Experimental.  Example:\n#  policy_stream_mapping: \n#   finance: \n#     - selector: '{namespace=\"prod\", container=\"billing\"}' \n#       priority: 2 \n#   ops: \n#     - selector: '{namespace=\"prod\", container=\"ops\"}' \n#       priority: 1 \n#   staging: \n#     - selector: '{namespace=\"staging\"}' \n#       priority: 1\n[policy_stream_mapping: <map of string to list of PriorityStreams>]\n\n# The number of partitions a tenant's data should be sharded to when using kafka\n# ingestion. Tenants are sharded across partitions using shuffle-sharding. 0\n# disables shuffle sharding and tenant is sharded across all partitions.\n# CLI flag: -limits.ingestion-partition-tenant-shard-size\n[ingestion_partitions_tenant_shard_size: <int> | default = 0]\n\n# List of LogQL vector and range aggregations that should be sharded.\n[shard_aggregations: <list of strings>]\n\n# Default list of JSON fields to tokenize for pattern detection. It is recommend\n# to append to or delete from the defaults rather than replacing them.\n# CLI flag: -limits.pattern-ingester-tokenizable-json-fields\n[pattern_ingester_tokenizable_json_fields_default: <string> | default = \"log,message,msg,msg_,_msg,content\"]\n\n# List of additional JSON fields to tokenize for pattern detection.\n# CLI flag: -limits.pattern-ingester-tokenizable-json-fields-append\n[pattern_ingester_tokenizable_json_fields_append: <string> | default = \"\"]\n\n# List of JSON fields to excluded from the defaults to tokenize for pattern\n# detection.\n# CLI flag: -limits.pattern-ingester-tokenizable-json-fields-delete\n[pattern_ingester_tokenizable_json_fields_delete: <string> | default = \"\"]\n\n# Enable metric aggregation. When enabled, pushed streams will be sampled for\n# bytes and line counts. These metrics will be written back into Loki as a\n# special __aggregated_metric__ stream.\n# CLI flag: -limits.aggregation-enabled\n[metric_aggregation_enabled: <boolean> | default = false]\n\n# Enable persistence of patterns detected at ingest. When enabled, patterns for\n# pushed streams will be written back into Loki as a special __pattern__ stream.\n# CLI flag: -limits.pattern-persistence-enabled\n[pattern_persistence_enabled: <boolean> | default = false]\n\n# The time granularity for persisting patterns. Controls how many data points\n# are written when patterns are flushed. Set to 0 to use the default from the\n# pattern ingester configuration.\n# CLI flag: -limits.pattern-persistence-granularity\n[pattern_persistence_granularity: <duration> | default = 0s]\n\n# Minimum pattern rate (samples per second) required for a pattern to be\n# persisted. Patterns with lower rates will be filtered out during persistence.\n# CLI flag: -limits.pattern-rate-threshold\n[pattern_rate_threshold: <float> | default = 1]\n\n# S3 server-side encryption type. Required to enable server-side encryption\n# overrides for a specific tenant. If not set, the default S3 client settings\n# are used.\n[s3_sse_type: <string> | default = \"\"]\n\n# S3 server-side encryption KMS Key ID. Ignored if the SSE type override is not\n# set.\n[s3_sse_kms_key_id: <string> | default = \"\"]\n\n# S3 server-side encryption KMS encryption context. If unset and the key ID\n# override is set, the encryption context will not be provided to S3. Ignored if\n# the SSE type override is not set.\n[s3_sse_kms_encryption_context: <string> | default = \"\"]\n\n# Experimental: Controls the amount of scan tasks that can be running in\n# parallel in the new query engine. The default of 0 means unlimited parallelism\n# and all tasks will be scheduled at once.\n# CLI flag: -limits.max-scan-task-parallelism\n[max_scan_task_parallelism: <int> | default = 0]\n\n# Experimental: Toggles verbose debug logging of tasks in the new query engine.\n# CLI flag: -limits.debug-engine-tasks\n[debug_engine_tasks: <boolean> | default = false]\n\n# Experimental: Toggles verbose debug logging of data streams in the new query\n# engine.\n# CLI flag: -limits.debug-engine-streams\n[debug_engine_streams: <boolean> | default = false]\n```\n\n### local_storage_config\n\nThe `local_storage_config` block configures the usage of local file system as object storage backend.\n\n```yaml\n# Directory to store chunks in.\n# CLI flag: -local.chunk-directory\n[directory: <string> | default = \"\"]\n```\n\n### memberlist\n\nConfiguration for `memberlist` client. Only applies if the selected kvstore is memberlist.\n\nWhen a memberlist config with atleast 1 join_members is defined, kvstore of type memberlist is automatically selected for all the components that require a ring unless otherwise specified in the component's configuration section.\n\n```yaml\n# Name of the node in memberlist cluster. Defaults to hostname.\n# CLI flag: -memberlist.nodename\n[node_name: <string> | default = \"\"]\n\n# Add random suffix to the node name.\n# CLI flag: -memberlist.randomize-node-name\n[randomize_node_name: <boolean> | default = true]\n\n# The timeout for establishing a connection with a remote node, and for\n# read/write operations.\n# CLI flag: -memberlist.stream-timeout\n[stream_timeout: <duration> | default = 2s]\n\n# Multiplication factor used when sending out messages (factor * log(N+1)).\n# CLI flag: -memberlist.retransmit-factor\n[retransmit_factor: <int> | default = 4]\n\n# How often to use pull/push sync.\n# CLI flag: -memberlist.pullpush-interval\n[pull_push_interval: <duration> | default = 30s]\n\n# How often to gossip.\n# CLI flag: -memberlist.gossip-interval\n[gossip_interval: <duration> | default = 200ms]\n\n# How many nodes to gossip to.\n# CLI flag: -memberlist.gossip-nodes\n[gossip_nodes: <int> | default = 3]\n\n# How long to keep gossiping to dead nodes, to give them chance to refute their\n# death.\n# CLI flag: -memberlist.gossip-to-dead-nodes-time\n[gossip_to_dead_nodes_time: <duration> | default = 30s]\n\n# How soon can dead node's name be reclaimed with new address. 0 to disable.\n# CLI flag: -memberlist.dead-node-reclaim-time\n[dead_node_reclaim_time: <duration> | default = 0s]\n\n# Enable message compression. This can be used to reduce bandwidth usage at the\n# cost of slightly more CPU utilization.\n# CLI flag: -memberlist.compression-enabled\n[compression_enabled: <boolean> | default = true]\n\n# How frequently to notify watchers when a key changes. Can reduce CPU activity\n# in large memberlist deployments. 0 to notify without delay.\n# CLI flag: -memberlist.notify-interval\n[notify_interval: <duration> | default = 0s]\n\n# Gossip address to advertise to other members in the cluster. Used for NAT\n# traversal.\n# CLI flag: -memberlist.advertise-addr\n[advertise_addr: <string> | default = \"\"]\n\n# Gossip port to advertise to other members in the cluster. Used for NAT\n# traversal.\n# CLI flag: -memberlist.advertise-port\n[advertise_port: <int> | default = 7946]\n\n# The cluster label is an optional string to include in outbound packets and\n# gossip streams. Other members in the memberlist cluster will discard any\n# message whose label doesn't match the configured one, unless the\n# 'cluster-label-verification-disabled' configuration option is set to true.\n# CLI flag: -memberlist.cluster-label\n[cluster_label: <string> | default = \"\"]\n\n# When true, memberlist doesn't verify that inbound packets and gossip streams\n# have the cluster label matching the configured one. This verification should\n# be disabled while rolling out the change to the configured cluster label in a\n# live memberlist cluster.\n# CLI flag: -memberlist.cluster-label-verification-disabled\n[cluster_label_verification_disabled: <boolean> | default = false]\n\n# Other cluster members to join. Can be specified multiple times. It can be an\n# IP, hostname or an entry specified in the DNS Service Discovery format.\n# CLI flag: -memberlist.join\n[join_members: <list of strings> | default = []]\n\n# Min backoff duration to join other cluster members.\n# CLI flag: -memberlist.min-join-backoff\n[min_join_backoff: <duration> | default = 1s]\n\n# Max backoff duration to join other cluster members.\n# CLI flag: -memberlist.max-join-backoff\n[max_join_backoff: <duration> | default = 1m]\n\n# Max number of retries to join other cluster members.\n# CLI flag: -memberlist.max-join-retries\n[max_join_retries: <int> | default = 10]\n\n# Abort if this node fails the fast memberlist cluster joining procedure at\n# startup. When enabled, it's guaranteed that other services, depending on\n# memberlist, have an updated view over the cluster state when they're started.\n# CLI flag: -memberlist.abort-if-fast-join-fails\n[abort_if_cluster_fast_join_fails: <boolean> | default = false]\n\n# Abort if this node fails to join memberlist cluster at startup. When enabled,\n# it's not guaranteed that other services are started only after the cluster\n# state has been successfully updated; use 'abort-if-fast-join-fails' instead.\n# CLI flag: -memberlist.abort-if-join-fails\n[abort_if_cluster_join_fails: <boolean> | default = false]\n\n# If not 0, how often to rejoin the cluster. Occasional rejoin can help to fix\n# the cluster split issue, and is harmless otherwise. For example when using\n# only few components as a seed nodes (via -memberlist.join), then it's\n# recommended to use rejoin. If -memberlist.join points to dynamic service that\n# resolves to all gossiping nodes (eg. Kubernetes headless service), then rejoin\n# is not needed.\n# CLI flag: -memberlist.rejoin-interval\n[rejoin_interval: <duration> | default = 0s]\n\n# How long to keep LEFT ingesters in the ring.\n# CLI flag: -memberlist.left-ingesters-timeout\n[left_ingesters_timeout: <duration> | default = 5m]\n\n# How long to keep obsolete entries in the KV store.\n# CLI flag: -memberlist.obsolete-entries-timeout\n[obsolete_entries_timeout: <duration> | default = 30s]\n\n# Timeout for leaving memberlist cluster.\n# CLI flag: -memberlist.leave-timeout\n[leave_timeout: <duration> | default = 20s]\n\n# Timeout for broadcasting all remaining locally-generated updates to other\n# nodes when shutting down. Only used if there are nodes left in the memberlist\n# cluster, and only applies to locally-generated updates, not to broadcast\n# messages that are result of incoming gossip updates. 0 = no timeout, wait\n# until all locally-generated updates are sent.\n# CLI flag: -memberlist.broadcast-timeout-for-local-updates-on-shutdown\n[broadcast_timeout_for_local_updates_on_shutdown: <duration> | default = 10s]\n\n# How much space to use for keeping received and sent messages in memory for\n# troubleshooting (two buffers). 0 to disable.\n# CLI flag: -memberlist.message-history-buffer-bytes\n[message_history_buffer_bytes: <int> | default = 0]\n\n# Size of the buffered channel for the WatchPrefix function.\n# CLI flag: -memberlist.watch-prefix-buffer-size\n[watch_prefix_buffer_size: <int> | default = 128]\n\n# IP address to listen on for gossip messages. Multiple addresses may be\n# specified. Defaults to 0.0.0.0\n# CLI flag: -memberlist.bind-addr\n[bind_addr: <list of strings> | default = []]\n\n# Port to listen on for gossip messages.\n# CLI flag: -memberlist.bind-port\n[bind_port: <int> | default = 7946]\n\n# Timeout used when connecting to other nodes to send packet.\n# CLI flag: -memberlist.packet-dial-timeout\n[packet_dial_timeout: <duration> | default = 2s]\n\n# Timeout for writing 'packet' data.\n# CLI flag: -memberlist.packet-write-timeout\n[packet_write_timeout: <duration> | default = 5s]\n\n# Maximum number of concurrent writes to other nodes.\n# CLI flag: -memberlist.max-concurrent-writes\n[max_concurrent_writes: <int> | default = 3]\n\n# Timeout for acquiring one of the concurrent write slots. After this time, the\n# message will be dropped.\n# CLI flag: -memberlist.acquire-writer-timeout\n[acquire_writer_timeout: <duration> | default = 250ms]\n\n# Enable TLS on the memberlist transport layer.\n# CLI flag: -memberlist.tls-enabled\n[tls_enabled: <boolean> | default = false]\n\n# The TLS configuration.\n# The CLI flags prefix for this block configuration is: memberlist\n[<tls_config>]\n\nzone_aware_routing:\n  # Enable zone-aware routing for memberlist gossip.\n  # CLI flag: -memberlist.zone-aware-routing.enabled\n  [enabled: <boolean> | default = false]\n\n  # Availability zone where this node is running.\n  # CLI flag: -memberlist.zone-aware-routing.instance-availability-zone\n  [instance_availability_zone: <string> | default = \"\"]\n\n  # Role of this node in the cluster. Valid values: member, bridge.\n  # CLI flag: -memberlist.zone-aware-routing.role\n  [role: <string> | default = \"member\"]\n```\n\n### named_stores_config\n\nConfigures additional object stores for a given storage provider.\nSupported stores: aws, azure, bos, filesystem, gcs, swift.\nExample:\n```yaml\n    storage_config:\n      named_stores:\n        aws:\n          store-1:\n            endpoint: s3://foo-bucket\n            region: us-west1\n```\nNamed store from this example can be used by setting object_store to store-1 in period_config.\n\n```yaml\n[aws: <map of string to aws_storage_config>]\n\n[azure: <map of string to azure_storage_config>]\n\n[bos: <map of string to bos_storage_config>]\n\n[filesystem: <map of string to local_storage_config>]\n\n[gcs: <map of string to gcs_storage_config>]\n\n[alibabacloud: <map of string to alibabacloud_storage_config>]\n\n[swift: <map of string to swift_storage_config>]\n\n[cos: <map of string to cos_storage_config>]\n```\n\n### operational_config\n\nThese are values which allow you to control aspects of Loki's operation, most commonly used for controlling types of higher verbosity logging, the values here can be overridden in the `configs` section of the `runtime_config` file.\n\n```yaml\n# Log every new stream created by a push request (very verbose, recommend to\n# enable via runtime config only).\n# CLI flag: -operation-config.log-stream-creation\n[log_stream_creation: <boolean> | default = false]\n\n# Log every push request (very verbose, recommend to enable via runtime config\n# only).\n# CLI flag: -operation-config.log-push-request\n[log_push_request: <boolean> | default = false]\n\n# Log a commutative hash of the labels for all streams in a push request. In\n# some cases this can potentially be used as an identifier of the agent sending\n# the stream. Calculating hashes is epensive so only enable as needed.\n# CLI flag: -operation-config.log-hash-of-labels\n[log_hash_of_labels: <boolean> | default = false]\n\n# Log every stream in a push request (very verbose, recommend to enable via\n# runtime config only).\n# CLI flag: -operation-config.log-push-request-streams\n[log_push_request_streams: <boolean> | default = false]\n\n# Only show streams that match a provided IP address, LogPushRequestStreams must\n# be enabled. Can be used multiple times to filter by multiple IPs.\n# CLI flag: -operation-config.filter-push-request-streams-ips\n[filter_push_request_streams_ips: <list of strings> | default = []]\n\n# Log service name discovery (very verbose, recommend to enable via runtime\n# config only).\n# CLI flag: -operation-config.log-service-name-discovery\n[log_service_name_discovery: <boolean> | default = false]\n\n# Log metrics for duplicate lines received.\n# CLI flag: -operation-config.log-duplicate-metrics\n[log_duplicate_metrics: <boolean> | default = false]\n\n# Log stream info for duplicate lines received\n# CLI flag: -operation-config.log-duplicate-stream-info\n[log_duplicate_stream_info: <boolean> | default = false]\n\n# Log push errors with a rate limited logger, will show client push errors\n# without overly spamming logs.\n# CLI flag: -operation-config.limited-log-push-errors\n[limited_log_push_errors: <boolean> | default = true]\n```\n\n### period_config\n\nThe `period_config` block configures what index schemas should be used for from specific time periods.\n\n```yaml\n# The date of the first day that index buckets should be created. Use a date in\n# the past if this is your only period_config, otherwise use a date when you\n# want the schema to switch over. In YYYY-MM-DD format, for example: 2018-04-15.\n[from: <daytime>]\n\n# store and object_store below affect which <storage_config> key is used. Which\n# index to use. Either tsdb or boltdb-shipper. Following stores are deprecated:\n# aws, aws-dynamo, gcp, gcp-columnkey, bigtable, bigtable-hashed, cassandra,\n# grpc.\n[store: <string> | default = \"\"]\n\n# Which store to use for the chunks. Either aws (alias s3), azure, gcs,\n# alibabacloud, bos, cos, swift, filesystem, or a named_store (refer to\n# named_stores_config). Following stores are deprecated: aws-dynamo, gcp,\n# gcp-columnkey, bigtable, bigtable-hashed, cassandra, grpc.\n[object_store: <string> | default = \"\"]\n\n# The schema version to use, current recommended schema is v13.\n[schema: <string> | default = \"\"]\n\n# Configures how the index is updated and stored.\nindex:\n  # Path prefix for index tables. Prefix always needs to end with a path\n  # delimiter '/', except when the prefix is empty.\n  [path_prefix: <string> | default = \"index/\"]\n\n  # Table prefix for all period tables.\n  [prefix: <string> | default = \"\"]\n\n  # Table period.\n  [period: <duration>]\n\n  # A map to be added to all managed tables.\n  [tags: <map of string to string>]\n\n# Configured how the chunks are updated and stored.\nchunks:\n  # Table prefix for all period tables.\n  [prefix: <string> | default = \"\"]\n\n  # Table period.\n  [period: <duration>]\n\n  # A map to be added to all managed tables.\n  [tags: <map of string to string>]\n\n# How many shards will be created. Only used if schema is v10 or greater.\n[row_shards: <int> | default = 16]\n```\n\n### profiling\n\nConfiguration for `profiling` options.\n\n```yaml\n# Sets the value for runtime.SetBlockProfilingRate\n# CLI flag: -profiling.block-profile-rate\n[block_profile_rate: <int> | default = 0]\n\n# Sets the value for runtime.SetCPUProfileRate\n# CLI flag: -profiling.cpu-profile-rate\n[cpu_profile_rate: <int> | default = 0]\n\n# Sets the value for runtime.SetMutexProfileFraction\n# CLI flag: -profiling.mutex-profile-fraction\n[mutex_profile_fraction: <int> | default = 0]\n```\n\n### querier\n\nConfigures the `querier`. Only appropriate when running all modules or just the querier.\n\n```yaml\n# Maximum duration for which the live tailing requests are served.\n# CLI flag: -querier.tail-max-duration\n[tail_max_duration: <duration> | default = 1h]\n\n# Time to wait before sending more than the minimum successful query requests.\n# CLI flag: -querier.extra-query-delay\n[extra_query_delay: <duration> | default = 0s]\n\n# Maximum lookback beyond which queries are not sent to ingester. 0 means all\n# queries are sent to ingester.\n# CLI flag: -querier.query-ingesters-within\n[query_ingesters_within: <duration> | default = 3h]\n\nengine:\n  # The maximum amount of time to look back for log lines. Used only for instant\n  # log queries.\n  # CLI flag: -querier.engine.max-lookback-period\n  [max_look_back_period: <duration> | default = 30s]\n\n  # The maximum number of labels the heap of a topk query using a count min\n  # sketch can track.\n  # CLI flag: -querier.engine.max-count-min-sketch-heap-size\n  [max_count_min_sketch_heap_size: <int> | default = 10000]\n\n# The maximum number of queries that can be simultaneously processed by the\n# querier.\n# CLI flag: -querier.max-concurrent\n[max_concurrent: <int> | default = 4]\n\n# Only query the store, and not attempt any ingesters. This is useful for\n# running a standalone querier pool operating only against stored data.\n# CLI flag: -querier.query-store-only\n[query_store_only: <boolean> | default = false]\n\n# When true, queriers only query the ingesters, and not stored data. This is\n# useful when the object store is unavailable.\n# CLI flag: -querier.query-ingester-only\n[query_ingester_only: <boolean> | default = false]\n\n# When true, allow queries to span multiple tenants.\n# CLI flag: -querier.multi-tenant-queries-enabled\n[multi_tenant_queries_enabled: <boolean> | default = false]\n\n# When true, querier limits sent via a header are enforced.\n# CLI flag: -querier.per-request-limits-enabled\n[per_request_limits_enabled: <boolean> | default = false]\n\n# When true, querier directs ingester queries to the partition-ingesters instead\n# of the normal ingesters.\n# CLI flag: -querier.query-partition-ingesters\n[query_partition_ingesters: <boolean> | default = false]\n```\n\n### query_range\n\nThe `query_range` block configures the query splitting and caching in the Loki query-frontend.\n\n```yaml\n# Mutate incoming queries to align their start and end with their step.\n# CLI flag: -querier.align-querier-with-step\n[align_queries_with_step: <boolean> | default = false]\n\nresults_cache:\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is: frontend\n  [cache: <cache_config>]\n\n  # Use compression in cache. The default is an empty value '', which disables\n  # compression. Supported values are: 'snappy' and ''.\n  # CLI flag: -frontend.compression\n  [compression: <string> | default = \"\"]\n\n# Cache query results.\n# CLI flag: -querier.cache-results\n[cache_results: <boolean> | default = false]\n\n# Maximum number of retries for a single request; beyond this, the downstream\n# error is returned.\n# CLI flag: -querier.max-retries-per-request\n[max_retries: <int> | default = 5]\n\n# Perform query parallelisations based on storage sharding configuration and\n# query ASTs. This feature is supported only by the chunks storage engine.\n# CLI flag: -querier.parallelise-shardable-queries\n[parallelise_shardable_queries: <boolean> | default = true]\n\n# A comma-separated list of LogQL vector and range aggregations that should be\n# sharded. Possible values 'quantile_over_time', 'last_over_time',\n# 'first_over_time'.\n# CLI flag: -querier.shard-aggregations\n[shard_aggregations: <string> | default = \"\"]\n\n# Cache index stats query results.\n# CLI flag: -querier.cache-index-stats-results\n[cache_index_stats_results: <boolean> | default = true]\n\n# If a cache config is not specified and cache_index_stats_results is true, the\n# config for the results cache is used.\nindex_stats_results_cache:\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is:\n  # frontend.index-stats-results-cache\n  [cache: <cache_config>]\n\n  # Use compression in cache. The default is an empty value '', which disables\n  # compression. Supported values are: 'snappy' and ''.\n  # CLI flag: -frontend.index-stats-results-cache.compression\n  [compression: <string> | default = \"\"]\n\n# Cache volume query results.\n# CLI flag: -querier.cache-volume-results\n[cache_volume_results: <boolean> | default = true]\n\n# If a cache config is not specified and cache_volume_results is true, the\n# config for the results cache is used.\nvolume_results_cache:\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is:\n  # frontend.volume-results-cache\n  [cache: <cache_config>]\n\n  # Use compression in cache. The default is an empty value '', which disables\n  # compression. Supported values are: 'snappy' and ''.\n  # CLI flag: -frontend.volume-results-cache.compression\n  [compression: <string> | default = \"\"]\n\n# Cache instant metric query results.\n# CLI flag: -querier.cache-instant-metric-results\n[cache_instant_metric_results: <boolean> | default = false]\n\n# If a cache config is not specified and cache_instant_metric_results is true,\n# the config for the results cache is used.\ninstant_metric_results_cache:\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is:\n  # frontend.instant-metric-results-cache\n  [cache: <cache_config>]\n\n  # Use compression in cache. The default is an empty value '', which disables\n  # compression. Supported values are: 'snappy' and ''.\n  # CLI flag: -frontend.instant-metric-results-cache.compression\n  [compression: <string> | default = \"\"]\n\n# Whether to align the splits of instant metric query with splitByInterval and\n# query's exec time. Useful when instant_metric_cache is enabled\n# CLI flag: -querier.instant-metric-query-split-align\n[instant_metric_query_split_align: <boolean> | default = false]\n\n# Cache series query results.\n# CLI flag: -querier.cache-series-results\n[cache_series_results: <boolean> | default = true]\n\n# If series_results_cache is not configured and cache_series_results is true,\n# the config for the results cache is used.\nseries_results_cache:\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is:\n  # frontend.series-results-cache\n  [cache: <cache_config>]\n\n  # Use compression in cache. The default is an empty value '', which disables\n  # compression. Supported values are: 'snappy' and ''.\n  # CLI flag: -frontend.series-results-cache.compression\n  [compression: <string> | default = \"\"]\n\n# Cache label query results.\n# CLI flag: -querier.cache-label-results\n[cache_label_results: <boolean> | default = true]\n\n# If label_results_cache is not configured and cache_label_results is true, the\n# config for the results cache is used.\nlabel_results_cache:\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is:\n  # frontend.label-results-cache\n  [cache: <cache_config>]\n\n  # Use compression in cache. The default is an empty value '', which disables\n  # compression. Supported values are: 'snappy' and ''.\n  # CLI flag: -frontend.label-results-cache.compression\n  [compression: <string> | default = \"\"]\n```\n\n### query_scheduler\n\nThe `query_scheduler` block configures the Loki query scheduler. When configured it separates the tenant query queues from the query-frontend.\n\n```yaml\n# Maximum number of outstanding requests per tenant per query-scheduler.\n# In-flight requests above this limit will fail with HTTP response status code\n# 429.\n# CLI flag: -query-scheduler.max-outstanding-requests-per-tenant\n[max_outstanding_requests_per_tenant: <int> | default = 32000]\n\n# Maximum number of levels of nesting of hierarchical queues. 0 means that\n# hierarchical queues are disabled.\n# CLI flag: -query-scheduler.max-queue-hierarchy-levels\n[max_queue_hierarchy_levels: <int> | default = 3]\n\n# If a querier disconnects without sending notification about graceful shutdown,\n# the query-scheduler will keep the querier in the tenant's shard until the\n# forget delay has passed. This feature is useful to reduce the blast radius\n# when shuffle-sharding is enabled.\n# CLI flag: -query-scheduler.querier-forget-delay\n[querier_forget_delay: <duration> | default = 0s]\n\n# This configures the gRPC client used to report errors back to the\n# query-frontend.\n# The CLI flags prefix for this block configuration is:\n# query-scheduler.grpc-client-config\n[grpc_client_config: <grpc_client>]\n\n# Set to true to have the query schedulers create and place themselves in a\n# ring. If no frontend_address or scheduler_address are present anywhere else in\n# the configuration, Loki will toggle this value to true.\n# CLI flag: -query-scheduler.use-scheduler-ring\n[use_scheduler_ring: <boolean> | default = false]\n\n# The hash ring configuration. This option is required only if\n# use_scheduler_ring is true.\nscheduler_ring:\n  kvstore:\n    # Backend storage to use for the ring. Supported values are: consul, etcd,\n    # inmemory, memberlist, multi.\n    # CLI flag: -query-scheduler.ring.store\n    [store: <string> | default = \"consul\"]\n\n    # The prefix for the keys in the store. Should end with a /.\n    # CLI flag: -query-scheduler.ring.prefix\n    [prefix: <string> | default = \"collectors/\"]\n\n    # Configuration for a Consul client. Only applies if the selected kvstore is\n    # consul.\n    # The CLI flags prefix for this block configuration is: query-scheduler.ring\n    [consul: <consul>]\n\n    # Configuration for an ETCD v3 client. Only applies if the selected kvstore\n    # is etcd.\n    # The CLI flags prefix for this block configuration is: query-scheduler.ring\n    [etcd: <etcd>]\n\n    multi:\n      # Primary backend storage used by multi-client.\n      # CLI flag: -query-scheduler.ring.multi.primary\n      [primary: <string> | default = \"\"]\n\n      # Secondary backend storage used by multi-client.\n      # CLI flag: -query-scheduler.ring.multi.secondary\n      [secondary: <string> | default = \"\"]\n\n      # Mirror writes to the secondary store.\n      # CLI flag: -query-scheduler.ring.multi.mirror-enabled\n      [mirror_enabled: <boolean> | default = false]\n\n      # Timeout for storing a value to the secondary store.\n      # CLI flag: -query-scheduler.ring.multi.mirror-timeout\n      [mirror_timeout: <duration> | default = 2s]\n\n  # Period at which to heartbeat to the ring.\n  # CLI flag: -query-scheduler.ring.heartbeat-period\n  [heartbeat_period: <duration> | default = 15s]\n\n  # The heartbeat timeout after which compactors are considered unhealthy within\n  # the ring. 0 = never (timeout disabled).\n  # CLI flag: -query-scheduler.ring.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # File path where tokens are stored. If empty, tokens are not stored at\n  # shutdown and restored at startup.\n  # CLI flag: -query-scheduler.ring.tokens-file-path\n  [tokens_file_path: <string> | default = \"\"]\n\n  # True to enable zone-awareness and replicate blocks across different\n  # availability zones.\n  # CLI flag: -query-scheduler.ring.zone-awareness-enabled\n  [zone_awareness_enabled: <boolean> | default = false]\n\n  # Instance ID to register in the ring.\n  # CLI flag: -query-scheduler.ring.instance-id\n  [instance_id: <string> | default = \"<hostname>\"]\n\n  # Name of network interface to read address from.\n  # CLI flag: -query-scheduler.ring.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # Port to advertise in the ring (defaults to server.grpc-listen-port).\n  # CLI flag: -query-scheduler.ring.instance-port\n  [instance_port: <int> | default = 0]\n\n  # IP address to advertise in the ring.\n  # CLI flag: -query-scheduler.ring.instance-addr\n  [instance_addr: <string> | default = \"\"]\n\n  # The availability zone where this instance is running. Required if\n  # zone-awareness is enabled.\n  # CLI flag: -query-scheduler.ring.instance-availability-zone\n  [instance_availability_zone: <string> | default = \"\"]\n\n  # Enable using a IPv6 instance address.\n  # CLI flag: -query-scheduler.ring.instance-enable-ipv6\n  [instance_enable_ipv6: <boolean> | default = false]\n```\n\n### ruler\n\nThe `ruler` block configures the Loki ruler.\n\n```yaml\n# Base URL of the Grafana instance.\n# CLI flag: -ruler.external.url\n[external_url: <url>]\n\n# Datasource UID for the dashboard.\n# CLI flag: -ruler.datasource-uid\n[datasource_uid: <string> | default = \"\"]\n\n# Labels to add to all alerts.\nexternal_labels:\n\n# The grpc_client block configures the gRPC client used to communicate between a\n# client and server component in Loki.\n# The CLI flags prefix for this block configuration is: ruler.client\n[ruler_client: <grpc_client>]\n\n# How frequently to evaluate rules.\n# CLI flag: -ruler.evaluation-interval\n[evaluation_interval: <duration> | default = 1m]\n\n# How frequently to poll for rule changes.\n# CLI flag: -ruler.poll-interval\n[poll_interval: <duration> | default = 1m]\n\n# Deprecated: Use -ruler-storage. CLI flags and their respective YAML config\n# options instead.\nstorage:\n  # Method to use for backend rule storage (configdb, azure, gcs, s3, swift,\n  # local, bos, cos)\n  # CLI flag: -ruler.storage.type\n  [type: <string> | default = \"\"]\n\n  # Configures backend rule storage for Azure.\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [azure: <azure_storage_config>]\n\n  # Configures backend rule storage for AlibabaCloud Object Storage (OSS).\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [alibabacloud: <alibabacloud_storage_config>]\n\n  # Configures backend rule storage for GCS.\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [gcs: <gcs_storage_config>]\n\n  # Configures backend rule storage for S3.\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [s3: <s3_storage_config>]\n\n  # Configures backend rule storage for Baidu Object Storage (BOS).\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [bos: <bos_storage_config>]\n\n  # Configures backend rule storage for Swift.\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [swift: <swift_storage_config>]\n\n  # Configures backend rule storage for IBM Cloud Object Storage (COS).\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [cos: <cos_storage_config>]\n\n  # Configures backend rule storage for a local file system directory.\n  local:\n    # Directory to scan for rules\n    # CLI flag: -ruler.storage.local.directory\n    [directory: <string> | default = \"\"]\n\n# File path to store temporary rule files.\n# CLI flag: -ruler.rule-path\n[rule_path: <string> | default = \"/rules\"]\n\n# Comma-separated list of Alertmanager URLs to send notifications to. Each\n# Alertmanager URL is treated as a separate group in the configuration. Multiple\n# Alertmanagers in HA per group can be supported by using DNS resolution via\n# '-ruler.alertmanager-discovery'.\n# CLI flag: -ruler.alertmanager-url\n[alertmanager_url: <string> | default = \"\"]\n\n# Use DNS SRV records to discover Alertmanager hosts.\n# CLI flag: -ruler.alertmanager-discovery\n[enable_alertmanager_discovery: <boolean> | default = false]\n\n# How long to wait between refreshing DNS resolutions of Alertmanager hosts.\n# CLI flag: -ruler.alertmanager-refresh-interval\n[alertmanager_refresh_interval: <duration> | default = 1m]\n\n# Use Alertmanager APIv2. APIv1 was deprecated in Alertmanager 0.16.0 and is\n# removed as of 0.27.0.\n# CLI flag: -ruler.alertmanager-use-v2\n[enable_alertmanager_v2: <boolean> | default = true]\n\n# List of alert relabel configs.\n[alert_relabel_configs: <relabel_config...>]\n\n# Capacity of the queue for notifications to be sent to the Alertmanager.\n# CLI flag: -ruler.notification-queue-capacity\n[notification_queue_capacity: <int> | default = 10000]\n\n# HTTP timeout duration when sending notifications to the Alertmanager.\n# CLI flag: -ruler.notification-timeout\n[notification_timeout: <duration> | default = 10s]\n\nalertmanager_client:\n  # The TLS configuration.\n  # The CLI flags prefix for this block configuration is:\n  # ruler.alertmanager-client\n  [<tls_config>]\n\n  # HTTP Basic authentication username. It overrides the username set in the URL\n  # (if any).\n  # CLI flag: -ruler.alertmanager-client.basic-auth-username\n  [basic_auth_username: <string> | default = \"\"]\n\n  # HTTP Basic authentication password. It overrides the password set in the URL\n  # (if any).\n  # CLI flag: -ruler.alertmanager-client.basic-auth-password\n  [basic_auth_password: <string> | default = \"\"]\n\n  # HTTP Header authorization type (default: Bearer).\n  # CLI flag: -ruler.alertmanager-client.type\n  [type: <string> | default = \"Bearer\"]\n\n  # HTTP Header authorization credentials.\n  # CLI flag: -ruler.alertmanager-client.credentials\n  [credentials: <string> | default = \"\"]\n\n  # HTTP Header authorization credentials file.\n  # CLI flag: -ruler.alertmanager-client.credentials-file\n  [credentials_file: <string> | default = \"\"]\n\n# Max time to tolerate outage for restoring \"for\" state of alert.\n# CLI flag: -ruler.for-outage-tolerance\n[for_outage_tolerance: <duration> | default = 1h]\n\n# Minimum duration between alert and restored \"for\" state. This is maintained\n# only for alerts with configured \"for\" time greater than the grace period.\n# CLI flag: -ruler.for-grace-period\n[for_grace_period: <duration> | default = 10m]\n\n# Minimum amount of time to wait before resending an alert to Alertmanager.\n# CLI flag: -ruler.resend-delay\n[resend_delay: <duration> | default = 1m]\n\n# Distribute rule evaluation using ring backend.\n# CLI flag: -ruler.enable-sharding\n[enable_sharding: <boolean> | default = false]\n\n# The sharding strategy to use. Supported values are: default, shuffle-sharding.\n# CLI flag: -ruler.sharding-strategy\n[sharding_strategy: <string> | default = \"default\"]\n\n# The sharding algorithm to use for deciding how rules & groups are sharded.\n# Supported values are: by-group, by-rule.\n# CLI flag: -ruler.sharding-algo\n[sharding_algo: <string> | default = \"by-group\"]\n\n# Time to spend searching for a pending ruler when shutting down.\n# CLI flag: -ruler.search-pending-for\n[search_pending_for: <duration> | default = 5m]\n\n# Ring used by Loki ruler. The CLI flags prefix for this block configuration is\n# 'ruler.ring'.\nring:\n  kvstore:\n    # Backend storage to use for the ring. Supported values are: consul, etcd,\n    # inmemory, memberlist, multi.\n    # CLI flag: -ruler.ring.store\n    [store: <string> | default = \"consul\"]\n\n    # The prefix for the keys in the store. Should end with a /.\n    # CLI flag: -ruler.ring.prefix\n    [prefix: <string> | default = \"rulers/\"]\n\n    # Configuration for a Consul client. Only applies if the selected kvstore is\n    # consul.\n    # The CLI flags prefix for this block configuration is: ruler.ring\n    [consul: <consul>]\n\n    # Configuration for an ETCD v3 client. Only applies if the selected kvstore\n    # is etcd.\n    # The CLI flags prefix for this block configuration is: ruler.ring\n    [etcd: <etcd>]\n\n    multi:\n      # Primary backend storage used by multi-client.\n      # CLI flag: -ruler.ring.multi.primary\n      [primary: <string> | default = \"\"]\n\n      # Secondary backend storage used by multi-client.\n      # CLI flag: -ruler.ring.multi.secondary\n      [secondary: <string> | default = \"\"]\n\n      # Mirror writes to the secondary store.\n      # CLI flag: -ruler.ring.multi.mirror-enabled\n      [mirror_enabled: <boolean> | default = false]\n\n      # Timeout for storing a value to the secondary store.\n      # CLI flag: -ruler.ring.multi.mirror-timeout\n      [mirror_timeout: <duration> | default = 2s]\n\n  # Interval between heartbeats sent to the ring.\n  # CLI flag: -ruler.ring.heartbeat-period\n  [heartbeat_period: <duration> | default = 5s]\n\n  # The heartbeat timeout after which ruler ring members are considered\n  # unhealthy within the ring. 0 = never (timeout disabled).\n  # CLI flag: -ruler.ring.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # Name of network interface to read addresses from.\n  # CLI flag: -ruler.ring.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # The number of tokens the lifecycler will generate and put into the ring if\n  # it joined without transferring tokens from another lifecycler.\n  # CLI flag: -ruler.ring.num-tokens\n  [num_tokens: <int> | default = 128]\n\n# Period with which to attempt to flush rule groups.\n# CLI flag: -ruler.flush-period\n[flush_period: <duration> | default = 1m]\n\n# Enable the ruler API.\n# CLI flag: -ruler.enable-api\n[enable_api: <boolean> | default = true]\n\n# Comma separated list of tenants whose rules this ruler can evaluate. If\n# specified, only these tenants will be handled by ruler, otherwise this ruler\n# can process rules from all tenants. Subject to sharding.\n# CLI flag: -ruler.enabled-tenants\n[enabled_tenants: <string> | default = \"\"]\n\n# Comma separated list of tenants whose rules this ruler cannot evaluate. If\n# specified, a ruler that would normally pick the specified tenant(s) for\n# processing will ignore them instead. Subject to sharding.\n# CLI flag: -ruler.disabled-tenants\n[disabled_tenants: <string> | default = \"\"]\n\n# Report the wall time for ruler queries to complete as a per user metric and as\n# an info level log message.\n# CLI flag: -ruler.query-stats-enabled\n[query_stats_enabled: <boolean> | default = false]\n\n# Disable the rule_group label on exported metrics.\n# CLI flag: -ruler.disable-rule-group-label\n[disable_rule_group_label: <boolean> | default = false]\n\nwal:\n  # The directory in which to write tenant WAL files. Each tenant will have its\n  # own directory one level below this directory.\n  # CLI flag: -ruler.wal.dir\n  [dir: <string> | default = \"ruler-wal\"]\n\n  # Frequency with which to run the WAL truncation process.\n  # CLI flag: -ruler.wal.truncate-frequency\n  [truncate_frequency: <duration> | default = 1h]\n\n  # Minimum age that samples must exist in the WAL before being truncated.\n  # CLI flag: -ruler.wal.min-age\n  [min_age: <duration> | default = 5m]\n\n  # Maximum age that samples must exist in the WAL before being truncated.\n  # CLI flag: -ruler.wal.max-age\n  [max_age: <duration> | default = 4h]\n\nwal_cleaner:\n  # The minimum age of a WAL to consider for cleaning.\n  # CLI flag: -ruler.wal-cleaner.min-age\n  [min_age: <duration> | default = 12h]\n\n  # How often to run the WAL cleaner. 0 = disabled.\n  # CLI flag: -ruler.wal-cleaner.period\n  [period: <duration> | default = 0s]\n\n# Remote-write configuration to send rule samples to a Prometheus remote-write\n# endpoint.\nremote_write:\n  # Deprecated: Use 'clients' instead. Configure remote write client.\n  [client: <RemoteWriteConfig>]\n\n  # Configure remote write clients. A map with remote client id as key. For\n  # details, see\n  # https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write\n  # Specifying a header with key 'X-Scope-OrgID' under the 'headers' section of\n  # RemoteWriteConfig is not permitted. If specified, it will be dropped during\n  # config parsing.\n  [clients: <map of string to RemoteWriteConfig>]\n\n  # Enable remote-write functionality.\n  # CLI flag: -ruler.remote-write.enabled\n  [enabled: <boolean> | default = false]\n\n  # Minimum period to wait between refreshing remote-write reconfigurations.\n  # This should be greater than or equivalent to\n  # -limits.per-user-override-period.\n  # CLI flag: -ruler.remote-write.config-refresh-period\n  [config_refresh_period: <duration> | default = 10s]\n\n  # Add an X-Scope-OrgID header in remote write requests with the tenant ID of a\n  # Loki tenant that the recording rules are part of.\n  # CLI flag: -ruler.remote-write.add-org-id-header\n  [add_org_id_header: <boolean> | default = true]\n\n# Configuration for rule evaluation.\nevaluation:\n  # The evaluation mode for the ruler. Can be either 'local' or 'remote'. If set\n  # to 'local', the ruler will evaluate rules locally. If set to 'remote', the\n  # ruler will evaluate rules remotely. If unset, the ruler will evaluate rules\n  # locally.\n  # CLI flag: -ruler.evaluation.mode\n  [mode: <string> | default = \"local\"]\n\n  # Upper bound of random duration to wait before rule evaluation to avoid\n  # contention during concurrent execution of rules. Jitter is calculated\n  # consistently for a given rule. Set 0 to disable (default).\n  # CLI flag: -ruler.evaluation.max-jitter\n  [max_jitter: <duration> | default = 0s]\n\n  query_frontend:\n    # GRPC listen address of the query-frontend(s). Must be a DNS address\n    # (prefixed with dns:///) to enable client side load balancing.\n    # CLI flag: -ruler.evaluation.query-frontend.address\n    [address: <string> | default = \"\"]\n\n    # Set to true if query-frontend connection requires TLS.\n    # CLI flag: -ruler.evaluation.query-frontend.tls-enabled\n    [tls_enabled: <boolean> | default = false]\n\n    # The TLS configuration.\n    # The CLI flags prefix for this block configuration is:\n    # ruler.evaluation.query-frontend\n    [<tls_config>]\n```\n\n### runtime_config\n\nConfiguration for 'runtime config' module, responsible for reloading runtime configuration file.\n\n```yaml\n# How often to check runtime config files.\n# CLI flag: -runtime-config.reload-period\n[period: <duration> | default = 10s]\n\n# Comma separated list of yaml files with the configuration that can be updated\n# at runtime. Runtime config files will be merged from left to right.\n# CLI flag: -runtime-config.file\n[file: <string> | default = \"\"]\n```\n\n### s3_storage_config\n\nThe `s3_storage_config` block configures the connection to Amazon S3 object storage backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n&nbsp;\n\n```yaml\n# S3 endpoint URL with escaped Key and Secret encoded. If only region is\n# specified as a host, proper endpoint will be deduced. Use\n# inmemory:///<bucket-name> to use a mock in-memory implementation.\n# CLI flag: -<prefix>.s3.url\n[s3: <url>]\n\n# Set this to `true` to force the request to use path-style addressing.\n# CLI flag: -<prefix>.s3.force-path-style\n[s3forcepathstyle: <boolean> | default = false]\n\n# Comma separated list of bucket names to evenly distribute chunks over.\n# Overrides any buckets specified in s3.url flag\n# CLI flag: -<prefix>.s3.buckets\n[bucketnames: <string> | default = \"\"]\n\n# S3 Endpoint to connect to.\n# CLI flag: -<prefix>.s3.endpoint\n[endpoint: <string> | default = \"\"]\n\n# AWS region to use.\n# CLI flag: -<prefix>.s3.region\n[region: <string> | default = \"\"]\n\n# AWS Access Key ID\n# CLI flag: -<prefix>.s3.access-key-id\n[access_key_id: <string> | default = \"\"]\n\n# AWS Secret Access Key\n# CLI flag: -<prefix>.s3.secret-access-key\n[secret_access_key: <string> | default = \"\"]\n\n# AWS Session Token\n# CLI flag: -<prefix>.s3.session-token\n[session_token: <string> | default = \"\"]\n\n# Disable https on s3 connection.\n# CLI flag: -<prefix>.s3.insecure\n[insecure: <boolean> | default = false]\n\n# Delimiter used to replace the default delimiter ':' in chunk IDs when storing\n# chunks. This is mainly intended when you run a MinIO instance on a Windows\n# machine. You should not change this value inflight.\n# CLI flag: -<prefix>.s3.chunk-delimiter\n[chunk_delimiter: <string> | default = \"\"]\n\nhttp_config:\n  # Timeout specifies a time limit for requests made by s3 Client.\n  # CLI flag: -<prefix>.s3.http.timeout\n  [timeout: <duration> | default = 0s]\n\n  # The maximum amount of time an idle connection will be held open.\n  # CLI flag: -<prefix>.s3.http.idle-conn-timeout\n  [idle_conn_timeout: <duration> | default = 1m30s]\n\n  # If non-zero, specifies the amount of time to wait for a server's response\n  # headers after fully writing the request.\n  # CLI flag: -<prefix>.s3.http.response-header-timeout\n  [response_header_timeout: <duration> | default = 0s]\n\n  # Set to true to skip verifying the certificate chain and hostname.\n  # CLI flag: -<prefix>.s3.http.insecure-skip-verify\n  [insecure_skip_verify: <boolean> | default = false]\n\n  # Path to the trusted CA file that signed the SSL certificate of the S3\n  # endpoint.\n  # CLI flag: -<prefix>.s3.http.ca-file\n  [ca_file: <string> | default = \"\"]\n\n# The signature version to use for authenticating against S3. Supported values\n# are: v4.\n# CLI flag: -<prefix>.s3.signature-version\n[signature_version: <string> | default = \"v4\"]\n\n# The S3 storage class which objects will use. Supported values are: GLACIER,\n# DEEP_ARCHIVE, GLACIER_IR, INTELLIGENT_TIERING, ONEZONE_IA, OUTPOSTS,\n# REDUCED_REDUNDANCY, STANDARD, STANDARD_IA.\n# CLI flag: -<prefix>.s3.storage-class\n[storage_class: <string> | default = \"STANDARD\"]\n\nsse:\n  # Enable AWS Server Side Encryption. Supported values: SSE-KMS, SSE-S3.\n  # CLI flag: -<prefix>.s3.sse.type\n  [type: <string> | default = \"\"]\n\n  # KMS Key ID used to encrypt objects in S3\n  # CLI flag: -<prefix>.s3.sse.kms-key-id\n  [kms_key_id: <string> | default = \"\"]\n\n  # KMS Encryption Context used for object encryption. It expects JSON formatted\n  # string.\n  # CLI flag: -<prefix>.s3.sse.kms-encryption-context\n  [kms_encryption_context: <string> | default = \"\"]\n\n# Configures back off when S3 get Object.\nbackoff_config:\n  # Minimum backoff time when s3 get Object\n  # CLI flag: -<prefix>.s3.min-backoff\n  [min_period: <duration> | default = 100ms]\n\n  # Maximum backoff time when s3 get Object\n  # CLI flag: -<prefix>.s3.max-backoff\n  [max_period: <duration> | default = 3s]\n\n  # Maximum number of times to retry for s3 GetObject or ObjectExists\n  # CLI flag: -<prefix>.s3.max-retries\n  [max_retries: <int> | default = 5]\n\n# Disable forcing S3 dualstack endpoint usage.\n# CLI flag: -<prefix>.s3.disable-dualstack\n[disable_dualstack: <boolean> | default = false]\n```\n\n### schema_config\n\nConfigures the chunk index schema and where it is stored.\n\n```yaml\n[configs: <list of period_configs>]\n```\n\n### server\n\nConfigures the `server` of the launched module(s).\n\n```yaml\n# HTTP server listen network, default tcp\n# CLI flag: -server.http-listen-network\n[http_listen_network: <string> | default = \"tcp\"]\n\n# HTTP server listen address.\n# CLI flag: -server.http-listen-address\n[http_listen_address: <string> | default = \"\"]\n\n# HTTP server listen port.\n# CLI flag: -server.http-listen-port\n[http_listen_port: <int> | default = 3100]\n\n# Maximum number of simultaneous http connections, <=0 to disable\n# CLI flag: -server.http-conn-limit\n[http_listen_conn_limit: <int> | default = 0]\n\n# gRPC server listen network\n# CLI flag: -server.grpc-listen-network\n[grpc_listen_network: <string> | default = \"tcp\"]\n\n# gRPC server listen address.\n# CLI flag: -server.grpc-listen-address\n[grpc_listen_address: <string> | default = \"\"]\n\n# gRPC server listen port.\n# CLI flag: -server.grpc-listen-port\n[grpc_listen_port: <int> | default = 9095]\n\n# Maximum number of simultaneous grpc connections, <=0 to disable\n# CLI flag: -server.grpc-conn-limit\n[grpc_listen_conn_limit: <int> | default = 0]\n\n# If true, the max streams by connection gauge will be collected.\n# CLI flag: -server.grpc-collect-max-streams-by-conn\n[grpc_collect_max_streams_by_conn: <boolean> | default = true]\n\n# Enables PROXY protocol.\n# CLI flag: -server.proxy-protocol-enabled\n[proxy_protocol_enabled: <boolean> | default = false]\n\n# Comma-separated list of cipher suites to use. If blank, the default Go cipher\n# suites is used.\n# CLI flag: -server.tls-cipher-suites\n[tls_cipher_suites: <string> | default = \"\"]\n\n# Minimum TLS version to use. Allowed values: VersionTLS10, VersionTLS11,\n# VersionTLS12, VersionTLS13. If blank, the Go TLS minimum version is used.\n# CLI flag: -server.tls-min-version\n[tls_min_version: <string> | default = \"\"]\n\nhttp_tls_config:\n  # Server TLS certificate. This configuration parameter is YAML only.\n  [cert: <string> | default = \"\"]\n\n  # Server TLS key. This configuration parameter is YAML only.\n  [key: <string> | default = \"\"]\n\n  # Root certificate authority used to verify client certificates. This\n  # configuration parameter is YAML only.\n  [client_ca: <string> | default = \"\"]\n\n  # HTTP server cert path.\n  # CLI flag: -server.http-tls-cert-path\n  [cert_file: <string> | default = \"\"]\n\n  # HTTP server key path.\n  # CLI flag: -server.http-tls-key-path\n  [key_file: <string> | default = \"\"]\n\n  # HTTP TLS Client Auth type.\n  # CLI flag: -server.http-tls-client-auth\n  [client_auth_type: <string> | default = \"\"]\n\n  # HTTP TLS Client CA path.\n  # CLI flag: -server.http-tls-ca-path\n  [client_ca_file: <string> | default = \"\"]\n\ngrpc_tls_config:\n  # Server TLS certificate. This configuration parameter is YAML only.\n  [cert: <string> | default = \"\"]\n\n  # Server TLS key. This configuration parameter is YAML only.\n  [key: <string> | default = \"\"]\n\n  # Root certificate authority used to verify client certificates. This\n  # configuration parameter is YAML only.\n  [client_ca: <string> | default = \"\"]\n\n  # GRPC TLS server cert path.\n  # CLI flag: -server.grpc-tls-cert-path\n  [cert_file: <string> | default = \"\"]\n\n  # GRPC TLS server key path.\n  # CLI flag: -server.grpc-tls-key-path\n  [key_file: <string> | default = \"\"]\n\n  # GRPC TLS Client Auth type.\n  # CLI flag: -server.grpc-tls-client-auth\n  [client_auth_type: <string> | default = \"\"]\n\n  # GRPC TLS Client CA path.\n  # CLI flag: -server.grpc-tls-ca-path\n  [client_ca_file: <string> | default = \"\"]\n\n# Register the intrumentation handlers (/metrics etc).\n# CLI flag: -server.register-instrumentation\n[register_instrumentation: <boolean> | default = true]\n\n# If set to true, gRPC statuses will be reported in instrumentation labels with\n# their string representations. Otherwise, they will be reported as \"error\".\n# CLI flag: -server.report-grpc-codes-in-instrumentation-label-enabled\n[report_grpc_codes_in_instrumentation_label_enabled: <boolean> | default = false]\n\n# Timeout for graceful shutdowns\n# CLI flag: -server.graceful-shutdown-timeout\n[graceful_shutdown_timeout: <duration> | default = 30s]\n\n# Read timeout for entire HTTP request, including headers and body.\n# CLI flag: -server.http-read-timeout\n[http_server_read_timeout: <duration> | default = 30s]\n\n# Read timeout for HTTP request headers. If set to 0, value of\n# -server.http-read-timeout is used.\n# CLI flag: -server.http-read-header-timeout\n[http_server_read_header_timeout: <duration> | default = 0s]\n\n# Write timeout for HTTP server\n# CLI flag: -server.http-write-timeout\n[http_server_write_timeout: <duration> | default = 30s]\n\n# Idle timeout for HTTP server\n# CLI flag: -server.http-idle-timeout\n[http_server_idle_timeout: <duration> | default = 2m]\n\n# Log closed connections that did not receive any response, most likely because\n# client didn't send any request within timeout.\n# CLI flag: -server.http-log-closed-connections-without-response-enabled\n[http_log_closed_connections_without_response_enabled: <boolean> | default = false]\n\n# Limit on the size of a gRPC message this server can receive (bytes).\n# CLI flag: -server.grpc-max-recv-msg-size-bytes\n[grpc_server_max_recv_msg_size: <int> | default = 4194304]\n\n# Limit on the size of a gRPC message this server can send (bytes).\n# CLI flag: -server.grpc-max-send-msg-size-bytes\n[grpc_server_max_send_msg_size: <int> | default = 4194304]\n\n# Limit on the number of concurrent streams for gRPC calls per client connection\n# (0 = unlimited)\n# CLI flag: -server.grpc-max-concurrent-streams\n[grpc_server_max_concurrent_streams: <int> | default = 100]\n\n# The duration after which an idle connection should be closed. Default:\n# infinity\n# CLI flag: -server.grpc.keepalive.max-connection-idle\n[grpc_server_max_connection_idle: <duration> | default = 2562047h47m16.854775807s]\n\n# The duration for the maximum amount of time a connection may exist before it\n# will be closed. Default: infinity\n# CLI flag: -server.grpc.keepalive.max-connection-age\n[grpc_server_max_connection_age: <duration> | default = 2562047h47m16.854775807s]\n\n# An additive period after max-connection-age after which the connection will be\n# forcibly closed. Default: infinity\n# CLI flag: -server.grpc.keepalive.max-connection-age-grace\n[grpc_server_max_connection_age_grace: <duration> | default = 2562047h47m16.854775807s]\n\n# Duration after which a keepalive probe is sent in case of no activity over the\n# connection., Default: 2h\n# CLI flag: -server.grpc.keepalive.time\n[grpc_server_keepalive_time: <duration> | default = 2h]\n\n# After having pinged for keepalive check, the duration after which an idle\n# connection should be closed, Default: 20s\n# CLI flag: -server.grpc.keepalive.timeout\n[grpc_server_keepalive_timeout: <duration> | default = 20s]\n\n# Minimum amount of time a client should wait before sending a keepalive ping.\n# If client sends keepalive ping more often, server will send GOAWAY and close\n# the connection.\n# CLI flag: -server.grpc.keepalive.min-time-between-pings\n[grpc_server_min_time_between_pings: <duration> | default = 10s]\n\n# If true, server allows keepalive pings even when there are no active\n# streams(RPCs). If false, and client sends ping when there are no active\n# streams, server will send GOAWAY and close the connection.\n# CLI flag: -server.grpc.keepalive.ping-without-stream-allowed\n[grpc_server_ping_without_stream_allowed: <boolean> | default = true]\n\n# If non-zero, configures the amount of GRPC server workers used to serve the\n# requests.\n# CLI flag: -server.grpc.num-workers\n[grpc_server_num_workers: <int> | default = 0]\n\n# If true, the request_message_bytes, response_message_bytes, and\n# inflight_requests metrics will be tracked. Enabling this option prevents the\n# use of memory pools for parsing gRPC request bodies and may lead to more\n# memory allocations.\n# CLI flag: -server.grpc.stats-tracking-enabled\n[grpc_server_stats_tracking_enabled: <boolean> | default = true]\n\n# Deprecated option, has no effect and will be removed in a future version.\n# CLI flag: -server.grpc.recv-buffer-pools-enabled\n[grpc_server_recv_buffer_pools_enabled: <boolean> | default = false]\n\n# Output log messages in the given format. Valid formats: [logfmt, json]\n# CLI flag: -log.format\n[log_format: <string> | default = \"logfmt\"]\n\n# Only log messages with the given severity or above. Valid levels: [debug,\n# info, warn, error]\n# CLI flag: -log.level\n[log_level: <string> | default = \"info\"]\n\n# Optionally log the source IPs.\n# CLI flag: -server.log-source-ips-enabled\n[log_source_ips_enabled: <boolean> | default = false]\n\n# Log all source IPs instead of only the originating one. Only used if\n# server.log-source-ips-enabled is true\n# CLI flag: -server.log-source-ips-full\n[log_source_ips_full: <boolean> | default = false]\n\n# Header field storing the source IPs. Only used if\n# server.log-source-ips-enabled is true. If not set the default Forwarded,\n# X-Real-IP and X-Forwarded-For headers are used\n# CLI flag: -server.log-source-ips-header\n[log_source_ips_header: <string> | default = \"\"]\n\n# Regex for matching the source IPs. Only used if server.log-source-ips-enabled\n# is true. If not set the default Forwarded, X-Real-IP and X-Forwarded-For\n# headers are used\n# CLI flag: -server.log-source-ips-regex\n[log_source_ips_regex: <string> | default = \"\"]\n\n# Optionally log request headers.\n# CLI flag: -server.log-request-headers\n[log_request_headers: <boolean> | default = false]\n\n# Optionally log requests at info level instead of debug level. Applies to\n# request headers as well if server.log-request-headers is enabled.\n# CLI flag: -server.log-request-at-info-level-enabled\n[log_request_at_info_level_enabled: <boolean> | default = false]\n\n# Comma separated list of headers to exclude from loggin. Only used if\n# server.log-request-headers is true.\n# CLI flag: -server.log-request-headers-exclude-list\n[log_request_exclude_headers_list: <string> | default = \"\"]\n\n# Optionally add request headers to tracing spans.\n# CLI flag: -server.trace-request-headers\n[trace_request_headers: <boolean> | default = false]\n\n# Comma separated list of headers to exclude from tracing spans. Only used if\n# server.trace-request-headers is true. The following headers are always\n# excluded: Authorization, Cookie, X-Access-Token, X-Csrf-Token, X-Grafana-Id.\n# CLI flag: -server.trace-request-headers-exclude-list\n[trace_request_exclude_headers_list: <string> | default = \"\"]\n\n# Base path to serve all API routes from (e.g. /v1/)\n# CLI flag: -server.path-prefix\n[http_path_prefix: <string> | default = \"\"]\n\ncluster_validation:\n  # Primary cluster validation label.\n  # CLI flag: -server.cluster-validation.label\n  [label: <string> | default = \"\"]\n\n  # Comma-separated list of additional cluster validation labels that the server\n  # will accept from incoming requests.\n  # CLI flag: -server.cluster-validation.additional-labels\n  [additional_labels: <string> | default = \"\"]\n\n  grpc:\n    # When enabled, cluster label validation is executed: configured cluster\n    # validation label is compared with the cluster validation label received\n    # through the requests.\n    # CLI flag: -server.cluster-validation.grpc.enabled\n    [enabled: <boolean> | default = false]\n\n    # When enabled, soft cluster label validation is executed. Can be enabled\n    # only together with server.cluster-validation.grpc.enabled\n    # CLI flag: -server.cluster-validation.grpc.soft-validation\n    [soft_validation: <boolean> | default = false]\n\n  http:\n    # When enabled, cluster label validation is executed: configured cluster\n    # validation label is compared with the cluster validation label received\n    # through the requests.\n    # CLI flag: -server.cluster-validation.http.enabled\n    [enabled: <boolean> | default = false]\n\n    # When enabled, soft cluster label validation is executed. Can be enabled\n    # only together with server.cluster-validation.http.enabled\n    # CLI flag: -server.cluster-validation.http.soft-validation\n    [soft_validation: <boolean> | default = false]\n\n    # Comma-separated list of url paths that are excluded from the cluster\n    # validation check.\n    # CLI flag: -server.cluster-validation.http.excluded-paths\n    [excluded_paths: <string> | default = \"\"]\n\n    # Comma-separated list of user agents that are excluded from the cluster\n    # validation check.\n    # CLI flag: -server.cluster-validation.http.excluded-user-agents\n    [excluded_user_agents: <string> | default = \"\"]\n```\n\n### storage_config\n\nThe `storage_config` block configures one of many possible stores for both the index and chunks. Which configuration to be picked should be defined in schema_config block.\n\n```yaml\n# The alibabacloud_storage_config block configures the connection to Alibaba\n# Cloud Storage object storage backend.\n[alibabacloud: <alibabacloud_storage_config>]\n\n# The aws_storage_config block configures the connection to dynamoDB and S3\n# object storage. Either one of them or both can be configured.\n[aws: <aws_storage_config>]\n\n# The azure_storage_config block configures the connection to Azure object\n# storage backend.\n[azure: <azure_storage_config>]\n\n# The bos_storage_config block configures the connection to Baidu Object Storage\n# (BOS) object storage backend.\n[bos: <bos_storage_config>]\n\n# Deprecated: Configures storing indexes in Bigtable. Required fields only\n# required when bigtable is defined in config.\nbigtable:\n  # Bigtable project ID.\n  # CLI flag: -bigtable.project\n  [project: <string> | default = \"\"]\n\n  # Bigtable instance ID. Please refer to\n  # https://cloud.google.com/docs/authentication/production for more information\n  # about how to configure authentication.\n  # CLI flag: -bigtable.instance\n  [instance: <string> | default = \"\"]\n\n  # The grpc_client block configures the gRPC client used to communicate between\n  # a client and server component in Loki.\n  # The CLI flags prefix for this block configuration is: bigtable\n  [grpc_client_config: <grpc_client>]\n\n  # If enabled, once a tables info is fetched, it is cached.\n  # CLI flag: -bigtable.table-cache.enabled\n  [table_cache_enabled: <boolean> | default = true]\n\n  # Duration to cache tables before checking again.\n  # CLI flag: -bigtable.table-cache.expiration\n  [table_cache_expiration: <duration> | default = 30m]\n\n# Configures storing chunks in GCS. Required fields only required when gcs is\n# defined in config.\n[gcs: <gcs_storage_config>]\n\n# Deprecated: Configures storing chunks and/or the index in Cassandra.\ncassandra:\n  # Comma-separated hostnames or IPs of Cassandra instances.\n  # CLI flag: -cassandra.addresses\n  [addresses: <string> | default = \"\"]\n\n  # Port that Cassandra is running on\n  # CLI flag: -cassandra.port\n  [port: <int> | default = 9042]\n\n  # Keyspace to use in Cassandra.\n  # CLI flag: -cassandra.keyspace\n  [keyspace: <string> | default = \"\"]\n\n  # Consistency level for Cassandra.\n  # CLI flag: -cassandra.consistency\n  [consistency: <string> | default = \"QUORUM\"]\n\n  # Replication factor to use in Cassandra.\n  # CLI flag: -cassandra.replication-factor\n  [replication_factor: <int> | default = 3]\n\n  # Instruct the cassandra driver to not attempt to get host info from the\n  # system.peers table.\n  # CLI flag: -cassandra.disable-initial-host-lookup\n  [disable_initial_host_lookup: <boolean> | default = false]\n\n  # Use SSL when connecting to cassandra instances.\n  # CLI flag: -cassandra.ssl\n  [SSL: <boolean> | default = false]\n\n  # Require SSL certificate validation.\n  # CLI flag: -cassandra.host-verification\n  [host_verification: <boolean> | default = true]\n\n  # Policy for selecting Cassandra host. Supported values are: round-robin,\n  # token-aware.\n  # CLI flag: -cassandra.host-selection-policy\n  [host_selection_policy: <string> | default = \"round-robin\"]\n\n  # Path to certificate file to verify the peer.\n  # CLI flag: -cassandra.ca-path\n  [CA_path: <string> | default = \"\"]\n\n  # Path to certificate file used by TLS.\n  # CLI flag: -cassandra.tls-cert-path\n  [tls_cert_path: <string> | default = \"\"]\n\n  # Path to private key file used by TLS.\n  # CLI flag: -cassandra.tls-key-path\n  [tls_key_path: <string> | default = \"\"]\n\n  # Enable password authentication when connecting to cassandra.\n  # CLI flag: -cassandra.auth\n  [auth: <boolean> | default = false]\n\n  # Username to use when connecting to cassandra.\n  # CLI flag: -cassandra.username\n  [username: <string> | default = \"\"]\n\n  # Password to use when connecting to cassandra.\n  # CLI flag: -cassandra.password\n  [password: <string> | default = \"\"]\n\n  # File containing password to use when connecting to cassandra.\n  # CLI flag: -cassandra.password-file\n  [password_file: <string> | default = \"\"]\n\n  # If set, when authenticating with cassandra a custom authenticator will be\n  # expected during the handshake. This flag can be set multiple times.\n  # CLI flag: -cassandra.custom-authenticator\n  [custom_authenticators: <list of strings> | default = []]\n\n  # Timeout when connecting to cassandra.\n  # CLI flag: -cassandra.timeout\n  [timeout: <duration> | default = 2s]\n\n  # Initial connection timeout, used during initial dial to server.\n  # CLI flag: -cassandra.connect-timeout\n  [connect_timeout: <duration> | default = 5s]\n\n  # Interval to retry connecting to cassandra nodes marked as DOWN.\n  # CLI flag: -cassandra.reconnent-interval\n  [reconnect_interval: <duration> | default = 1s]\n\n  # Number of retries to perform on a request. Set to 0 to disable retries.\n  # CLI flag: -cassandra.max-retries\n  [max_retries: <int> | default = 0]\n\n  # Maximum time to wait before retrying a failed request.\n  # CLI flag: -cassandra.retry-max-backoff\n  [retry_max_backoff: <duration> | default = 10s]\n\n  # Minimum time to wait before retrying a failed request.\n  # CLI flag: -cassandra.retry-min-backoff\n  [retry_min_backoff: <duration> | default = 100ms]\n\n  # Limit number of concurrent queries to Cassandra. Set to 0 to disable the\n  # limit.\n  # CLI flag: -cassandra.query-concurrency\n  [query_concurrency: <int> | default = 0]\n\n  # Number of TCP connections per host.\n  # CLI flag: -cassandra.num-connections\n  [num_connections: <int> | default = 2]\n\n  # Convict hosts of being down on failure.\n  # CLI flag: -cassandra.convict-hosts-on-failure\n  [convict_hosts_on_failure: <boolean> | default = true]\n\n  # Table options used to create index or chunk tables. This value is used as\n  # plain text in the table `WITH` like this, \"CREATE TABLE\n  # <generated_by_cortex> (...) WITH <cassandra.table-options>\". For details,\n  # see https://cortexmetrics.io/docs/production/cassandra. By default it will\n  # use the default table options of your Cassandra cluster.\n  # CLI flag: -cassandra.table-options\n  [table_options: <string> | default = \"\"]\n\n# Deprecated: Configures storing index in BoltDB. Required fields only required\n# when boltdb is present in the configuration.\nboltdb:\n  # Location of BoltDB index files.\n  # CLI flag: -boltdb.dir\n  [directory: <string> | default = \"\"]\n\n# Configures storing the chunks on the local file system. Required fields only\n# required when filesystem is present in the configuration.\n[filesystem: <local_storage_config>]\n\n# The swift_storage_config block configures the connection to OpenStack Object\n# Storage (Swift) object storage backend.\n[swift: <swift_storage_config>]\n\n# Deprecated:\ngrpc_store:\n  # Hostname or IP of the gRPC store instance.\n  # CLI flag: -grpc-store.server-address\n  [server_address: <string> | default = \"\"]\n\nhedging:\n  # If set to a non-zero value a second request will be issued at the provided\n  # duration. Default is 0 (disabled)\n  # CLI flag: -store.hedge-requests-at\n  [at: <duration> | default = 0s]\n\n  # The maximum of hedge requests allowed.\n  # CLI flag: -store.hedge-requests-up-to\n  [up_to: <int> | default = 2]\n\n  # The maximum of hedge requests allowed per seconds.\n  # CLI flag: -store.hedge-max-per-second\n  [max_per_second: <int> | default = 5]\n\n# Configures additional object stores for a given storage provider.\n# Supported stores: aws, azure, bos, filesystem, gcs, swift.\n# Example:\n# ```yaml\n#     storage_config:\n#       named_stores:\n#         aws:\n#           store-1:\n#             endpoint: s3://foo-bucket\n#             region: us-west1\n# ```\n# Named store from this example can be used by setting object_store to store-1\n# in period_config.\n[named_stores: <named_stores_config>]\n\n# The cos_storage_config block configures the connection to IBM Cloud Object\n# Storage (COS) backend.\n[cos: <cos_storage_config>]\n\n# Cache validity for active index entries. Should be no higher than\n# -ingester.max-chunk-idle.\n# CLI flag: -store.index-cache-validity\n[index_cache_validity: <duration> | default = 5m]\n\ncongestion_control:\n  # Use storage congestion control (default: disabled).\n  # CLI flag: -store.congestion-control.enabled\n  [enabled: <boolean> | default = false]\n\n  controller:\n    # Congestion control strategy to use (default: none, options: 'aimd').\n    # CLI flag: -store.congestion-control.strategy\n    [strategy: <string> | default = \"\"]\n\n    aimd:\n      # AIMD starting throughput window size: how many requests can be sent per\n      # second (default: 2000).\n      # CLI flag: -store.congestion-control.strategy.aimd.start\n      [start: <int> | default = 2000]\n\n      # AIMD maximum throughput window size: upper limit of requests sent per\n      # second (default: 10000).\n      # CLI flag: -store.congestion-control.strategy.aimd.upper-bound\n      [upper_bound: <int> | default = 10000]\n\n      # AIMD backoff factor when upstream service is throttled to decrease\n      # number of requests sent per second (default: 0.5).\n      # CLI flag: -store.congestion-control.strategy.aimd.backoff-factor\n      [backoff_factor: <float> | default = 0.5]\n\n  retry:\n    # Congestion control retry strategy to use (default: none, options:\n    # 'limited').\n    # CLI flag: -store.congestion-control.retry.strategy\n    [strategy: <string> | default = \"\"]\n\n    # Maximum number of retries allowed.\n    # CLI flag: -store.congestion-control.retry.strategy.limited.limit\n    [limit: <int> | default = 2]\n\n  hedging:\n    config:\n      [at: <duration>]\n\n      [up_to: <int>]\n\n      [max_per_second: <int>]\n\n    # Congestion control hedge strategy to use (default: none, options:\n    # 'limited').\n    # CLI flag: -store.congestion-control.hedge.strategy\n    [strategy: <string> | default = \"\"]\n\n# Experimental. Sets a constant prefix for all keys inserted into object\n# storage. Example: loki/\n# CLI flag: -store.object-prefix\n[object_prefix: <string> | default = \"\"]\n\n# The cache_config block configures the cache backend for a specific Loki\n# component.\n# The CLI flags prefix for this block configuration is: store.index-cache-read\n[index_queries_cache_config: <cache_config>]\n\n# Disable broad index queries which results in reduced cache usage and faster\n# query performance at the expense of somewhat higher QPS on the index store.\n# CLI flag: -store.disable-broad-index-queries\n[disable_broad_index_queries: <boolean> | default = false]\n\n# Maximum number of parallel chunk reads.\n# CLI flag: -store.max-parallel-get-chunk\n[max_parallel_get_chunk: <int> | default = 150]\n\n# Enables the use of thanos-io/objstore clients for connecting to object\n# storage. When set to true, the configuration inside\n# `storage_config.object_store` or `common.storage.object_store` block takes\n# effect.\n# CLI flag: -use-thanos-objstore\n[use_thanos_objstore: <boolean> | default = false]\n\nobject_store:\n  # The thanos_object_store_config block configures the connection to object\n  # storage backend using thanos-io/objstore clients. This will become the\n  # default way of configuring object store clients in future releases.\n  # Currently this is opt-in and takes effect only when `-use-thanos-objstore`\n  # is set to true.\n  # The CLI flags prefix for this block configuration is: object-store\n  [<thanos_object_store_config>]\n\n  named_stores:\n    [azure: <map of string to NamedAzureStorageConfig>]\n\n    [filesystem: <map of string to NamedFilesystemStorageConfig>]\n\n    [gcs: <map of string to NamedGCSStorageConfig>]\n\n    [s3: <map of string to NamedS3StorageConfig>]\n\n    [swift: <map of string to NamedSwiftStorageConfig>]\n\n# The maximum number of chunks to fetch per batch.\n# CLI flag: -store.max-chunk-batch-size\n[max_chunk_batch_size: <int> | default = 50]\n\n# Configures storing index in an Object Store\n# (GCS/S3/Azure/Swift/COS/Filesystem) in the form of boltdb files. Required\n# fields only required when boltdb-shipper is defined in config.\nboltdb_shipper:\n  # Directory where ingesters would write index files which would then be\n  # uploaded by shipper to configured storage\n  # CLI flag: -boltdb.shipper.active-index-directory\n  [active_index_directory: <string> | default = \"\"]\n\n  # Cache location for restoring index files from storage for queries\n  # CLI flag: -boltdb.shipper.cache-location\n  [cache_location: <string> | default = \"\"]\n\n  # TTL for index files restored in cache for queries\n  # CLI flag: -boltdb.shipper.cache-ttl\n  [cache_ttl: <duration> | default = 24h]\n\n  # Resync downloaded files with the storage\n  # CLI flag: -boltdb.shipper.resync-interval\n  [resync_interval: <duration> | default = 5m]\n\n  # Number of days of common index to be kept downloaded for queries. For per\n  # tenant index query readiness, use limits overrides config.\n  # CLI flag: -boltdb.shipper.query-ready-num-days\n  [query_ready_num_days: <int> | default = 0]\n\n  index_gateway_client:\n    # The grpc_client block configures the gRPC client used to communicate\n    # between a client and server component in Loki.\n    # The CLI flags prefix for this block configuration is:\n    # boltdb.shipper.index-gateway-client.grpc\n    [grpc_client_config: <grpc_client>]\n\n    # Hostname or IP of the Index Gateway gRPC server running in simple mode.\n    # Can also be prefixed with dns+, dnssrv+, or dnssrvnoa+ to resolve a DNS A\n    # record with multiple IP's, a DNS SRV record with a followup A record\n    # lookup, or a DNS SRV record without a followup A record lookup,\n    # respectively.\n    # CLI flag: -boltdb.shipper.index-gateway-client.server-address\n    [server_address: <string> | default = \"\"]\n\n    # Whether requests sent to the gateway should be logged or not.\n    # CLI flag: -boltdb.shipper.index-gateway-client.log-gateway-requests\n    [log_gateway_requests: <boolean> | default = false]\n\n    # Experimental: Defines buckets for time-based sharding. Time based sharding\n    # only takes affect when index gateways run in simple mode. To enable client\n    # side time-based sharding of queries across index gateway instances set at\n    # least one bucket in the format of a string representation of a\n    # time.Duration, e.g. ['168h', '336h', '504h']\n    # CLI flag: -boltdb.shipper.index-gateway-client.time-based-sharding-buckets\n    [time_based_sharding_buckets: <list of strings> | default = []]\n\n  [ingestername: <string> | default = \"\"]\n\n  [mode: <string> | default = \"\"]\n\n  [ingesterdbretainperiod: <duration>]\n\n  # Build per tenant index files\n  # CLI flag: -boltdb.shipper.build-per-tenant-index\n  [build_per_tenant_index: <boolean> | default = false]\n\n# Configures storing index in an Object Store\n# (GCS/S3/Azure/Swift/COS/Filesystem) in a prometheus TSDB-like format. Required\n# fields only required when TSDB is defined in config.\ntsdb_shipper:\n  # Directory where ingesters would write index files which would then be\n  # uploaded by shipper to configured storage\n  # CLI flag: -tsdb.shipper.active-index-directory\n  [active_index_directory: <string> | default = \"\"]\n\n  # Cache location for restoring index files from storage for queries\n  # CLI flag: -tsdb.shipper.cache-location\n  [cache_location: <string> | default = \"\"]\n\n  # TTL for index files restored in cache for queries\n  # CLI flag: -tsdb.shipper.cache-ttl\n  [cache_ttl: <duration> | default = 24h]\n\n  # Resync downloaded files with the storage\n  # CLI flag: -tsdb.shipper.resync-interval\n  [resync_interval: <duration> | default = 5m]\n\n  # Number of days of common index to be kept downloaded for queries. For per\n  # tenant index query readiness, use limits overrides config.\n  # CLI flag: -tsdb.shipper.query-ready-num-days\n  [query_ready_num_days: <int> | default = 0]\n\n  index_gateway_client:\n    # The grpc_client block configures the gRPC client used to communicate\n    # between a client and server component in Loki.\n    # The CLI flags prefix for this block configuration is:\n    # tsdb.shipper.index-gateway-client.grpc\n    [grpc_client_config: <grpc_client>]\n\n    # Hostname or IP of the Index Gateway gRPC server running in simple mode.\n    # Can also be prefixed with dns+, dnssrv+, or dnssrvnoa+ to resolve a DNS A\n    # record with multiple IP's, a DNS SRV record with a followup A record\n    # lookup, or a DNS SRV record without a followup A record lookup,\n    # respectively.\n    # CLI flag: -tsdb.shipper.index-gateway-client.server-address\n    [server_address: <string> | default = \"\"]\n\n    # Whether requests sent to the gateway should be logged or not.\n    # CLI flag: -tsdb.shipper.index-gateway-client.log-gateway-requests\n    [log_gateway_requests: <boolean> | default = false]\n\n    # Experimental: Defines buckets for time-based sharding. Time based sharding\n    # only takes affect when index gateways run in simple mode. To enable client\n    # side time-based sharding of queries across index gateway instances set at\n    # least one bucket in the format of a string representation of a\n    # time.Duration, e.g. ['168h', '336h', '504h']\n    # CLI flag: -tsdb.shipper.index-gateway-client.time-based-sharding-buckets\n    [time_based_sharding_buckets: <list of strings> | default = []]\n\n  [ingestername: <string> | default = \"\"]\n\n  [mode: <string> | default = \"\"]\n\n  [ingesterdbretainperiod: <duration>]\n\n# Experimental: Configures the bloom shipper component, which contains the store\n# abstraction to fetch bloom filters from and put them to object storage.\nbloom_shipper:\n  # Working directory to store downloaded bloom blocks. Supports multiple\n  # directories, separated by comma.\n  # CLI flag: -bloom.shipper.working-directory\n  [working_directory: <string> | default = \"/data/blooms\"]\n\n  # Maximum size of bloom pages that should be queried. Larger pages than this\n  # limit are skipped when querying blooms to limit memory usage.\n  # CLI flag: -bloom.max-query-page-size\n  [max_query_page_size: <int> | default = 64MiB]\n\n  # The amount of maximum concurrent bloom blocks downloads. Usually set to 2x\n  # number of CPU cores.\n  # CLI flag: -bloom.download-parallelism\n  [download_parallelism: <int> | default = 8]\n\n  blocks_cache:\n    # Cache for bloom blocks. Soft limit of the cache in bytes. Exceeding this\n    # limit will trigger evictions of least recently used items in the\n    # background.\n    # CLI flag: -bloom.blocks-cache.soft-limit\n    [soft_limit: <int> | default = 32GiB]\n\n    # Cache for bloom blocks. Hard limit of the cache in bytes. Exceeding this\n    # limit will block execution until soft limit is deceeded.\n    # CLI flag: -bloom.blocks-cache.hard-limit\n    [hard_limit: <int> | default = 64GiB]\n\n    # Cache for bloom blocks. The time to live for items in the cache before\n    # they get purged.\n    # CLI flag: -bloom.blocks-cache.ttl\n    [ttl: <duration> | default = 24h]\n\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is: bloom.metas-cache\n  [metas_cache: <cache_config>]\n\n  metas_lru_cache:\n    # In-memory LRU cache for bloom metas. Whether embedded cache is enabled.\n    # CLI flag: -bloom.metas-lru-cache.enabled\n    [enabled: <boolean> | default = false]\n\n    # In-memory LRU cache for bloom metas. Maximum memory size of the cache in\n    # MB.\n    # CLI flag: -bloom.metas-lru-cache.max-size-mb\n    [max_size_mb: <int> | default = 100]\n\n    # In-memory LRU cache for bloom metas. Maximum number of entries in the\n    # cache.\n    # CLI flag: -bloom.metas-lru-cache.max-size-items\n    [max_size_items: <int> | default = 0]\n\n    # In-memory LRU cache for bloom metas. The time to live for items in the\n    # cache before they get purged.\n    # CLI flag: -bloom.metas-lru-cache.ttl\n    [ttl: <duration> | default = 1h]\n```\n\n### swift_storage_config\n\nThe `swift_storage_config` block configures the connection to OpenStack Object Storage (Swift) object storage backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n\u00a0\n\n```yaml\n# OpenStack Swift authentication API version. 0 to autodetect.\n# CLI flag: -<prefix>.swift.auth-version\n[auth_version: <int> | default = 0]\n\n# OpenStack Swift authentication URL\n# CLI flag: -<prefix>.swift.auth-url\n[auth_url: <string> | default = \"\"]\n\n# Set this to true to use the internal OpenStack Swift endpoint URL\n# CLI flag: -<prefix>.swift.internal\n[internal: <boolean> | default = false]\n\n# OpenStack Swift username.\n# CLI flag: -<prefix>.swift.username\n[username: <string> | default = \"\"]\n\n# OpenStack Swift user's domain name.\n# CLI flag: -<prefix>.swift.user-domain-name\n[user_domain_name: <string> | default = \"\"]\n\n# OpenStack Swift user's domain ID.\n# CLI flag: -<prefix>.swift.user-domain-id\n[user_domain_id: <string> | default = \"\"]\n\n# OpenStack Swift user ID.\n# CLI flag: -<prefix>.swift.user-id\n[user_id: <string> | default = \"\"]\n\n# OpenStack Swift API key.\n# CLI flag: -<prefix>.swift.password\n[password: <string> | default = \"\"]\n\n# OpenStack Swift user's domain ID.\n# CLI flag: -<prefix>.swift.domain-id\n[domain_id: <string> | default = \"\"]\n\n# OpenStack Swift user's domain name.\n# CLI flag: -<prefix>.swift.domain-name\n[domain_name: <string> | default = \"\"]\n\n# OpenStack Swift project ID (v2,v3 auth only).\n# CLI flag: -<prefix>.swift.project-id\n[project_id: <string> | default = \"\"]\n\n# OpenStack Swift project name (v2,v3 auth only).\n# CLI flag: -<prefix>.swift.project-name\n[project_name: <string> | default = \"\"]\n\n# ID of the OpenStack Swift project's domain (v3 auth only), only needed if it\n# differs the from user domain.\n# CLI flag: -<prefix>.swift.project-domain-id\n[project_domain_id: <string> | default = \"\"]\n\n# Name of the OpenStack Swift project's domain (v3 auth only), only needed if it\n# differs from the user domain.\n# CLI flag: -<prefix>.swift.project-domain-name\n[project_domain_name: <string> | default = \"\"]\n\n# OpenStack Swift Region to use (v2,v3 auth only).\n# CLI flag: -<prefix>.swift.region-name\n[region_name: <string> | default = \"\"]\n\n# Name of the OpenStack Swift container to put chunks in.\n# CLI flag: -<prefix>.swift.container-name\n[container_name: <string> | default = \"\"]\n\n# Max retries on requests error.\n# CLI flag: -<prefix>.swift.max-retries\n[max_retries: <int> | default = 3]\n\n# Time after which a connection attempt is aborted.\n# CLI flag: -<prefix>.swift.connect-timeout\n[connect_timeout: <duration> | default = 10s]\n\n# Time after which an idle request is aborted. The timeout watchdog is reset\n# each time some data is received, so the timeout triggers after X time no data\n# is received on a request.\n# CLI flag: -<prefix>.swift.request-timeout\n[request_timeout: <duration> | default = 5s]\n\nhttp:\n  # Path to the CA certificates to validate server certificate against. If not\n  # set, the host's root CA certificates are used.\n  # CLI flag: -<prefix>.swift.http.tls-ca-path\n  [tls_ca_path: <string> | default = \"\"]\n```\n\n### table_manager\n\nThe `table_manager` block configures the table manager for retention.\n\n```yaml\n# If true, disable all changes to DB capacity\n# CLI flag: -table-manager.throughput-updates-disabled\n[throughput_updates_disabled: <boolean> | default = false]\n\n# If true, enables retention deletes of DB tables\n# CLI flag: -table-manager.retention-deletes-enabled\n[retention_deletes_enabled: <boolean> | default = false]\n\n# Tables older than this retention period are deleted. Must be either 0\n# (disabled) or a multiple of 24h. When enabled, be aware this setting is\n# destructive to data!\n# CLI flag: -table-manager.retention-period\n[retention_period: <duration> | default = 0s]\n\n# How frequently to poll backend to learn our capacity.\n# CLI flag: -table-manager.poll-interval\n[poll_interval: <duration> | default = 2m]\n\n# Periodic tables grace period (duration which table will be created/deleted\n# before/after it's needed).\n# CLI flag: -table-manager.periodic-table.grace-period\n[creation_grace_period: <duration> | default = 10m]\n\nindex_tables_provisioning:\n  # Enables on demand throughput provisioning for the storage provider (if\n  # supported). Applies only to tables which are not autoscaled. Supported by\n  # DynamoDB\n  # CLI flag: -table-manager.index-table.enable-ondemand-throughput-mode\n  [enable_ondemand_throughput_mode: <boolean> | default = false]\n\n  # Table default write throughput. Supported by DynamoDB\n  # CLI flag: -table-manager.index-table.write-throughput\n  [provisioned_write_throughput: <int> | default = 1000]\n\n  # Table default read throughput. Supported by DynamoDB\n  # CLI flag: -table-manager.index-table.read-throughput\n  [provisioned_read_throughput: <int> | default = 300]\n\n  write_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.index-table.write-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.index-table.write-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.index-table.write-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.index-table.write-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.index-table.write-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.index-table.write-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.index-table.write-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  read_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.index-table.read-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.index-table.read-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.index-table.read-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.index-table.read-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.index-table.read-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.index-table.read-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.index-table.read-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  # Enables on demand throughput provisioning for the storage provider (if\n  # supported). Applies only to tables which are not autoscaled. Supported by\n  # DynamoDB\n  # CLI flag: -table-manager.index-table.inactive-enable-ondemand-throughput-mode\n  [enable_inactive_throughput_on_demand_mode: <boolean> | default = false]\n\n  # Table write throughput for inactive tables. Supported by DynamoDB\n  # CLI flag: -table-manager.index-table.inactive-write-throughput\n  [inactive_write_throughput: <int> | default = 1]\n\n  # Table read throughput for inactive tables. Supported by DynamoDB\n  # CLI flag: -table-manager.index-table.inactive-read-throughput\n  [inactive_read_throughput: <int> | default = 300]\n\n  inactive_write_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  inactive_read_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  # Number of last inactive tables to enable write autoscale.\n  # CLI flag: -table-manager.index-table.inactive-write-throughput.scale-last-n\n  [inactive_write_scale_lastn: <int> | default = 4]\n\n  # Number of last inactive tables to enable read autoscale.\n  # CLI flag: -table-manager.index-table.inactive-read-throughput.scale-last-n\n  [inactive_read_scale_lastn: <int> | default = 4]\n\nchunk_tables_provisioning:\n  # Enables on demand throughput provisioning for the storage provider (if\n  # supported). Applies only to tables which are not autoscaled. Supported by\n  # DynamoDB\n  # CLI flag: -table-manager.chunk-table.enable-ondemand-throughput-mode\n  [enable_ondemand_throughput_mode: <boolean> | default = false]\n\n  # Table default write throughput. Supported by DynamoDB\n  # CLI flag: -table-manager.chunk-table.write-throughput\n  [provisioned_write_throughput: <int> | default = 1000]\n\n  # Table default read throughput. Supported by DynamoDB\n  # CLI flag: -table-manager.chunk-table.read-throughput\n  [provisioned_read_throughput: <int> | default = 300]\n\n  write_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  read_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  # Enables on demand throughput provisioning for the storage provider (if\n  # supported). Applies only to tables which are not autoscaled. Supported by\n  # DynamoDB\n  # CLI flag: -table-manager.chunk-table.inactive-enable-ondemand-throughput-mode\n  [enable_inactive_throughput_on_demand_mode: <boolean> | default = false]\n\n  # Table write throughput for inactive tables. Supported by DynamoDB\n  # CLI flag: -table-manager.chunk-table.inactive-write-throughput\n  [inactive_write_throughput: <int> | default = 1]\n\n  # Table read throughput for inactive tables. Supported by DynamoDB\n  # CLI flag: -table-manager.chunk-table.inactive-read-throughput\n  [inactive_read_throughput: <int> | default = 300]\n\n  inactive_write_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  inactive_read_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  # Number of last inactive tables to enable write autoscale.\n  # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale-last-n\n  [inactive_write_scale_lastn: <int> | default = 4]\n\n  # Number of last inactive tables to enable read autoscale.\n  # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale-last-n\n  [inactive_read_scale_lastn: <int> | default = 4]\n```\n\n### thanos_object_store_config\n\nThe `thanos_object_store_config` block configures the connection to object storage backend using thanos-io/objstore clients. This will become the default way of configuring object store clients in future releases.\nCurrently this is opt-in and takes effect only when `-use-thanos-objstore` is set to true. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage.object-store`\n- `object-store`\n- `ruler-storage`\n- `ui.goldfish.results`\n\n\u00a0\n\n```yaml\ns3:\n  # The S3 bucket endpoint. It could be an AWS S3 endpoint listed at\n  # https://docs.aws.amazon.com/general/latest/gr/s3.html or the address of an\n  # S3-compatible service in hostname:port format.\n  # CLI flag: -<prefix>.s3.endpoint\n  [endpoint: <string> | default = \"\"]\n\n  # S3 region. If unset, the client will issue a S3 GetBucketLocation API call\n  # to autodetect it.\n  # CLI flag: -<prefix>.s3.region\n  [region: <string> | default = \"\"]\n\n  # S3 bucket name\n  # CLI flag: -<prefix>.s3.bucket-name\n  [bucket_name: <string> | default = \"\"]\n\n  # S3 secret access key\n  # CLI flag: -<prefix>.s3.secret-access-key\n  [secret_access_key: <string> | default = \"\"]\n\n  # S3 access key ID\n  # CLI flag: -<prefix>.s3.access-key-id\n  [access_key_id: <string> | default = \"\"]\n\n  # S3 session token\n  # CLI flag: -<prefix>.s3.session-token\n  [session_token: <string> | default = \"\"]\n\n  # If enabled, use http:// for the S3 endpoint instead of https://. This could\n  # be useful in local dev/test environments while using an S3-compatible\n  # backend storage, like Minio.\n  # CLI flag: -<prefix>.s3.insecure\n  [insecure: <boolean> | default = false]\n\n  # Use a specific version of the S3 list object API. Supported values are v1 or\n  # v2. Default is unset.\n  # CLI flag: -<prefix>.s3.list-objects-version\n  [list_objects_version: <string> | default = \"\"]\n\n  # Bucket lookup style type, used to access bucket in S3-compatible service.\n  # Default is auto. Supported values are: auto, path, virtual-hosted.\n  # CLI flag: -<prefix>.s3.bucket-lookup-type\n  [bucket_lookup_type: <int> | default = auto]\n\n  # When enabled, direct all AWS S3 requests to the dual-stack IPv4/IPv6\n  # endpoint for the configured region.\n  # CLI flag: -<prefix>.s3.dualstack-enabled\n  [dualstack_enabled: <boolean> | default = true]\n\n  # The S3 storage class to use, not set by default. Details can be found at\n  # https://aws.amazon.com/s3/storage-classes/. Supported values are: STANDARD,\n  # REDUCED_REDUNDANCY, GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING,\n  # DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR, SNOW, EXPRESS_ONEZONE, FSX_OPENZFS,\n  # FSX_ONTAP\n  # CLI flag: -<prefix>.s3.storage-class\n  [storage_class: <string> | default = \"\"]\n\n  # If enabled, it will use the default authentication methods of the AWS SDK\n  # for go based on known environment variables and known AWS config files.\n  # CLI flag: -<prefix>.s3.native-aws-auth-enabled\n  [native_aws_auth_enabled: <boolean> | default = false]\n\n  # The minimum file size in bytes used for multipart uploads. If 0, the value\n  # is optimally computed for each object.\n  # CLI flag: -<prefix>.s3.part-size\n  [part_size: <int> | default = 0]\n\n  # If enabled, a Content-MD5 header is sent with S3 Put Object requests.\n  # Consumes more resources to compute the MD5, but may improve compatibility\n  # with object storage services that do not support checksums.\n  # CLI flag: -<prefix>.s3.send-content-md5\n  [send_content_md5: <boolean> | default = false]\n\n  # Accessing S3 resources using temporary, secure credentials provided by AWS\n  # Security Token Service.\n  # CLI flag: -<prefix>.s3.sts-endpoint\n  [sts_endpoint: <string> | default = \"\"]\n\n  # The maximum number of retries for S3 requests that are retryable. Default is\n  # 10, set this to 1 to disable retries.\n  # CLI flag: -<prefix>.s3.max-retries\n  [max_retries: <int> | default = 10]\n\n  sse:\n    # Enable AWS Server Side Encryption. Supported values: SSE-KMS, SSE-S3.\n    # CLI flag: -<prefix>.s3.sse.type\n    [type: <string> | default = \"\"]\n\n    # KMS Key ID used to encrypt objects in S3\n    # CLI flag: -<prefix>.s3.sse.kms-key-id\n    [kms_key_id: <string> | default = \"\"]\n\n    # KMS Encryption Context used for object encryption. It expects JSON\n    # formatted string.\n    # CLI flag: -<prefix>.s3.sse.kms-encryption-context\n    [kms_encryption_context: <string> | default = \"\"]\n\n  http:\n    # The time an idle connection will remain idle before closing.\n    # CLI flag: -<prefix>.s3.http.idle-conn-timeout\n    [idle_conn_timeout: <duration> | default = 1m30s]\n\n    # The amount of time the client will wait for a servers response headers.\n    # CLI flag: -<prefix>.s3.http.response-header-timeout\n    [response_header_timeout: <duration> | default = 2m]\n\n    # If the client connects via HTTPS and this option is enabled, the client\n    # will accept any certificate and hostname.\n    # CLI flag: -<prefix>.s3.http.insecure-skip-verify\n    [insecure_skip_verify: <boolean> | default = false]\n\n    # Maximum time to wait for a TLS handshake. 0 means no limit.\n    # CLI flag: -<prefix>.s3.tls-handshake-timeout\n    [tls_handshake_timeout: <duration> | default = 10s]\n\n    # The time to wait for a server's first response headers after fully writing\n    # the request headers if the request has an Expect header. 0 to send the\n    # request body immediately.\n    # CLI flag: -<prefix>.s3.expect-continue-timeout\n    [expect_continue_timeout: <duration> | default = 1s]\n\n    # Maximum number of idle (keep-alive) connections across all hosts. 0 means\n    # no limit.\n    # CLI flag: -<prefix>.s3.max-idle-connections\n    [max_idle_connections: <int> | default = 100]\n\n    # Maximum number of idle (keep-alive) connections to keep per-host. If 0, a\n    # built-in default value is used.\n    # CLI flag: -<prefix>.s3.max-idle-connections-per-host\n    [max_idle_connections_per_host: <int> | default = 100]\n\n    # Maximum number of connections per host. 0 means no limit.\n    # CLI flag: -<prefix>.s3.max-connections-per-host\n    [max_connections_per_host: <int> | default = 0]\n\n    # Path to the CA certificates to validate server certificate against. If not\n    # set, the host's root CA certificates are used.\n    # CLI flag: -<prefix>.s3.http.tls-ca-path\n    [tls_ca_path: <string> | default = \"\"]\n\n    # Path to the client certificate, which will be used for authenticating with\n    # the server. Also requires the key path to be configured.\n    # CLI flag: -<prefix>.s3.http.tls-cert-path\n    [tls_cert_path: <string> | default = \"\"]\n\n    # Path to the key for the client certificate. Also requires the client\n    # certificate to be configured.\n    # CLI flag: -<prefix>.s3.http.tls-key-path\n    [tls_key_path: <string> | default = \"\"]\n\n    # Override the expected name on the server certificate.\n    # CLI flag: -<prefix>.s3.http.tls-server-name\n    [tls_server_name: <string> | default = \"\"]\n\n  trace:\n    # When enabled, low-level S3 HTTP operation information is logged at the\n    # debug level.\n    # CLI flag: -<prefix>.s3.trace.enabled\n    [enabled: <boolean> | default = false]\n\ngcs:\n  # GCS bucket name\n  # CLI flag: -<prefix>.gcs.bucket-name\n  [bucket_name: <string> | default = \"\"]\n\n  # JSON either from a Google Developers Console client_credentials.json file,\n  # or a Google Developers service account key. Needs to be valid JSON, not a\n  # filesystem path. If empty, fallback to Google default logic:\n  # 1. A JSON file whose path is specified by the GOOGLE_APPLICATION_CREDENTIALS\n  # environment variable. For workload identity federation, refer to\n  # https://cloud.google.com/iam/docs/how-to#using-workload-identity-federation\n  # on how to generate the JSON configuration file for on-prem/non-Google cloud\n  # platforms.\n  # 2. A JSON file in a location known to the gcloud command-line tool:\n  # $HOME/.config/gcloud/application_default_credentials.json.\n  # 3. On Google Compute Engine it fetches credentials from the metadata server.\n  # CLI flag: -<prefix>.gcs.service-account\n  [service_account: <string> | default = \"\"]\n\n  # The maximum size of the buffer that GCS client for a single PUT request. 0\n  # to disable buffering.\n  # CLI flag: -<prefix>.gcs.chunk-buffer-size\n  [chunk_buffer_size: <int> | default = 0]\n\n  # The maximum number of retries for idempotent operations. Overrides the\n  # default gcs storage client behavior if this value is greater than 0. Set\n  # this to 1 to disable retries.\n  # CLI flag: -<prefix>.gcs.max-retries\n  [max_retries: <int> | default = 10]\n\nazure:\n  # Azure storage account name\n  # CLI flag: -<prefix>.azure.account-name\n  [account_name: <string> | default = \"\"]\n\n  # Azure storage account key. If unset, Azure managed identities will be used\n  # for authentication instead.\n  # CLI flag: -<prefix>.azure.account-key\n  [account_key: <string> | default = \"\"]\n\n  # If `connection-string` is set, the value of `endpoint-suffix` will not be\n  # used. Use this method over `account-key` if you need to authenticate via a\n  # SAS token. Or if you use the Azurite emulator.\n  # CLI flag: -<prefix>.azure.connection-string\n  [connection_string: <string> | default = \"\"]\n\n  # Azure storage container name\n  # CLI flag: -<prefix>.azure.container-name\n  [container_name: <string> | default = \"\"]\n\n  # Azure storage endpoint suffix without schema. The account name will be\n  # prefixed to this value to create the FQDN. If set to empty string, default\n  # endpoint suffix is used.\n  # CLI flag: -<prefix>.azure.endpoint-suffix\n  [endpoint_suffix: <string> | default = \"\"]\n\n  # Number of retries for recoverable errors\n  # CLI flag: -<prefix>.azure.max-retries\n  [max_retries: <int> | default = 20]\n\n  # User assigned managed identity. If empty, then System assigned identity is\n  # used.\n  # CLI flag: -<prefix>.azure.user-assigned-id\n  [user_assigned_id: <string> | default = \"\"]\n\n  # Delimiter used to replace ':' in chunk IDs when storing chunks\n  # CLI flag: -<prefix>.azure.chunk-delimiter\n  [chunk_delimiter: <string> | default = \"-\"]\n\nswift:\n  # OpenStack Swift application credential id\n  # CLI flag: -<prefix>.swift.application-credential-id\n  [application_credential_id: <string> | default = \"\"]\n\n  # OpenStack Swift application credential name\n  # CLI flag: -<prefix>.swift.application-credential-name\n  [application_credential_name: <string> | default = \"\"]\n\n  # OpenStack Swift application credential secret\n  # CLI flag: -<prefix>.swift.application-credential-secret\n  [application_credential_secret: <string> | default = \"\"]\n\n  # OpenStack Swift authentication API version. 0 to autodetect.\n  # CLI flag: -<prefix>.swift.auth-version\n  [auth_version: <int> | default = 0]\n\n  # OpenStack Swift authentication URL\n  # CLI flag: -<prefix>.swift.auth-url\n  [auth_url: <string> | default = \"\"]\n\n  # OpenStack Swift username.\n  # CLI flag: -<prefix>.swift.username\n  [username: <string> | default = \"\"]\n\n  # OpenStack Swift user's domain name.\n  # CLI flag: -<prefix>.swift.user-domain-name\n  [user_domain_name: <string> | default = \"\"]\n\n  # OpenStack Swift user's domain ID.\n  # CLI flag: -<prefix>.swift.user-domain-id\n  [user_domain_id: <string> | default = \"\"]\n\n  # OpenStack Swift user ID.\n  # CLI flag: -<prefix>.swift.user-id\n  [user_id: <string> | default = \"\"]\n\n  # OpenStack Swift API key.\n  # CLI flag: -<prefix>.swift.password\n  [password: <string> | default = \"\"]\n\n  # OpenStack Swift user's domain ID.\n  # CLI flag: -<prefix>.swift.domain-id\n  [domain_id: <string> | default = \"\"]\n\n  # OpenStack Swift user's domain name.\n  # CLI flag: -<prefix>.swift.domain-name\n  [domain_name: <string> | default = \"\"]\n\n  # OpenStack Swift project ID (v2,v3 auth only).\n  # CLI flag: -<prefix>.swift.project-id\n  [project_id: <string> | default = \"\"]\n\n  # OpenStack Swift project name (v2,v3 auth only).\n  # CLI flag: -<prefix>.swift.project-name\n  [project_name: <string> | default = \"\"]\n\n  # ID of the OpenStack Swift project's domain (v3 auth only), only needed if it\n  # differs the from user domain.\n  # CLI flag: -<prefix>.swift.project-domain-id\n  [project_domain_id: <string> | default = \"\"]\n\n  # Name of the OpenStack Swift project's domain (v3 auth only), only needed if\n  # it differs from the user domain.\n  # CLI flag: -<prefix>.swift.project-domain-name\n  [project_domain_name: <string> | default = \"\"]\n\n  # OpenStack Swift Region to use (v2,v3 auth only).\n  # CLI flag: -<prefix>.swift.region-name\n  [region_name: <string> | default = \"\"]\n\n  # Name of the OpenStack Swift container to put chunks in.\n  # CLI flag: -<prefix>.swift.container-name\n  [container_name: <string> | default = \"\"]\n\n  # Max retries on requests error.\n  # CLI flag: -<prefix>.swift.max-retries\n  [max_retries: <int> | default = 3]\n\n  # Time after which a connection attempt is aborted.\n  # CLI flag: -<prefix>.swift.connect-timeout\n  [connect_timeout: <duration> | default = 10s]\n\n  # Time after which an idle request is aborted. The timeout watchdog is reset\n  # each time some data is received, so the timeout triggers after X time no\n  # data is received on a request.\n  # CLI flag: -<prefix>.swift.request-timeout\n  [request_timeout: <duration> | default = 5s]\n\n  http:\n    # The time an idle connection will remain idle before closing.\n    # CLI flag: -<prefix>.swift.http.idle-conn-timeout\n    [idle_conn_timeout: <duration> | default = 1m30s]\n\n    # The amount of time the client will wait for a servers response headers.\n    # CLI flag: -<prefix>.swift.http.response-header-timeout\n    [response_header_timeout: <duration> | default = 2m]\n\n    # If the client connects via HTTPS and this option is enabled, the client\n    # will accept any certificate and hostname.\n    # CLI flag: -<prefix>.swift.http.insecure-skip-verify\n    [insecure_skip_verify: <boolean> | default = false]\n\n    # Maximum time to wait for a TLS handshake. 0 means no limit.\n    # CLI flag: -<prefix>.swift.tls-handshake-timeout\n    [tls_handshake_timeout: <duration> | default = 10s]\n\n    # The time to wait for a server's first response headers after fully writing\n    # the request headers if the request has an Expect header. 0 to send the\n    # request body immediately.\n    # CLI flag: -<prefix>.swift.expect-continue-timeout\n    [expect_continue_timeout: <duration> | default = 1s]\n\n    # Maximum number of idle (keep-alive) connections across all hosts. 0 means\n    # no limit.\n    # CLI flag: -<prefix>.swift.max-idle-connections\n    [max_idle_connections: <int> | default = 100]\n\n    # Maximum number of idle (keep-alive) connections to keep per-host. If 0, a\n    # built-in default value is used.\n    # CLI flag: -<prefix>.swift.max-idle-connections-per-host\n    [max_idle_connections_per_host: <int> | default = 100]\n\n    # Maximum number of connections per host. 0 means no limit.\n    # CLI flag: -<prefix>.swift.max-connections-per-host\n    [max_connections_per_host: <int> | default = 0]\n\n    # Path to the CA certificates to validate server certificate against. If not\n    # set, the host's root CA certificates are used.\n    # CLI flag: -<prefix>.swift.http.tls-ca-path\n    [tls_ca_path: <string> | default = \"\"]\n\n    # Path to the client certificate, which will be used for authenticating with\n    # the server. Also requires the key path to be configured.\n    # CLI flag: -<prefix>.swift.http.tls-cert-path\n    [tls_cert_path: <string> | default = \"\"]\n\n    # Path to the key for the client certificate. Also requires the client\n    # certificate to be configured.\n    # CLI flag: -<prefix>.swift.http.tls-key-path\n    [tls_key_path: <string> | default = \"\"]\n\n    # Override the expected name on the server certificate.\n    # CLI flag: -<prefix>.swift.http.tls-server-name\n    [tls_server_name: <string> | default = \"\"]\n\nfilesystem:\n  # Local filesystem storage directory.\n  # CLI flag: -<prefix>.filesystem.dir\n  [dir: <string> | default = \"\"]\n\nalibaba:\n  # Endpoint to connect to.\n  # CLI flag: -<prefix>.oss.endpoint\n  [endpoint: <string> | default = \"\"]\n\n  # Name of OSS bucket.\n  # CLI flag: -<prefix>.oss.bucketname\n  [bucket: <string> | default = \"\"]\n\n  # alibabacloud Access Key ID\n  # CLI flag: -<prefix>.oss.access-key-id\n  [access_key_id: <string> | default = \"\"]\n\n  # alibabacloud Secret Access Key\n  # CLI flag: -<prefix>.oss.access-key-secret\n  [access_key_secret: <string> | default = \"\"]\n\nbos:\n  # Name of BOS bucket.\n  # CLI flag: -<prefix>.bos.bucket\n  [bucket: <string> | default = \"\"]\n\n  # BOS endpoint to connect to.\n  # CLI flag: -<prefix>.bos.endpoint\n  [endpoint: <string> | default = \"\"]\n\n  # Baidu Cloud Engine (BCE) Access Key ID.\n  # CLI flag: -<prefix>.bos.access-key\n  [access_key: <string> | default = \"\"]\n\n  # Baidu Cloud Engine (BCE) Secret Access Key.\n  # CLI flag: -<prefix>.bos.secret-key\n  [secret_key: <string> | default = \"\"]\n\n# Prefix for all objects stored in the backend storage. For simplicity, it may\n# only contain digits, English alphabet letters and dashes.\n# CLI flag: -<prefix>.storage-prefix\n[storage_prefix: <string> | default = \"\"]\n```\n\n### tls_config\n\nThe TLS configuration. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `bigtable`\n- `bloom-build.builder.grpc`\n- `bloom-gateway-client.grpc`\n- `bloom.metas-cache.memcached`\n- `boltdb.shipper.index-gateway-client.grpc`\n- `common.storage.ring.etcd`\n- `compactor.grpc-client`\n- `compactor.ring.etcd`\n- `dataobj-consumer.etcd`\n- `dataobj-consumer.partition-ring.etcd`\n- `distributor.ring.etcd`\n- `etcd`\n- `frontend.grpc-client-config`\n- `frontend.index-stats-results-cache.memcached`\n- `frontend.instant-metric-results-cache.memcached`\n- `frontend.label-results-cache.memcached`\n- `frontend.memcached`\n- `frontend.series-results-cache.memcached`\n- `frontend.tail-tls-config`\n- `frontend.volume-results-cache.memcached`\n- `index-gateway.ring.etcd`\n- `ingest-limits-frontend-client`\n- `ingest-limits-frontend.etcd`\n- `ingest-limits-frontend.limits-client`\n- `ingest-limits.etcd`\n- `ingester.client`\n- `ingester.partition-ring.etcd`\n- `memberlist`\n- `pattern-ingester.client`\n- `pattern-ingester.etcd`\n- `querier.frontend-client`\n- `querier.frontend-grpc-client`\n- `querier.scheduler-grpc-client`\n- `query-scheduler.grpc-client-config`\n- `query-scheduler.ring.etcd`\n- `reporting.tls-config`\n- `ruler.alertmanager-client`\n- `ruler.client`\n- `ruler.evaluation.query-frontend`\n- `ruler.ring.etcd`\n- `store.chunks-cache-l2.memcached`\n- `store.chunks-cache.memcached`\n- `store.index-cache-read.memcached`\n- `store.index-cache-write.memcached`\n- `tsdb.shipper.index-gateway-client.grpc`\n- `ui.ring.etcd`\n\n\u00a0\n\n```yaml\n# Path to the client certificate, which will be used for authenticating with the\n# server. Also requires the key path to be configured.\n# CLI flag: -<prefix>.tls-cert-path\n[tls_cert_path: <string> | default = \"\"]\n\n# Path to the key for the client certificate. Also requires the client\n# certificate to be configured.\n# CLI flag: -<prefix>.tls-key-path\n[tls_key_path: <string> | default = \"\"]\n\n# Path to the CA certificates to validate server certificate against. If not\n# set, the host's root CA certificates are used.\n# CLI flag: -<prefix>.tls-ca-path\n[tls_ca_path: <string> | default = \"\"]\n\n# Override the expected name on the server certificate.\n# CLI flag: -<prefix>.tls-server-name\n[tls_server_name: <string> | default = \"\"]\n\n# Skip validating server certificate.\n# CLI flag: -<prefix>.tls-insecure-skip-verify\n[tls_insecure_skip_verify: <boolean> | default = false]\n\n# Override the default cipher suite list (separated by commas). Allowed values:\n# \n# Secure Ciphers:\n# - TLS_AES_128_GCM_SHA256\n# - TLS_AES_256_GCM_SHA384\n# - TLS_CHACHA20_POLY1305_SHA256\n# - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA\n# - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA\n# - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA\n# - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA\n# - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256\n# - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384\n# - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\n# - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\n# - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256\n# - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256\n# \n# Insecure Ciphers:\n# - TLS_RSA_WITH_RC4_128_SHA\n# - TLS_RSA_WITH_3DES_EDE_CBC_SHA\n# - TLS_RSA_WITH_AES_128_CBC_SHA\n# - TLS_RSA_WITH_AES_256_CBC_SHA\n# - TLS_RSA_WITH_AES_128_CBC_SHA256\n# - TLS_RSA_WITH_AES_128_GCM_SHA256\n# - TLS_RSA_WITH_AES_256_GCM_SHA384\n# - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA\n# - TLS_ECDHE_RSA_WITH_RC4_128_SHA\n# - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA\n# - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256\n# - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256\n# CLI flag: -<prefix>.tls-cipher-suites\n[tls_cipher_suites: <string> | default = \"\"]\n\n# Override the default minimum TLS version. Allowed values: VersionTLS10,\n# VersionTLS11, VersionTLS12, VersionTLS13\n# CLI flag: -<prefix>.tls-min-version\n[tls_min_version: <string> | default = \"\"]\n```\n\n### tracing\n\nConfiguration for `tracing`.\n\n```yaml\n# Set to false to disable tracing.\n# CLI flag: -tracing.enabled\n[enabled: <boolean> | default = true]\n```\n\n \n\n## Runtime Configuration file\n\nLoki 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= ` flag and reload period (which defaults to 10 seconds) can be changed by `-runtime-config.reload-period= ` flag. Previously this mechanism was only used by limits overrides, and flags were called `-limits.per-user-override-config= ` and `-limits.per-user-override-period=10s` respectively. These are still used, if `-runtime-config.file= ` is not specified.\n\nAt the moment, two components use runtime configuration: limits and multi KV store.\n\nOptions for runtime configuration reload can also be configured via YAML:\n\n```yaml\n# Configuration file to periodically check and reload.\n[file: <string>: default = empty]\n\n# How often to check the file.\n[period: <duration>: default 10s]\n```\n\nExample runtime configuration file:\n\n```yaml\noverrides:\n  tenant1:\n    ingestion_rate_mb: 10\n    max_streams_per_user: 100000\n    max_chunks_per_query: 100000\n  tenant2:\n    max_streams_per_user: 1000000\n    max_chunks_per_query: 1000000\n\nmulti_kv_config:\n    mirror-enabled: false\n    primary: consul\n```\n\n## Accept out-of-order writes\n\nSince the beginning of Loki, log entries had to be written to Loki in order\nby time.\nThis limitation has been lifted.\nOut-of-order writes are enabled globally by default, but can be disabled/enabled\non a cluster or per-tenant basis.\n\n- To disable out-of-order writes for all tenants,\nplace in the `limits_config` section:\n\n    ```yaml\n    limits_config:\n        unordered_writes: false\n    ```\n\n- To disable out-of-order writes for specific tenants,\nconfigure a runtime configuration file:\n\n    ```yaml\n    runtime_config:\n      file: overrides.yaml\n    ```\n\n In the `overrides.yaml` file, add `unordered_writes` for each tenant\n permitted to have out-of-order writes:\n\n    ```yaml\n    overrides:\n      \"tenantA\":\n        unordered_writes: false\n    ```\n\nHow far into the past accepted out-of-order log entries may be\nis configurable with `max_chunk_age`.\n`max_chunk_age` defaults to 2 hour.\nLoki calculates the earliest time that out-of-order entries may have\nand be accepted with\n\n```yaml\ntime_of_most_recent_line - (max_chunk_age/2)\n```\n\nLog entries with timestamps that are after this earliest time are accepted.\nLog entries further back in time return an out-of-order error.\n\nFor example, if `max_chunk_age` is 2 hours\nand the stream `{foo=\"bar\"}` has one entry at `8:00`,\nLoki will accept data for that stream as far back in time as `7:00`.\nIf another log line is written at `10:00`,\nLoki will accept data for that stream as far back in time as `9:00`.\n",
      "content_chars": 313725,
      "published_date": null
    }
  ],
  "answer_text": null,
  "citations": [],
  "raw_response": {
    "requestId": "9bfaeb744ff50c2cacf070f171922d25",
    "resolvedSearchType": "",
    "results": [
      {
        "id": "https://grafana.com/docs/loki/latest/operations/storage/logs-deletion/",
        "title": "Log entry deletion | Grafana Loki documentation",
        "url": "https://grafana.com/docs/loki/latest/operations/storage/logs-deletion/",
        "text": "Log entry deletion | Grafana Loki documentation \n\n# Log entry deletion \n\nGrafana Loki supports the deletion of log entries from a specified stream. Log entries that fall within a specified time window and match an optional line filter are those that will be deleted.\n\nLog entry deletion is supported when the TSDB index is configured as the index store. It is also supported on the deprecated BoltDB Shipper index, but BoltDB Shipper is being removed in Loki 4.0, so new deployments should use TSDB.\n\nThe compactor component exposes REST endpoints that process delete requests. Hitting the endpoint specifies the streams and the time window. The deletion of the log entries takes place after a configurable cancellation time period expires.\n\nLog entry deletion relies on configuration of the custom logs retention workflow as defined for the compactor. The compactor looks at unprocessed requests which are past their cancellation period to decide whether a chunk is to be deleted or not.\n\n## Configuration \n\nEnable log entry deletion by setting `retention_enabled` to `true` in the compactor\u2019s configuration (`-compactor.retention-enabled` on the command line). The tenant\u2019s `deletion_mode` must also be `filter-only` or `filter-and-delete`, which is the case by default. `delete_request_store` also needs to be configured when retention is enabled to process delete requests, this determines the storage bucket that stores the delete requests.\n\n> Warning\n> \n> Be very careful when enabling retention. It is strongly recommended that you also enable versioning on your objects in object storage to allow you to recover from accidental misconfiguration of a retention setting. If you want to enable deletion but do not want to enforce retention, configure the `retention_period` setting with a value of `0s`.\n\n`deletion_mode` is a global and per-tenant setting in `limits_config`. Its default value is `filter-and-delete`, so log entry deletion is active for every tenant as soon as `retention_enabled` is `true` and `delete_request_store` is configured, unless you explicitly change the mode. Set `deletion_mode` in the main configuration file for a global default, or override it per tenant in the runtime configuration file.\n\n`deletion_mode` supports three values:\n\n- `disabled`: Deletion is not allowed. Requests to the deletion API endpoints are rejected with a `403 Forbidden` response.\n- `filter-only`: Log lines matching the query in the delete request are filtered out when querying Loki. They are not removed from storage.\n- `filter-and-delete`: Log lines matching the query in the delete request are filtered out when querying Loki, and they are also removed from storage. This is the default.\n\nA delete request may be canceled within a configurable cancellation period. Set the `delete_request_cancel_period` in the compactor\u2019s YAML configuration or on the command line when invoking Loki. Its default value is 24h. To cancel a delete request that has already started processing, pass the `force=true` query parameter to the cancellation endpoint.\n\nDelete requests that include a line filter are split into smaller requests that each cover no more than `delete_max_interval` (24h by default). You can request a smaller split for a single request with the `max_interval` query parameter, but it cannot be larger than `delete_max_interval`. Delete requests without a line filter are not split. Refer to the HTTP API reference for the full set of request parameters.\n\nDelete requests themselves are stored using the database type set by `delete_request_store_db_type`, which defaults to `boltdb`. You can instead use `sqlite`. When you migrate from one database type to another, you can set `backup_delete_request_store_db_type` to `boltdb` so that delete requests are also written to a backup database. Refer to the compactor configuration reference for details.\n\nThe deletion API endpoints are registered only when `compactor.retention_enabled` is `true`. When retention is not enabled, the endpoints are unavailable for every tenant, whatever the `deletion_mode` value is. When retention is enabled, use the `deletion_mode` tenant override to control which tenants can use the deletion API.\n\n> Note\n> \n> Deletion of log lines with line filters is one of the compactor\u2019s most resource-intensive operations. If you delete large volumes of data with line filters, refer to Horizontal scaling of Compactor to distribute that work across multiple compactor instances.",
        "image": "https://grafana.com/meta-generator/Log+entry+deletion@@@loki@@@4.png"
      },
      {
        "id": "https://grafana.com/docs/loki/latest/operations/storage/retention/",
        "title": "Log retention | Grafana Loki documentation",
        "url": "https://grafana.com/docs/loki/latest/operations/storage/retention/",
        "text": "Log retention | Grafana Loki documentation \n\n# Log retention \n\nRetention in Grafana Loki is achieved through the Compactor. By default the `compactor.retention-enabled` flag is not set, so the logs sent to Loki live forever.\n\n> Note\n> \n> If you have a lifecycle policy configured on the object store, please ensure that it is longer than the retention period.\n\nGranular retention policies to apply retention at per tenant or per stream level are also supported by the Compactor.\n\n> Note\n> \n> The Compactor does not support retention on legacy index types. Please use the Table Manager when using legacy index types. Both the Table manager and legacy index types are deprecated and may be removed in future major versions of Loki.\n\n## Compactor \n\nThe Compactor is responsible for compaction of index files and applying log retention.\n\n> Note\n> \n> Run the Compactor as a singleton (a single instance).\n\nThe Compactor runs compaction and retention on two independent schedules:\n\n- Compaction runs every `compactor.compaction-interval`.\n- Retention runs every `compactor.apply-retention-interval`. If you leave this at its default of `0s`, Loki sets it to the same value as `compactor.compaction-interval`. Whenever the two intervals are equal, Loki extends the retention interval by the smaller of `10m` or half the interval, so that compaction and retention do not run at the same time. For example, with the default `compaction_interval` of `10m`, retention runs every `15m`.\n\nIf the Compactor falls behind on either schedule, it runs the corresponding operation as soon as possible. Both compaction and retention are idempotent, which means once the action has been performed, if the action is performed multiple times, it has no further effect on logs after the first time it is performed. If the Compactor restarts, it continues from where it left off.\n\n> Note\n> \n> Changes to your retention period are not retroactive, that is, they are not applied to logs that have already been ingested.\n\nThe Compactor\u2019s algorithm to apply retention is as follows:\n\n- For each day or table (one table per day with 24h index period):\n\n- Compact multiple index files in the table into per-tenant index files. Result of compaction is a single index file per tenant per day.\n- Traverse the per-tenant index. Use the tenant configuration to identify the chunks that need to be removed.\n- Remove the references to the matching chunks from the index and add the chunk references to a marker file on disk.\n- Upload the new modified index files.\n\nChunks are not deleted while applying the retention algorithm on the index. They are deleted asynchronously by a sweeper process and this delay can be configured by setting `-compactor.retention-delete-delay`. Marker files are used to keep track of the chunks pending for deletion.\n\nChunks cannot be deleted immediately for the following reasons:\n\n- Index Gateway downloads a copy of the index files to serve queries and refreshes them at a regular interval. Having a delay allows the index gateways to pull the modified index file which would not contain any reference to the chunks marked for deletion. Without the delay, index files (that are stale) on the gateways could refer to already deleted chunks leading to query failures.\n- It provides a short window of time in which to cancel chunk deletion in the case of a configuration mistake.\n\nBy default, marker files are written to local disk, under `<working_directory>/retention/<object_store_type>_<period_from_date>/markers/`. Marker files should be stored on a persistent disk to ensure that the chunks pending for deletion are processed even if the Compactor process restarts.\n\n> Note\n> \n> Grafana Labs recommends running Compactor as a stateful deployment (StatefulSet when using Kubernetes) with a persistent storage for storing marker files.\n\nAlternatively, you can configure the Compactor to store marker files in object storage instead of local disk, by setting `compactor.deletion-marker-object-store-prefix` (`deletion_marker_object_store_prefix`) to a prefix that ends with `/`. When set, the Compactor writes marker files to the same per-period object store bucket used for chunks, under that prefix. On startup it also copies any existing marker files from local disk to that prefix, then removes the local copies. This lets you run the Compactor without a persistent volume for marker files. Leave this setting empty to keep using local disk.\n\n### Retention Configuration \n\nThis Compactor configuration example activates retention.\n\n```yaml\ncompactor:\n  working_directory: /data/retention\n  compaction_interval: 10m\n  retention_enabled: true\n  retention_delete_delay: 2h\n  retention_delete_worker_count: 150\n  delete_request_store: gcs\nschema_config:\n  configs:\n    - from: \"2020-07-31\"\n      index:\n        period: 24h\n        prefix: index_\n      object_store: gcs\n      schema: v13\n      store: tsdb\nstorage_config:\n  tsdb_shipper:\n    active_index_directory: /data/index\n    cache_location: /data/index_cache\n  gcs:\n    bucket_name: loki\n```\n\n> Note\n> \n> Retention is only available if the index period is 24h. Single store TSDB and single store BoltDB require 24h index period.\n\n`retention_enabled` should be set to true. Without this, the Compactor will only compact tables.\n\n`delete_request_store` should be set to configure the store for delete requests. This is required when retention is enabled.\n\n`working_directory` is the directory where marked chunks and temporary tables will be saved.\n\n`compaction_interval` dictates how often compaction is applied. If the Compactor falls behind, compaction occurs as soon as possible.\n\n`apply_retention_interval` dictates how often retention is applied, independently of `compaction_interval`. Refer to Compactor for how the default value is derived from `compaction_interval`.\n\n`retention_delete_delay` is the delay after which the Compactor will delete marked chunks.\n\n`retention_delete_worker_count` specifies the maximum quantity of goroutine workers instantiated to delete chunks.\n\nA few other options are also relevant when tuning retention:\n\n- `retention_table_timeout` bounds how long the Compactor spends applying retention and processing delete requests on any single table. It defaults to `0s`, meaning no timeout. If the work on a table exceeds this timeout, the Compactor logs a warning and stops early rather than failing, and the remaining work is picked up again on a later run.\n- `retention_backoff_config` controls the retry behavior (minimum and maximum backoff, and number of retries) used by the sweeper when it fails to delete a marked chunk.\n- `delete_request_store_key_prefix` sets the path prefix used to store delete requests within `delete_request_store` (default `index/`).\n- `delete_request_store_db_type` sets the type of database used to store delete requests (default `boltdb`).\n\nRefer to the Configuration reference for the full list of `compactor` options and their defaults.\n\n#### Configuring the retention period \n\nRetention period is configured within the `limits_config` configuration section.\n\nThere are two ways of setting retention policies:\n\n- `retention_period` which is applied globally for all log streams.\n- `retention_stream` which is only applied to log streams matching the selector.\n\n> Note\n> \n> Each `retention_stream` rule\u2019s `period` must be at least 24h. Loki rejects configuration with a shorter value, both in the global `retention_stream` list and in any per-tenant override. This minimum does not apply to the `retention_period` setting, either globally or per tenant.\n\nThis example configures global retention that applies to all tenants (unless overridden by configuring per-tenant overrides):\n\n```yaml\n...\nlimits_config:\n  retention_period: 744h\n  retention_stream:\n  - selector: '{namespace=\"dev\"}'\n    priority: 1\n    period: 24h\n  per_tenant_override_config: /etc/overrides.yaml\n...\n```\n\n> Note\n> \n> You can only use label matchers in the `selector` field of a `retention_stream` definition. Arbitrary LogQL expressions are not supported.\n\nPer tenant retention can be defined by configuring runtime overrides. For example:\n\n```yaml\noverrides:\n    \"29\":\n        retention_period: 168h\n        retention_stream:\n        - selector: '{namespace=\"prod\"}'\n          priority: 2\n          period: 336h\n        - selector: '{container=\"loki\"}'\n          priority: 1\n          period: 72h\n    \"30\":\n        retention_stream:\n        - selector: '{container=\"nginx\", level=\"debug\"}'\n          priority: 1\n          period: 24h\n```\n\nRetention period for a given stream is decided based on the first match in this list:\n\n1. If multiple per-tenant `retention_stream` selectors match the stream, retention period with the highest priority is picked.\n2. If multiple global `retention_stream` selectors match the stream, retention period with the highest priority is picked. This value is not considered if per-tenant `retention_stream` is set.\n3. If a per-tenant `retention_period` is specified, it will be applied.\n4. The global `retention_period` will be applied if none of the above match.\n5. If no global `retention_period` is specified, the default value of `0s` is used, which means logs are kept indefinitely.\n\n> Note\n> \n> The larger the priority value, the higher the priority. If two matching `retention_stream` rules have the same priority, Loki applies the shorter (lowest) of the two periods.\n\nStream matching uses the same syntax as Prometheus label matching:\n\n- `=`: Select labels that are exactly equal to the provided string.\n- `!=`: Select labels that are not equal to the provided string.\n- `=~`: Select labels that regex-match the provided string.\n- `!~`: Select labels that do not regex-match the provided string.\n\nThe example configurations defined above will result in the following retention periods:\n\n- For tenant `29`:\n\n- Streams that have the namespace label `prod` will have a retention period of `336h` (2 weeks), even if the container label is `loki`, since the priority of the `prod` rule is higher.\n- Streams that have the container label `loki` but are not in the namespace `prod` will have a `72h` retention period.\n- For the rest of the streams in this tenant, per-tenant override `retention_period` value of `168h` is applied.\n- For tenant `30`:\n\n- Streams that have the label `nginx` and level `debug` will have a retention period of `24h`.\n- For the rest of the streams in this tenant the global retention period of `744h`, since there is no override specified.\n- All tenants except `29` and `30`:\n\n- Streams that have the namespace label `dev` will have a retention period of `24h` hours.\n- Streams except those with the namespace label `dev` will have the retention period of `744h`.\n\n> Note\n> \n> If you are a Grafana Cloud customer, you can use the config self-serve API to configure your tenant retention.\n\n## Table Manager (deprecated) \n\nRetention through the Table Manager is achieved by relying on the object store TTL feature, and will work for both boltdb-shipper store and chunk/index stores.\n\nIn order to enable the retention support, the Table Manager needs to be configured to enable deletions and a retention period. Please refer to the `table_manager` section of the Loki configuration reference for all available options. Alternatively, the `table-manager.retention-period` and `table-manager.retention-deletes-enabled` command line flags can be used. The provided retention period needs to be a duration represented as a string that can be parsed using the Prometheus common model ParseDuration. Examples: `7d`, `1w`, `168h`.\n\n> Warning\n> \n> The retention period must be a multiple of the index and chunks table `period`, configured in the `period_config` block. See the Table Manager documentation for more information.\n\n> Note\n> \n> To avoid querying of data beyond the retention period,`max_query_lookback` config in `limits_config` must be set to a value less than or equal to what is set in `table_manager.retention_period`.\n\nWhen using S3 or GCS, the bucket storing the chunks needs to have the expiry policy set correctly. For more details check S3\u2019s documentation or GCS\u2019s documentation.\n\nIf you must delete ingested logs, you can delete old chunks in your object store. Note, however, that this only deletes the log content and keeps the label index intact; you will still be able to see related labels but will be unable to retrieve the deleted log content.\n\nFor further details on the Table Manager internals, refer to the Table Manager documentation.\n\nAlternatively, if the BoltDB Shipper is configured for the index store, you can enable Log entry deletion to delete log entries from a specific stream.\n\n## Example Configuration \n\nExample configuration with GCS with a 28 day retention:\n\n```yaml\nschema_config:\n  configs:\n    - from: 2018-04-15\n      store: tsdb\n      object_store: gcs\n      schema: v13\n      index:\n        prefix: loki_index_\n        period: 24h\n\nstorage_config:\n  tsdb_shipper:\n    active_index_directory: /loki/index\n    cache_location: /loki/index_cache\n  gcs:\n    bucket_name: GCS_BUCKET_NAME\n\nlimits_config:\n  max_query_lookback: 672h # 28 days\n  retention_period: 672h   # 28 days\n\ncompactor:\n  working_directory: /data/retention\n  delete_request_store: gcs\n  retention_enabled: true\n```\n\n## Object store lifecycle policies \n\nLoki stores chunks and indexes as objects in the configured object store (S3, GCS, Azure Blob Storage, and so on). Chunks are deleted by the Compactor according to your configured retention, but the Compactor only removes chunk objects: it never deletes the objects that hold cluster state, such as the index or the cluster seed.\n\nIf you also configure an object store lifecycle policy on the bucket, scope it carefully. A blanket \u201cdelete everything older than N days\u201d rule will eventually remove objects that Loki must keep, which corrupts the store and causes query failures. The note at the top of this page applies here as well: any lifecycle expiration must be longer than your retention period.\n\n> Warning\n> \n> Never apply a lifecycle rule with an empty prefix (one that targets the whole bucket). Always scope lifecycle rules to the per-tenant chunk prefixes described below.\n\n### Bucket object layout \n\nThe following objects are written to the configured bucket. The exact prefixes depend on your `schema_config` and on whether multi-tenancy is enabled, so confirm them against your own configuration before writing a lifecycle rule.\n\n| Object or prefix | Content | Safe to expire with a lifecycle policy? |\n| --- | --- | --- |\n| `<tenant_id>/` (for example, `fake/` in single-tenant mode, or your org ID per tenant) | Chunk objects (the log data). | Yes. These are the only objects a lifecycle rule should target. |\n| Index objects (under the index path prefix, `index/` by default, set by `index.path_prefix` in `schema_config`) | TSDB or BoltDB index files, written by ingesters and rewritten by the Compactor. The `index.prefix` value (for example `index_` or `loki_index_`) is the table-name prefix used inside this path, not the path itself, so match a lifecycle rule against the path prefix. | No. Loki manages the index lifecycle internally. Deleting index objects removes references to live chunks and breaks queries. |\n| `loki_cluster_seed.json` | A small file at the bucket root holding the cluster seed used by usage reporting. It is written once and never rotated. | No. A blanket age-based rule will delete it once it ages past the time to live (TTL). |\n| Delete-request store objects (a `delete_requests/` table under `delete_request_store_key_prefix`, `index/` by default, in the bucket configured by `delete_request_store`) | The Compactor\u2019s database of delete requests submitted through the Log entry deletion API, and their processing status. | No. Removing these makes the Compactor lose track of pending delete requests. |\n| Deletion marker objects (only present if you set `deletion_marker_object_store_prefix`; otherwise markers are kept on the Compactor\u2019s local disk and never appear in the bucket) | The Compactor\u2019s record of chunks that are marked for deletion but not yet swept. Written under the configured prefix in the same per-period bucket used for chunks. | No. Removing these makes the Compactor lose track of chunks pending deletion. |\n| Ruler store objects (if the Ruler is backed by the same bucket) | Recording and alerting rule files. | No. These are configuration, not time-series data. |\n\n### Compactor retention versus object store lifecycle policies \n\nCompactor retention and object store lifecycle policies are two independent mechanisms, and they should not be configured in ways that conflict:\n\n- The Compactor is index-aware. It only deletes a chunk after it has removed every reference to that chunk from the index, and it waits `compactor.retention-delete-delay` (default `2h`) before the sweeper deletes the marked chunk, so that index gateways pick up the rewritten index first.\n- An object store lifecycle policy is index-unaware. It deletes objects purely by age and prefix, with no knowledge of whether a chunk is still referenced by the index.\n\nFor most deployments, enabling Compactor retention is sufficient and an object store lifecycle policy is not required. If you do add a lifecycle policy as a cost safety net, set its expiration longer than your retention period plus `compactor.retention-delete-delay`, so the Compactor always deletes chunks first and the lifecycle rule only ever catches objects the Compactor has already orphaned.\n\n### Example: Amazon S3 lifecycle policy \n\nThis policy expires only chunk objects under a single tenant prefix. Replace `fake/` with your tenant prefix (use one rule per tenant, or your org ID prefix, when multi-tenancy is enabled). The `Days` value must be larger than your retention period plus the delete delay.\n\n```json\n{\n  \"Rules\": [\n    {\n      \"ID\": \"loki-chunk-expiration\",\n      \"Status\": \"Enabled\",\n      \"Filter\": {\n        \"Prefix\": \"fake/\"\n      },\n      \"Expiration\": {\n        \"Days\": 395\n      }\n    }\n  ]\n}\n```\n\nApply it with the AWS CLI:\n\n```bash\naws s3api put-bucket-lifecycle-configuration \\\n  --bucket YOUR_LOKI_BUCKET \\\n  --lifecycle-configuration file://lifecycle.json\n```\n\n### Example: Google Cloud Storage lifecycle rule \n\nThe equivalent GCS rule expires objects by age and prefix. As with S3, scope `matchesPrefix` to the tenant chunk prefix and keep `age` larger than your retention period plus the delete delay.\n\n```json\n{\n  \"rule\": [\n    {\n      \"action\": {\"type\": \"Delete\"},\n      \"condition\": {\n        \"age\": 395,\n        \"matchesPrefix\": [\"fake/\"]\n      }\n    }\n  ]\n}\n```\n\nApply it with the Google Cloud CLI:\n\n```bash\ngcloud storage buckets update gs://YOUR_LOKI_BUCKET --lifecycle-file=lifecycle.json\n```\n\nFor Azure Blob Storage, use a management policy with a `prefixMatch` set to the tenant chunk prefix and the same \u201cexpiration must exceed retention plus delete delay\u201d rule.\n\nEmail docs@grafana.com\n\nOn this page",
        "image": "https://grafana.com/meta-generator/Log+retention@@@loki@@@13.png"
      },
      {
        "id": "https://grafana.com/docs/loki/latest/operations/storage/retention/?pg=loki-2-3-is-out-custom-retention-15x-query-speed-on-recent-data-prometheus-style-recording-rules&plcmt=in-text",
        "title": "Log retention | Grafana Loki documentation",
        "url": "https://grafana.com/docs/loki/latest/operations/storage/retention/?pg=loki-2-3-is-out-custom-retention-15x-query-speed-on-recent-data-prometheus-style-recording-rules&plcmt=in-text",
        "text": "Log retention | Grafana Loki documentation \n\n# Log retention \n\nRetention in Grafana Loki is achieved through the Compactor. By default the `compactor.retention-enabled` flag is not set, so the logs sent to Loki live forever.\n\n> Note\n> \n> If you have a lifecycle policy configured on the object store, please ensure that it is longer than the retention period.\n\nGranular retention policies to apply retention at per tenant or per stream level are also supported by the Compactor.\n\n> Note\n> \n> The Compactor does not support retention on legacy index types. Please use the Table Manager when using legacy index types. Both the Table manager and legacy index types are deprecated and may be removed in future major versions of Loki.\n\n## Compactor \n\nThe Compactor is responsible for compaction of index files and applying log retention.\n\n> Note\n> \n> Run the Compactor as a singleton (a single instance).\n\nThe Compactor loops to apply compaction and retention at every `compactor.compaction-interval`, or as soon as possible if running behind. Both compaction and retention are idempotent, which means once the action has been performed, if the action is performed multiple times, it has no further effect on logs after the first time it is performed. If the Compactor restarts, it continues from where it left off.\n\n> Note\n> \n> Changes to your retention period are not retroactive, that is, they are not applied to logs that have already been ingested.\n\nThe Compactor\u2019s algorithm to apply retention is as follows:\n\n- For each day or table (one table per day with 24h index period):\n\n- Compact multiple index files in the table into per-tenant index files. Result of compaction is a single index file per tenant per day.\n- Traverse the per-tenant index. Use the tenant configuration to identify the chunks that need to be removed.\n- Remove the references to the matching chunks from the index and add the chunk references to a marker file on disk.\n- Upload the new modified index files.\n\nChunks are not deleted while applying the retention algorithm on the index. They are deleted asynchronously by a sweeper process and this delay can be configured by setting `-compactor.retention-delete-delay`. Marker files are used to keep track of the chunks pending for deletion.\n\nChunks cannot be deleted immediately for the following reasons:\n\n- Index Gateway downloads a copy of the index files to serve queries and refreshes them at a regular interval. Having a delay allows the index gateways to pull the modified index file which would not contain any reference to the chunks marked for deletion. Without the delay, index files (that are stale) on the gateways could refer to already deleted chunks leading to query failures.\n- It provides a short window of time in which to cancel chunk deletion in the case of a configuration mistake.\n\nMarker files should be stored on a persistent disk to ensure that the chunks pending for deletion are processed even if the Compactor process restarts.\n\n> Note\n> \n> Grafana Labs recommends running Compactor as a stateful deployment (StatefulSet when using Kubernetes) with a persistent storage for storing marker files.\n\n### Retention Configuration \n\nThis Compactor configuration example activates retention.\n\n```yaml\ncompactor:\n  working_directory: /data/retention\n  compaction_interval: 10m\n  retention_enabled: true\n  retention_delete_delay: 2h\n  retention_delete_worker_count: 150\n  delete_request_store: gcs\nschema_config:\n  configs:\n    - from: \"2020-07-31\"\n      index:\n        period: 24h\n        prefix: index_\n      object_store: gcs\n      schema: v13\n      store: tsdb\nstorage_config:\n  tsdb_shipper:\n    active_index_directory: /data/index\n    cache_location: /data/index_cache\n  gcs:\n    bucket_name: loki\n```\n\n> Note\n> \n> Retention is only available if the index period is 24h. Single store TSDB and single store BoltDB require 24h index period.\n\n`retention_enabled` should be set to true. Without this, the Compactor will only compact tables.\n\n`delete_request_store` should be set to configure the store for delete requests. This is required when retention is enabled.\n\n`working_directory` is the directory where marked chunks and temporary tables will be saved.\n\n`compaction_interval` dictates how often compaction and/or retention is applied. If the Compactor falls behind, compaction and/or retention occur as soon as possible.\n\n`retention_delete_delay` is the delay after which the Compactor will delete marked chunks.\n\n`retention_delete_worker_count` specifies the maximum quantity of goroutine workers instantiated to delete chunks.\n\n#### Configuring the retention period \n\nRetention period is configured within the `limits_config` configuration section.\n\nThere are two ways of setting retention policies:\n\n- `retention_period` which is applied globally for all log streams.\n- `retention_stream` which is only applied to log streams matching the selector.\n\n> Note\n> \n> The minimum retention period is 24h.\n\nThis example configures global retention that applies to all tenants (unless overridden by configuring per-tenant overrides):\n\n```yaml\n...\nlimits_config:\n  retention_period: 744h\n  retention_stream:\n  - selector: '{namespace=\"dev\"}'\n    priority: 1\n    period: 24h\n  per_tenant_override_config: /etc/overrides.yaml\n...\n```\n\n> Note\n> \n> You can only use label matchers in the `selector` field of a `retention_stream` definition. Arbitrary LogQL expressions are not supported.\n\nPer tenant retention can be defined by configuring runtime overrides. For example:\n\n```yaml\noverrides:\n    \"29\":\n        retention_period: 168h\n        retention_stream:\n        - selector: '{namespace=\"prod\"}'\n          priority: 2\n          period: 336h\n        - selector: '{container=\"loki\"}'\n          priority: 1\n          period: 72h\n    \"30\":\n        retention_stream:\n        - selector: '{container=\"nginx\", level=\"debug\"}'\n          priority: 1\n          period: 24h\n```\n\nRetention period for a given stream is decided based on the first match in this list:\n\n1. If multiple per-tenant `retention_stream` selectors match the stream, retention period with the highest priority is picked.\n2. If multiple global `retention_stream` selectors match the stream, retention period with the highest priority is picked. This value is not considered if per-tenant `retention_stream` is set.\n3. If a per-tenant `retention_period` is specified, it will be applied.\n4. The global `retention_period` will be applied if none of the above match.\n5. If no global `retention_period` is specified, the default value of `0s` is used, which means logs are kept indefinitely.\n\n> Note\n> \n> The larger the priority value, the higher the priority.\n\nStream matching uses the same syntax as Prometheus label matching:\n\n- `=`: Select labels that are exactly equal to the provided string.\n- `!=`: Select labels that are not equal to the provided string.\n- `=~`: Select labels that regex-match the provided string.\n- `!~`: Select labels that do not regex-match the provided string.\n\nThe example configurations defined above will result in the following retention periods:\n\n- For tenant `29`:\n\n- Streams that have the namespace label `prod` will have a retention period of `336h` (2 weeks), even if the container label is `loki`, since the priority of the `prod` rule is higher.\n- Streams that have the container label `loki` but are not in the namespace `prod` will have a `72h` retention period.\n- For the rest of the streams in this tenant, per-tenant override `retention_period` value of `168h` is applied.\n- For tenant `30`:\n\n- Streams that have the label `nginx` and level `debug` will have a retention period of `24h`.\n- For the rest of the streams in this tenant the global retention period of `744h`, since there is no override specified.\n- All tenants except `29` and `30`:\n\n- Streams that have the namespace label `dev` will have a retention period of `24h` hours.\n- Streams except those with the namespace label `dev` will have the retention period of `744h`.\n\n> Note\n> \n> If you are a Grafana Cloud customer, you can use the config self-serve API to configure your tenant retention.\n\n## Table Manager (deprecated) \n\nRetention through the Table Manager is achieved by relying on the object store TTL feature, and will work for both boltdb-shipper store and chunk/index stores.\n\nIn order to enable the retention support, the Table Manager needs to be configured to enable deletions and a retention period. Please refer to the `table_manager` section of the Loki configuration reference for all available options. Alternatively, the `table-manager.retention-period` and `table-manager.retention-deletes-enabled` command line flags can be used. The provided retention period needs to be a duration represented as a string that can be parsed using the Prometheus common model ParseDuration. Examples: `7d`, `1w`, `168h`.\n\n> Warning\n> \n> The retention period must be a multiple of the index and chunks table `period`, configured in the `period_config` block. See the Table Manager documentation for more information.\n\n> Note\n> \n> To avoid querying of data beyond the retention period,`max_query_lookback` config in `limits_config` must be set to a value less than or equal to what is set in `table_manager.retention_period`.\n\nWhen using S3 or GCS, the bucket storing the chunks needs to have the expiry policy set correctly. For more details check S3\u2019s documentation or GCS\u2019s documentation.\n\nIf you must delete ingested logs, you can delete old chunks in your object store. Note, however, that this only deletes the log content and keeps the label index intact; you will still be able to see related labels but will be unable to retrieve the deleted log content.\n\nFor further details on the Table Manager internals, refer to the Table Manager documentation.\n\nAlternatively, if the BoltDB Shipper is configured for the index store, you can enable Log entry deletion to delete log entries from a specific stream.\n\n## Example Configuration \n\nExample configuration with GCS with a 28 day retention:\n\n```yaml\nschema_config:\n  configs:\n    - from: 2018-04-15\n      store: tsdb\n      object_store: gcs\n      schema: v13\n      index:\n        prefix: loki_index_\n        period: 24h\n\nstorage_config:\n  tsdb_shipper:\n    active_index_directory: /loki/index\n    cache_location: /loki/index_cache\n  gcs:\n    bucket_name: GCS_BUCKET_NAME\n\nlimits_config:\n  max_query_lookback: 672h # 28 days\n  retention_period: 672h   # 28 days\n\ncompactor:\n  working_directory: /data/retention\n  delete_request_store: gcs\n  retention_enabled: true\n```\n\n## Object store lifecycle policies \n\nLoki stores chunks and indexes as objects in the configured object store (S3, GCS, Azure Blob Storage, and so on). Chunks are deleted by the Compactor according to your configured retention, but the Compactor only removes chunk objects: it never deletes the objects that hold cluster state, such as the index or the cluster seed.\n\nIf you also configure an object store lifecycle policy on the bucket, scope it carefully. A blanket \u201cdelete everything older than N days\u201d rule will eventually remove objects that Loki must keep, which corrupts the store and causes query failures. The note at the top of this page applies here as well: any lifecycle expiration must be longer than your retention period.\n\n> Warning\n> \n> Never apply a lifecycle rule with an empty prefix (one that targets the whole bucket). Always scope lifecycle rules to the per-tenant chunk prefixes described below.\n\n### Bucket object layout \n\nThe following objects are written to the configured bucket. The exact prefixes depend on your `schema_config` and on whether multi-tenancy is enabled, so confirm them against your own configuration before writing a lifecycle rule.\n\n| Object or prefix | Content | Safe to expire with a lifecycle policy? |\n| --- | --- | --- |\n| `<tenant_id>/` (for example, `fake/` in single-tenant mode, or your org ID per tenant) | Chunk objects (the log data). | Yes. These are the only objects a lifecycle rule should target. |\n| Index objects (under the index path prefix, `index/` by default, set by `index.path_prefix` in `schema_config`) | TSDB or BoltDB index files, written by ingesters and rewritten by the Compactor. The `index.prefix` value (for example `index_` or `loki_index_`) is the table-name prefix used inside this path, not the path itself, so match a lifecycle rule against the path prefix. | No. Loki manages the index lifecycle internally. Deleting index objects removes references to live chunks and breaks queries. |\n| `loki_cluster_seed.json` | A small file at the bucket root holding the cluster seed used by usage reporting. It is written once and never rotated. | No. A blanket age-based rule will delete it once it ages past the time to live (TTL). |\n| Compactor delete-request store (the `delete_request_store` you configure, such as `markers/` and the delete-request objects) | The Compactor\u2019s record of chunks pending deletion and of in-flight delete requests. | No. Removing these makes the Compactor lose track of pending deletions. |\n| Ruler store objects (if the Ruler is backed by the same bucket) | Recording and alerting rule files. | No. These are configuration, not time-series data. |\n\n### Compactor retention versus object store lifecycle policies \n\nCompactor retention and object store lifecycle policies are two independent mechanisms, and they should not be configured in ways that conflict:\n\n- The Compactor is index-aware. It only deletes a chunk after it has removed every reference to that chunk from the index, and it waits `compactor.retention-delete-delay` (default `2h`) before the sweeper deletes the marked chunk, so that index gateways pick up the rewritten index first.\n- An object store lifecycle policy is index-unaware. It deletes objects purely by age and prefix, with no knowledge of whether a chunk is still referenced by the index.\n\nFor most deployments, enabling Compactor retention is sufficient and an object store lifecycle policy is not required. If you do add a lifecycle policy as a cost safety net, set its expiration longer than your retention period plus `compactor.retention-delete-delay`, so the Compactor always deletes chunks first and the lifecycle rule only ever catches objects the Compactor has already orphaned.\n\n### Example: Amazon S3 lifecycle policy \n\nThis policy expires only chunk objects under a single tenant prefix. Replace `fake/` with your tenant prefix (use one rule per tenant, or your org ID prefix, when multi-tenancy is enabled). The `Days` value must be larger than your retention period plus the delete delay.\n\n```json\n{\n  \"Rules\": [\n    {\n      \"ID\": \"loki-chunk-expiration\",\n      \"Status\": \"Enabled\",\n      \"Filter\": {\n        \"Prefix\": \"fake/\"\n      },\n      \"Expiration\": {\n        \"Days\": 395\n      }\n    }\n  ]\n}\n```\n\nApply it with the AWS CLI:\n\n```bash\naws s3api put-bucket-lifecycle-configuration \\\n  --bucket YOUR_LOKI_BUCKET \\\n  --lifecycle-configuration file://lifecycle.json\n```\n\n### Example: Google Cloud Storage lifecycle rule \n\nThe equivalent GCS rule expires objects by age and prefix. As with S3, scope `matchesPrefix` to the tenant chunk prefix and keep `age` larger than your retention period plus the delete delay.\n\n```json\n{\n  \"rule\": [\n    {\n      \"action\": {\"type\": \"Delete\"},\n      \"condition\": {\n        \"age\": 395,\n        \"matchesPrefix\": [\"fake/\"]\n      }\n    }\n  ]\n}\n```\n\nApply it with the Google Cloud CLI:\n\n```bash\ngcloud storage buckets update gs://YOUR_LOKI_BUCKET --lifecycle-file=lifecycle.json\n```\n\nFor Azure Blob Storage, use a management policy with a `prefixMatch` set to the tenant chunk prefix and the same \u201cexpiration must exceed retention plus delete delay\u201d rule.\n\nScaling and securing your logs with Grafana Loki\n\nThis webinar covers the challenges of scaling and securing logs, and how Grafana Cloud Logs powered by Grafana Loki can help, cost-effectively.\n\nOn this page\n\n See what\u2019s actually working with AI in observability. Learn how teams are using AI for investigations, incident response, OpenTelemetry, and telemetry cost control in production. \n\n Bring your hardest observability problem. From OpenTelemetry and incident response to telemetry cost control and AI-powered investigations, learn what\u2019s working at scale. \n\n Learn how teams are scaling observability with AI, OpenTelemetry, and Adaptive Telemetry. Real systems. Real incidents. Real operational lessons.",
        "image": "https://grafana.com/meta-generator/Log+retention@@@loki@@@11.png"
      },
      {
        "id": "https://github.com/grafana/loki/issues/6300",
        "title": "Old chunks not getting deleted after retention period",
        "url": "https://github.com/grafana/loki/issues/6300",
        "text": "# Old chunks not getting deleted after retention period\n\n- State: closed\n- Author: wzjjack\n- Created: 2022-06-03T06:31:56Z\n- Updated: 2026-04-22T00:46:55Z\n- Repository: grafana/loki\n- Number: #6300\n\n---\n\n \n \n**Describe the bug** \nI've configured 168h retention for my logs, but I can see chunks 5 years old filling my disk \n \n**To Reproduce** \n \nthis is my config \n```\r\nauth_enabled: false\r\n\r\nserver:\r\n  http_listen_port: 3100\r\n  grpc_listen_port: 9096\r\n  grpc_server_max_recv_msg_size: 8388608\r\n  grpc_server_max_send_msg_size: 8388608\r\nquerier:\r\n  engine:\r\n    max_look_back_period: 168h      \r\n\r\ningester:\r\n  wal:\r\n    enabled: true\r\n    dir: /tmp/wal\r\n  lifecycler:\r\n    address: 127.0.0.1\r\n    ring:\r\n      kvstore:\r\n        store: inmemory\r\n      replication_factor: 1\r\n    final_sleep: 0s\r\n  chunk_idle_period: 24h       # Any chunk not receiving new logs in this time will be flushed\r\n  max_chunk_age: 24h           # All chunks will be flushed when they hit this age, default is 1h\r\n  chunk_target_size: 1048576  # Loki will attempt to build chunks up to 1.5MB, flushing first if chunk_idle_period or max_chunk_age is reached first\r\n  chunk_retain_period: 5m    # Must be greater than index read cache TTL if using an index cache (Default index read cache TTL is 5m)\r\n  max_transfer_retries: 0     # Chunk transfers disabled\r\n\r\nschema_config:\r\n  configs:\r\n    - from: 2020-10-24\r\n      store: boltdb-shipper\r\n      object_store: filesystem\r\n      schema: v11\r\n      index:\r\n        prefix: index_\r\n        period: 24h\r\n\r\nstorage_config:\r\n  boltdb_shipper:\r\n    active_index_directory: /tmp/loki/boltdb-shipper-active\r\n    cache_location: /tmp/loki/boltdb-shipper-cache\r\n    cache_ttl: 24h         # Can be increased for faster performance over longer query periods, uses more disk space\r\n    shared_store: filesystem\r\n  filesystem:\r\n    directory: /tmp/loki/chunks\r\n\r\ncompactor:\r\n  working_directory: /tmp/loki/boltdb-shipper-compactor\r\n  shared_store: filesystem\r\n\r\nlimits_config:\r\n  reject_old_samples: true\r\n  reject_old_samples_max_age: 168h\r\n  max_streams_per_user: 1000000\r\n  max_entries_limit_per_query: 5000000\r\n  ingestion_rate_mb: 100\r\n  ingestion_burst_size_mb: 20 \r\nchunk_store_config:\r\n  max_look_back_period: 168h\r\n\r\ntable_manager:\r\n  retention_deletes_enabled: false\r\n  retention_period: 168h\r\n```\r\n \n**Expected behavior** \nChunks older than 168h should be deleted. \n \n**Environment:** \n - Infrastructure: [e.g., Kubernetes, bare-metal, laptop] \n - Deployment tool: [e.g., helm, jsonnet] \n \n**Screenshots, Promtail config, or terminal output** \nWe can see 49 days of logs although I've configured 168h \nimage \n\n## Timeline\n\n- Referenced by issue #936: Old chunks not getting deleted after retention period\n\n**DeBuXer** commented on 2022-06-03T13:04:57Z:\n\n> I got the same issue. Logs older than 7 days are deleted and they're not visible in Grafana. Only the chunk files won't be deleted on the filesystem.\n> \n> ```\n> loki, version 2.5.0 (branch: HEAD, revision: 2d9d0ee23)\n> build user: root@4779f4b48f3a\n> build date: 2022-04-07T21:50:00Z\n> go version: go1.17.6\n> platform: linux/amd64\n> ```\n> \n> ```\n> server:\n> http_listen_port: 3100\n> grpc_listen_port: 9096\n> \n> common:\n> path_prefix: /var/lib/loki\n> storage:\n> filesystem:\n> chunks_directory: /var/lib/loki/chunks\n> rules_directory: /var/lib/loki/rules\n> replication_factor: 1\n> ring:\n> instance_addr: 127.0.0.1\n> kvstore:\n> store: inmemory\n> \n> schema_config:\n> configs:\n> - from: 2020-10-24\n> store: boltdb-shipper\n> object_store: filesystem\n> schema: v11\n> index:\n> prefix: index_\n> period: 24h\n> \n> chunk_store_config:\n> max_look_back_period: 168h\n> \n> table_manager:\n> retention_deletes_enabled: true\n> retention_period: 168h\n> ```\n\n**splitice** commented on 2022-06-04T07:15:14Z:\n\n> Use compactor not table_manager if you arent using AWS S3.\n\n**DeBuXer** commented on 2022-06-07T08:52:38Z:\n\n> > Use compactor not table_manager if you arent using AWS S3.\n> \n> Thanks, that did the trick :)\n\n**Mastedont** commented on 2022-06-14T09:56:43Z:\n\n> Hey @DeBuXer, could you post what you add to your config file in order to get deletion on s3 done?. I am running the same issue and I have not found the solution.\n\n- DeBuXer mentioned\n\n- DeBuXer subscribed\n\n**DeBuXer** commented on 2022-06-14T10:00:18Z:\n\n> @Mastedont, I don't use S3, I store my chunks directly on disk. My current configuration:\n> \n> ```\n> server:\n> http_listen_port: 3100\n> grpc_listen_port: 9096\n> \n> common:\n> path_prefix: /var/lib/loki\n> storage:\n> filesystem:\n> chunks_directory: /var/lib/loki/chunks\n> rules_directory: /var/lib/loki/rules\n> replication_factor: 1\n> ring:\n> instance_addr: 127.0.0.1\n> kvstore:\n> store: inmemory\n> \n> schema_config:\n> configs:\n> - from: 2020-10-24\n> store: boltdb-shipper\n> object_store: filesystem\n> schema: v11\n> index:\n> prefix: index_\n> period: 24h\n> \n> chunk_store_config:\n> max_look_back_period: 168h\n> \n> compactor:\n> working_directory: /var/lib/loki/retention\n> shared_store: filesystem\n> compaction_interval: 10m\n> retention_enabled: true\n> retention_delete_delay: 2h\n> retention_delete_worker_count: 150\n> \n> limits_config:\n> retention_period: 168h\n> \n> ruler:\n> alertmanager_url: http://127.0.0.1:9093\n> ```\n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n**Mastedont** commented on 2022-06-14T10:02:00Z:\n\n> Thank you, @DeBuXer \n\n- DeBuXer mentioned\n\n- DeBuXer subscribed\n\n**Mastedont** commented on 2022-06-14T11:02:51Z:\n\n> One last question @DeBuXer.\n> \n> Do you how can I know if log retention is working or not? What output written in logs will let know thats is working?\n\n- DeBuXer mentioned\n\n- DeBuXer subscribed\n\n**DeBuXer** commented on 2022-06-14T13:19:51Z:\n\n> @Mastedont, Not 100% sure, but I guess:\n> \n> ```\n> Jun 14 15:15:44 loki loki[277929]: level=info ts=2022-06-14T13:15:44.57537489Z caller=index_set.go:280 table-name=index_19150 msg=\"removing source db files from storage\" count=1\n> Jun 14 15:15:44 loki loki[277929]: level=info ts=2022-06-14T13:15:44.576099223Z caller=compactor.go:495 msg=\"finished compacting table\" table-name=index_19150\n> ```\n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n**Mastedont** commented on 2022-06-14T14:07:09Z:\n\n> That log output is from Ingester?\n> \n> I only can see outpur like this, despite of having Compactor enabled:\n> \n> ```\n> level=info ts=2022-06-14T14:05:17.574831148Z caller=table.go:358 msg=\"uploading table loki_pre_19157\"\n> level=info ts=2022-06-14T14:05:17.574847901Z caller=table.go:385 msg=\"finished uploading table loki_pre_19157\"\n> level=info ts=2022-06-14T14:05:17.57485537Z caller=table.go:443 msg=\"cleaning up unwanted dbs from table loki_pre_19157\"\n> ```\n\n**DeBuXer** commented on 2022-06-14T14:26:06Z:\n\n> > That log output is from Ingester?\n> \n> From /var/log/syslog but should have the same information. When compactor is enabled, you should see something like;\n> \n> ```\n> level=info ts=2022-06-14T14:24:56.072803949Z caller=compactor.go:324 msg=\"this instance has been chosen to run the compactor, starting compactor\"\n> ```\n\n**rickydjohn** commented on 2022-07-05T07:19:52Z:\n\n> @DeBuXer , thanks a lot for your support here. I don't see the chunk files getting rotated. I also see pretty old index directories as well. I wanted my logs to be rotated every 7 days. I am not sure what I am doing wrong here. Could you please help me with it?\n> \n> ```\n> auth_enabled: false\n> chunk_store_config:\n> max_look_back_period: 168h\n> \n> compactor:\n> shared_store: filesystem\n> working_directory: /data/loki/boltdb-shipper-compactor\n> \n> ingester:\n> chunk_block_size: 262144\n> chunk_idle_period: 3m\n> chunk_retain_period: 1m\n> wal:\n> dir: /data/loki/wal \n> flush_on_shutdown: true\n> lifecycler:\n> ring:\n> kvstore:\n> store: inmemory\n> replication_factor: 1\n> max_transfer_retries: 0\n> \n> limits_config:\n> enforce_metric_name: false\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> ingestion_rate_mb: 32\n> ingestion_burst_size_mb: 36\n> unordered_writes: true\n> retention_period: 168h\n> \n> schema_config:\n> configs:\n> - from: 2020-10-24\n> index:\n> period: 24h\n> prefix: index_\n> object_store: filesystem\n> schema: v11\n> store: boltdb-shipper\n> \n> server:\n> http_listen_port: 3100\n> \n> storage_config:\n> boltdb_shipper:\n> active_index_directory: /data/loki/boltdb-shipper-active\n> cache_location: /data/loki/boltdb-shipper-cache\n> cache_ttl: 24h\n> shared_store: filesystem\n> filesystem:\n> directory: /data/loki/chunks\n> \n> table_manager:\n> retention_deletes_enabled: true\n> retention_period: 168h\n> \n> ```\n\n- DeBuXer mentioned\n\n- DeBuXer subscribed\n\n**DeBuXer** commented on 2022-07-05T07:30:31Z:\n\n> @rickydjohn, I think you need to enable ` retention_enabled`. See also https://grafana.com/docs/loki/latest/operations/storage/retention/#retention-configuration\n\n- rickydjohn mentioned\n\n- rickydjohn subscribed\n\n**stale[bot]** commented on 2022-08-13T12:49:02Z:\n\n> Hi! This issue has been automatically marked as stale because it has not had any\n> activity in the past 30 days.\n> \n> We use a stalebot among other tools to help manage the state of issues in this project.\n> A stalebot can be very useful in closing issues in a number of cases; the most common\n> is closing issues or PRs where the original reporter has not responded.\n> \n> Stalebots are also emotionless and cruel and can close issues which are still very relevant.\n> \n> **If this issue is important to you, please add a comment to keep it open. More importantly, please add a thumbs-up to the original issue entry.**\n> \n> We regularly sort for closed issues which have a `stale` label sorted by thumbs up.\n> \n> We may also:\n> * Mark issues as `revivable` if we think it's a valid issue but isn't something we are likely\n> to prioritize in the future (the issue will still remain closed).\n> * Add a `keepalive` label to silence the stalebot if the issue is very common/popular/important.\n> \n> We are doing our best to respond, organize, and prioritize all issues but it can be a challenging task,\n> our sincere apologies if you find yourself at the mercy of the stalebot.\n\n- stale[bot] added label \"stale\"\n\n**atze234** commented on 2022-08-30T08:20:16Z:\n\n> Hi @Mastedont ,\n> did you manage to get the chunks deleted from s3? Im having that same problem, that i cannot see any logs about compactor and in s3 store there are older files (>7days) than my configured retention. It seems only the index is cleared, because grafana wont show older log entries. \n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n**ghost** commented on 2022-09-05T07:10:20Z:\n\n> > Hi @Mastedont , did you manage to get the chunks deleted from s3? Im having that same problem, that i cannot see any logs about compactor and in s3 store there are older files (>7days) than my configured retention. It seems only the index is cleared, because grafana wont show older log entries.\n> \n> I have the same problem\n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n- stale[bot] removed label \"stale\"\n\n**webfrank** commented on 2022-11-16T17:11:14Z:\n\n> Hi, I have this relevant config:\n> \n> ```\n> compactor:\n> compaction_interval: 10m\n> retention_delete_delay: 2h\n> retention_delete_worker_count: 150\n> retention_enabled: true\n> shared_store: s3\n> working_directory: /var/loki/retention\n> limits_config:\n> enforce_metric_name: false\n> max_cache_freshness_per_query: 10m\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> retention_period: 720h\n> split_queries_by_interval: 30m\n> ```\n> \n> but log files are not deleted on S3, only index compacted.\n\n**jarrettprosser** commented on 2022-11-18T03:32:44Z:\n\n> I'm also finding this on loki 2.4.0, using minio as storage. Even with `retention_delete_delay: 5m` no chunks are being deleted. \n\n**Codecaver** commented on 2022-12-19T08:13:04Z:\n\n> > @Mastedont, I don't use S3, I store my chunks directly on disk. My current configuration:\n> > \n> > ```\n> > server:\n> > http_listen_port: 3100\n> > grpc_listen_port: 9096\n> > \n> > common:\n> > path_prefix: /var/lib/loki\n> > storage:\n> > filesystem:\n> > chunks_directory: /var/lib/loki/chunks\n> > rules_directory: /var/lib/loki/rules\n> > replication_factor: 1\n> > ring:\n> > instance_addr: 127.0.0.1\n> > kvstore:\n> > store: inmemory\n> > \n> > schema_config:\n> > configs:\n> > - from: 2020-10-24\n> > store: boltdb-shipper\n> > object_store: filesystem\n> > schema: v11\n> > index:\n> > prefix: index_\n> > period: 24h\n> > \n> > chunk_store_config:\n> > max_look_back_period: 168h\n> > \n> > compactor:\n> > working_directory: /var/lib/loki/retention\n> > shared_store: filesystem\n> > compaction_interval: 10m\n> > retention_enabled: true\n> > retention_delete_delay: 2h\n> > retention_delete_worker_count: 150\n> > \n> > limits_config:\n> > retention_period: 168h\n> > \n> > ruler:\n> > alertmanager_url: http://127.0.0.1:9093\n> > ```\n> Hi\uff0cwill this configuration clean up expired files in the chunks directory?\n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n**patsevanton** commented on 2022-12-30T10:38:28Z:\n\n> any update ?\n\n**seany89** commented on 2023-01-27T13:29:47Z:\n\n> Judging from the discussion in this issue https://github.com/grafana/loki/issues/7068\n> I don't think the compactor will delete the chunks in s3 object store you need a bucket lifecycle policy for that.\n> \n> It would be nice to have a clear answer on this though.\n\n**nvanheuverzwijn** commented on 2023-02-15T19:16:38Z:\n\n> For everyone wondering what's going with the retention, I've tested the feature _a lot_ in the past days so here are what will work.\n> \n> ### Minimal Configuration Needed\n> First of all, you absolutely need those config setup\n> ```\n> limits_config:\n> retention_period: 10d # Keep 10 days\n> compactor:\n> delete_request_cancel_period: 10m # don't wait 24h before processing the delete_request\n> retention_enabled: true # actually do the delete\n> retention_delete_delay: 2h # wait 2 hours before actually deleting stuff\n> ```\n> You can tweak those config to delete faster or slower.\n> \n> ### Check If It's Working\n> Once you got those config up and running, check that the logs are actually reporting that the retention is being applied : `msg=\"applying retention with compaction\"`. The \"caller\" for this log is `compactor.go`.\n> \n> Next, check that the retention manager is actually doing it's job in the logs: `msg=\"mark file created\"` and `msg=\"no marks file found\"` from the caller `marker.go`.\n> \n> The `mark file created` means that loki did found some chunks to be deleted and it has created a file to keep track of it. The `no marks file found` means that while performing the chunk delete routine, there was no file that matched it's filters, the filters mainly being the delay.\n> \n> Whenever you see the `mark file created` logs, you can go into the working directory of the compactor and check for the mark files. The path should be something like `/var/loki/compactor/retention/markers`. These files are kept there for 2 hours or whatever is set in `retention_delete_delay`. After `retention_delete_delay` is passed, loki _will_ delete the chunks.\n> \n> Not having any of the logs mentionned above means that the retention process is not started.\n> \n> ### Important Notes\n> Loki will *only delete chunks that are indexed*. The indexes are actually being purged before deleting the chunks. This means that if you lose files from the compactor's working directory, whatever chunks that were marked there won't be deleted ever so it is still worth to have a lifecycle policy to cover for this OR have persistent storage for this particular folder.\n\n**amseager** commented on 2023-03-05T13:27:48Z:\n\n> @nvanheuverzwijn if I were the CTO of Grafana Labs, I would give you a job offer immediately\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**adthonb** commented on 2023-04-28T00:54:14Z:\n\n> @nvanheuverzwijn Thank you a lot! Your explanation makes me clear. The Loki document makes me confuse that Table Manager also deletes chucks when using the filesystem chuck store.\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**yangmeilly** commented on 2023-07-11T12:48:42Z:\n\n> more info about 'Check If It's Working'\n> such as `compaction_interval: 10m`\n> assuming the loki instance start at `2023-07-11T12:30:25.060395045Z`, then there are logs about caller=compactor.go at `ts=2023-07-11T12:40:25.047110295Z`\n> \n> level=info ts=2023-07-11T12:30:25.060441045Z caller=compactor.go:440 msg=\"waiting 10m0s for ring to stay stable and previous compactions to finish before starting compactor\"\n> level=info ts=2023-07-11T12:40:25.045542628Z caller=compactor.go:445 msg=\"compactor startup delay completed\"\n> level=info ts=2023-07-11T12:40:25.045568295Z caller=compactor.go:497 msg=\"compactor started\"\n> **level=info ts=2023-07-11T12:40:25.04562367Z caller=compactor.go:454 msg=\"applying retention with compaction\"**\n> level=info ts=2023-07-11T12:40:25.047110295Z caller=compactor.go:609 msg=\"compacting table\" table-name=loki_index_19549\n> level=info ts=2023-07-11T12:40:25.047208753Z caller=table_compactor.go:325 table-name=loki_index_19549 msg=\"using compactor-1689078092.gz as seed file\"\n> level=info ts=2023-07-11T12:40:25.048495753Z caller=util.go:85 table-name=loki_index_19549 file-name=compactor-1689078092.gz msg=\"downloaded file\" total_time=1.280041ms\n> level=info ts=2023-07-11T12:40:25.06665592Z caller=compactor.go:614 msg=\"finished compacting table\" table-name=loki_index_19549\n> level=info ts=2023-07-11T12:40:25.066668503Z caller=compactor.go:609 msg=\"compacting table\" table-name=loki_index_19548\n> level=info ts=2023-07-11T12:40:25.067591628Z caller=util.go:85 table-name=loki_index_19548 file-name=compactor-1689041382.gz msg=\"downloaded file\" total_time=863.125\u00b5s\n> level=info ts=2023-07-11T12:40:25.078401878Z caller=compactor.go:614 msg=\"finished compacting table\" table-name=loki_index_19548\n\n**Nurlan199206** commented on 2023-07-12T07:56:53Z:\n\n> @yangmeilly \n> \n> you can send full config pls `loki.yaml`?\n> \n> for me not working.\n\n- yangmeilly mentioned\n\n- yangmeilly subscribed\n\n**yangmeilly** commented on 2023-07-13T08:30:15Z:\n\n> > @yangmeilly\n> > \n> > you can send full config pls `loki.yaml`?\n> > \n> > for me not working.\n> \n> in my scenario, using boltdb-shipper for indexs and filesystem for chunks.\n> the full loki config as following, and bold should have your attention.\n> \n> \n> **compactor block:\n> compaction_interval: 10m\n> delete_request_cancel_period: 2h\n> retention_delete_delay: 2h\n> retention_delete_worker_count: 150\n> retention_enabled: true\n> shared_store: filesystem\n> working_directory: /var/loki/retention**\n> \n> limits_config block:\n> enforce_metric_name: false\n> max_cache_freshness_per_query: 10m\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> split_queries_by_interval: 15m\n> **etention_period: 72h\n> max_query_lookback: 72h**\n> \n> \n> table_manager block: // this make nosense for filesystem\n> retention_deletes_enabled: false\n> retention_period: 0\n\n- yangmeilly mentioned\n\n- yangmeilly subscribed\n\n**HammerNL89** commented on 2023-07-25T12:55:21Z:\n\n> > Whenever you see the `mark file created` logs, you can go into the working directory of the compactor and check for the mark files. The path should be something like `/var/loki/compactor/retention/markers`. These files are kept there for 2 hours or whatever is set in `retention_delete_delay`. After `retention_delete_delay` is passed, loki _will_ delete the chunks.\n> > \n> > Not having any of the logs mentionned above means that the retention process is not started.\n> > \n> \n> @nvanheuverzwijn\n> Thanks for the info. Regarding your statement, loki will delete the chunks, are you talking about a filesystem backend or also a s3/azure backend? \n> I can't find a definitive answer stating that loki is able to delete chunks from external storage.\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**nvanheuverzwijn** commented on 2023-07-25T13:09:29Z:\n\n> It will also delete on S3/Azure. I did this with Google Cloud storage but\n> it should be the same for the other backend.\n> \n> Le mar. 25 juill. 2023, 08 h 55, HammerNL89 ***@***.***> a\n> \u00e9crit :\n> \n> > Whenever you see the mark file created logs, you can go into the working\n> > directory of the compactor and check for the mark files. The path should be\n> > something like /var/loki/compactor/retention/markers. These files are\n> > kept there for 2 hours or whatever is set in retention_delete_delay.\n> > After retention_delete_delay is passed, loki *will* delete the chunks.\n> >\n> > Not having any of the logs mentionned above means that the retention\n> > process is not started.\n> >\n> > @nvanheuverzwijn \n> > Thanks for the info. Regarding your statement, loki will delete the\n> > chunks, are you talking about a filesystem backend or also a s3/azure\n> > backend?\n> > I can't find a definitive answer stating that loki is able to delete\n> > chunks from external storage.\n> >\n> > \u2014\n> > Reply to this email directly, view it on GitHub\n> >, or\n> > unsubscribe\n> > \n> > .\n> > You are receiving this because you were mentioned.Message ID:\n> > ***@***.***>\n> >\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**stringang** commented on 2023-08-03T10:59:23Z:\n\n> @nvanheuverzwijn \n> `compactor` did not delete the chunk. why?\n> \n> compactor log:\n> ```\n> level=info ts=2023-08-03T06:50:12.634846248Z caller=compactor.go:497 msg=\"compactor started\"\n> level=info ts=2023-08-03T06:50:12.634865722Z caller=compactor.go:454 msg=\"applying retention with compaction\"\n> level=info ts=2023-08-03T06:50:12.634865349Z caller=marker.go:177 msg=\"mark processor started\" workers=150 delay=2h0m0s\n> level=info ts=2023-08-03T06:50:12.634955656Z caller=expiration.go:78 msg=\"overall smallest retention period 1690440612.634, default smallest retention period 1690440612.634\"\n> ts=2023-08-03T06:50:12.635021334Z caller=spanlogger.go:85 level=info msg=\"building index list cache\"\n> level=info ts=2023-08-03T06:50:12.635046761Z caller=marker.go:202 msg=\"no marks file found\"\n> ```\n> \n> config:\n> ```\n> storage_config:\n> aws:\n> access_key_id: xxxxxx\n> bucketnames: loki\n> endpoint: https://s3.xxxx.com\n> s3forcepathstyle: true\n> secret_access_key: xxxxx\n> boltdb_shipper:\n> active_index_directory: /var/loki/index\n> cache_location: /var/loki/cache\n> cache_ttl: 24h\n> index_gateway_client:\n> server_address: dns:///loki-distributed-index-gateway:9095\n> shared_store: s3\n> \n> compactor:\n> retention_enabled: true\n> shared_store: s3\n> working_directory: /var/loki/compactor\n> retention_delete_delay: 2h\n> delete_request_cancel_period: 10m\n> \n> limits_config:\n> enforce_metric_name: false\n> ingestion_burst_size_mb: 1024\n> ingestion_rate_mb: 1024\n> max_cache_freshness_per_query: 10m\n> max_global_streams_per_user: 0\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> retention_period: 1h\n> split_queries_by_interval: 15m\n> ```\n> ----\n> **update**:\n> It was caused by my incorrect configuration.\n> \n> The storage configuration needs to be placed in the `common`.\n> \n> ```\n> common:\n> compactor_address: http://loki-distributed-compactor:3100\n> storage:\n> s3:\n> access_key_id: xxxxxx\n> bucketnames: loki\n> endpoint: https://s3.xxxx.com\n> s3forcepathstyle: true\n> secret_access_key: xxxxxx\n> ```\n> \n> \n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**yangfan-witcher** commented on 2023-08-15T09:20:10Z:\n\n> @nvanheuverzwijn so beautiful\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**ningyougang** commented on 2023-09-05T05:41:47Z:\n\n> @stringang can you share the whole loki.yaml?\n> \n> I am also testing, log files are not deleted from S3, only index compacted,\n> 1. index compacted, e.g.\n> image\n> 2. log files are not deleted, e.g.\n> image\n> \n> My whole configuartion\n> ```\n> auth_enabled: false\n> chunk_store_config:\n> max_look_back_period: 0s\n> compactor:\n> shared_store: s3\n> working_directory: /data/loki/boltdb-shipper-compactor\n> retention_enabled: true\n> compaction_interval: 10m\n> retention_delete_delay: 2h\n> distributor:\n> ring:\n> kvstore:\n> store: memberlist\n> ingester:\n> chunk_block_size: 262144\n> chunk_idle_period: 3m\n> chunk_retain_period: 1m\n> lifecycler:\n> ring:\n> kvstore:\n> store: memberlist\n> replication_factor: 1\n> max_transfer_retries: 0\n> query_store_max_look_back_period: 0\n> wal:\n> enabled: true\n> dir: /data/wal\n> querier:\n> max_concurrent: 20\n> limits_config:\n> ingestion_rate_mb: 8\n> ingestion_burst_size_mb: 16\n> per_stream_rate_limit: 5MB\n> per_stream_rate_limit_burst: 15MB\n> enforce_metric_name: false\n> reject_old_samples: true\n> reject_old_samples_max_age: 24h\n> retention_period: 24h\n> memberlist:\n> join_members:\n> - loki-headless\n> schema_config:\n> configs:\n> - from: \"2022-11-20\"\n> store: boltdb-shipper\n> object_store: s3\n> schema: v11\n> index:\n> period: 24h\n> prefix: index_\n> chunks:\n> period: 24h\n> prefix: chunks_\n> server:\n> http_listen_port: 3100\n> log_level: debug\n> storage_config:\n> object_prefix: test-nyg\n> boltdb_shipper:\n> active_index_directory: /data/loki/boltdb-shipper-active\n> cache_location: /data/loki/boltdb-shipper-cache\n> cache_ttl: 24h\n> shared_store: s3\n> common:\n> storage:\n> s3:\n> s3: s3://test-admin:test-admin@s3Address:10000/$bucketName\n> s3forcepathstyle: true\n> ```\n> \n> Do i miss something?\n\n- stringang mentioned\n\n- stringang subscribed\n\n**stringang** commented on 2023-09-05T07:02:40Z:\n\n> @ningyougang \n> ```\n> auth_enabled: false\n> chunk_store_config:\n> max_look_back_period: 0s\n> common:\n> compactor_address: http://loki-distributed-compactor:3100\n> storage:\n> s3:\n> access_key_id: xxxxxxxxxxx\n> bucketnames: loki\n> endpoint: https://s3.xxxxxx.com\n> s3forcepathstyle: true\n> secret_access_key: xxxxxxxxxxx\n> compactor:\n> delete_request_cancel_period: 10m\n> retention_delete_delay: 1h\n> retention_enabled: true\n> shared_store: s3\n> working_directory: /var/loki/compactor\n> distributor:\n> ring:\n> kvstore:\n> store: memberlist\n> frontend:\n> compress_responses: true\n> log_queries_longer_than: 5s\n> tail_proxy_url: http://loki-distributed-querier:3100\n> frontend_worker:\n> frontend_address: loki-distributed-query-frontend-headless:9095\n> ingester:\n> chunk_block_size: 262144\n> chunk_encoding: snappy\n> chunk_idle_period: 1h\n> chunk_retain_period: 1m\n> chunk_target_size: 8388608\n> lifecycler:\n> join_after: 10s\n> observe_period: 5s\n> ring:\n> heartbeat_timeout: 10m\n> kvstore:\n> store: memberlist\n> replication_factor: 3\n> max_transfer_retries: 0\n> wal:\n> dir: /var/loki/wal\n> ingester_client:\n> grpc_client_config:\n> grpc_compression: gzip\n> limits_config:\n> enforce_metric_name: false\n> ingestion_burst_size_mb: 1024\n> ingestion_rate_mb: 1024\n> max_cache_freshness_per_query: 10m\n> max_global_streams_per_user: 0\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> retention_period: 1d\n> split_queries_by_interval: 15m\n> memberlist:\n> join_members:\n> - loki-distributed-memberlist\n> query_range:\n> align_queries_with_step: true\n> cache_results: true\n> max_retries: 5\n> results_cache:\n> cache:\n> embedded_cache:\n> enabled: true\n> ttl: 24h\n> ruler:\n> alertmanager_url: http://am.xxxxxxxxxxx.com/\n> enable_alertmanager_v2: true\n> enable_api: true\n> enable_sharding: true\n> ring:\n> kvstore:\n> store: memberlist\n> rule_path: /tmp/loki/scratch\n> storage:\n> local:\n> directory: /etc/loki/rules\n> type: local\n> runtime_config:\n> file: /var/loki-distributed-runtime/runtime.yaml\n> schema_config:\n> configs:\n> - from: \"2023-08-12\"\n> index:\n> period: 24h\n> prefix: loki_index_\n> object_store: s3\n> schema: v11\n> store: boltdb-shipper\n> server:\n> grpc_server_max_recv_msg_size: 8388608\n> http_listen_port: 3100\n> log_level: debug\n> storage_config:\n> boltdb_shipper:\n> active_index_directory: /var/loki/index\n> cache_location: /var/loki/cache\n> cache_ttl: 24h\n> index_gateway_client:\n> server_address: dns:///loki-distributed-index-gateway:9095\n> shared_store: s3\n> table_manager:\n> retention_deletes_enabled: false\n> retention_period: 0s\n> ```\n\n- ningyougang mentioned\n\n- ningyougang subscribed\n\n**ben5556** commented on 2023-09-11T05:29:15Z:\n\n> @nvanheuverzwijn I do see mark file created but then a few mins later the logs show\n> ```\n> level=info ts=2023-09-11T05:23:41.019592474Z caller=compactor.go:364 msg=\"applying retention with compaction\"\n> level=info ts=2023-09-11T05:23:41.020937376Z caller=expiration.go:60 msg=\"overall smallest retention period 1691817821.02, default smallest retention period 1691817821.02\"\n> level=info ts=2023-09-11T05:23:41.065287615Z caller=marker.go:78 msg=\"mark file created\" file=/data/loki/boltdb-shipper-compactor/retention/markers/1694409821056046054\n> ```\n> \n> Few secs later\n> ```\n> level=info ts=2023-09-11T05:24:41.019702032Z caller=marker.go:203 msg=\"no marks file found\"\n> level=info ts=2023-09-11T05:25:41.020103387Z caller=marker.go:203 msg=\"no marks file found\"\n> level=info ts=2023-09-11T05:26:41.020436386Z caller=marker.go:203 msg=\"no marks file found\"\n> level=info ts=2023-09-11T05:27:41.020020721Z caller=marker.go:203 msg=\"no marks file found\"\n> level=info ts=2023-09-11T05:28:41.01973026Z caller=marker.go:203 msg=\"no marks file found\"\n> level=info ts=2023-09-11T05:30:41.020528317Z caller=marker.go:203 msg=\"no marks file found\"\n> ```\n> \n> So looks like even after 5 mins (retention_delete_delay) it still cannot find the mark file. I verified that the mark file exists in that location\n> Below is my loki config\n> \n> ```\n> auth_enabled: false\n> chunk_store_config:\n> max_look_back_period: 0s\n> compactor:\n> delete_request_cancel_period: 10m\n> retention_delete_delay: 5m\n> retention_delete_worker_count: 150\n> retention_enabled: true\n> shared_store: filesystem\n> working_directory: /data/loki/boltdb-shipper-compactor\n> ingester:\n> chunk_block_size: 262144\n> chunk_idle_period: 3m\n> chunk_retain_period: 1m\n> lifecycler:\n> ring:\n> replication_factor: 1\n> max_transfer_retries: 0\n> wal:\n> dir: /data/loki/wal\n> limits_config:\n> enforce_metric_name: false\n> max_entries_limit_per_query: 5000\n> max_query_lookback: 720h\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> retention_period: 720h\n> memberlist:\n> join_members:\n> - 'loki-memberlist'\n> schema_config:\n> configs:\n> - from: \"2020-10-24\"\n> index:\n> period: 24h\n> prefix: index_\n> object_store: filesystem\n> schema: v11\n> store: boltdb-shipper\n> server:\n> grpc_listen_port: 9095\n> http_listen_port: 3100\n> http_server_read_timeout: 120s\n> ```\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**kirannhegde** commented on 2023-09-21T11:40:14Z:\n\n> This is not working for me even with v2.8.4 version of Grafana Loki\n> \n> Loki version: v2.8.4\n> AKS version: 1.23.x\n> Storage backend: azure blob storage\n> \n> From reading the documenation for compactor, i get the impression that compactor is capable of deletion of old chunks from the blob storage.\n> However, i see that the old chunks of Loki are not getting deleted from the blob stroage even though the necessary configuration is in place.\n> Could somone be kind enough to tell me what could be wrong in my configuration?\n> When i inspect the logs for the compactor, i see that the marker file is being created. I also see a lot of API calls to: GET /loki/api/v1/delete.\n> However, i dont see any POST calls to /loki/api/v1/delete. So this gives me the impression that no deletion is happening now.\n> I confirmed the same that chunks from several months ago are still lying in my blob storage.\n> \n> ```\n> auth_enabled: false\n> \n> server:\n> http_listen_port: {{ .Values.loki.containerPorts.http }}\n> log_level: debug\n> common:\n> compactor_address: http://{{ include \"grafana-loki.compactor.fullname\" . }}:{{ .Values.compactor.service.ports.http }}\n> storage:\n> azure:\n> account_name: abc \n> account_key: abc\n> container_name: abc\n> use_managed_identity: false\n> request_timeout: 0 \n> \n> \n> distributor:\n> ring:\n> kvstore:\n> store: memberlist\n> \n> memberlist:\n> join_members:\n> - {{ include \"grafana-loki.gossip-ring.fullname\" . }}\n> \n> ingester:\n> lifecycler:\n> ring:\n> kvstore:\n> store: memberlist\n> replication_factor: 1\n> chunk_idle_period: 2h # Any chunk not receiving new logs in this time will be flushed\n> chunk_block_size: 262144\n> chunk_encoding: snappy\n> chunk_retain_period: 1m\n> max_chunk_age: 2h # All chunks will be flushed when they hit this age, default is 1h\n> max_transfer_retries: 0\n> autoforget_unhealthy: true\n> wal:\n> dir: {{ .Values.loki.dataDir }}/wal\n> \n> limits_config:\n> retention_period: 48h\n> enforce_metric_name: false\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> max_cache_freshness_per_query: 10m\n> split_queries_by_interval: 15m\n> per_stream_rate_limit: 10MB\n> per_stream_rate_limit_burst: 20MB\n> ingestion_rate_mb: 100\n> ingestion_burst_size_mb: 30\n> \n> schema_config:\n> configs:\n> - from: 2020-10-24\n> store: boltdb-shipper\n> object_store: azure\n> schema: v11\n> index:\n> prefix: index_\n> period: 24h\n> chunks:\n> period: 24h\n> \n> storage_config: \n> boltdb_shipper:\n> shared_store: azure\n> active_index_directory: {{ .Values.loki.dataDir }}/loki/index\n> cache_location: {{ .Values.loki.dataDir }}/loki/cache\n> cache_ttl: 168h\n> {{- if .Values.indexGateway.enabled }}\n> index_gateway_client:\n> server_address: {{ (printf \"dns:///%s:9095\" (include \"grafana-loki.index-gateway.fullname\" .)) }}\n> {{- end }}\n> filesystem:\n> directory: {{ .Values.loki.dataDir }}/chunks\n> index_queries_cache_config:\n> {{- if .Values.memcachedindexqueries.enabled }}\n> memcached:\n> batch_size: 100\n> parallelism: 100\n> memcached_client:\n> consistent_hash: true\n> addresses: dns+{{ include \"grafana-loki.memcached-index-queries.host\" . }}\n> service: http\n> {{- end }}\n> \n> chunk_store_config:\n> max_look_back_period: 2d\n> {{- if .Values.memcachedchunks.enabled }}\n> chunk_cache_config:\n> memcached:\n> batch_size: 100\n> parallelism: 100\n> memcached_client:\n> consistent_hash: true\n> addresses: dns+{{ include \"grafana-loki.memcached-chunks.host\" . }}\n> {{- end }}\n> {{- if .Values.memcachedindexwrites.enabled }}\n> write_dedupe_cache_config:\n> memcached:\n> batch_size: 100\n> parallelism: 100\n> memcached_client:\n> consistent_hash: true\n> addresses: dns+{{ include \"grafana-loki.memcached-index-writes.host\" . }}\n> {{- end }}\n> \n> table_manager:\n> retention_deletes_enabled: true\n> retention_period: 2d\n> \n> query_range:\n> align_queries_with_step: true\n> max_retries: 5\n> cache_results: true\n> results_cache:\n> cache:\n> {{- if .Values.memcachedfrontend.enabled }}\n> memcached_client:\n> consistent_hash: true\n> addresses: dns+{{ include \"grafana-loki.memcached-frontend.host\" . }}\n> max_idle_conns: 16\n> timeout: 500ms\n> update_interval: 1m\n> {{- else }}\n> enable_fifocache: true\n> fifocache:\n> max_size_items: 1024\n> validity: 24h\n> {{- end }}\n> {{- if not .Values.queryScheduler.enabled }}\n> frontend_worker:\n> frontend_address: {{ include \"grafana-loki.query-frontend.fullname\" . }}:{{ .Values.queryFrontend.service.ports.grpc }}\n> {{- end }}\n> \n> frontend:\n> log_queries_longer_than: 5s\n> compress_responses: true\n> tail_proxy_url: http://{{ include \"grafana-loki.querier.fullname\" . }}:{{ .Values.querier.service.ports.http }}\n> \n> compactor:\n> working_directory: {{ .Values.loki.dataDir }}/retention\n> shared_store: azure\n> compaction_interval: 10m\n> retention_enabled: true\n> retention_delete_delay: 2h\n> retention_delete_worker_count: 150\n> \n> ruler:\n> storage:\n> type: local\n> local:\n> directory: {{ .Values.loki.dataDir }}/conf/rules\n> ring:\n> kvstore:\n> store: memberlist\n> rule_path: /tmp/loki/scratch\n> alertmanager_url: http://abc.bdc.com/alertmanager\n> external_url: https://abc.bdc.com/alertmanager\n> ```\n\n**tomasz-kazmierczak** commented on 2023-09-30T19:39:45Z:\n\n> Hi,\n> I had a similar issue with recent 2.9.1 version of loki. It appears that recently there has been some work with the property `deletion_mode` (https://grafana.com/docs/loki/latest/operations/storage/logs-deletion/). This property is now a per tenant configurable within the runtime config, the default value is not documented but I had to enforce `filter-and-delete` mode and it started to delete chunks from my object storage.\n> \n> The helm values config for that setting is:\n> ```\n> loki:\n> runtimeConfig:\n> overrides:\n> fake:\n> deletion_mode: filter-and-delete\n> ```\n> I hope this solves your issues.\n\n- Referenced by issue #5: set a scheduled reminder to run every month\n\n**alexmeise** commented on 2024-01-03T09:39:14Z:\n\n> As far as I understood from https://github.com/grafana/loki/issues/7068#issuecomment-1347131945 chunks are never going to get deleted from s3 by the compactor. It is not possible to configure retention so that the compactor actually deletes the chunks from S3. This needs to be done via lifecyclePolicy or some other mechanism. What the compactor will do is manage the chunk/index relationship so that you dont receive issues for \"deleted chunks/indexes\" when running queries. I guess it will actually delete references to chunks in the indexes but not the chunk files themselves. Am I right?? It's a bit conter-intuitive and would help if this is clarified in the documentation. \n\n**szthanatos** commented on 2024-01-13T07:42:54Z:\n\n> > @Mastedont, I don't use S3, I store my chunks directly on disk. My current configuration:\n> > \n> > ```\n> > server:\n> > http_listen_port: 3100\n> > grpc_listen_port: 9096\n> > \n> > common:\n> > path_prefix: /var/lib/loki\n> > storage:\n> > filesystem:\n> > chunks_directory: /var/lib/loki/chunks\n> > rules_directory: /var/lib/loki/rules\n> > replication_factor: 1\n> > ring:\n> > instance_addr: 127.0.0.1\n> > kvstore:\n> > store: inmemory\n> > \n> > schema_config:\n> > configs:\n> > - from: 2020-10-24\n> > store: boltdb-shipper\n> > object_store: filesystem\n> > schema: v11\n> > index:\n> > prefix: index_\n> > period: 24h\n> > \n> > chunk_store_config:\n> > max_look_back_period: 168h\n> > \n> > compactor:\n> > working_directory: /var/lib/loki/retention\n> > shared_store: filesystem\n> > compaction_interval: 10m\n> > retention_enabled: true\n> > retention_delete_delay: 2h\n> > retention_delete_worker_count: 150\n> > \n> > limits_config:\n> > retention_period: 168h\n> > \n> > ruler:\n> > alertmanager_url: http://127.0.0.1:9093\n> > ```\n> \n> mark\n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n**otaku-bowei** commented on 2024-01-31T02:49:11Z:\n\n> > For everyone wondering what's going with the retention, I've tested the feature _a lot_ in the past days so here are what will work.\n> > \n> > ### Minimal Configuration Needed\n> > First of all, you absolutely need those config setup\n> > \n> > ```\n> > limits_config:\n> > retention_period: 10d # Keep 10 days\n> > compactor:\n> > delete_request_cancel_period: 10m # don't wait 24h before processing the delete_request\n> > retention_enabled: true # actually do the delete\n> > retention_delete_delay: 2h # wait 2 hours before actually deleting stuff\n> > ```\n> > \n> > You can tweak those config to delete faster or slower.\n> > \n> > ### Check If It's Working\n> > Once you got those config up and running, check that the logs are actually reporting that the retention is being applied : `msg=\"applying retention with compaction\"`. The \"caller\" for this log is `compactor.go`.\n> > \n> > Next, check that the retention manager is actually doing it's job in the logs: `msg=\"mark file created\"` and `msg=\"no marks file found\"` from the caller `marker.go`.\n> > \n> > The `mark file created` means that loki did found some chunks to be deleted and it has created a file to keep track of it. The `no marks file found` means that while performing the chunk delete routine, there was no file that matched it's filters, the filters mainly being the delay.\n> > \n> > Whenever you see the `mark file created` logs, you can go into the working directory of the compactor and check for the mark files. The path should be something like `/var/loki/compactor/retention/markers`. These files are kept there for 2 hours or whatever is set in `retention_delete_delay`. After `retention_delete_delay` is passed, loki _will_ delete the chunks.\n> > \n> > Not having any of the logs mentionned above means that the retention process is not started.\n> > \n> > ### Important Notes\n> > Loki will _only delete chunks that are indexed_. The indexes are actually being purged before deleting the chunks. This means that if you lose files from the compactor's working directory, whatever chunks that were marked there won't be deleted ever so it is still worth to have a lifecycle policy to cover for this OR have persistent storage for this particular folder.\n> \n> @nvanheuverzwijn learn a lot, how can i know which chunks are indexed?\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n- Mastedont mentioned\n\n- Mastedont subscribed\n\n**myaswanth03** commented on 2024-05-30T07:15:04Z:\n\n> > I got the same issue. Logs older than 7 days are deleted and they're not visible in Grafana. Only the chunk files won't be deleted on the filesystem.\n> > \n> > ```\n> > loki, version 2.5.0 (branch: HEAD, revision: 2d9d0ee23)\n> > build user: root@4779f4b48f3a\n> > build date: 2022-04-07T21:50:00Z\n> > go version: go1.17.6\n> > platform: linux/amd64\n> > ```\n> > \n> > ```\n> > server:\n> > http_listen_port: 3100\n> > grpc_listen_port: 9096\n> > \n> > common:\n> > path_prefix: /var/lib/loki\n> > storage:\n> > filesystem:\n> > chunks_directory: /var/lib/loki/chunks\n> > rules_directory: /var/lib/loki/rules\n> > replication_factor: 1\n> > ring:\n> > instance_addr: 127.0.0.1\n> > kvstore:\n> > store: inmemory\n> > \n> > schema_config:\n> > configs:\n> > - from: 2020-10-24\n> > store: boltdb-shipper\n> > object_store: filesystem\n> > schema: v11\n> > index:\n> > prefix: index_\n> > period: 24h\n> > \n> > chunk_store_config:\n> > max_look_back_period: 168h\n> > \n> > table_manager:\n> > retention_deletes_enabled: true\n> > retention_period: 168h\n> > ```\n> \n> Hi, i used the same file, loki is up and running but retention is not working.\n> \n> permissions are also fine.\n> \n> \n> level=info ts=2024-05-30T07:12:05.009458014Z caller=metrics.go:159 component=frontend org_id=fake traceID=6cc7b11248ffd6f2 latency=fast query=\"sum by (level) (count_over_time({job=\\\"containerlogs\\\"} | drop __error__[1s]))\" query_hash=1978880347 query_type=metric range_type=range length=5m1s start_delta=5m2.009446978s end_delta=1.009448479s step=1s duration=930.872366ms status=200 limit=100 returned_lines=0 throughput=12kB total_bytes=11kB total_bytes_structured_metadata=0B lines_per_second=82 total_lines=77 post_filter_lines=77 total_entries=1 store_chunks_download_time=0s queue_time=100.027997ms splits=0 shards=16 cache_chunk_req=0 cache_chunk_hit=0 cache_chunk_bytes_stored=0 cache_chunk_bytes_fetched=0 cache_chunk_download_time=0s cache_index_req=0 cache_index_hit=0 cache_index_download_time=0s cache_stats_results_req=0 cache_stats_results_hit=0 cache_stats_results_download_time=0s cache_result_req=0 cache_result_hit=0 cache_result_download_time=0s source=logvolhist\n> level=info ts=2024-05-30T07:12:05.180281106Z caller=roundtrip.go:241 org_id=fake traceID=7306103002fd206d msg=\"executing query\" type=range query=\"{job=\\\"containerlogs\\\"}\" length=5m0s step=5m0s query_hash=3605303691\n> level=info ts=2024-05-30T07:12:05.180937762Z caller=engine.go:234 component=querier org_id=fake traceID=7306103002fd206d msg=\"executing query\" type=range query=\"{job=\\\"containerlogs\\\"}\" length=5m0s step=5m0s query_hash=3605303691\n\n**krishgu** commented on 2024-08-08T20:12:56Z:\n\n> > > For everyone wondering what's going with the retention, I've tested the feature _a lot_ in the past days so here are what will work.\n> > > ### Minimal Configuration Needed\n> > > First of all, you absolutely need those config setup\n> > > ```\n> > > limits_config:\n> > > retention_period: 10d # Keep 10 days\n> > > compactor:\n> > > delete_request_cancel_period: 10m # don't wait 24h before processing the delete_request\n> > > retention_enabled: true # actually do the delete\n> > > retention_delete_delay: 2h # wait 2 hours before actually deleting stuff\n> > > ```\n> > > \n> > > \n> > > \n> > > \n> > > \n> > > \n> > > \n> > > \n> > > \n> > > \n> > > \n> > > You can tweak those config to delete faster or slower.\n> > > ### Check If It's Working\n> > > Once you got those config up and running, check that the logs are actually reporting that the retention is being applied : `msg=\"applying retention with compaction\"`. The \"caller\" for this log is `compactor.go`.\n> > > Next, check that the retention manager is actually doing it's job in the logs: `msg=\"mark file created\"` and `msg=\"no marks file found\"` from the caller `marker.go`.\n> > > The `mark file created` means that loki did found some chunks to be deleted and it has created a file to keep track of it. The `no marks file found` means that while performing the chunk delete routine, there was no file that matched it's filters, the filters mainly being the delay.\n> > > Whenever you see the `mark file created` logs, you can go into the working directory of the compactor and check for the mark files. The path should be something like `/var/loki/compactor/retention/markers`. These files are kept there for 2 hours or whatever is set in `retention_delete_delay`. After `retention_delete_delay` is passed, loki _will_ delete the chunks.\n> > > Not having any of the logs mentionned above means that the retention process is not started.\n> > > ### Important Notes\n> > > Loki will _only delete chunks that are indexed_. The indexes are actually being purged before deleting the chunks. This means that if you lose files from the compactor's working directory, whatever chunks that were marked there won't be deleted ever so it is still worth to have a lifecycle policy to cover for this OR have persistent storage for this particular folder.\n> > \n> > @nvanheuverzwijn learn a lot, how can i know which chunks are indexed?\n> \n> The above article by @nvanheuverzwijn is so on point. Thank you!\n> There are a lot of docs of setting Lifecycle Policies as the \"only\" way to purge, and those are outdated. This setup seems to be working fine. \n> \n> In the `compactor` or the `backend` pod, the `working_dir`/retention/`storage`/markers folder will have these marker files. \n> ```text\n> /var/loki/compactor/retention/aws/markers $ ls -la\n> total 312\n> drwxr-sr-x 2 loki loki 4096 Aug 8 19:50 .\n> drwxr-sr-x 3 loki loki 4096 Aug 7 19:59 ..\n> -rw-r--r-- 1 loki loki 32768 Aug 8 18:09 1723140578748104859\n> -rw-r--r-- 1 loki loki 32768 Aug 8 18:19 1723141178696907357\n> ...\n> -rw-r--r-- 1 loki loki 32768 Aug 8 19:49 1723146578638477113\n> -rw-r--r-- 1 loki loki 32768 Aug 8 19:59 1723147178354528360\n> ```\n> \n> If the compactor cycle is running every 10 minutes (default), you will see a new file created and the oldest file processed and deleted every 10 minutes. And in S3 or your storage providers these objects no longer exist!\n> \n> To find out what objects are about to be deleted, use the `strings` or `od -c` on the market file. So doing this on the oldest marker file will tell us about the next-in-line objects that are purged\n> \n> ```sh\n> /var/loki/compactor/retention/aws/markers $ strings 1723140578748104859\n> chunks\n> fake/65ff478cf0700326:190eb0ab615:190eb125142:ee83e028\n> fake/36bfb27dc259bf11:190eaa1db48:190eb0fef22:7101872a\n> fake/eecc8a1a1bba16ea:190eb0a8a31:190eb122448:156be59e\n> fake/dd094d6bff631bd5:190eaa581d0:190eb13688f:62c6862c\n> fake/f78ea3e78078c811:190eaa51fb0:190eb12fcfd:41bb1a13\n> fake/225757be61ef1d7a:190eaa50dad:190eb12f961:48b0c78c\n> fake/f4a7b9aef3c86224:190eb0c4cb2:190eb13a35e:a2919ec1\n> ```\n> \n> 1. To prove there is no old data, use the `aws s3api` command as below to list the oldest object.. You should not see any objects older than your retention_period if all went per plan\n> 2. you see that this is the oldest object is `fake/36bfb27dc259bf1...`, and this was in the output of the previous `strings 1723140578748104859` command (2nd of the fake/... objects). 10 minutes later you will see this deleted. This tallies correctly with the 14d retention period.\n> \n> ```sh\n> $ aws s3api list-objects-v2 --bucket dframe-loki- --prefix fake --query 'sort_by(Contents, &LastModified)[0]' --output json\n> {\n> \"Key\": \"fake/36bfb27dc259bf11:190eaa1db48:190eb0fef22:7101872a\",\n> \"LastModified\": \"2024-07-25T18:03:45.000Z\",\n> \"ETag\": \"\\\"606ec603a5cb748a96a3ea3e4fb11b87\\\"\",\n> \"Size\": 7000,\n> \"StorageClass\": \"STANDARD\"\n> \n> }\n> ```\n> \n> This ticket can be closed, not sure why it is still open...\n\n- nvanheuverzwijn mentioned\n\n- nvanheuverzwijn subscribed\n\n**kdvermagojoko** commented on 2024-08-14T07:20:00Z:\n\n> Hi, I have below conf in my helm override file for having retention period of 24hr, but still i see old index file in S3. I am using loki-stack-2.10.2 chart. Any idea what i am missing here?\n> \n> ```\n> loki:\n> serviceAccount:\n> name: loki-service-account\n> create: false\n> config:\n> schema_config:\n> configs:\n> - from: 2020-10-24\n> store: boltdb-shipper\n> object_store: s3\n> schema: v11\n> index:\n> prefix: loki_index_\n> period: 24h\n> storage_config:\n> aws:\n> s3: s3://aws_region/s3-bucket\n> s3forcepathstyle: true\n> bucketnames: s3-bucket\n> region: aws_region\n> insecure: false\n> sse_encryption: false\n> boltdb_shipper:\n> shared_store: s3\n> cache_ttl: 24h\n> limits_config:\n> enforce_metric_name: false\n> reject_old_samples: true\n> reject_old_samples_max_age: 24h\n> max_entries_limit_per_query: 5000\n> retention_period: 24h\n> max_query_lookback: 24h\n> compactor:\n> working_directory: /data/loki/boltdb-shipper-compactor\n> shared_store: filesystem\n> retention_enabled: true\n> delete_request_cancel_period: 24h\n> retention_delete_delay: 2h\n> retention_delete_worker_count: 150\n> compaction_interval: 24h\n> table_manager:\n> retention_deletes_enabled: true\n> retention_period: 24h\n> ```\n\n**younsl** commented on 2024-08-28T00:49:33Z:\n\n> Here's my `loki-distributed` chart configuration backed by S3 storage. Need to set `delete_request_store` in compactor config, too.\n> \n> > [!NOTE]\n> > `compactor.delete_request_store` should be set to configure the store for delete requests. This is required when retention is enabled. See loki's retention doc.\n> \n> ```yaml\n> # charts/loki-distributed/values.yaml\n> loki:\n> config: |\n> compactor:\n> shared_store: s3\n> working_directory: /var/loki/compactor\n> compaction_interval: 10m\n> retention_enabled: true\n> retention_delete_delay: 2h\n> retention_delete_worker_count: 150\n> delete_request_store: s3\n> \n> limits_config:\n> enforce_metric_name: false\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> max_cache_freshness_per_query: 10m\n> split_queries_by_interval: 15m\n> retention_period: 7d\n> ingestion_rate_mb: 20\n> ingestion_burst_size_mb: 30\n> ```\n> \n> ## Reference\n> \n> issue #9207\n\n- karakuraizer subscribed\n\n- karakuraizer unsubscribed\n\n- paulojmdias subscribed\n\n**adityamandke23** commented on 2024-12-30T07:12:33Z:\n\n> > @nvanheuverzwijn I do see mark file created but then a few mins later the logs show\n> > \n> > ```\n> > level=info ts=2023-09-11T05:23:41.019592474Z caller=compactor.go:364 msg=\"applying retention with compaction\"\n> > level=info ts=2023-09-11T05:23:41.020937376Z caller=expiration.go:60 msg=\"overall smallest retention period 1691817821.02, default smallest retention period 1691817821.02\"\n> > level=info ts=2023-09-11T05:23:41.065287615Z caller=marker.go:78 msg=\"mark file created\" file=/data/loki/boltdb-shipper-compactor/retention/markers/1694409821056046054\n> > ```\n> > \n> > Few secs later\n> > \n> > ```\n> > level=info ts=2023-09-11T05:24:41.019702032Z caller=marker.go:203 msg=\"no marks file found\"\n> > level=info ts=2023-09-11T05:25:41.020103387Z caller=marker.go:203 msg=\"no marks file found\"\n> > level=info ts=2023-09-11T05:26:41.020436386Z caller=marker.go:203 msg=\"no marks file found\"\n> > level=info ts=2023-09-11T05:27:41.020020721Z caller=marker.go:203 msg=\"no marks file found\"\n> > level=info ts=2023-09-11T05:28:41.01973026Z caller=marker.go:203 msg=\"no marks file found\"\n> > level=info ts=2023-09-11T05:30:41.020528317Z caller=marker.go:203 msg=\"no marks file found\"\n> > ```\n> > \n> > So looks like even after 5 mins (retention_delete_delay) it still cannot find the mark file. I verified that the mark file exists in that location Below is my loki config\n> > \n> > ```\n> > auth_enabled: false\n> > chunk_store_config:\n> > max_look_back_period: 0s\n> > compactor:\n> > delete_request_cancel_period: 10m\n> > retention_delete_delay: 5m\n> > retention_delete_worker_count: 150\n> > retention_enabled: true\n> > shared_store: filesystem\n> > working_directory: /data/loki/boltdb-shipper-compactor\n> > ingester:\n> > chunk_block_size: 262144\n> > chunk_idle_period: 3m\n> > chunk_retain_period: 1m\n> > lifecycler:\n> > ring:\n> > replication_factor: 1\n> > max_transfer_retries: 0\n> > wal:\n> > dir: /data/loki/wal\n> > limits_config:\n> > enforce_metric_name: false\n> > max_entries_limit_per_query: 5000\n> > max_query_lookback: 720h\n> > reject_old_samples: true\n> > reject_old_samples_max_age: 168h\n> > retention_period: 720h\n> > memberlist:\n> > join_members:\n> > - 'loki-memberlist'\n> > schema_config:\n> > configs:\n> > - from: \"2020-10-24\"\n> > index:\n> > period: 24h\n> > prefix: index_\n> > object_store: filesystem\n> > schema: v11\n> > store: boltdb-shipper\n> > server:\n> > grpc_listen_port: 9095\n> > http_listen_port: 3100\n> > http_server_read_timeout: 120s\n> > ```\n> \n> any fix for this? facing same issue.\n\n**rknightion** commented on 2025-01-26T19:17:33Z:\n\n> > Hi, I had a similar issue with recent 2.9.1 version of loki. It appears that recently there has been some work with the property `deletion_mode` (https://grafana.com/docs/loki/latest/operations/storage/logs-deletion/). This property is now a per tenant configurable within the runtime config, the default value is not documented but I had to enforce `filter-and-delete` mode and it started to delete chunks from my object storage.\n> > \n> > The helm values config for that setting is:\n> > \n> > ```\n> > loki:\n> > runtimeConfig:\n> > overrides:\n> > fake:\n> > deletion_mode: filter-and-delete\n> > ```\n> > \n> > I hope this solves your issues.\n> \n> THIS is what did it for me after following everything else in the thread. Despite a default limits_config being set to filter-and-delete I had to apply a per-tenant override for every tenant I have and now its actually deleting chunks!!\n\n- banschikovde subscribed\n\n**zzhura** commented on 2025-06-18T08:42:06Z:\n\n> sorry for offtopic but can comeone help with opposite problem - logs being deleted from my disk storage in ~11 days and no config changes helps :(\n> here's detailed description: https://community.grafana.com/t/logs-disappearing-after-11-days-in-storage/144618\n\n**Codecaver** commented on 2025-06-26T02:39:26Z:\n\n> > > Hi, I had a similar issue with recent 2.9.1 version of loki. It appears that recently there has been some work with the property `deletion_mode` (https://grafana.com/docs/loki/latest/operations/storage/logs-deletion/). This property is now a per tenant configurable within the runtime config, the default value is not documented but I had to enforce `filter-and-delete` mode and it started to delete chunks from my object storage.\n> > > The helm values config for that setting is:\n> > > ```\n> > > loki:\n> > > runtimeConfig:\n> > > overrides:\n> > > fake:\n> > > deletion_mode: filter-and-delete\n> > > ```\n> > > \n> > > \n> > > \n> > > \n> > > I hope this solves your issues.\n> > \n> > THIS is what did it for me after following everything else in the thread. Despite a default limits_config being set to filter-and-delete I had to apply a per-tenant override for every tenant I have and now its actually deleting chunks!!\n> \n> LGTM. and this is my config file:\n> Loki: 2.9.2\n> install method: Docker\n> ```\n> auth_enabled: false\n> \n> server:\n> http_listen_port: 3100\n> grpc_listen_port: 9096\n> \n> common:\n> instance_addr: 127.0.0.1\n> path_prefix: /tmp/loki\n> storage:\n> filesystem:\n> chunks_directory: /tmp/loki/chunks\n> rules_directory: /tmp/loki/rules\n> replication_factor: 1\n> ring:\n> kvstore:\n> store: inmemory\n> \n> compactor:\n> retention_enabled: true\n> retention_delete_delay: 0s\n> working_directory: /tmp/loki/compactor\n> #working_directory: /tmp/loki/chunks\n> shared_store: filesystem\n> \n> limits_config:\n> enforce_metric_name: false\n> reject_old_samples: true\n> reject_old_samples_max_age: 168h\n> ingestion_rate_mb: 50\n> ingestion_burst_size_mb: 100\n> per_stream_rate_limit: 256MB\n> per_stream_rate_limit_burst: 512MB\n> deletion_mode: filter-and-delete\n> retention_period: 168h\n> \n> table_manager:\n> retention_deletes_enabled: true\n> retention_period: 168h\n> \n> query_range:\n> results_cache:\n> cache:\n> embedded_cache:\n> enabled: true\n> max_size_mb: 1000\n> \n> schema_config:\n> configs:\n> - from: 2020-10-24\n> store: tsdb\n> object_store: filesystem\n> schema: v13\n> index:\n> prefix: index_\n> period: 24h\n> \n> ruler:\n> alertmanager_url: http://localhost:9093\n> ```\n\n**JStickler** commented on 2026-04-22T00:46:55Z:\n\n> Closing as stale. This issue was opened against a version of Loki that is no longer supported. If this issues still exists in more recent versions of Loki, please leave a comment and we can reopen the issue.\n\n- JStickler closed\n\n- ivankovnatsky unsubscribed"
      },
      {
        "id": "https://github.com/grafana/loki/blob/main/operator/internal/manifests/internal/config/loki-config.yaml",
        "title": "operator/internal/manifests/internal/config/loki-config.yaml at main \u00b7 grafana/loki",
        "url": "https://github.com/grafana/loki/blob/main/operator/internal/manifests/internal/config/loki-config.yaml",
        "text": "# operator/internal/manifests/internal/config/loki-config.yaml\n\n- Branch: main\n- Repository: grafana/loki\n\n---\n\n{{- /*gotype: github.com/grafana/loki/operator/internal/manifests/internal/config.Options*/ -}}\n---\nauth_enabled: true\nchunk_store_config:\n chunk_cache_config:\n embedded_cache:\n enabled: true\n max_size_mb: 500\ncommon:\n storage:\n object_store:\n {{- with .ObjectStorage.Azure }}\n azure:\n container_name: {{ .Container }}\n account_name: ${AZURE_STORAGE_ACCOUNT_NAME}\n endpoint_suffix: {{ .EndpointSuffix }}\n {{- if not .WorkloadIdentity }}\n account_key: ${AZURE_STORAGE_ACCOUNT_KEY}\n {{- end }}\n {{- end }}\n {{- with .ObjectStorage.GCS }}\n gcs:\n bucket_name: {{ .Bucket }}\n {{- end }}\n {{- with .ObjectStorage.S3 }}\n s3:\n {{- if .STS }}\n bucket_name: {{ .Buckets }}\n region: {{ .Region }}\n endpoint: s3.{{.Region}}.amazonaws.com\n native_aws_auth_enabled: true\n {{- else }}\n endpoint: {{ .Endpoint }}\n bucket_name: {{ .Buckets }}\n region: {{ .Region }}\n access_key_id: ${AWS_ACCESS_KEY_ID}\n secret_access_key: ${AWS_ACCESS_KEY_SECRET}\n {{- if .Insecure }}\n insecure: true\n {{- end}}\n {{- if .ForcePathStyle }}\n bucket_lookup_type: path\n {{- end}}\n {{- end }}\n {{- with .SSE }}\n {{- if .Type }}\n sse:\n type: {{ .Type }}\n {{- if eq .Type \"SSE-KMS\" }}\n kms_key_id: {{ .KMSKeyID }}\n {{- with .KMSEncryptionContext }}\n kms_encryption_context: |\n ${AWS_SSE_KMS_ENCRYPTION_CONTEXT}\n {{- end }}\n {{- end}}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- with .ObjectStorage.Swift }}\n swift:\n auth_url: {{ .AuthURL }}\n username: ${SWIFT_USERNAME}\n user_domain_name: {{ .UserDomainName }}\n user_domain_id: {{ .UserDomainID }}\n user_id: {{ .UserID }}\n password: ${SWIFT_PASSWORD}\n domain_id: {{ .DomainID }}\n domain_name: {{ .DomainName }}\n project_id: {{ .ProjectID }}\n project_name: {{ .ProjectName }}\n project_domain_id: {{ .ProjectDomainID }}\n project_domain_name: {{ .ProjectDomainName }}\n region_name: {{ .Region }}\n container_name: {{ .Container }}\n {{- end }}\n {{- with .ObjectStorage.AlibabaCloud}}\n alibaba:\n bucket: {{ .Bucket }}\n endpoint: {{ .Endpoint }}\n access_key_id: ${ALIBABA_CLOUD_ACCESS_KEY_ID}\n access_key_secret: ${ALIBABA_CLOUD_ACCESS_KEY_SECRET}\n {{- end }}\n compactor_grpc_address: {{ .Compactor.FQDN }}:{{ .Compactor.Port }}\n {{- with .GossipRing }}\n ring:\n kvstore:\n store: memberlist\n heartbeat_period: 5s\n heartbeat_timeout: 1m\n {{- with .InstanceAddr }}\n instance_addr: {{ . }}\n {{- end }}\n instance_port: {{ .InstancePort }}\n {{- if .EnableInstanceAvailabilityZone }}\n zone_awareness_enabled: true\n instance_availability_zone: ${INSTANCE_AVAILABILITY_ZONE}\n {{- end }}\n {{- end }}\ncompactor:\n compaction_interval: 2h\n working_directory: {{ .StorageDirectory }}/compactor\n{{- if .Retention.Enabled }}\n{{- with .Retention }}\n retention_enabled: true\n retention_delete_delay: 4h\n retention_delete_worker_count: {{.DeleteWorkerCount}}\n{{- end }}\n delete_request_store: {{.ObjectStorage.SharedStore}}\n{{- end }}\n{{- if .OTLPAttributes.RemoveDefaultLabels }}\ndistributor:\n otlp_config:\n default_resource_attributes_as_index_labels: []\n{{- end }}\nfrontend:\n tail_proxy_url: {{ .Querier.Protocol }}://{{ .Querier.FQDN }}:{{ .Querier.Port }}\n{{- if .Gates.HTTPEncryption }}\n tail_tls_config:\n tls_cert_path: {{ .TLS.Paths.HTTP.Certificate }}\n tls_key_path: {{ .TLS.Paths.HTTP.Key }}\n tls_ca_path: {{ .TLS.Paths.CA }}\n tls_server_name: {{ .TLS.ServerNames.HTTP.Querier }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n tls_min_version: {{ .TLS.MinTLSVersion }}\n{{- end }}\n compress_responses: true\n max_outstanding_per_tenant: 4096\n log_queries_longer_than: 5s\nfrontend_worker:\n frontend_address: {{ .FrontendWorker.FQDN }}:{{ .FrontendWorker.Port }}\n grpc_client_config:\n max_send_msg_size: 104857600\n{{- if .Gates.GRPCEncryption }}\n tls_enabled: true\n tls_cert_path: {{ .TLS.Paths.GRPC.Certificate }}\n tls_key_path: {{ .TLS.Paths.GRPC.Key }}\n tls_ca_path: {{ .TLS.Paths.CA }}\n tls_server_name: {{ .TLS.ServerNames.GRPC.QueryFrontend }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n tls_min_version: {{ .TLS.MinTLSVersion }}\n{{- end }}\ningester:\n chunk_block_size: 262144\n chunk_encoding: snappy\n chunk_idle_period: 1h\n chunk_retain_period: 5m\n chunk_target_size: 2097152\n flush_op_timeout: 10m\n max_chunk_age: 2h\n autoforget_unhealthy: true\n lifecycler:\n final_sleep: 0s\n join_after: 30s\n num_tokens: 512\n tokens_file_path: {{ .StorageDirectory }}/ring-tokens\n {{- if .GossipRing.EnableIPv6 }}\n enable_inet6: true\n {{- end}}\n ring:\n replication_factor: {{ .Stack.Replication.Factor }}\n wal:\n enabled: true\n dir: {{ .WriteAheadLog.Directory }}\n replay_memory_ceiling: {{ .WriteAheadLog.ReplayMemoryCeiling }}\ningester_client:\n grpc_client_config:\n max_recv_msg_size: 67108864\n{{- if .Gates.GRPCEncryption }}\n tls_enabled: true\n tls_cert_path: {{ .TLS.Paths.GRPC.Certificate }}\n tls_key_path: {{ .TLS.Paths.GRPC.Key }}\n tls_ca_path: {{ .TLS.Paths.CA }}\n tls_server_name: {{ .TLS.ServerNames.GRPC.Ingester }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n tls_min_version: {{ .TLS.MinTLSVersion }}\n{{- end }}\n remote_timeout: 5s\n# NOTE: Keep the order of keys as in Loki docs\n# to enable easy diffs when vendoring newer\n# Loki releases.\n# (See https://grafana.com/docs/loki/latest/configuration/#limits_config)\n#\n# Values for not exposed fields are taken from the grafana/loki production\n# configuration manifests.\n# (See https://github.com/grafana/loki/blob/main/production/ksonnet/loki/config.libsonnet)\nlimits_config:\n ingestion_rate_strategy: global\n ingestion_rate_mb: {{ .Stack.Limits.Global.IngestionLimits.IngestionRate }}\n ingestion_burst_size_mb: {{ .Stack.Limits.Global.IngestionLimits.IngestionBurstSize }}\n max_label_name_length: {{ .Stack.Limits.Global.IngestionLimits.MaxLabelNameLength }}\n max_label_value_length: {{ .Stack.Limits.Global.IngestionLimits.MaxLabelValueLength }}\n max_label_names_per_series: {{ .Stack.Limits.Global.IngestionLimits.MaxLabelNamesPerSeries }}\n reject_old_samples: true\n reject_old_samples_max_age: 168h\n creation_grace_period: 10m\n # Keep max_streams_per_user always to 0 to default\n # using max_global_streams_per_user always.\n # (See https://github.com/grafana/loki/blob/main/pkg/ingester/limiter.go#L73)\n max_streams_per_user: 0\n max_line_size: {{ .Stack.Limits.Global.IngestionLimits.MaxLineSize }}\n max_entries_limit_per_query: {{ .Stack.Limits.Global.QueryLimits.MaxEntriesLimitPerQuery }}\n discover_service_name: []\n discover_log_levels: {{ .DiscoverLogLevels }}\n max_global_streams_per_user: {{ .Stack.Limits.Global.IngestionLimits.MaxGlobalStreamsPerTenant }}\n max_chunks_per_query: {{ .Stack.Limits.Global.QueryLimits.MaxChunksPerQuery }}\n max_query_length: 721h\n max_query_parallelism: 32\n tsdb_max_query_parallelism: 512\n max_query_series: {{ .Stack.Limits.Global.QueryLimits.MaxQuerySeries }}\n cardinality_limit: {{ .Stack.Limits.Global.QueryLimits.CardinalityLimit }}\n max_streams_matchers_per_query: 1000\n query_timeout: {{ .Stack.Limits.Global.QueryLimits.QueryTimeout }}\n volume_enabled: true\n volume_max_series: {{ .Stack.Limits.Global.QueryLimits.MaxVolumeSeries }}\n{{- if .Retention.Enabled }}{{- with .Stack.Limits.Global.Retention }}\n retention_period: {{.Days}}d\n{{- with .Streams }}\n retention_stream:\n{{- range . }}\n - selector: '{{ .Selector }}'\n priority: {{ .Priority }}\n period: {{ .Days }}d\n{{- end }}\n{{- end }}\n{{- end }}{{- end }}\n max_cache_freshness_per_query: 10m\n per_stream_rate_limit: {{ .Stack.Limits.Global.IngestionLimits.PerStreamRateLimit }}MB\n per_stream_rate_limit_burst: {{ .Stack.Limits.Global.IngestionLimits.PerStreamRateLimitBurst }}MB\n split_queries_by_interval: 30m\n{{- with .Stack.Limits.Global.IngestionLimits.PerStreamDesiredRate }}\n shard_streams:\n enabled: true\n desired_rate: {{ . }}MB\n time_sharding_enabled: true\n{{- end }}\n{{- with .OTLPAttributes.Global }}\n otlp_config:\n {{- if .ResourceAttributes }}\n resource_attributes:\n {{- with .ResourceAttributes}}\n attributes_config:\n {{- range . }}\n - action: {{ .Action }}\n {{- with .Regex }}\n regex: {{ . }}\n {{- end }}\n {{- with .Names }}\n attributes:\n {{- range . }}\n - {{ . }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- with .ScopeAttributes }}\n scope_attributes:\n {{- range . }}\n - action: {{ .Action }}\n {{- with .Regex }}\n regex: {{ . }}\n {{- end }}\n {{- with .Names }}\n attributes:\n {{- range . }}\n - {{ . }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- with .LogAttributes }}\n log_attributes:\n {{- range . }}\n - action: {{ .Action }}\n {{- with .Regex }}\n regex: {{ . }}\n {{- end }}\n {{- with .Names }}\n attributes:\n {{- range . }}\n - {{ . }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- end }}\n{{- end }}\n allow_structured_metadata: {{ .ObjectStorage.AllowStructuredMetadata }}\n{{- with .GossipRing }}\nmemberlist:\n abort_if_cluster_join_fails: true\n rejoin_interval: 90s\n {{- with .InstanceAddr }}\n advertise_addr: {{ . }}\n {{- end }}\n advertise_port: {{ .BindPort }}\n bind_port: {{ .BindPort }}\n join_members:\n - {{ .MembersDiscoveryAddr }}:{{ .BindPort }}\n max_join_backoff: 1m\n max_join_retries: 10\n min_join_backoff: 1s\n{{- end }}\nquerier:\n engine:\n max_look_back_period: 30s\n extra_query_delay: 0s\n query_ingesters_within: 3h\n tail_max_duration: 1h\n max_concurrent: {{ .MaxConcurrent.AvailableQuerierCPUCores }}\n{{- if .Gates.GRPCEncryption }}\ncompactor_grpc_client:\n tls_enabled: true\n tls_cert_path: {{ .TLS.Paths.GRPC.Certificate }}\n tls_key_path: {{ .TLS.Paths.GRPC.Key }}\n tls_ca_path: {{ .TLS.Paths.CA }}\n tls_server_name: {{ .TLS.ServerNames.GRPC.Compactor }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n tls_min_version: {{ .TLS.MinTLSVersion }}\n{{- end }}\nquery_range:\n align_queries_with_step: true\n cache_results: true\n max_retries: 5\n results_cache:\n cache:\n embedded_cache:\n enabled: true\n max_size_mb: 500\n parallelise_shardable_queries: true\nschema_config:\n configs:\n {{- $store := .ObjectStorage.SharedStore }}\n {{- range .ObjectStorage.Schemas }}\n - from: \"{{ .EffectiveDate }}\"\n index:\n period: 24h\n prefix: index_\n object_store: {{ $store }}\n schema: {{ .Version }}\n {{- if or (eq .Version \"v11\") (eq .Version \"v12\")}}\n store: boltdb-shipper\n {{- else }}\n store: tsdb\n {{- end}}\n {{- end }}\n{{ if .Ruler.Enabled }}\nruler_storage:\n backend: local\n local:\n directory: {{ .Ruler.RulesStorageDirectory }}\nruler:\n enable_api: true\n enable_sharding: true\n {{- with .Ruler.EvaluationInterval }}\n evaluation_interval: {{ . }}\n {{- end }}\n {{- with .Ruler.PollInterval }}\n poll_interval: {{ . }}\n {{- end }}\n {{- with .Ruler.AlertManager }}\n {{- with .ExternalURL }}\n external_url: {{ . }}\n {{- end}}\n {{- with .ExternalLabels }}\n external_labels:\n {{- range $name, $value := . }}\n {{ $name }}: {{ $value }}\n {{- end }}\n {{- end}}\n alertmanager_url: {{ .Hosts }}\n {{- if .EnableV2 }}\n enable_alertmanager_v2: {{ .EnableV2 }}\n {{- end }}\n {{- if .EnableDiscovery }}\n enable_alertmanager_discovery: {{ .EnableDiscovery }}\n alertmanager_refresh_interval: {{ .RefreshInterval }}\n {{- end }}\n {{- if .QueueCapacity }}\n notification_queue_capacity: {{ .QueueCapacity }}\n {{- end }}\n {{- if .Timeout }}\n notification_timeout: {{ .Timeout }}\n {{- end }}\n {{- if .Notifier }}\n {{- with .Notifier }}\n alertmanager_client:\n {{- if .TLS.CertPath }}\n tls_cert_path: {{ .TLS.CertPath }}\n {{- end }}\n {{- if .TLS.KeyPath }}\n tls_key_path: {{ .TLS.KeyPath }}\n {{- end }}\n {{- if .TLS.CAPath }}\n tls_ca_path: {{ .TLS.CAPath }}\n {{- end }}\n {{- if .TLS.ServerName }}\n tls_server_name: {{ .TLS.ServerName }}\n {{- end }}\n {{- if .TLS.InsecureSkipVerify }}\n tls_insecure_skip_verify: {{ .TLS.InsecureSkipVerify }}\n {{- end }}\n {{- if .TLS.CipherSuites }}\n tls_cipher_suites: {{ .TLS.CipherSuites }}\n {{- end }}\n {{- if .TLS.MinVersion }}\n tls_min_version: {{ .TLS.MinVersion }}\n {{- end }}\n {{- if .BasicAuth.Username }}\n basic_auth_username: {{ .BasicAuth.Username }}\n {{- end }}\n {{- if .BasicAuth.Password }}\n basic_auth_password: {{ .BasicAuth.Password }}\n {{- end }}\n {{- if .HeaderAuth.Type }}\n type: {{ .HeaderAuth.Type }}\n {{- end }}\n {{- if .HeaderAuth.Credentials }}\n credentials: {{ .HeaderAuth.Credentials }}\n {{- end }}\n {{- if .HeaderAuth.CredentialsFile }}\n credentials_file: {{ .HeaderAuth.CredentialsFile }}\n {{- end }}\n {{- end }}\n {{- end }}\n\n {{- with .RelabelConfigs }}\n alert_relabel_configs:\n {{- range $k, $cfg := . }}\n - {{ if $cfg.SourceLabels}}\n source_labels: {{ $cfg.SourceLabelsString }}\n {{- end }}\n {{- if $cfg.Regex }}\n regex: {{ $cfg.Regex }}\n {{- end }}\n {{- if $cfg.Action }}\n action: {{ $cfg.Action }}\n {{- end }}\n separator: {{ $cfg.SeparatorString }}\n {{- if $cfg.Replacement }}\n replacement: {{ $cfg.Replacement }}\n {{- end }}\n {{- if $cfg.TargetLabel }}\n target_label: {{ $cfg.TargetLabel }}\n {{- end }}\n {{- if $cfg.Modulus }}\n modulus: {{ $cfg.Modulus }}\n {{- end }}\n {{- end }}\n {{- end }}\n\n {{- if .ForOutageTolerance }}\n for_outage_tolerance: {{ .ForOutageTolerance }}\n {{- end }}\n {{- if .ForGracePeriod }}\n for_grace_period: {{ .ForGracePeriod }}\n {{- end }}\n {{- if .ResendDelay }}\n resend_delay: {{ .ResendDelay }}\n {{- end }}\n {{- end}}\n {{- with .Ruler.RemoteWrite }}\n {{- if .Enabled }}\n remote_write:\n enabled: {{ .Enabled }}\n config_refresh_period: {{ .RefreshPeriod }}\n clients:\n {{- with .Client }}\n default:\n name: {{ .Name }}\n url: {{ .URL }}\n remote_timeout: {{ .RemoteTimeout }}\n proxy_url: {{ .ProxyURL }}\n follow_redirects: {{ .FollowRedirects }}\n headers:\n {{- range $key, $val := .Headers }}\n \"{{ $key }}\": \"{{ $val }}\"\n {{- end }}\n {{- if and .BasicAuthUsername .BasicAuthPassword }}\n basic_auth:\n username: {{ .BasicAuthUsername }}\n password: {{ .BasicAuthPassword }}\n {{- end }}\n {{- if .BearerToken }}\n authorization:\n type: bearer\n credentials: {{ .BearerToken }}\n {{- end }}\n {{- end}}\n {{- with .RelabelConfigs }}\n write_relabel_configs:\n {{- range $k, $cfg := . }}\n - {{- if $cfg.SourceLabels}}\n source_labels: {{ $cfg.SourceLabelsString }}\n {{- end }}\n {{- if $cfg.Regex }}\n regex: {{ $cfg.Regex }}\n {{- end }}\n {{- if $cfg.Action }}\n action: {{ $cfg.Action }}\n {{- end }}\n separator: {{ $cfg.SeparatorString }}\n {{- if $cfg.Replacement }}\n replacement: {{ $cfg.Replacement }}\n {{- end }}\n {{- if $cfg.TargetLabel }}\n target_label: {{ $cfg.TargetLabel }}\n {{- end }}\n {{- if $cfg.Modulus }}\n modulus: {{ $cfg.Modulus }}\n {{- end }}\n {{- end}}\n {{- end }}\n {{- with .Queue }}\n queue_config:\n {{- if .Capacity }}\n capacity: {{ .Capacity }}\n {{- end }}\n {{- if .MaxShards }}\n max_shards: {{ .MaxShards }}\n {{- end }}\n {{- if .MinShards }}\n min_shards: {{ .MinShards }}\n {{- end }}\n {{- if .MaxSamplesPerSend }}\n max_samples_per_send: {{ .MaxSamplesPerSend }}\n {{- end }}\n {{- if .BatchSendDeadline }}\n batch_send_deadline: {{ .BatchSendDeadline }}\n {{- end }}\n {{- if .MinBackOffPeriod }}\n min_backoff: {{ .MinBackOffPeriod }}\n {{- end }}\n {{- if .MaxBackOffPeriod }}\n max_backoff: {{ .MaxBackOffPeriod }}\n {{- end }}\n {{- end }}\n {{- end }}\n {{- end }}\n wal:\n dir: {{ .WriteAheadLog.Directory }}\n truncate_frequency: 60m\n min_age: 5m\n max_age: 4h\n rule_path: {{ .StorageDirectory }}\n ring:\n kvstore:\n store: memberlist\n{{- if .Gates.GRPCEncryption }}\n ruler_client:\n tls_enabled: true\n tls_cert_path: {{ .TLS.Paths.GRPC.Certificate }}\n tls_key_path: {{ .TLS.Paths.GRPC.Key }}\n tls_ca_path: {{ .TLS.Paths.CA }}\n tls_server_name: {{ .TLS.ServerNames.GRPC.Ruler }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n tls_min_version: {{ .TLS.MinTLSVersion }}\n{{- end }}\n{{ end }}\n{{- if .Gates.HTTPEncryption }}\ninternal_server:\n enable: true\n http_listen_address: \"\"\n tls_min_version: {{ .TLS.MinTLSVersion }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n http_tls_config:\n cert_file: {{ .TLS.Paths.HTTP.Certificate }}\n key_file: {{ .TLS.Paths.HTTP.Key }}\n{{- end }}\nserver:\n graceful_shutdown_timeout: 5s\n grpc_server_min_time_between_pings: '10s'\n grpc_server_ping_without_stream_allowed: true\n grpc_server_max_concurrent_streams: 1000\n grpc_server_max_recv_msg_size: 104857600\n grpc_server_max_send_msg_size: 104857600\n http_listen_port: 3100\n http_server_idle_timeout: {{ .HTTPTimeouts.IdleTimeout }}\n http_server_read_timeout: {{ .HTTPTimeouts.ReadTimeout }}\n http_server_write_timeout: {{ .HTTPTimeouts.WriteTimeout }}\n{{- if or .Gates.HTTPEncryption .Gates.GRPCEncryption }}\n tls_min_version: {{ .TLS.MinTLSVersion }}\n tls_cipher_suites: {{ .TLS.CipherSuitesString }}\n{{- if .Gates.HTTPEncryption }}\n http_tls_config:\n cert_file: {{ .TLS.Paths.HTTP.Certificate }}\n key_file: {{ .TLS.Paths.HTTP.Key }}\n client_auth_type: RequireAndVerifyClientCert\n client_ca_file: {{ .TLS.Paths.CA }}\n{{- end }}\n{{- if .Gates.GRPCEncryption }}\n grpc_tls_config:\n cert_file: {{ .TLS.Paths.GRPC.Certificate }}\n key_file: {{ .TLS.Paths.GRPC.Key }}\n client_auth_type: RequireAndVerifyClientCert\n client_ca_file: {{ .TLS.Paths.CA }}\n{{- end }}\n{{- end }}\n log_level: info\nstorage_config:\n use_thanos_objstore: true\n{{- range $_, $ship := .Shippers }}\n{{- if eq $ship \"boltdb\" }}\n boltdb_shipper:\n active_index_directory: {{ $.StorageDirectory }}/index\n cache_location: {{ $.StorageDirectory }}/index_cache\n{{- end }}\n{{- if eq $ship \"tsdb\" }}\n tsdb_shipper:\n active_index_directory: {{ $.StorageDirectory }}/tsdb-index\n cache_location: {{ $.StorageDirectory }}/tsdb-cache\n{{- end }}\n cache_ttl: 24h\n resync_interval: 5m\n index_gateway_client:\n server_address: dns:///{{ $.IndexGateway.FQDN }}:{{ $.IndexGateway.Port }}\n{{- if $.Gates.GRPCEncryption }}\n grpc_client_config:\n tls_enabled: true\n tls_cert_path: {{ $.TLS.Paths.GRPC.Certificate }}\n tls_key_path: {{ $.TLS.Paths.GRPC.Key }}\n tls_ca_path: {{ $.TLS.Paths.CA }}\n tls_server_name: {{ $.TLS.ServerNames.GRPC.IndexGateway }}\n tls_cipher_suites: {{ $.TLS.CipherSuitesString }}\n tls_min_version: {{ $.TLS.MinTLSVersion }}\n{{- end }}\n{{- end }}\ntracing:\n enabled: false\nanalytics:\n reporting_enabled: {{ .EnableRemoteReporting }}\n"
      },
      {
        "id": "https://grafana.com/docs/loki/v2.6.x/operations/storage/retention",
        "title": "Grafana Loki Storage Retention",
        "url": "https://grafana.com/docs/loki/v2.6.x/operations/storage/retention",
        "text": "Retention | Grafana Loki documentation\n\nTry using Grot AI for this query ->\n\nMenu\n\nImportant: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.\n\nDocumentation Grafana Loki Operations Storage Retention\n\nOpen source\n\n# Grafana Loki Storage Retention\n\nRetention in Grafana Loki is achieved either through the Table Manager or the Compactor.\n\nRetention through the Table Manager is achieved by relying on the object store TTL feature, and will work for both boltdb-shipper store and chunk/index store. However retention through the Compactor is supported only with the boltdb-shipper store.\n\nThe Compactor retention will become the default and have long term support. It supports more granular retention policies on per tenant and per stream use cases.\n\n## Compactor\n\nThe Compactor can deduplicate index entries. It can also apply granular retention. When applying retention with the Compactor, the Table Manager is unnecessary.\n\nRun the compactor as a singleton (a single instance).\n\nCompaction and retention are idempotent. If the compactor restarts, it will continue from where it left off.\n\nThe Compactor loops to apply compaction and retention at every`compaction_interval`, or as soon as possible if running behind.\n\nThe compactor\u2019s algorithm to update the index:\n\nFor each table within each day:\n\n- Compact the table into a single index file.\n- Traverse the entire index. Use the tenant configuration to identify and mark chunks that need to be removed.\n- Remove marked chunks from the index and save their reference in a file on disk.\n- Upload the new modified index files.\n\nThe retention algorithm is applied to the index. Chunks are not deleted while applying the retention algorithm. The chunks will be deleted by the compactor asynchronously when swept.\n\nMarked chunks will only be deleted after`retention_delete_delay` configured is expired because:\n\nboltdb-shipper indexes are refreshed from the shared store on components using it (querier and ruler) at a specific interval. This means deleting chunks instantly could lead to components still having reference to old chunks and so they could fails to execute queries. Having a delay allows for components to refresh their store and so remove gracefully their reference of those chunks.\n\nIt provides a short window of time in which to cancel chunk deletion in the case of a configuration mistake.\n\nMarker files (containing chunks to delete) should be stored on a persistent disk, since the disk will be the sole reference to them.\n\n### Retention Configuration\n\nThis compactor configuration example activates retention.\n\nYAML Copy\n\n```\ncompactor:\n  working_directory: /data/retention\n  shared_store: gcs\n  compaction_interval: 10m\n  retention_enabled: true\n  retention_delete_delay: 2h\n  retention_delete_worker_count: 150\nschema_config:\n    configs:\n      - from: \"2020-07-31\"\n        index:\n            period: 24h\n            prefix: loki_index_\n        object_store: gcs\n        schema: v11\n        store: boltdb-shipper\nstorage_config:\n    boltdb_shipper:\n        active_index_directory: /data/index\n        cache_location: /data/boltdb-cache\n        shared_store: gcs\n    gcs:\n        bucket_name: loki\n```\n\nNote that retention is only available if the index period is 24h.\n\nSet`retention_enabled` to true. Without this, the Compactor will only compact tables.\n\nDefine`schema_config` and`storage_config` to access the storage.\n\nThe index period must be 24h.\n\n`working_directory` is the directory where marked chunks and temporary tables will be saved.\n\n`compaction_interval` dictates how often compaction and/or retention is applied. If the Compactor falls behind, compaction and/or retention occur as soon as possible.\n\n`retention_delete_delay` is the delay after which the compactor will delete marked chunks.\n\n`retention_delete_worker_count` specifies the maximum quantity of goroutine workers instantiated to delete chunks.\n\n#### Configuring the retention period\n\nRetention period is configured within the limits_config configuration section.\n\nThere are two ways of setting retention policies:\n\n- `retention_period` which is applied globally.\n- `retention_stream` which is only applied to chunks matching the selector\n\nThe minimum retention period is 24h.\n\nThis example configures global retention:\n\nYAML Copy\n\n```\n...\nlimits_config:\n  retention_period: 744h\n  retention_stream:\n  - selector: '{namespace=\"dev\"}'\n    priority: 1\n    period: 24h\n  per_tenant_override_config: /etc/overrides.yaml\n...\n```\n\nNOTE: You can only use label matchers in the`selector` field of a`retention_stream` definition. Arbitrary LogQL expressions are not supported.\n\nPer tenant retention can be defined using the`/etc/overrides.yaml` files. For example:\n\nYAML Copy\n\n```\noverrides:\n    \"29\":\n        retention_period: 168h\n        retention_stream:\n        - selector: '{namespace=\"prod\", container=~\"(nginx|loki)\"}'\n          priority: 2\n          period: 336h\n        - selector: '{container=\"loki\"}'\n          priority: 1\n          period: 72h\n    \"30\":\n        retention_stream:\n        - selector: '{container=\"nginx\", level=\"debug\"}'\n          priority: 1\n          period: 24h\n```\n\nA rule to apply is selected by choosing the first in this list that matches:\n\n1. If a per-tenant`retention_stream` matches the current stream, the highest priority is picked.\n2. If a global`retention_stream` matches the current stream, the highest priority is picked.\n3. If a per-tenant`retention_period` is specified, it will be applied.\n4. The global`retention_period` will be selected if nothing else matched.\n5. If no global`retention_period` is specified, the default value of`744h`(30days) retention is used.\n\nStream matching uses the same syntax as Prometheus label matching:\n\n- `=`: Select labels that are exactly equal to the provided string.\n- `!=`: Select labels that are not equal to the provided string.\n- `=~`: Select labels that regex-match the provided string.\n- `!~`: Select labels that do not regex-match the provided string.\n\nThe example configurations will set these rules:\n\nFor tenant`29`:\n\n- All streams except those in the container`loki` or in the namespace`prod` will have retention period of`168h`(1 week).\n- All streams in the`prod` namespace will have a retention period of`336h`(2 weeks), even if the container label is`loki`, since the priority of the`prod` rule is higher.\n- Streams that have the container label`loki` but are not in the namespace`prod` will have a`72h` retention period.\n\nFor tenant`30`:\n\n- All streams except those having the container label`nginx` will have the global retention period of`744h`, since there is no override specified.\n- Streams that have the label`nginx` will have a retention period of`24h`.\n\n## Table Manager\n\nIn order to enable the retention support, the Table Manager needs to be configured to enable deletions and a retention period. Please refer to the table_manager section of the Loki configuration reference for all available options. Alternatively, the`table-manager.retention-period` and`table-manager.retention-deletes-enabled` command line flags can be used. The provided retention period needs to be a duration represented as a string that can be parsed using the Prometheus common model ParseDuration. Examples:`7d`,`1w`,`168h`.\n\nWARNING: The retention period must be a multiple of the index and chunks table`period`, configured in the period_config block. See the Table Manager documentation for more information.\n\nNOTE: To avoid querying of data beyond the retention period,`max_look_back_period` config in chunk_store_config must be set to a value less than or equal to what is set in`table_manager.retention_period`.\n\nWhen using S3 or GCS, the bucket storing the chunks needs to have the expiry policy set correctly. For more details check S3\u2019s documentation or GCS\u2019s documentation.\n\nCurrently, the retention policy can only be set globally. A per-tenant retention policy with an API to delete ingested logs is still under development.\n\nSince a design goal of Loki is to make storing logs cheap, a volume-based deletion API is deprioritized. Until this feature is released, if you suddenly must delete ingested logs, you can delete old chunks in your object store. Note, however, that this only deletes the log content and keeps the label index intact; you will still be able to see related labels but will be unable to retrieve the deleted log content.\n\nFor further details on the Table Manager internals, refer to the Table Manager documentation.\n\n## Example Configuration\n\nExample configuration with GCS with a 28 day retention:\n\nYAML Copy\n\n```\nschema_config:\n  configs:\n  - from: 2018-04-15\n    store: bigtable\n    object_store: gcs\n    schema: v11\n    index:\n      prefix: loki_index_\n      period: 168h\n\nstorage_config:\n  bigtable:\n    instance: BIGTABLE_INSTANCE\n    project: BIGTABLE_PROJECT\n  gcs:\n    bucket_name: GCS_BUCKET_NAME\n\nchunk_store_config:\n  max_look_back_period: 672h\n\ntable_manager:\n  retention_deletes_enabled: true\n  retention_period: 672h\n```\n\n## Was this page helpful?\n\nYes No\n\nSuggest an edit in GitHub\n\nCreate a GitHub issue\n\nEmail docs@grafana.com\n\nHelp and support\n\nCommunity\n\n## Related resources from Grafana Labs\n\nAdditional helpful documentation, links, and articles:",
        "image": "https://grafana.com/meta-generator/Retention@@@loki@@@6.png",
        "favicon": "https://archive.grafana.com/static/assets/img/fav32.png"
      },
      {
        "id": "https://github.com/grafana/loki/blob/v1.3.0/docs/configuration/README.md",
        "title": "docs/configuration/README.md",
        "url": "https://github.com/grafana/loki/blob/v1.3.0/docs/configuration/README.md",
        "text": "# docs/configuration/README.md\n\n- Branch: v1.3.0\n- Repository: grafana/loki\n\n---\n\n# Configuring Loki\n\nLoki is configured in a YAML file (usually referred to as `loki.yaml`)\nwhich contains information on the Loki server and its individual components,\ndepending on which mode Loki is launched in.\n\nConfiguration examples can be found in the Configuration Examples document.\n\n* Configuration File Reference\n* server_config\n* distributor_config\n* querier_config\n* ingester_client_config\n * grpc_client_config\n* ingester_config\n * lifecycler_config\n * ring_config\n* storage_config\n * cache_config\n* chunk_store_config\n* schema_config\n * period_config\n* limits_config\n* table_manager_config\n * provision_config\n * auto_scaling_config\n\n## Configuration File Reference\n\nTo specify which configuration file to load, pass the `-config.file` flag at the\ncommand line. The file is written in YAML format,\ndefined by the scheme below. Brackets indicate that a parameter is optional. For\nnon-list parameters the value is set to the specified default.\n\nGeneric placeholders are defined as follows:\n\n* ` `: a boolean that can take the values `true` or `false`\n* ` `: any integer matching the regular expression `[1-9]+[0-9]*`\n* ` `: a duration matching the regular expression `[0-9]+(ns|us|\u00b5s|ms|[smh])`\n* ` `: a string matching the regular expression `[a-zA-Z_][a-zA-Z0-9_]*`\n* ` `: a string of unicode characters\n* ` `: a valid path relative to current working directory or an\n absolute path.\n* ` `: a valid string consisting of a hostname or IP followed by an optional port number\n* ` `: a regular string\n* ` `: a regular string that is a secret, such as a password\n\nSupported contents and default values of `loki.yaml`:\n\n```yaml\n# The module to run Loki with. Supported values\n# all, querier, table-manager, ingester, distributor\n[target: <string> | default = \"all\"]\n\n# Enables authentication through the X-Scope-OrgID header, which must be present\n# if true. If false, the OrgID will always be set to \"fake\".\n[auth_enabled: <boolean> | default = true]\n\n# Configures the server of the launched module(s).\n[server: <server_config>]\n\n# Configures the distributor.\n[distributor: <distributor_config>]\n\n# Configures the querier. Only appropriate when running all modules or\n# just the querier.\n[querier: <querier_config>]\n\n# Configures how the distributor will connect to ingesters. Only appropriate\n# when running all modules, the distributor, or the querier.\n[ingester_client: <ingester_client_config>]\n\n# Configures the ingester and how the ingester will register itself to a\n# key value store.\n[ingester: <ingester_config>]\n\n# Configures where Loki will store data.\n[storage_config: <storage_config>]\n\n# Configures how Loki will store data in the specific store.\n[chunk_store_config: <chunk_store_config>]\n\n# Configures the chunk index schema and where it is stored.\n[schema_config: <schema_config>]\n\n# Configures limits per-tenant or globally\n[limits_config: <limits_config>]\n\n# Configures the table manager for retention\n[table_manager: <table_manager_config>]\n```\n\n## server_config\n\nThe `server_config` block configures Promtail's behavior as an HTTP server:\n\n```yaml\n# HTTP server listen host\n[http_listen_address: <string>]\n\n# HTTP server listen port\n[http_listen_port: <int> | default = 80]\n\n# gRPC server listen host\n[grpc_listen_address: <string>]\n\n# gRPC server listen port\n[grpc_listen_port: <int> | default = 9095]\n\n# Register instrumentation handlers (/metrics, etc.)\n[register_instrumentation: <boolean> | default = true]\n\n# Timeout for graceful shutdowns\n[graceful_shutdown_timeout: <duration> | default = 30s]\n\n# Read timeout for HTTP server\n[http_server_read_timeout: <duration> | default = 30s]\n\n# Write timeout for HTTP server\n[http_server_write_timeout: <duration> | default = 30s]\n\n# Idle timeout for HTTP server\n[http_server_idle_timeout: <duration> | default = 120s]\n\n# Max gRPC message size that can be received\n[grpc_server_max_recv_msg_size: <int> | default = 4194304]\n\n# Max gRPC message size that can be sent\n[grpc_server_max_send_msg_size: <int> | default = 4194304]\n\n# Limit on the number of concurrent streams for gRPC calls (0 = unlimited)\n[grpc_server_max_concurrent_streams: <int> | default = 100]\n\n# Log only messages with the given severity or above. Supported values [debug,\n# info, warn, error]\n[log_level: <string> | default = \"info\"]\n\n# Base path to server all API routes from (e.g., /v1/).\n[http_path_prefix: <string>]\n```\n\n## distributor_config\n\nThe `distributor_config` block configures the Loki Distributor.\n\n```yaml\n# Configures the distributors ring, used when the \"global\" ingestion rate\n# strategy is enabled.\n[ring: <ring_config>]\n```\n\n## querier_config\n\nThe `querier_config` block configures the Loki Querier.\n\n```yaml\n# Timeout when querying ingesters or storage during the execution of a\n# query request.\n[query_timeout: <duration> | default = 1m]\n\n# Limit of the duration for which live tailing requests should be\n# served.\n[tail_max_duration: <duration> | default = 1h]\n\n# Time to wait before sending more than the minimum successful query\n# requests.\n[extra_query_delay: <duration> | default = 0s]\n\n# Configuration options for the LogQL engine.\nengine:\n  # Timeout for query execution\n  [timeout: <duration> | default = 3m]\n\n  # The maximum amount of time to look back for log lines. Only\n  # applicable for instant log queries.\n  [max_look_back_period: <duration> | default = 30s]\n```\n\n## ingester_client_config\n\nThe `ingester_client_config` block configures how connections to ingesters\noperate.\n\n```yaml\n# Configures how connections are pooled\npool_config:\n  # Whether or not to do health checks.\n  [health_check_ingesters: <boolean> | default = false]\n\n  # How frequently to clean up clients for servers that have gone away after\n  # a health check.\n  [client_cleanup_period: <duration> | default = 15s]\n\n  # How quickly a dead client will be removed after it has been detected\n  # to disappear. Set this to a value to allow time for a secondary\n  # health check to recover the missing client.\n  [remotetimeout: <duration>]\n\n# The remote request timeout on the client side.\n[remote_timeout: <duration> | default = 5s]\n\n# Configures how the gRPC connection to ingesters work as a\n# client.\n[grpc_client_config: <grpc_client_config>]\n```\n\n### grpc_client_config\n\nThe `grpc_client_config` block configures a client connection to a gRPC service.\n\n```yaml\n# The maximum size in bytes the client can receive\n[max_recv_msg_size: <int> | default = 104857600]\n\n# The maximum size in bytes the client can send\n[max_send_msg_size: <int> | default = 16777216]\n\n# Whether or not messages should be compressed\n[use_gzip_compression: <bool> | default = false]\n\n# Rate limit for gRPC client. 0 is disabled\n[rate_limit: <float> | default = 0]\n\n# Rate limit burst for gRPC client.\n[rate_limit_burst: <int> | default = 0]\n\n# Enable backoff and retry when a rate limit is hit.\n[backoff_on_ratelimits: <bool> | default = false]\n\n# Configures backoff when enbaled.\nbackoff_config:\n  # Minimum delay when backing off.\n  [minbackoff: <duration> | default = 100ms]\n\n  # The maximum delay when backing off.\n  [maxbackoff: <duration> | default = 10s]\n\n  # Number of times to backoff and retry before failing.\n  [maxretries: <int> | default = 10]\n```\n\n## ingester_config\n\nThe `ingester_config` block configures Ingesters.\n\n```yaml\n# Configures how the lifecycle of the ingester will operate\n# and where it will register for discovery.\n[lifecycler: <lifecycler_config>]\n\n# Number of times to try and transfer chunks when leaving before\n# falling back to flushing to the store. Zero = no transfers are done.\n[max_transfer_retries: <int> | default = 10]\n\n# How many flushes can happen concurrently from each stream.\n[concurrent_flushes: <int> | default = 16]\n\n# How often should the ingester see if there are any blocks\n# to flush\n[flush_check_period: <duration> | default = 30s]\n\n# The timeout before a flush is cancelled\n[flush_op_timeout: <duration> | default = 10s]\n\n# How long chunks should be retained in-memory after they've\n# been flushed.\n[chunk_retain_period: <duration> | default = 15m]\n\n# How long chunks should sit in-memory with no updates before\n# being flushed if they don't hit the max block size. This means\n# that half-empty chunks will still be flushed after a certain\n# period as long as they receieve no further activity.\n[chunk_idle_period: <duration> | default = 30m]\n\n# The targeted _uncompressed_ size in bytes of a chunk block\n# When this threshold is exceeded the head block will be cut and compressed inside the chunk\n[chunk_block_size: <int> | default = 262144]\n\n# A target _compressed_ size in bytes for chunks.\n# This is a desired size not an exact size, chunks may be slightly bigger\n# or significantly smaller if they get flushed for other reasons (e.g. chunk_idle_period)\n# The default value of 0 for this will create chunks with a fixed 10 blocks,\n# A non zero value will create chunks with a variable number of blocks to meet the target size.\n[chunk_target_size: <int> | default = 0]\n\n# The compression algorithm to use for chunks. (supported: gzip, lz4, snappy)\n# You should choose your algorithm depending on your need:\n# - `gzip` highest compression ratio but also slowest decompression speed. (144 kB per chunk)\n# - `lz4` fastest compression speed (188 kB per chunk)\n# - `snappy` fast and popular compression algorithm (272 kB per chunk)\n[chunk_encoding: <string> | default = gzip]\n\n# Parameters used to synchronize ingesters to cut chunks at the same moment.\n# Sync period is used to roll over incoming entry to a new chunk. If chunk's utilization\n# isn't high enough (eg. less than 50% when sync_min_utilization is set to 0.5), then\n# this chunk rollover doesn't happen.\n[sync_period: <duration> | default = 0]\n[sync_min_utilization: <float> | Default = 0]\n\n# The maximum number of errors a stream will report to the user\n# when a push fails. 0 to make unlimited.\n[max_returned_stream_errors: <int> | default = 10]\n```\n\n### lifecycler_config\n\nThe `lifecycler_config` is used by the Ingester to control how that ingester\nregisters itself into the ring and manages its lifecycle during its stay in the\nring.\n\n```yaml\n# Configures the ring the lifecycler connects to\n[ring: <ring_config>]\n\n# The number of tokens the lifecycler will generate and put into the ring if\n# it joined without transferring tokens from another lifecycler.\n[num_tokens: <int> | default = 128]\n\n# Period at which to heartbeat to the underlying ring.\n[heartbeat_period: <duration> | default = 5s]\n\n# How long to wait to claim tokens and chunks from another member when\n# that member is leaving. Will join automatically after the duration expires.\n[join_after: <duration> | default = 0s]\n\n# Minimum duration to wait before becoming ready. This is to work around race\n# conditions with ingesters exiting and updating the ring.\n[min_ready_duration: <duration> | default = 1m]\n\n# Store tokens in a normalised fashion to reduce the number of allocations.\n[normalise_tokens: <boolean> | default = false]\n\n# Name of network interfaces to read addresses from.\ninterface_names:\n  - [<string> ... | default = [\"eth0\", \"en0\"]]\n\n# Duration to sleep before exiting to ensure metrics are scraped.\n[final_sleep: <duration> | default = 30s]\n```\n\n### ring_config\n\nThe `ring_config` is used to discover and connect to Ingesters.\n\n```yaml\nkvstore:\n  # The backend storage to use for the ring. Supported values are\n  # consul, etcd, inmemory\n  store: <string>\n\n  # The prefix for the keys in the store. Should end with a /.\n  [prefix: <string> | default = \"collectors/\"]\n\n  # Configuration for a Consul client. Only applies if store\n  # is \"consul\"\n  consul:\n    # The hostname and port of Consul.\n    [host: <string> | duration = \"localhost:8500\"]\n\n    # The ACL Token used to interact with Consul.\n    [acltoken: <string>]\n\n    # The HTTP timeout when communicating with Consul\n    [httpclienttimeout: <duration> | default = 20s]\n\n    # Whether or not consistent reads to Consul are enabled.\n    [consistentreads: <boolean> | default = true]\n\n  # Configuration for an ETCD v3 client. Only applies if\n  # store is \"etcd\"\n  etcd:\n    # The ETCD endpoints to connect to.\n    endpoints:\n      - <string>\n\n    # The Dial timeout for the ETCD connection.\n    [dial_tmeout: <duration> | default = 10s]\n\n    # The maximum number of retries to do for failed ops to ETCD.\n    [max_retries: <int> | default = 10]\n\n# The heartbeat timeout after which ingesters are skipped for\n# reading and writing.\n[heartbeat_timeout: <duration> | default = 1m]\n\n# The number of ingesters to write to and read from. Must be at least\n# 1.\n[replication_factor: <int> | default = 3]\n```\n\n## storage_config\n\nThe `storage_config` block configures one of many possible stores for both the\nindex and chunks. Which configuration is read from depends on the schema_config\nblock and what is set for the store value.\n\n```yaml\n# Configures storing chunks in AWS. Required options only required when aws is\n# present.\naws:\n  # S3 or S3-compatible URL to connect to. If only region is specified as a\n  # host, the proper endpoint will be deduced. Use inmemory:///<bucket-name> to\n  # use a mock in-memory implementation.\n  s3: <string>\n\n  # Set to true to force the request to use path-style addressing\n  [s3forcepathstyle: <boolean> | default = false]\n\n  # Configure the DynamoDB connection\n  dynamodbconfig:\n    # URL for DynamoDB with escaped Key and Secret encoded. If only region is specified as a\n    # host, the proper endpoint will be deduced. Use inmemory:///<bucket-name> to\n    # use a mock in-memory implementation.\n    dynamodb: <string>\n\n    # DynamoDB table management requests per-second limit.\n    [apilimit: <float> | default = 2.0]\n\n    # DynamoDB rate cap to back off when throttled.\n    [throttlelimit: <float> | default = 10.0]\n\n    # Application Autoscaling endpoint URL with escaped Key and Secret\n    # encoded.\n    [applicationautoscaling: <string>]\n\n    # Metics-based autoscaling configuration.\n    metrics:\n      # Use metrics-based autoscaling via this Prometheus query URL.\n      [url: <string>]\n\n      # Queue length above which we will scale up capacity.\n      [targetqueuelen: <int> | default = 100000]\n\n      # Scale up capacity by this multiple\n      [scaleupfactor: <float64> | default = 1.3]\n\n      # Ignore throttling below this level (rate per second)\n      [minthrottling: <float64> | default = 1]\n\n      # Query to fetch ingester queue length\n      [queuelengthquery: <string> | default = \"sum(avg_over_time(cortex_ingester_flush_queue_length{job=\"cortex/ingester\"}[2m]))\"]\n\n      # Query to fetch throttle rates per table\n      [throttlequery: <string> | default = \"sum(rate(cortex_dynamo_throttled_total{operation=\"DynamoDB.BatchWriteItem\"}[1m])) by (table) > 0\"]\n\n      # Quer to fetch write capacity usage per table\n      [usagequery: <string> | default = \"sum(rate(cortex_dynamo_consumed_capacity_total{operation=\"DynamoDB.BatchWriteItem\"}[15m])) by (table) > 0\"]\n\n      # Query to fetch read capacity usage per table\n      [readusagequery: <string> | default = \"sum(rate(cortex_dynamo_consumed_capacity_total{operation=\"DynamoDB.QueryPages\"}[1h])) by (table) > 0\"]\n\n      # Query to fetch read errors per table\n      [readerrorquery: <string> | default = \"sum(increase(cortex_dynamo_failures_total{operation=\"DynamoDB.QueryPages\",error=\"ProvisionedThroughputExceededException\"}[1m])) by (table) > 0\"]\n\n    # Number of chunks to group together to parallelise fetches (0 to disable)\n    [chunkgangsize: <int> | default = 10]\n\n    # Max number of chunk get operations to start in parallel.\n    [chunkgetmaxparallelism: <int> | default = 32]\n\n# Configures storing chunks in Bigtable. Required fields only required\n# when bigtable is defined in config.\nbigtable:\n  # BigTable project ID\n  project: <string>\n\n  # BigTable instance ID\n  instance: <string>\n\n  # Configures the gRPC client used to connect to Bigtable.\n  [grpc_client_config: <grpc_client_config>]\n\n# Configures storing index in GCS. Required fields only required\n# when gcs is defined in config.\ngcs:\n  # Name of GCS bucket to put chunks in.\n  bucket_name: <string>\n\n  # The size of the buffer that the GCS client uses for each PUT request. 0\n  # to disable buffering.\n  [chunk_buffer_size: <int> | default = 0]\n\n  # The duration after which the requests to GCS should be timed out.\n  [request_timeout: <duration> | default = 0s]\n\n# Configures storing chunks in Cassandra\ncassandra:\n  # Comma-separated hostnames or IPs of Cassandra instances\n  addresses: <string>\n\n  # Port that cassandra is running on\n  [port: <int> | default = 9042]\n\n  # Keyspace to use in Cassandra\n  keyspace: <string>\n\n  # Consistency level for Cassandra\n  [consistency: <string> | default = \"QUORUM\"]\n\n  # Replication factor to use in Cassandra.\n  [replication_factor: <int> | default = 1]\n\n  # Instruct the Cassandra driver to not attempt to get host\n  # info from the system.peers table.\n  [disable_initial_host_lookup: <bool> | default = false]\n\n  # Use SSL when connecting to Cassandra instances.\n  [SSL: <boolean> | default = false]\n\n  # Require SSL certificate validation when SSL is enabled.\n  [host_verification: <bool> | default = true]\n\n  # Path to certificate file to verify the peer when SSL is\n  # enabled.\n  [CA_path: <string>]\n\n  # Enable password authentication when connecting to Cassandra.\n  [auth: <bool> | default = false]\n\n  # Username for password authentication when auth is true.\n  [username: <string>]\n\n  # Password for password authentication when auth is true.\n  [password: <string>]\n\n  # Timeout when connecting to Cassandra.\n  [timeout: <duration> | default = 600ms]\n\n  # Initial connection timeout during initial dial to server.\n  [connect_timeout: <duration> | default = 600ms]\n\n# Configures storing index in BoltDB. Required fields only\n# required when boltdb is present in config.\nboltdb:\n  # Location of BoltDB index files.\n  directory: <string>\n\n# Configures storing the chunks on the local filesystem. Required\n# fields only required when filesystem is present in config.\nfilesystem:\n  # Directory to store chunks in.\n  directory: <string>\n\n# Cache validity for active index entries. Should be no higher than\n# the chunk_idle_period in the ingester settings.\n[indexcachevalidity: <duration> | default = 5m]\n\n# The maximum number of chunks to fetch per batch.\n[max_chunk_batch_size: <int> | default = 50]\n\n# Config for how the cache for index queries should\n# be built.\nindex_queries_cache_config: <cache_config>\n```\n\n### cache_config\n\nThe `cache_config` block configures how Loki will cache requests, chunks, and\nthe index to a backing cache store.\n\n```yaml\n# Enable in-memory cache.\n[enable_fifocache: <boolean>]\n\n# The default validity of entries for caches unless overridden.\n# \"defaul\" is correct.\n[defaul_validity: <duration>]\n\n# Configures the background cache when memcached is used.\nbackground:\n  # How many goroutines to use to write back to memcached.\n  [writeback_goroutines: <int> | default = 10]\n\n  # How many chunks to buffer for background write back to memcached.\n  [writeback_buffer: <int> = 10000]\n\n# Configures memcached settings.\nmemcached:\n  # Configures how long keys stay in memcached.\n  expiration: <duration>\n\n  # Configures how many keys to fetch in each batch request.\n  batch_size: <int>\n\n  # Maximum active requests to memcached.\n  [parallelism: <int> | default = 100]\n\n# Configures how to connect to one or more memcached servers.\nmemcached_client:\n  # The hostname to use for memcached services when caching chunks. If\n  # empty, no memcached will be used. A SRV lookup will be used.\n  [host: <string>]\n\n  # SRV service used to discover memcached servers.\n  [service: <string> | default = \"memcached\"]\n\n  # Maximum time to wait before giving up on memcached requests.\n  [timeout: <duration> | default = 100ms]\n\n  # The maximum number of idle connections in the memcached client\n  # pool.\n  [max_idle_conns: <int> | default = 100]\n\n  # The period with which to poll the DNS for memcached servers.\n  [update_interval: <duration> | default = 1m]\n\n  # Whether or not to use a consistent hash to discover multiple memcached\n  # servers.\n  [consistent_hash: <bool>]\n\nredis:\n  # Redis service endpoint to use when caching chunks. If empty, no redis will be used.\n  [endpoint: <string>]\n  # Maximum time to wait before giving up on redis requests.\n  [timeout: <duration> | default = 100ms]\n  # How long keys stay in the redis.\n  [expiration: <duration> | default = 0s]\n  # Maximum number of idle connections in pool.\n  [max_idle_conns: <int> | default = 80]\n  # Maximum number of active connections in pool.\n  [max_active_conns: <int> | default = 0]\n\nfifocache:\n  # Number of entries to cache in-memory.\n  [size: <int> | default = 0]\n\n  # The expiry duration for the in-memory cache.\n  [validity: <duration> | default = 0s]\n```\n\n## chunk_store_config\n\nThe `chunk_store_config` block configures how chunks will be cached and how long\nto wait before saving them to the backing store.\n\n```yaml\n# The cache configuration for storing chunks\n[chunk_cache_config: <cache_config>]\n\n# The cache configuration for deduplicating writes\n[write_dedupe_cache_config: <cache_config>]\n\n# The minimum time between a chunk update and being saved\n# to the store.\n[min_chunk_age: <duration>]\n\n# Cache index entries older than this period. Default is\n# disabled.\n[cache_lookups_older_than: <duration>]\n\n# Limit how long back data can be queried. Default is disabled.\n# This should always be set to a value less than or equal to\n# what is set in `table_manager.retention_period`.\n[max_look_back_period: <duration>]\n```\n\n## schema_config\n\nThe `schema_config` block configures schemas from given dates.\n\n```yaml\n# The configuration for chunk index schemas.\nconfigs:\n  - [<period_config>]\n```\n\n### period_config\n\nThe `period_config` block configures what index schemas should be used\nfor from specific time periods.\n\n```yaml\n# The date of the first day that index buckets should be created. Use\n# a date in the past if this is your only period_config, otherwise\n# use a date when you want the schema to switch over.\n[from: <daytime>]\n\n# store and object_store below affect which <storage_config> key is\n# used.\n\n# Which store to use for the index. Either cassandra, bigtable, dynamodb, or\n# boltdb\nstore: <string>\n\n# Which store to use for the chunks. Either gcs, s3, inmemory, filesystem,\n# cassandra. If omitted, defaults to same value as store.\n[object_store: <string>]\n\n# The schema to use. Set to v9 or v10.\nschema: <string>\n\n# Configures how the index is updated and stored.\nindex:\n  # Table prefix for all period tables.\n  prefix: <string>\n  # Table period.\n  [period: <duration> | default = 168h]\n  # A map to be added to all managed tables.\n  tags:\n    [<string>: <string> ...]\n\n# Configured how the chunks are updated and stored.\nchunks:\n  # Table prefix for all period tables.\n  prefix: <string>\n  # Table period.\n  [period: <duration> | default = 168h]\n  # A map to be added to all managed tables.\n  tags:\n    [<string>: <string> ...]\n\n# How many shards will be created. Only used if schema is v10.\n[row_shards: <int> | default = 16]\n```\n\nWhere `daytime` is a value in the format of `yyyy-mm-dd` like `2006-01-02`.\n\n## limits_config\n\nThe `limits_config` block configures global and per-tenant limits for ingesting\nlogs in Loki.\n\n```yaml\n# Whether the ingestion rate limit should be applied individually to each\n# distributor instance (local), or evenly shared across the cluster (global).\n# The ingestion rate strategy cannot be overridden on a per-tenant basis.\n#\n# - local: enforces the limit on a per distributor basis. The actual effective\n#   rate limit will be N times higher, where N is the number of distributor\n#   replicas.\n# - global: enforces the limit globally, configuring a per-distributor local\n#   rate limiter as \"ingestion_rate / N\", where N is the number of distributor\n#   replicas (it's automatically adjusted if the number of replicas change).\n#   The global strategy requires the distributors to form their own ring, which\n#   is used to keep track of the current number of healthy distributor replicas.\n[ingestion_rate_strategy: <string> | default = \"local\"]\n\n# Per-user ingestion rate limit in sample size per second. Units in MB.\n[ingestion_rate_mb: <float> | default = 4]\n\n# Per-user allowed ingestion burst size (in sample size). Units in MB.\n# The burst size refers to the per-distributor local rate limiter even in the\n# case of the \"global\" strategy, and should be set at least to the maximum logs\n# size expected in a single push request.\n[ingestion_burst_size_mb: <int> | default = 6]\n\n# Maximum length of a label name.\n[max_label_name_length: <int> | default = 1024]\n\n# Maximum length of a label value.\n[max_label_value_length: <int> | default = 2048]\n\n# Maximum number of label names per series.\n[max_label_names_per_series: <int> | default = 30]\n\n# Whether or not old samples will be rejected.\n[reject_old_samples: <bool> | default = false]\n\n# Maximum accepted sample age before rejecting.\n[reject_old_samples_max_age: <duration> | default = 336h]\n\n# Duration for a table to be created/deleted before/after it's\n# needed. Samples won't be accepted before this time.\n[creation_grace_period: <duration> | default = 10m]\n\n# Enforce every sample has a metric name.\n[enforce_metric_name: <boolean> | default = true]\n\n# Maximum number of active streams per user, per ingester. 0 to disable.\n[max_streams_per_user: <int> | default = 10000]\n\n# Maximum number of active streams per user, across the cluster. 0 to disable.\n# When the global limit is enabled, each ingester is configured with a dynamic\n# local limit based on the replication factor and the current number of healthy\n# ingesters, and is kept updated whenever the number of ingesters change.\n[max_global_streams_per_user: <int> | default = 0]\n\n# Maximum number of chunks that can be fetched by a single query.\n[max_chunks_per_query: <int> | default = 2000000]\n\n# The limit to length of chunk store queries. 0 to disable.\n[max_query_length: <duration> | default = 0]\n\n# Maximum number of queries that will be scheduled in parallel by the\n# frontend.\n[max_query_parallelism: <int> | default = 14]\n\n# Cardinality limit for index queries\n[cardinality_limit: <int> | default = 100000]\n\n# Maximum number of stream matchers per query.\n[max_streams_matchers_per_query: <int> | default = 1000]\n\n# Filename of per-user overrides file\n[per_tenant_override_config: <string>]\n\n# Period with which to reload the overrides file if configured.\n[per_tenant_override_period: <duration> | default = 10s]\n```\n\n## table_manager_config\n\nThe `table_manager_config` block configures how the table manager operates\nand how to provision tables when DynamoDB is used as the backing store.\n\n```yaml\n# Master 'off-switch' for table capacity updates, e.g. when troubleshooting\n[throughput_updates_disabled: <boolean> | default = false]\n\n# Master 'on-switch' for table retention deletions\n[retention_deletes_enabled: <boolean> | default = false]\n\n# How far back tables will be kept before they are deleted. 0s disables\n# deletion. The retention period must be a multiple of the index / chunks\n# table \"period\" (see period_config).\n[retention_period: <duration> | default = 0s]\n\n# Period with which the table manager will poll for tables.\n[dynamodb_poll_interval: <duration> | default = 2m]\n\n# duration a table will be created before it is needed.\n[creation_grace_period: <duration> | default = 10m]\n\n# Configures management of the index tables for DynamoDB.\nindex_tables_provisioning: <provision_config>\n\n# Configures management of the chunk tables for DynamoDB.\nchunk_tables_provisioning: <provision_config>\n```\n\n### provision_config\n\nThe `provision_config` block configures provisioning capacity for DynamoDB.\n\n```yaml\n# Enables on-demand throughput provisioning for the storage\n# provider, if supported. Applies only to tables which are not autoscaled.\n[provisioned_throughput_on_demand_mode: <boolean> | default = false]\n\n# DynamoDB table default write throughput.\n[provisioned_write_throughput: <int> | default = 3000]\n\n# DynamoDB table default read throughput.\n[provisioned_read_throughput: <int> | default = 300]\n\n# Enables on-demand throughput provisioning for the storage provide,\n# if supported. Applies only to tables which are not autoscaled.\n[inactive_throughput_on_demand_mode: <boolean> | default = false]\n\n# DynamoDB table write throughput for inactive tables.\n[inactive_write_throughput: <int> | default = 1]\n\n# DynamoDB table read throughput for inactive tables.\n[inactive_read_throughput: <int> | Default = 300]\n\n# Active table write autoscale config.\n[write_scale: <auto_scaling_config>]\n\n# Inactive table write autoscale config.\n[inactive_write_scale: <auto_scaling_config>]\n\n# Number of last inactive tables to enable write autoscale.\n[inactive_write_scale_lastn: <int>]\n\n# Active table read autoscale config.\n[read_scale: <auto_scaling_config>]\n\n# Inactive table read autoscale config.\n[inactive_read_scale: <auto_scaling_config>]\n\n# Number of last inactive tables to enable read autoscale.\n[inactive_read_scale_lastn: <int>]\n```\n\n#### auto_scaling_config\n\nThe `auto_scaling_config` block configures autoscaling for DynamoDB.\n\n```yaml\n# Whether or not autoscaling should be enabled.\n[enabled: <boolean>: default = false]\n\n# AWS AutoScaling role ARN\n[role_arn: <string>]\n\n# DynamoDB minimum provision capacity.\n[min_capacity: <int> | default = 3000]\n\n# DynamoDB maximum provision capacity.\n[max_capacity: <int> | default = 6000]\n\n# DynamoDB minimum seconds between each autoscale up.\n[out_cooldown: <int> | default = 1800]\n\n# DynamoDB minimum seconds between each autoscale down.\n[in_cooldown: <int> | default = 1800]\n\n# DynamoDB target ratio of consumed capacity to provisioned capacity.\n[target: <float> | default = 80]\n```\n"
      },
      {
        "id": "https://grafana.com/docs/enterprise-logs/latest/manage/storage/retention/",
        "title": "Log retention | Grafana Enterprise Logs documentation",
        "url": "https://grafana.com/docs/enterprise-logs/latest/manage/storage/retention/",
        "text": "Log retention | Grafana Enterprise Logs documentation\n\nSave the Date!\n\nSign up to get the latest GrafanaCON 2026 updates, agenda drops, and first access to early-bird tickets when they\u2019re first available.\n\nWe have our sightson Barcelona\n\nSave the Date\n\nWatch the keynote again and signup for more on-demand sessions.\n\n\ud83d\udce2 Registration + agenda now live Explore the latest Grafana Cloud and AI solutions, learn tips & tricks from demos and hands-on workshops, and get actionable advice to advance your observability strategy. Register now and get 50% off - limited tickets available (while they last!).\n\nLog retention\n\nEnterprise\n\n# Log retention\n\nRetention in Grafana Loki is achieved through the Compactor. By default the`compactor.retention-enabled` flag is not set, so the logs sent to Loki live forever.\n\nNote\n\nIf you have a lifecycle policy configured on the object store, please ensure that it is longer than the retention period.\n\nGranular retention policies to apply retention at per tenant or per stream level are also supported by the Compactor.\n\nNote\n\nThe Compactor does not support retention on legacy index types. Please use the Table Manager when using legacy index types. Both the Table manager and legacy index types are deprecated and may be removed in future major versions of Loki.\n\n## Compactor\n\nThe Compactor is responsible for compaction of index files and applying log retention.\n\nNote\n\nRun the Compactor as a singleton (a single instance).\n\nThe Compactor loops to apply compaction and retention at every`compactor.compaction-interval`, or as soon as possible if running behind. Both compaction and retention are idempotent, which means once the action has been performed, if the action is performed multiple times, it has no further effect on logs after the first time it is performed. If the Compactor restarts, it continues from where it left off.\n\nNote\n\nChanges to your retention period are not retroactive, that is, they are not applied to logs that have already been ingested.\n\nThe Compactor\u2019s algorithm to apply retention is as follows:\n\nFor each day or table (one table per day with 24h index period):\n\n- Compact multiple index files in the table into per-tenant index files. Result of compaction is a single index file per tenant per day.\n- Traverse the per-tenant index. Use the tenant configuration to identify the chunks that need to be removed.\n- Remove the references to the matching chunks from the index and add the chunk references to a marker file on disk.\n- Upload the new modified index files.\n\nChunks are not deleted while applying the retention algorithm on the index. They are deleted asynchronously by a sweeper process and this delay can be configured by setting`-compactor.retention-delete-delay`. Marker files are used to keep track of the chunks pending for deletion.\n\nChunks cannot be deleted immediately for the following reasons:\n\nIndex Gateway downloads a copy of the index files to serve queries and refreshes them at a regular interval. Having a delay allows the index gateways to pull the modified index file which would not contain any reference to the chunks marked for deletion. Without the delay, index files (that are stale) on the gateways could refer to already deleted chunks leading to query failures.\n\nIt provides a short window of time in which to cancel chunk deletion in the case of a configuration mistake.\n\nMarker files should be stored on a persistent disk to ensure that the chunks pending for deletion are processed even if the Compactor process restarts.\n\nNote\n\nGrafana Labs recommends running Compactor as a stateful deployment (StatefulSet when using Kubernetes) with a persistent storage for storing marker files.\n\n### Retention Configuration\n\nThis Compactor configuration example activates retention.\n\nYAML Copy\n\nExpand code\n\n```yaml\ncompactor:\n  working_directory: /data/retention\n  compaction_interval: 10m\n  retention_enabled: true\n  retention_delete_delay: 2h\n  retention_delete_worker_count: 150\n  delete_request_store: gcs\nschema_config:\n  configs:\n    - from: \"2020-07-31\"\n      index:\n        period: 24h\n        prefix: index_\n      object_store: gcs\n      schema: v13\n      store: tsdb\nstorage_config:\n  tsdb_shipper:\n    active_index_directory: /data/index\n    cache_location: /data/index_cache\n  gcs:\n    bucket_name: loki\n```\n\nNote\n\nRetention is only available if the index period is 24h. Single store TSDB and single store BoltDB require 24h index period.\n\n`retention_enabled` should be set to true. Without this, the Compactor will only compact tables.\n\n`delete_request_store` should be set to configure the store for delete requests. This is required when retention is enabled.\n\n`working_directory` is the directory where marked chunks and temporary tables will be saved.\n\n`compaction_interval` dictates how often compaction and/or retention is applied. If the Compactor falls behind, compaction and/or retention occur as soon as possible.\n\n`retention_delete_delay` is the delay after which the Compactor will delete marked chunks.\n\n`retention_delete_worker_count` specifies the maximum quantity of goroutine workers instantiated to delete chunks.\n\n#### Configuring the retention period\n\nRetention period is configured within the limits_config configuration section.\n\nThere are two ways of setting retention policies:\n\n- `retention_period` which is applied globally for all log streams.\n- `retention_stream` which is only applied to log streams matching the selector.\n\nNote\n\nThe minimum retention period is 24h.\n\nThis example configures global retention that applies to all tenants (unless overridden by configuring per-tenant overrides):\n\nYAML Copy\n\n```yaml\n...\nlimits_config:\n  retention_period: 744h\n  retention_stream:\n  - selector: '{namespace=\"dev\"}'\n    priority: 1\n    period: 24h\n  per_tenant_override_config: /etc/overrides.yaml\n...\n```\n\nNote\n\nYou can only use label matchers in the`selector` field of a`retention_stream` definition. Arbitrary LogQL expressions are not supported.\n\nPer tenant retention can be defined by configuring runtime overrides. For example:\n\nYAML Copy\n\n```yaml\noverrides:\n    \"29\":\n        retention_period: 168h\n        retention_stream:\n        - selector: '{namespace=\"prod\"}'\n          priority: 2\n          period: 336h\n        - selector: '{container=\"loki\"}'\n          priority: 1\n          period: 72h\n    \"30\":\n        retention_stream:\n        - selector: '{container=\"nginx\", level=\"debug\"}'\n          priority: 1\n          period: 24h\n```\n\nRetention period for a given stream is decided based on the first match in this list:\n\n1. If multiple per-tenant`retention_stream` selectors match the stream, retention period with the highest priority is picked.\n2. If multiple global`retention_stream` selectors match the stream, retention period with the highest priority is picked. This value is not considered if per-tenant`retention_stream` is set.\n3. If a per-tenant`retention_period` is specified, it will be applied.\n4. The global`retention_period` will be applied if none of the above match.\n5. If no global`retention_period` is specified, the default value of`0s` is used, which means logs are kept indefinitely.\n\nNote\n\nThe larger the priority value, the higher the priority.\n\nStream matching uses the same syntax as Prometheus label matching:\n\n- `=`: Select labels that are exactly equal to the provided string.\n- `!=`: Select labels that are not equal to the provided string.\n- `=~`: Select labels that regex-match the provided string.\n- `!~`: Select labels that do not regex-match the provided string.\n\nThe example configurations defined above will result in the following retention periods:\n\nFor tenant`29`:\n\n- Streams that have the namespace label`prod` will have a retention period of`336h`(2 weeks), even if the container label is`loki`, since the priority of the`prod` rule is higher.\n- Streams that have the container label`loki` but are not in the namespace`prod` will have a`72h` retention period.\n- For the rest of the streams in this tenant, per-tenant override`retention_period` value of`168h` is applied.\n\nFor tenant`30`:\n\n- Streams that have the label`nginx` and level`debug` will have a retention period of`24h`.\n- For the rest of the streams in this tenant the global retention period of`744h`, since there is no override specified.\n\nAll tenants except`29` and`30`:\n\n- Streams that have the namespace label`dev` will have a retention period of`24h` hours.\n- Streams except those with the namespace label`dev` will have the retention period of`744h`.\n\nNote\n\nIf you are a Grafana Cloud customer, you can use the config self-serve API to configure your tenant retention.\n\n## Table Manager (deprecated)\n\nRetention through the Table Manager is achieved by relying on the object store TTL feature, and will work for both boltdb-shipper store and chunk/index stores.\n\nIn order to enable the retention support, the Table Manager needs to be configured to enable deletions and a retention period. Please refer to the table_manager section of the Loki configuration reference for all available options. Alternatively, the`table-manager.retention-period` and`table-manager.retention-deletes-enabled` command line flags can be used. The provided retention period needs to be a duration represented as a string that can be parsed using the Prometheus common model ParseDuration. Examples:`7d`,`1w`,`168h`.\n\nWarning\n\nThe retention period must be a multiple of the index and chunks table`period`, configured in the period_config block. See the Table Manager documentation for more information.\n\nNote\n\nTo avoid querying of data beyond the retention period,`max_query_lookback` config in limits_config must be set to a value less than or equal to what is set in`table_manager.retention_period`.\n\nWhen using S3 or GCS, the bucket storing the chunks needs to have the expiry policy set correctly. For more details check S3\u2019s documentation or GCS\u2019s documentation.\n\nIf you must delete ingested logs, you can delete old chunks in your object store. Note, however, that this only deletes the log content and keeps the label index intact; you will still be able to see related labels but will be unable to retrieve the deleted log content.\n\nFor further details on the Table Manager internals, refer to the Table Manager documentation.\n\nAlternatively, if the BoltDB Shipper is configured for the index store, you can enable Log entry deletion to delete log entries from a specific stream.\n\n## Example Configuration\n\nExample configuration with GCS with a 28 day retention:\n\nYAML Copy\n\nExpand code\n\n```yaml\nschema_config:\n  configs:\n    - from: 2018-04-15\n      store: tsdb\n      object_store: gcs\n      schema: v13\n      index:\n        prefix: loki_index_\n        period: 24h\n\nstorage_config:\n  tsdb_shipper:\n    active_index_directory: /loki/index\n    cache_location: /loki/index_cache\n  gcs:\n    bucket_name: GCS_BUCKET_NAME\n\nlimits_config:\n  max_query_lookback: 672h # 28 days\n  retention_period: 672h   # 28 days\n\ncompactor:\n  working_directory: /data/retention\n  delete_request_store: gcs\n  retention_enabled: true\n```\n\n## Object store lifecycle policies\n\nLoki stores chunks and indexes as objects in the configured object store (S3, GCS, Azure Blob Storage, and so on). Chunks are deleted by the Compactor according to your configured retention, but the Compactor only removes chunk objects: it never deletes the objects that hold cluster state, such as the index or the cluster seed.\n\nIf you also configure an object store lifecycle policy on the bucket, scope it carefully. A blanket \u201cdelete everything older than N days\u201d rule will eventually remove objects that Loki must keep, which corrupts the store and causes query failures. The note at the top of this page applies here as well: any lifecycle expiration must be longer than your retention period.\n\nWarning\n\nNever apply a lifecycle rule with an empty prefix (one that targets the whole bucket). Always scope lifecycle rules to the per-tenant chunk prefixes described below.\n\n### Bucket object layout\n\nThe following objects are written to the configured bucket. The exact prefixes depend on your`schema_config` and on whether multi-tenancy is enabled, so confirm them against your own configuration before writing a lifecycle rule.\n\nExpand table\n\n| Object or prefix | Content | Safe to expire with a lifecycle policy? |\n| --- | --- | --- |\n| `<tenant_id>/`(for example,`fake/` in single-tenant mode, or your org ID per tenant) | Chunk objects (the log data). | Yes. These are the only objects a lifecycle rule should target. |\n| Index objects (under the index path prefix,`index/` by default, set by`index.path_prefix` in`schema_config`) | TSDB or BoltDB index files, written by ingesters and rewritten by the Compactor. The`index.prefix` value (for example`index_` or`loki_index_`) is the table-name prefix used inside this path, not the path itself, so match a lifecycle rule against the path prefix. | No. Loki manages the index lifecycle internally. Deleting index objects removes references to live chunks and breaks queries. |\n| `loki_cluster_seed.json` | A small file at the bucket root holding the cluster seed used by usage reporting. It is written once and never rotated. | No. A blanket age-based rule will delete it once it ages past the time to live (TTL). |\n| Compactor delete-request store (the`delete_request_store` you configure, such as`markers/` and the delete-request objects) | The Compactor\u2019s record of chunks pending deletion and of in-flight delete requests. | No. Removing these makes the Compactor lose track of pending deletions. |\n| Ruler store objects (if the Ruler is backed by the same bucket) | Recording and alerting rule files. | No. These are configuration, not time-series data. |\n\n### Compactor retention versus object store lifecycle policies\n\nCompactor retention and object store lifecycle policies are two independent mechanisms, and they should not be configured in ways that conflict:\n\n- The Compactor is index-aware. It only deletes a chunk after it has removed every reference to that chunk from the index, and it waits`compactor.retention-delete-delay`(default`2h`) before the sweeper deletes the marked chunk, so that index gateways pick up the rewritten index first.\n- An object store lifecycle policy is index-unaware. It deletes objects purely by age and prefix, with no knowledge of whether a chunk is still referenced by the index.\n\nFor most deployments, enabling Compactor retention is sufficient and an object store lifecycle policy is not required. If you do add a lifecycle policy as a cost safety net, set its expiration longer than your retention period plus`compactor.retention-delete-delay`, so the Compactor always deletes chunks first and the lifecycle rule only ever catches objects the Compactor has already orphaned.\n\n### Example: Amazon S3 lifecycle policy\n\nThis policy expires only chunk objects under a single tenant prefix. Replace`fake/` with your tenant prefix (use one rule per tenant, or your org ID prefix, when multi-tenancy is enabled). The`Days` value must be larger than your retention period plus the delete delay.\n\nJSON Copy\n\n```json\n{\n  \"Rules\": [\n    {\n      \"ID\": \"loki-chunk-expiration\",\n      \"Status\": \"Enabled\",\n      \"Filter\": {\n        \"Prefix\": \"fake/\"\n      },\n      \"Expiration\": {\n        \"Days\": 395\n      }\n    }\n  ]\n}\n```\n\nApply it with the AWS CLI:\n\nBash Copy\n\n```bash\naws s3api put-bucket-lifecycle-configuration \\\n  --bucket YOUR_LOKI_BUCKET \\\n  --lifecycle-configuration file://lifecycle.json\n```\n\n### Example: Google Cloud Storage lifecycle rule\n\nThe equivalent GCS rule expires objects by age and prefix. As with S3, scope`matchesPrefix` to the tenant chunk prefix and keep`age` larger than your retention period plus the delete delay.\n\nJSON Copy\n\n```json\n{\n  \"rule\": [\n    {\n      \"action\": {\"type\": \"Delete\"},\n      \"condition\": {\n        \"age\": 395,\n        \"matchesPrefix\": [\"fake/\"]\n      }\n    }\n  ]\n}\n```\n\nApply it with the Google Cloud CLI:\n\nBash Copy\n\n```bash\ngcloud storage buckets update gs://YOUR_LOKI_BUCKET --lifecycle-file=lifecycle.json\n```\n\nFor Azure Blob Storage, use a management policy with a`prefixMatch` set to the tenant chunk prefix and the same \u201cexpiration must exceed retention plus delete delay\u201d rule.\n\n## Was this page helpful?\n\nYes No\n\nHelp and support\n\n## Related resources from Grafana Labs\n\nAdditional helpful documentation, links, and articles:\n\nVideoScaling and securing your logs with Grafana LokiThis webinar covers the challenges of scaling and securing logs, and how Grafana Cloud Logs powered by Grafana Loki can help, cost-effectively.\n\nVideoManaging privacy in log data with Grafana LokiLaws for data privacy are complex and rapidly changing. During this webinar, we will show how Grafana Loki can help organizations meet these requirements.\n\nBlogThe concise guide to Grafana Loki: Everything you need to know about labelsIn Part 2 of \"The concise guide to Loki,\" you'll learn about how to properly use labels in our favorite logging database.\n\nAsk Grafana Assistant",
        "image": "https://grafana.com/meta-generator/Log+retention.png",
        "favicon": "https://grafana.com/static/assets/img/fav32.png"
      },
      {
        "id": "https://community.grafana.com/t/loki-retention-isnt-working-as-expected-logs-older-than-24-hours-are-not-getting-deleted/142440/3",
        "title": "Loki retention isn't working as expected\u2014logs older than 24 hours are not getting deleted - Grafana Loki - Grafana Labs Community Forums",
        "url": "https://community.grafana.com/t/loki-retention-isnt-working-as-expected-logs-older-than-24-hours-are-not-getting-deleted/142440/3",
        "publishedDate": "2025-02-04T00:00:00.000Z",
        "text": "Loki retention isn't working as expected\u2014logs older than 24 hours are not getting deleted - Grafana Loki - Grafana Labs Community Forums\n\n# Loki retention isn\u2019t working as expected\u2014logs older than 24 hours are not getting deleted \n\nCheck Grafana events next to you this September From Austin to London to Kenya to Nagpur - 27 locations, 27 opportunities to meet the community \n\n## post by sivaprasad298 on Feb 4, 2025 \n\n 1 Feb 2025 \n\nHi, I have below configuration for grafana loki . I am expecting that the chunks will be deleted after every 24hrs. But it is not working as expected.\n\nauth_enabled: false\n\nserver: http_listen_port: 3100 http_server_read_timeout: 600s http_server_write_timeout: 600s grpc_server_max_recv_msg_size: 18388608 grpc_server_max_send_msg_size: 18388608\n\ncommon: path_prefix: /loki storage: filesystem: chunks_directory: /loki/chunks rules_directory: /loki/rules replication_factor: 1 ring: kvstore: store: inmemory\n\nschema_config: configs: - from: 2020-10-24 store: tsdb object_store: filesystem schema: v11 index: prefix: index_ period: 24h\n\nstorage_config: tsdb_shipper: active_index_directory: /loki/index cache_location: /loki/index_cache cache_ttl: 24h\n\nlimits_config: enforce_metric_name: false reject_old_samples: true reject_old_samples_max_age: 24h ingestion_rate_mb: 50 ingestion_burst_size_mb: 100 max_global_streams_per_user: 5000 per_stream_rate_limit: 50MB retention_period: 24h\n\ncompactor: retention_enabled: true shared_store: filesystem working_directory: /loki/compactor-work\n\nchunk_store_config: max_look_back_period: 0s\n\ntable_manager: retention_deletes_enabled: true retention_period: 24h\n\ningester_client: remote_timeout: 15s\n\n## post by tonyswumac on Feb 4, 2025 \n\nTry disabling table manager (see Log retention | Grafana Loki documentation).\n\n## post by sivaprasad298 on Feb 5, 2025 \n\n 1 Feb 2025 \n\nThanks for the response, tried that but still not working\n\nThis is my updated configuration:\n\nauth_enabled: false\n\nserver: http_listen_port: 3100 http_server_read_timeout: 600s http_server_write_timeout: 600s grpc_server_max_recv_msg_size: 18388608 grpc_server_max_send_msg_size: 18388608\n\ncommon: path_prefix: /loki storage: filesystem: chunks_directory: /loki/chunks rules_directory: /loki/rules replication_factor: 1 ring: kvstore: store: inmemory\n\nschema_config: configs: - from: 2020-10-24 store: tsdb object_store: filesystem schema: v11 index: prefix: index_ period: 24h\n\nstorage_config: tsdb_shipper: active_index_directory: /loki/index cache_location: /loki/index_cache cache_ttl: 24h\n\nlimits_config: enforce_metric_name: false reject_old_samples: true reject_old_samples_max_age: 24h ingestion_rate_mb: 50 ingestion_burst_size_mb: 100 max_global_streams_per_user: 5000 per_stream_rate_limit: 50MB\n\ncompactor: working_directory: /loki/compactor-work compaction_interval: 10m retention_enabled: true retention_delete_delay: 1h shared_store: filesystem retention_delete_worker_count: 5\n\ningester_client: remote_timeout: 15s\n\n## post by tonyswumac on Feb 5, 2025 \n\n Feb 2025 \n\n1. You are missing `retention_period` on your latest config.\n2. You may want to set `retention_period` to 48h. The minimum index period for Loki is 24h, and there is a chance compactor won\u2019t delete anything until 48h is up. I don\u2019t set my retention this low, so I am not entirely sure what the behavior is here.\n\n## Closed on Feb 5 \n\nThis topic was automatically closed 365 days after the last reply. New replies are no longer allowed.",
        "image": "https://us1.discourse-cdn.com/grafana/original/2X/a/a7f38198d3aa26d70bae13c3379e5b93a010e7d7.png"
      },
      {
        "id": "https://github.com/grafana/loki/blob/06ce74b7/docs/sources/shared/configuration.md",
        "title": "docs/sources/shared/configuration.md",
        "url": "https://github.com/grafana/loki/blob/06ce74b7/docs/sources/shared/configuration.md",
        "text": "# docs/sources/shared/configuration.md\n\n- Branch: 06ce74b7\n- Repository: grafana/loki\n\n---\n\n---\ndescription: Configuration reference for the parameters used to configure Grafana Loki.\ntitle: Grafana Loki configuration parameters\n---\n\n \n\n## Printing Loki config at runtime\n\nIf you pass Loki the flag `-print-config-stderr` or `-log-config-reverse-order`, (or `-print-config-stderr=true`)\nLoki will dump the entire config object it has created from the built-in defaults combined first with\noverrides from config file, and second by overrides from flags.\n\nThe result is the value for every config object in the Loki config struct, which is very large...\n\nMany values will not be relevant to your install such as storage configs which you are not using and which you did not define,\nthis is expected as every option has a default value if it is being used or not.\n\nThis config is what Loki will use to run, it can be invaluable for debugging issues related to configuration and\nis especially useful in making sure your config files and flags are being read and loaded properly.\n\n`-print-config-stderr` is nice when running Loki directly e.g. `./loki ` as you can get a quick output of the entire Loki config.\n\n`-log-config-reverse-order` is the flag we run Loki with in all our environments, the config entries are reversed so\nthat the order of configs reads correctly top to bottom when viewed in Grafana's Explore.\n\n## Configuration file reference\n\nTo specify which configuration file to load, pass the `-config.file` flag at the\ncommand line. The value can be a list of comma separated paths, then the first\nfile that exists will be used.\nIf no `-config.file` argument is specified, Loki will look up the `config.yaml` in the\ncurrent working directory and the `config/` subdirectory and try to use that.\n\nThe file is written in YAML\nformat, defined by the scheme below.\nBrackets indicate that a parameter is optional. For non-list parameters the\nvalue is set to the specified default.\n\n### Use environment variables in the configuration\n\n> **Note:** This feature is only available in Loki 2.1+.\n\nYou can use environment variable references in the configuration file to set values that need to be configurable during deployment.\nTo do this, pass `-config.expand-env=true` and use:\n\n```bash\n${VAR}\n```\n\nWhere VAR is the name of the environment variable.\n\nEach variable reference is replaced at startup by the value of the environment variable.\nThe replacement is case-sensitive and occurs before the YAML file is parsed.\nReferences to undefined variables are replaced by empty strings unless you specify a default value or custom error text.\n\nTo specify a default value, use:\n\n```bash\n${VAR:-default_value}\n```\n\nWhere default_value is the value to use if the environment variable is undefined.\n\nPass the `-config.expand-env` flag at the command line to enable this way of setting configs.\n\n### Generic placeholders\n\n- ` ` : a boolean that can take the values `true` or `false`\n- ` ` : any integer matching the regular expression `[1-9]+[0-9]*`\n- ` ` : a duration matching the regular expression `[0-9]+(ns|us|\u00b5s|ms|[smh])`\n- ` ` : a string matching the regular expression `[a-zA-Z_][a-zA-Z0-9_]*`\n- ` ` : a string of unicode characters\n- ` ` : a valid path relative to current working directory or an absolute path.\n- ` ` : a valid string consisting of a hostname or IP followed by an optional port number\n- ` ` : a string\n- ` ` : a string that represents a secret, such as a password\n\n### Supported contents and default values of `loki.yaml`\n\n \n\n```yaml\n# A comma-separated list of components to run. The default value 'all' runs Loki\n# in single binary mode. The value 'read' is an alias to run only read-path\n# related components such as the querier and query-frontend, but all in the same\n# process. The value 'write' is an alias to run only write-path related\n# components such as the distributor and compactor, but all in the same process.\n# Supported values: all, compactor, distributor, ingester, querier,\n# query-scheduler, ingester-querier, query-frontend, index-gateway, ruler,\n# table-manager, read, write. A full list of available targets can be printed\n# when running Loki with the '-list-targets' command line flag.\n# CLI flag: -target\n[target: <string> | default = \"all\"]\n\n# Enables authentication through the X-Scope-OrgID header, which must be present\n# if true. If false, the OrgID will always be set to 'fake'.\n# CLI flag: -auth.enabled\n[auth_enabled: <boolean> | default = true]\n\n# The amount of virtual memory in bytes to reserve as ballast in order to\n# optimize garbage collection. Larger ballasts result in fewer garbage\n# collection passes, reducing CPU overhead at the cost of heap size. The ballast\n# will not consume physical memory, because it is never read from. It will,\n# however, distort metrics, because it is counted as live memory.\n# CLI flag: -config.ballast-bytes\n[ballast_bytes: <int> | default = 0]\n\n# Configures the server of the launched module(s).\n[server: <server>]\n\nui:\n  # Enable the experimental Loki UI.\n  # CLI flag: -ui.enabled\n  [enabled: <boolean> | default = false]\n\n  # Enable debug logging for the UI.\n  # CLI flag: -ui.debug\n  [debug: <boolean> | default = false]\n\n  goldfish:\n    # Enable the Goldfish query comparison feature.\n    # CLI flag: -ui.goldfish.enable\n    [enable: <boolean> | default = false]\n\n    storage:\n      # Storage backend type (cloudsql, rds, or empty for no storage)\n      # CLI flag: -ui.goldfish.storage.type\n      [type: <string> | default = \"\"]\n\n      # CloudSQL host for Goldfish database.\n      # CLI flag: -ui.goldfish.storage.cloudsql.host\n      [cloudsql_host: <string> | default = \"127.0.0.1\"]\n\n      # CloudSQL port for Goldfish database.\n      # CLI flag: -ui.goldfish.storage.cloudsql.port\n      [cloudsql_port: <int> | default = 3306]\n\n      # CloudSQL database name for Goldfish.\n      # CLI flag: -ui.goldfish.storage.cloudsql.database\n      [cloudsql_database: <string> | default = \"goldfish\"]\n\n      # CloudSQL username for Goldfish database.\n      # CLI flag: -ui.goldfish.storage.cloudsql.user\n      [cloudsql_user: <string> | default = \"\"]\n\n      # RDS endpoint (host:port)\n      # CLI flag: -ui.goldfish.storage.rds.endpoint\n      [rds_endpoint: <string> | default = \"\"]\n\n      # RDS database name\n      # CLI flag: -ui.goldfish.storage.rds.database\n      [rds_database: <string> | default = \"\"]\n\n      # RDS database user\n      # CLI flag: -ui.goldfish.storage.rds.user\n      [rds_user: <string> | default = \"\"]\n\n      # Maximum number of database connections for Goldfish.\n      # CLI flag: -ui.goldfish.max-connections\n      [max_connections: <int> | default = 10]\n\n      # Maximum idle time for database connections in seconds.\n      # CLI flag: -ui.goldfish.max-idle-time\n      [max_idle_time_seconds: <int> | default = 300]\n\n    # Base URL of Grafana instance for explore links.\n    # CLI flag: -ui.goldfish.grafana-url\n    [grafana_url: <string> | default = \"\"]\n\n    # UID of the traces datasource in Grafana.\n    # CLI flag: -ui.goldfish.traces-datasource-uid\n    [traces_datasource_uid: <string> | default = \"\"]\n\n    # UID of the Loki datasource in Grafana.\n    # CLI flag: -ui.goldfish.logs-datasource-uid\n    [logs_datasource_uid: <string> | default = \"\"]\n\n    # Namespace for Cell A logs.\n    # CLI flag: -ui.goldfish.cell-a-namespace\n    [cell_a_namespace: <string> | default = \"\"]\n\n    # Namespace for Cell B logs.\n    # CLI flag: -ui.goldfish.cell-b-namespace\n    [cell_b_namespace: <string> | default = \"\"]\n\n    # Results storage backend (gcs, s3) for fetching stored query results.\n    # CLI flag: -ui.goldfish.results-backend\n    [results_backend: <string> | default = \"\"]\n\n    # The thanos_object_store_config block configures the connection to object\n    # storage backend using thanos-io/objstore clients. This will become the\n    # default way of configuring object store clients in future releases.\n    # Currently this is opt-in and takes effect only when `-use-thanos-objstore`\n    # is set to true.\n    # The CLI flags prefix for this block configuration is: ui.goldfish.results\n    [results_bucket: <thanos_object_store_config>]\n\n  ring:\n    kvstore:\n      # Backend storage to use for the ring. Supported values are: consul, etcd,\n      # inmemory, memberlist, multi.\n      # CLI flag: -ui.ring.store\n      [store: <string> | default = \"consul\"]\n\n      # The prefix for the keys in the store. Should end with a /.\n      # CLI flag: -ui.ring.prefix\n      [prefix: <string> | default = \"collectors/\"]\n\n      # Configuration for a Consul client. Only applies if the selected kvstore\n      # is consul.\n      # The CLI flags prefix for this block configuration is: ui.ring\n      [consul: <consul>]\n\n      # Configuration for an ETCD v3 client. Only applies if the selected\n      # kvstore is etcd.\n      # The CLI flags prefix for this block configuration is: ui.ring\n      [etcd: <etcd>]\n\n      multi:\n        # Primary backend storage used by multi-client.\n        # CLI flag: -ui.ring.multi.primary\n        [primary: <string> | default = \"\"]\n\n        # Secondary backend storage used by multi-client.\n        # CLI flag: -ui.ring.multi.secondary\n        [secondary: <string> | default = \"\"]\n\n        # Mirror writes to the secondary store.\n        # CLI flag: -ui.ring.multi.mirror-enabled\n        [mirror_enabled: <boolean> | default = false]\n\n        # Timeout for storing a value to the secondary store.\n        # CLI flag: -ui.ring.multi.mirror-timeout\n        [mirror_timeout: <duration> | default = 2s]\n\n    # Period at which to heartbeat to the ring.\n    # CLI flag: -ui.ring.heartbeat-period\n    [heartbeat_period: <duration> | default = 15s]\n\n    # The heartbeat timeout after which compactors are considered unhealthy\n    # within the ring. 0 = never (timeout disabled).\n    # CLI flag: -ui.ring.heartbeat-timeout\n    [heartbeat_timeout: <duration> | default = 1m]\n\n    # File path where tokens are stored. If empty, tokens are not stored at\n    # shutdown and restored at startup.\n    # CLI flag: -ui.ring.tokens-file-path\n    [tokens_file_path: <string> | default = \"\"]\n\n    # True to enable zone-awareness and replicate blocks across different\n    # availability zones.\n    # CLI flag: -ui.ring.zone-awareness-enabled\n    [zone_awareness_enabled: <boolean> | default = false]\n\n    # Number of tokens to own in the ring.\n    # CLI flag: -ui.ring.num-tokens\n    [num_tokens: <int> | default = 128]\n\n    # Factor for data replication.\n    # CLI flag: -ui.ring.replication-factor\n    [replication_factor: <int> | default = 3]\n\n    # Instance ID to register in the ring.\n    # CLI flag: -ui.ring.instance-id\n    [instance_id: <string> | default = \"<hostname>\"]\n\n    # Name of network interface to read address from.\n    # CLI flag: -ui.ring.instance-interface-names\n    [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n    # Port to advertise in the ring (defaults to server.grpc-listen-port).\n    # CLI flag: -ui.ring.instance-port\n    [instance_port: <int> | default = 0]\n\n    # IP address to advertise in the ring.\n    # CLI flag: -ui.ring.instance-addr\n    [instance_addr: <string> | default = \"\"]\n\n    # The availability zone where this instance is running. Required if\n    # zone-awareness is enabled.\n    # CLI flag: -ui.ring.instance-availability-zone\n    [instance_availability_zone: <string> | default = \"\"]\n\n    # Enable using a IPv6 instance address.\n    # CLI flag: -ui.ring.instance-enable-ipv6\n    [instance_enable_ipv6: <boolean> | default = false]\n\n# Configures the distributor.\n[distributor: <distributor>]\n\n# Configures the querier. Only appropriate when running all modules or just the\n# querier.\n[querier: <querier>]\n\nquery_engine:\n  # Experimental: Enable next generation query engine for supported queries.\n  # CLI flag: -query-engine.enable\n  [enable: <boolean> | default = false]\n\n  # Experimental: Enable distributed query execution.\n  # CLI flag: -query-engine.distributed\n  [distributed: <boolean> | default = false]\n\n  # Experimental: Name of network interface to read an advertise address from\n  # for accepting incoming traffic from query-engine-worker instances when\n  # distributed execution is enabled.\n  # CLI flag: -query-engine.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # Experimental: Batch size of the next generation query engine.\n  # CLI flag: -query-engine.batch-size\n  [batch_size: <int> | default = 100]\n\n  # Experimental: The number of inputs that are prefetched simultaneously by any\n  # Merge node. A value of 0 means that only the currently processed input is\n  # prefetched, 1 means that only the next input is prefetched, and so on. A\n  # negative value means that all inputs are be prefetched in parallel.\n  # CLI flag: -query-engine.merge-prefetch-count\n  [merge_prefetch_count: <int> | default = 0]\n\n  # Configures how to read byte ranges from object storage when using the V2\n  # engine.\n  range_reads:\n    # Experimental: maximum number of parallel reads\n    # CLI flag: -query-engine.range-reads.max-parallelism\n    [max_parallelism: <int> | default = 10]\n\n    # Experimental: maximum distance (in bytes) between ranges that causes them\n    # to be coalesced into a single range\n    # CLI flag: -query-engine.range-reads.coalesce-size\n    [coalesce_size: <int> | default = 1048576]\n\n    # Experimental: maximum size of a byte range\n    # CLI flag: -query-engine.range-reads.max-range-size\n    [max_range_size: <int> | default = 8388608]\n\n    # Experimental: minimum size of a byte range\n    # CLI flag: -query-engine.range-reads.min-range-size\n    [min_range_size: <int> | default = 1048576]\n\n  # Experimental: Number of worker threads to spawn. Each worker thread runs one\n  # task at a time. 0 means to use GOMAXPROCS value.\n  # CLI flag: -query-engine.worker-threads\n  [worker_threads: <int> | default = 0]\n\n  # Experimental: Address holding DNS SRV records of schedulers to connect to.\n  # CLI flag: -query-engine.scheduler-lookup-address\n  [scheduler_lookup_address: <string> | default = \"\"]\n\n  # Experimental: Interval at which to lookup new schedulers by DNS SRV records.\n  # CLI flag: -query-engine.scheduler-lookup-interval\n  [scheduler_lookup_interval: <duration> | default = 10s]\n\n  # Amount of time until data objects are available.\n  # CLI flag: -query-engine.storage-lag\n  [storage_lag: <duration> | default = 1h]\n\n  # Initial date when data objects became available. Format YYYY-MM-DD. If not\n  # set, assume data objects are always available no matter how far back.\n  # CLI flag: -query-engine.storage-start-date\n  [storage_start_date: <time> | default = 0]\n\n  # Enable routing of query splits in the query frontend to the next generation\n  # engine when they fall within the configured time range.\n  # CLI flag: -query-engine.enable-engine-router\n  [enable_engine_router: <boolean> | default = false]\n\n  # Downstream address to send query splits to. This is the HTTP handler address\n  # of the query engine scheduler.\n  # CLI flag: -query-engine.downstream-address\n  [downstream_address: <string> | default = \"\"]\n\n  # When enabled, query results exclude log lines that match overlapping delete\n  # requests (not just pending requests). Disable to return all logs without\n  # considering delete requests.\n  # CLI flag: -query-engine.enable-delete-req-filtering\n  [enable_delete_req_filtering: <boolean> | default = true]\n\n# The query_scheduler block configures the Loki query scheduler. When configured\n# it separates the tenant query queues from the query-frontend.\n[query_scheduler: <query_scheduler>]\n\n# The frontend block configures the Loki query-frontend.\n[frontend: <frontend>]\n\n# The query_range block configures the query splitting and caching in the Loki\n# query-frontend.\n[query_range: <query_range>]\n\n# The ruler block configures the Loki ruler.\n[ruler: <ruler>]\n\nruler_storage:\n  # The thanos_object_store_config block configures the connection to object\n  # storage backend using thanos-io/objstore clients. This will become the\n  # default way of configuring object store clients in future releases.\n  # Currently this is opt-in and takes effect only when `-use-thanos-objstore`\n  # is set to true.\n  # The CLI flags prefix for this block configuration is: ruler-storage\n  [<thanos_object_store_config>]\n\n  # Backend storage to use. Supported backends are: local, s3, gcs, azure,\n  # swift, filesystem, alibabacloud, bos\n  # CLI flag: -ruler-storage.backend\n  [backend: <string> | default = \"filesystem\"]\n\n  local:\n    # Directory to scan for rules\n    # CLI flag: -ruler-storage.local.directory\n    [directory: <string> | default = \"\"]\n\n# The ingester_client block configures how the distributor will connect to\n# ingesters. Only appropriate when running all components, the distributor, or\n# the querier.\n[ingester_client: <ingester_client>]\n\n# The ingester block configures the ingester and how the ingester will register\n# itself to a key value store.\n[ingester: <ingester>]\n\npattern_ingester:\n  # Whether the pattern ingester is enabled.\n  # CLI flag: -pattern-ingester.enabled\n  [enabled: <boolean> | default = false]\n\n  # Configures how the lifecycle of the pattern ingester will operate and where\n  # it will register for discovery.\n  lifecycler:\n    ring:\n      kvstore:\n        # Backend storage to use for the ring. Supported values are: consul,\n        # etcd, inmemory, memberlist, multi.\n        # CLI flag: -pattern-ingester.store\n        [store: <string> | default = \"consul\"]\n\n        # The prefix for the keys in the store. Should end with a /.\n        # CLI flag: -pattern-ingester.prefix\n        [prefix: <string> | default = \"collectors/\"]\n\n        # Configuration for a Consul client. Only applies if the selected\n        # kvstore is consul.\n        # The CLI flags prefix for this block configuration is: pattern-ingester\n        [consul: <consul>]\n\n        # Configuration for an ETCD v3 client. Only applies if the selected\n        # kvstore is etcd.\n        # The CLI flags prefix for this block configuration is: pattern-ingester\n        [etcd: <etcd>]\n\n        multi:\n          # Primary backend storage used by multi-client.\n          # CLI flag: -pattern-ingester.multi.primary\n          [primary: <string> | default = \"\"]\n\n          # Secondary backend storage used by multi-client.\n          # CLI flag: -pattern-ingester.multi.secondary\n          [secondary: <string> | default = \"\"]\n\n          # Mirror writes to the secondary store.\n          # CLI flag: -pattern-ingester.multi.mirror-enabled\n          [mirror_enabled: <boolean> | default = false]\n\n          # Timeout for storing a value to the secondary store.\n          # CLI flag: -pattern-ingester.multi.mirror-timeout\n          [mirror_timeout: <duration> | default = 2s]\n\n      # The heartbeat timeout after which ingesters are skipped for\n      # reads/writes.\n      # CLI flag: -pattern-ingester.ring.heartbeat-timeout\n      [heartbeat_timeout: <duration> | default = 1m]\n\n      # The number of ingesters to write to and read from.\n      # CLI flag: -pattern-ingester.distributor.replication-factor\n      [replication_factor: <int> | default = 1]\n\n      # True to enable the zone-awareness and replicate ingested samples across\n      # different availability zones.\n      # CLI flag: -pattern-ingester.distributor.zone-awareness-enabled\n      [zone_awareness_enabled: <boolean> | default = false]\n\n      # Comma-separated list of zones to exclude from the ring. Instances in\n      # excluded zones will be filtered out from the ring.\n      # CLI flag: -pattern-ingester.distributor.excluded-zones\n      [excluded_zones: <string> | default = \"\"]\n\n    # Number of tokens for each ingester.\n    # CLI flag: -pattern-ingester.num-tokens\n    [num_tokens: <int> | default = 128]\n\n    # Period at which to heartbeat to consul.\n    # CLI flag: -pattern-ingester.heartbeat-period\n    [heartbeat_period: <duration> | default = 5s]\n\n    # Heartbeat timeout after which instance is assumed to be unhealthy.\n    # CLI flag: -pattern-ingester.heartbeat-timeout\n    [heartbeat_timeout: <duration> | default = 1m]\n\n    # Observe tokens after generating to resolve collisions. Useful when using\n    # gossiping ring.\n    # CLI flag: -pattern-ingester.observe-period\n    [observe_period: <duration> | default = 0s]\n\n    # Period to wait for a claim from another member; will join automatically\n    # after this.\n    # CLI flag: -pattern-ingester.join-after\n    [join_after: <duration> | default = 0s]\n\n    # Minimum duration to wait after the internal readiness checks have passed\n    # but before succeeding the readiness endpoint. This is used to slowdown\n    # deployment controllers (eg. Kubernetes) after an instance is ready and\n    # before they proceed with a rolling update, to give the rest of the cluster\n    # instances enough time to receive ring updates.\n    # CLI flag: -pattern-ingester.min-ready-duration\n    [min_ready_duration: <duration> | default = 15s]\n\n    # Name of network interface to read address from.\n    # CLI flag: -pattern-ingester.lifecycler.interface\n    [interface_names: <list of strings> | default = [<private network interfaces>]]\n\n    # Enable IPv6 support. Required to make use of IP addresses from IPv6\n    # interfaces.\n    # CLI flag: -pattern-ingester.enable-inet6\n    [enable_inet6: <boolean> | default = false]\n\n    # Duration to sleep for before exiting, to ensure metrics are scraped.\n    # CLI flag: -pattern-ingester.final-sleep\n    [final_sleep: <duration> | default = 0s]\n\n    # File path where tokens are stored. If empty, tokens are not stored at\n    # shutdown and restored at startup.\n    # CLI flag: -pattern-ingester.tokens-file-path\n    [tokens_file_path: <string> | default = \"\"]\n\n    # The availability zone where this instance is running.\n    # CLI flag: -pattern-ingester.availability-zone\n    [availability_zone: <string> | default = \"\"]\n\n    # Unregister from the ring upon clean shutdown. It can be useful to disable\n    # for rolling restarts with consistent naming in conjunction with\n    # -distributor.extend-writes=false.\n    # CLI flag: -pattern-ingester.unregister-on-shutdown\n    [unregister_on_shutdown: <boolean> | default = true]\n\n    # When enabled the readiness probe succeeds only after all instances are\n    # ACTIVE and healthy in the ring, otherwise only the instance itself is\n    # checked. This option should be disabled if in your cluster multiple\n    # instances can be rolled out simultaneously, otherwise rolling updates may\n    # be slowed down.\n    # CLI flag: -pattern-ingester.readiness-check-ring-health\n    [readiness_check_ring_health: <boolean> | default = true]\n\n    # IP address to advertise in the ring.\n    # CLI flag: -pattern-ingester.lifecycler.addr\n    [address: <string> | default = \"\"]\n\n    # port to advertise in consul (defaults to server.grpc-listen-port).\n    # CLI flag: -pattern-ingester.lifecycler.port\n    [port: <int> | default = 0]\n\n    # ID to register in the ring.\n    # CLI flag: -pattern-ingester.lifecycler.ID\n    [id: <string> | default = \"<hostname>\"]\n\n  # Configures how the pattern ingester will connect to the ingesters.\n  client_config:\n    # Configures how connections are pooled.\n    pool_config:\n      # How frequently to clean up clients for ingesters that have gone away.\n      # CLI flag: -pattern-ingester.client-cleanup-period\n      [client_cleanup_period: <duration> | default = 15s]\n\n      # Run a health check on each ingester client during periodic cleanup.\n      # CLI flag: -pattern-ingester.health-check-ingesters\n      [health_check_ingesters: <boolean> | default = true]\n\n      # Timeout for the health check.\n      # CLI flag: -pattern-ingester.remote-timeout\n      [remote_timeout: <duration> | default = 1s]\n\n    # The remote request timeout on the client side.\n    # CLI flag: -pattern-ingester.client.timeout\n    [remote_timeout: <duration> | default = 5s]\n\n    # Configures how the gRPC connection to ingesters work as a client.\n    # The CLI flags prefix for this block configuration is:\n    # pattern-ingester.client\n    [grpc_client_config: <grpc_client>]\n\n  # How many flushes can happen concurrently from each stream.\n  # CLI flag: -pattern-ingester.concurrent-flushes\n  [concurrent_flushes: <int> | default = 32]\n\n  # How often should the ingester see if there are any blocks to flush. The\n  # first flush check is delayed by a random time up to 0.8x the flush check\n  # period. Additionally, there is +/- 1% jitter added to the interval.\n  # CLI flag: -pattern-ingester.flush-check-period\n  [flush_check_period: <duration> | default = 1m]\n\n  # The maximum number of detected pattern clusters that can be created by\n  # streams.\n  # CLI flag: -pattern-ingester.max-clusters\n  [max_clusters: <int> | default = 300]\n\n  # The maximum eviction ratio of patterns per stream. Once that ratio is\n  # reached, the stream will throttled pattern detection.\n  # CLI flag: -pattern-ingester.max-eviction-ratio\n  [max_eviction_ratio: <float> | default = 0.25]\n\n  # Configures the metric aggregation and storage behavior of the pattern\n  # ingester.\n  metric_aggregation:\n    # How often to sample metrics and patterns from raw push observations.\n    # CLI flag: -pattern-ingester.metric-aggregation.downsample-period\n    [sample_period: <duration> | default = 10s]\n\n    # The address of the Loki instance to push aggregated metrics to.\n    # CLI flag: -pattern-ingester.metric-aggregation.loki-address\n    [loki_address: <string> | default = \"\"]\n\n    # The timeout for writing to Loki.\n    # CLI flag: -pattern-ingester.metric-aggregation.timeout\n    [timeout: <duration> | default = 10s]\n\n    # How long to wait in between pushes to Loki.\n    # CLI flag: -pattern-ingester.metric-aggregation.push-period\n    [push_period: <duration> | default = 30s]\n\n    # The HTTP client configuration for pushing metrics to Loki.\n    http_client_config:\n      basic_auth:\n        [username: <string> | default = \"\"]\n\n        [username_file: <string> | default = \"\"]\n\n        [username_ref: <string> | default = \"\"]\n\n        [password: <string> | default = \"\"]\n\n        [password_file: <string> | default = \"\"]\n\n        [password_ref: <string> | default = \"\"]\n\n      authorization:\n        [type: <string> | default = \"\"]\n\n        [credentials: <string> | default = \"\"]\n\n        [credentials_file: <string> | default = \"\"]\n\n        [credentials_ref: <string> | default = \"\"]\n\n      oauth2:\n        [client_id: <string> | default = \"\"]\n\n        [client_secret: <string> | default = \"\"]\n\n        [client_secret_file: <string> | default = \"\"]\n\n        [client_secret_ref: <string> | default = \"\"]\n\n        [client_certificate_key_id: <string> | default = \"\"]\n\n        [client_certificate_key: <string> | default = \"\"]\n\n        [client_certificate_key_file: <string> | default = \"\"]\n\n        [client_certificate_key_ref: <string> | default = \"\"]\n\n        [grant_type: <string> | default = \"\"]\n\n        [signature_algorithm: <string> | default = \"\"]\n\n        [iss: <string> | default = \"\"]\n\n        [audience: <string> | default = \"\"]\n\n        [claims: <map of string to >]\n\n        [scopes: <list of strings>]\n\n        [token_url: <string> | default = \"\"]\n\n        [endpoint_params: <map of string to string>]\n\n        tls_config:\n          [ca: <string> | default = \"\"]\n\n          [cert: <string> | default = \"\"]\n\n          [key: <string> | default = \"\"]\n\n          [ca_file: <string> | default = \"\"]\n\n          [cert_file: <string> | default = \"\"]\n\n          [key_file: <string> | default = \"\"]\n\n          [ca_ref: <string> | default = \"\"]\n\n          [cert_ref: <string> | default = \"\"]\n\n          [key_ref: <string> | default = \"\"]\n\n          [server_name: <string> | default = \"\"]\n\n          [insecure_skip_verify: <boolean>]\n\n          [min_version: <int>]\n\n          [max_version: <int>]\n\n        proxy_url:\n          [url: <url>]\n\n        [no_proxy: <string> | default = \"\"]\n\n        [proxy_from_environment: <boolean>]\n\n        [proxy_connect_header: <map of string to list of strings>]\n\n      [bearer_token: <string> | default = \"\"]\n\n      [bearer_token_file: <string> | default = \"\"]\n\n      tls_config:\n        [ca: <string> | default = \"\"]\n\n        [cert: <string> | default = \"\"]\n\n        [key: <string> | default = \"\"]\n\n        [ca_file: <string> | default = \"\"]\n\n        [cert_file: <string> | default = \"\"]\n\n        [key_file: <string> | default = \"\"]\n\n        [ca_ref: <string> | default = \"\"]\n\n        [cert_ref: <string> | default = \"\"]\n\n        [key_ref: <string> | default = \"\"]\n\n        [server_name: <string> | default = \"\"]\n\n        [insecure_skip_verify: <boolean>]\n\n        [min_version: <int>]\n\n        [max_version: <int>]\n\n      [follow_redirects: <boolean>]\n\n      [enable_http2: <boolean>]\n\n      proxy_url:\n        [url: <url>]\n\n      [no_proxy: <string> | default = \"\"]\n\n      [proxy_from_environment: <boolean>]\n\n      [proxy_connect_header: <map of string to list of strings>]\n\n      http_headers:\n        [: <map of string to Header>]\n\n    # Whether to use TLS for pushing metrics to Loki.\n    # CLI flag: -pattern-ingester.metric-aggregation.tls\n    [use_tls: <boolean> | default = false]\n\n    # The basic auth configuration for pushing metrics to Loki.\n    basic_auth:\n      # Basic auth username for sending aggregations back to Loki.\n      # CLI flag: -pattern-ingester.metric-aggregation..basic-auth.username\n      [username: <string> | default = \"\"]\n\n      # Basic auth password for sending aggregations back to Loki.\n      # CLI flag: -pattern-ingester.metric-aggregation..basic-auth.password\n      [password: <string> | default = \"\"]\n\n    # The backoff configuration for pushing metrics to Loki.\n    backoff_config:\n      # Minimum delay when backing off.\n      # CLI flag: -pattern-ingester.metric-aggregation...backoff-min-period\n      [min_period: <duration> | default = 100ms]\n\n      # Maximum delay when backing off.\n      # CLI flag: -pattern-ingester.metric-aggregation...backoff-max-period\n      [max_period: <duration> | default = 10s]\n\n      # Number of times to backoff and retry before failing.\n      # CLI flag: -pattern-ingester.metric-aggregation...backoff-retries\n      [max_retries: <int> | default = 10]\n\n  # Configures how detected patterns are pushed back to Loki for persistence.\n  pattern_persistence:\n    # The address of the Loki instance to push patterns to.\n    # CLI flag: -pattern-ingester.pattern-persistence.loki-address\n    [loki_address: <string> | default = \"\"]\n\n    # The timeout for writing patterns to Loki.\n    # CLI flag: -pattern-ingester.pattern-persistence.timeout\n    [timeout: <duration> | default = 10s]\n\n    # How long to wait between pattern pushes to Loki.\n    # CLI flag: -pattern-ingester.pattern-persistence.push-period\n    [push_period: <duration> | default = 1m]\n\n    # The HTTP client configuration for pushing patterns to Loki.\n    http_client_config:\n      basic_auth:\n        [username: <string> | default = \"\"]\n\n        [username_file: <string> | default = \"\"]\n\n        [username_ref: <string> | default = \"\"]\n\n        [password: <string> | default = \"\"]\n\n        [password_file: <string> | default = \"\"]\n\n        [password_ref: <string> | default = \"\"]\n\n      authorization:\n        [type: <string> | default = \"\"]\n\n        [credentials: <string> | default = \"\"]\n\n        [credentials_file: <string> | default = \"\"]\n\n        [credentials_ref: <string> | default = \"\"]\n\n      oauth2:\n        [client_id: <string> | default = \"\"]\n\n        [client_secret: <string> | default = \"\"]\n\n        [client_secret_file: <string> | default = \"\"]\n\n        [client_secret_ref: <string> | default = \"\"]\n\n        [client_certificate_key_id: <string> | default = \"\"]\n\n        [client_certificate_key: <string> | default = \"\"]\n\n        [client_certificate_key_file: <string> | default = \"\"]\n\n        [client_certificate_key_ref: <string> | default = \"\"]\n\n        [grant_type: <string> | default = \"\"]\n\n        [signature_algorithm: <string> | default = \"\"]\n\n        [iss: <string> | default = \"\"]\n\n        [audience: <string> | default = \"\"]\n\n        [claims: <map of string to >]\n\n        [scopes: <list of strings>]\n\n        [token_url: <string> | default = \"\"]\n\n        [endpoint_params: <map of string to string>]\n\n        tls_config:\n          [ca: <string> | default = \"\"]\n\n          [cert: <string> | default = \"\"]\n\n          [key: <string> | default = \"\"]\n\n          [ca_file: <string> | default = \"\"]\n\n          [cert_file: <string> | default = \"\"]\n\n          [key_file: <string> | default = \"\"]\n\n          [ca_ref: <string> | default = \"\"]\n\n          [cert_ref: <string> | default = \"\"]\n\n          [key_ref: <string> | default = \"\"]\n\n          [server_name: <string> | default = \"\"]\n\n          [insecure_skip_verify: <boolean>]\n\n          [min_version: <int>]\n\n          [max_version: <int>]\n\n        proxy_url:\n          [url: <url>]\n\n        [no_proxy: <string> | default = \"\"]\n\n        [proxy_from_environment: <boolean>]\n\n        [proxy_connect_header: <map of string to list of strings>]\n\n      [bearer_token: <string> | default = \"\"]\n\n      [bearer_token_file: <string> | default = \"\"]\n\n      tls_config:\n        [ca: <string> | default = \"\"]\n\n        [cert: <string> | default = \"\"]\n\n        [key: <string> | default = \"\"]\n\n        [ca_file: <string> | default = \"\"]\n\n        [cert_file: <string> | default = \"\"]\n\n        [key_file: <string> | default = \"\"]\n\n        [ca_ref: <string> | default = \"\"]\n\n        [cert_ref: <string> | default = \"\"]\n\n        [key_ref: <string> | default = \"\"]\n\n        [server_name: <string> | default = \"\"]\n\n        [insecure_skip_verify: <boolean>]\n\n        [min_version: <int>]\n\n        [max_version: <int>]\n\n      [follow_redirects: <boolean>]\n\n      [enable_http2: <boolean>]\n\n      proxy_url:\n        [url: <url>]\n\n      [no_proxy: <string> | default = \"\"]\n\n      [proxy_from_environment: <boolean>]\n\n      [proxy_connect_header: <map of string to list of strings>]\n\n      http_headers:\n        [: <map of string to Header>]\n\n    # Whether to use TLS for pushing patterns to Loki.\n    # CLI flag: -pattern-ingester.pattern-persistence.tls\n    [use_tls: <boolean> | default = false]\n\n    # The basic auth configuration for pushing patterns to Loki.\n    basic_auth:\n      # Basic auth username for sending patterns back to Loki.\n      # CLI flag: -pattern-ingester.pattern-persistence..basic-auth.username\n      [username: <string> | default = \"\"]\n\n      # Basic auth password for sending patterns back to Loki.\n      # CLI flag: -pattern-ingester.pattern-persistence..basic-auth.password\n      [password: <string> | default = \"\"]\n\n    # The backoff configuration for pushing patterns to Loki.\n    backoff_config:\n      # Minimum delay when backing off.\n      # CLI flag: -pattern-ingester.pattern-persistence...backoff-min-period\n      [min_period: <duration> | default = 100ms]\n\n      # Maximum delay when backing off.\n      # CLI flag: -pattern-ingester.pattern-persistence...backoff-max-period\n      [max_period: <duration> | default = 10s]\n\n      # Number of times to backoff and retry before failing.\n      # CLI flag: -pattern-ingester.pattern-persistence...backoff-retries\n      [max_retries: <int> | default = 10]\n\n    # The maximum number of patterns to accumulate before pushing.\n    # CLI flag: -pattern-ingester.pattern-persistence.batch-size\n    [batch_size: <int> | default = 1000]\n\n  # Configures the pattern tee which forwards requests to the pattern ingester.\n  tee_config:\n    # The size of the batch of raw logs to send for template mining\n    # CLI flag: -pattern-ingester.tee.batch-size\n    [batch_size: <int> | default = 5000]\n\n    # The max time between batches of raw logs to send for template mining\n    # CLI flag: -pattern-ingester.tee.batch-flush-interval\n    [batch_flush_interval: <duration> | default = 1s]\n\n    # The number of log flushes to queue before dropping\n    # CLI flag: -pattern-ingester.tee.flush-queue-size\n    [flush_queue_size: <int> | default = 1000]\n\n    # the number of concurrent workers sending logs to the template service\n    # CLI flag: -pattern-ingester.tee.flush-worker-count\n    [flush_worker_count: <int> | default = 100]\n\n    # The max time we will try to flush any remaining logs to be mined when the\n    # service is stopped\n    # CLI flag: -pattern-ingester.tee.stop-flush-timeout\n    [stop_flush_timeout: <duration> | default = 30s]\n\n  # Timeout for connections between the Loki and the pattern ingester.\n  # CLI flag: -pattern-ingester.connection-timeout\n  [connection_timeout: <duration> | default = 2s]\n\n  # The maximum length of log lines that can be used for pattern detection.\n  # CLI flag: -pattern-ingester.max-allowed-line-length\n  [max_allowed_line_length: <int> | default = 3000]\n\n  # How long to retain patterns in the pattern ingester after they are pushed.\n  # CLI flag: -pattern-ingester.retain-for\n  [retain_for: <duration> | default = 3h]\n\n  # The maximum time span for a single pattern chunk.\n  # CLI flag: -pattern-ingester.max-chunk-age\n  [max_chunk_age: <duration> | default = 1h]\n\n  # The time resolution for pattern samples within chunks.\n  # CLI flag: -pattern-ingester.sample-interval\n  [pattern_sample_interval: <duration> | default = 10s]\n\n  # The threshold for filtering patterns by volume. Only patterns representing\n  # the top X% of log volume will be persisted (0-1).\n  # CLI flag: -pattern-ingester.volume-threshold\n  [volume_threshold: <float> | default = 0.99]\n\n# The index_gateway block configures the Loki index gateway server, responsible\n# for serving index queries without the need to constantly interact with the\n# object store.\n[index_gateway: <index_gateway>]\n\n# Experimental: The bloom_build block configures the Loki bloom planner and\n# builder servers, responsible for building bloom filters.\n[bloom_build: <bloom_build>]\n\n# Experimental: The bloom_gateway block configures the Loki bloom gateway\n# server, responsible for serving queries for filtering chunks based on filter\n# expressions.\n[bloom_gateway: <bloom_gateway>]\n\n# The storage_config block configures one of many possible stores for both the\n# index and chunks. Which configuration to be picked should be defined in\n# schema_config block.\n[storage_config: <storage_config>]\n\n# The chunk_store_config block configures how chunks will be cached and how long\n# to wait before saving them to the backing store.\n[chunk_store_config: <chunk_store_config>]\n\n# Configures the chunk index schema and where it is stored.\n[schema_config: <schema_config>]\n\n# The compactor block configures the compactor component, which compacts index\n# shards for performance.\n[compactor: <compactor>]\n\ncompactor_grpc_client:\n  # The grpc_client block configures the gRPC client used to communicate between\n  # a client and server component in Loki.\n  # The CLI flags prefix for this block configuration is: compactor.grpc-client\n  [<grpc_client>]\n\n# The limits_config block configures global and per-tenant limits in Loki. The\n# values here can be overridden in the `overrides` section of the runtime_config\n# file\n[limits_config: <limits_config>]\n\n# The frontend_worker configures the worker - running within the Loki querier -\n# picking up and executing queries enqueued by the query-frontend.\n[frontend_worker: <frontend_worker>]\n\n# The table_manager block configures the table manager for retention.\n[table_manager: <table_manager>]\n\n# Configuration for memberlist client. Only applies if the selected kvstore is\n# memberlist.\n# \n# When a memberlist config with atleast 1 join_members is defined, kvstore of\n# type memberlist is automatically selected for all the components that require\n# a ring unless otherwise specified in the component's configuration section.\n[memberlist: <memberlist>]\n\nkafka_config:\n  # The Kafka topic name.\n  # CLI flag: -kafka.topic\n  [topic: <string> | default = \"\"]\n\n  # The maximum time allowed to open a connection to a Kafka broker.\n  # CLI flag: -kafka.dial-timeout\n  [dial_timeout: <duration> | default = 2s]\n\n  # How long to wait for an incoming write request to be successfully committed\n  # to the Kafka backend.\n  # CLI flag: -kafka.write-timeout\n  [write_timeout: <duration> | default = 10s]\n\n  reader_config:\n    # The Kafka backend address.\n    # CLI flag: -kafka.reader.address\n    [address: <string> | default = \"localhost:9092\"]\n\n    # The Kafka client ID.\n    # CLI flag: -kafka.reader.client-id\n    [client_id: <string> | default = \"\"]\n\n  writer_config:\n    # The Kafka backend address.\n    # CLI flag: -kafka.writer.address\n    [address: <string> | default = \"localhost:9092\"]\n\n    # The Kafka client ID.\n    # CLI flag: -kafka.writer.client-id\n    [client_id: <string> | default = \"\"]\n\n  # The SASL username for authentication to Kafka using the PLAIN mechanism.\n  # Both username and password must be set.\n  # CLI flag: -kafka.sasl-username\n  [sasl_username: <string> | default = \"\"]\n\n  # The SASL password for authentication to Kafka using the PLAIN mechanism.\n  # Both username and password must be set.\n  # CLI flag: -kafka.sasl-password\n  [sasl_password: <string> | default = \"\"]\n\n  # The consumer group used by the consumer to track the last consumed offset.\n  # The consumer group must be different for each ingester zone.When empty, Loki\n  # uses the ingester instance ID.\n  # CLI flag: -kafka.consumer-group\n  [consumer_group: <string> | default = \"\"]\n\n  # How frequently a consumer should commit the consumed offset to Kafka. The\n  # last committed offset is used at startup to continue the consumption from\n  # where it was left.\n  # CLI flag: -kafka.consumer-group-offset-commit-interval\n  [consumer_group_offset_commit_interval: <duration> | default = 1s]\n\n  # How long to retry a failed request to get the last produced offset.\n  # CLI flag: -kafka.last-produced-offset-retry-timeout\n  [last_produced_offset_retry_timeout: <duration> | default = 10s]\n\n  # Enable auto-creation of Kafka topic if it doesn't exist.\n  # CLI flag: -kafka.auto-create-topic-enabled\n  [auto_create_topic_enabled: <boolean> | default = true]\n\n  # When auto-creation of Kafka topic is enabled and this value is positive,\n  # Kafka's num.partitions configuration option is set on Kafka brokers with\n  # this value when Loki component that uses Kafka starts. This configuration\n  # option specifies the default number of partitions that the Kafka broker uses\n  # for auto-created topics. Note that this is a Kafka-cluster wide setting, and\n  # applies to any auto-created topic. If the setting of num.partitions fails,\n  # Loki proceeds anyways, but auto-created topics could have an incorrect\n  # number of partitions.\n  # CLI flag: -kafka.auto-create-topic-default-partitions\n  [auto_create_topic_default_partitions: <int> | default = 1000]\n\n  # The maximum size of a Kafka record data that should be generated by the\n  # producer. An incoming write request larger than this size is split into\n  # multiple Kafka records. We strongly recommend to not change this setting\n  # unless for testing purposes.\n  # CLI flag: -kafka.producer-max-record-size-bytes\n  [producer_max_record_size_bytes: <int> | default = 15983616]\n\n  # The maximum size of (uncompressed) buffered and unacknowledged produced\n  # records sent to Kafka. The produce request fails once this limit is reached.\n  # This limit is per Kafka client. 0 to disable the limit.\n  # CLI flag: -kafka.producer-max-buffered-bytes\n  [producer_max_buffered_bytes: <int> | default = 1073741824]\n\n  # The guaranteed maximum lag before a consumer is considered to have caught up\n  # reading from a partition at startup, becomes ACTIVE in the hash ring and\n  # passes the readiness check. Set -kafka.max-consumer-lag-at-startup to 0 to\n  # disable waiting for maximum consumer lag being honored at startup.\n  # CLI flag: -kafka.max-consumer-lag-at-startup\n  [max_consumer_lag_at_startup: <duration> | default = 15s]\n\n  # The maximum number of workers to use for processing records from Kafka.\n  # CLI flag: -kafka.max-consumer-workers\n  [max_consumer_workers: <int> | default = 1]\n\n  # Enable collection of the following kafka latency histograms: read-wait,\n  # read-timing, write-wait, write-timing\n  # CLI flag: -kafka.enable-kafka-histograms\n  [enable_kafka_histograms: <boolean> | default = false]\n\ndataobj:\n  consumer:\n    builderconfig:\n      # The target maximum amount of uncompressed data to hold in data pages\n      # (for columnar sections). Uncompressed size is used for consistent I/O\n      # and planning.\n      # CLI flag: -dataobj-consumer.target-page-size\n      [target_page_size: <int> | default = 2MiB]\n\n      # The maximum row count for pages to use for the data object builder. A\n      # value of 0 means no limit.\n      # CLI flag: -dataobj-consumer.max-page-rows\n      [max_page_rows: <int> | default = 0]\n\n      # The target maximum size of the encoded object and all of its encoded\n      # sections (after compression), to limit memory usage of a builder.\n      # CLI flag: -dataobj-consumer.target-builder-memory-limit\n      [target_object_size: <int> | default = 1GiB]\n\n      # The target maximum amount of uncompressed data to hold in sections, for\n      # sections that support being limited by size. Uncompressed size is used\n      # for consistent I/O and planning.\n      # CLI flag: -dataobj-consumer.target-section-size\n      [target_section_size: <int> | default = 128MiB]\n\n      # The size of logs to buffer in memory before adding into columnar\n      # builders, used to reduce CPU load of sorting.\n      # CLI flag: -dataobj-consumer.buffer-size\n      [buffer_size: <int> | default = 16MiB]\n\n      # The maximum number of dataobj section stripes to merge into a section at\n      # once. Must be greater than 1.\n      # CLI flag: -dataobj-consumer.section-stripe-merge-limit\n      [section_stripe_merge_limit: <int> | default = 2]\n\n    lifecycler:\n      ring:\n        kvstore:\n          # Backend storage to use for the ring. Supported values are: consul,\n          # etcd, inmemory, memberlist, multi.\n          # CLI flag: -dataobj-consumer.store\n          [store: <string> | default = \"consul\"]\n\n          # The prefix for the keys in the store. Should end with a /.\n          # CLI flag: -dataobj-consumer.prefix\n          [prefix: <string> | default = \"collectors/\"]\n\n          # Configuration for a Consul client. Only applies if the selected\n          # kvstore is consul.\n          # The CLI flags prefix for this block configuration is:\n          # dataobj-consumer\n          [consul: <consul>]\n\n          # Configuration for an ETCD v3 client. Only applies if the selected\n          # kvstore is etcd.\n          # The CLI flags prefix for this block configuration is:\n          # dataobj-consumer\n          [etcd: <etcd>]\n\n          multi:\n            # Primary backend storage used by multi-client.\n            # CLI flag: -dataobj-consumer.multi.primary\n            [primary: <string> | default = \"\"]\n\n            # Secondary backend storage used by multi-client.\n            # CLI flag: -dataobj-consumer.multi.secondary\n            [secondary: <string> | default = \"\"]\n\n            # Mirror writes to the secondary store.\n            # CLI flag: -dataobj-consumer.multi.mirror-enabled\n            [mirror_enabled: <boolean> | default = false]\n\n            # Timeout for storing a value to the secondary store.\n            # CLI flag: -dataobj-consumer.multi.mirror-timeout\n            [mirror_timeout: <duration> | default = 2s]\n\n        # The heartbeat timeout after which ingesters are skipped for\n        # reads/writes.\n        # CLI flag: -dataobj-consumer.ring.heartbeat-timeout\n        [heartbeat_timeout: <duration> | default = 1m]\n\n        # The number of ingesters to write to and read from.\n        # CLI flag: -dataobj-consumer.distributor.replication-factor\n        [replication_factor: <int> | default = 3]\n\n        # True to enable the zone-awareness and replicate ingested samples\n        # across different availability zones.\n        # CLI flag: -dataobj-consumer.distributor.zone-awareness-enabled\n        [zone_awareness_enabled: <boolean> | default = false]\n\n        # Comma-separated list of zones to exclude from the ring. Instances in\n        # excluded zones will be filtered out from the ring.\n        # CLI flag: -dataobj-consumer.distributor.excluded-zones\n        [excluded_zones: <string> | default = \"\"]\n\n      # Number of tokens for each ingester.\n      # CLI flag: -dataobj-consumer.num-tokens\n      [num_tokens: <int> | default = 128]\n\n      # Period at which to heartbeat to consul.\n      # CLI flag: -dataobj-consumer.heartbeat-period\n      [heartbeat_period: <duration> | default = 5s]\n\n      # Heartbeat timeout after which instance is assumed to be unhealthy.\n      # CLI flag: -dataobj-consumer.heartbeat-timeout\n      [heartbeat_timeout: <duration> | default = 1m]\n\n      # Observe tokens after generating to resolve collisions. Useful when using\n      # gossiping ring.\n      # CLI flag: -dataobj-consumer.observe-period\n      [observe_period: <duration> | default = 0s]\n\n      # Period to wait for a claim from another member; will join automatically\n      # after this.\n      # CLI flag: -dataobj-consumer.join-after\n      [join_after: <duration> | default = 0s]\n\n      # Minimum duration to wait after the internal readiness checks have passed\n      # but before succeeding the readiness endpoint. This is used to slowdown\n      # deployment controllers (eg. Kubernetes) after an instance is ready and\n      # before they proceed with a rolling update, to give the rest of the\n      # cluster instances enough time to receive ring updates.\n      # CLI flag: -dataobj-consumer.min-ready-duration\n      [min_ready_duration: <duration> | default = 15s]\n\n      # Name of network interface to read address from.\n      # CLI flag: -dataobj-consumer.lifecycler.interface\n      [interface_names: <list of strings> | default = [<private network interfaces>]]\n\n      # Enable IPv6 support. Required to make use of IP addresses from IPv6\n      # interfaces.\n      # CLI flag: -dataobj-consumer.enable-inet6\n      [enable_inet6: <boolean> | default = false]\n\n      # Duration to sleep for before exiting, to ensure metrics are scraped.\n      # CLI flag: -dataobj-consumer.final-sleep\n      [final_sleep: <duration> | default = 0s]\n\n      # File path where tokens are stored. If empty, tokens are not stored at\n      # shutdown and restored at startup.\n      # CLI flag: -dataobj-consumer.tokens-file-path\n      [tokens_file_path: <string> | default = \"\"]\n\n      # The availability zone where this instance is running.\n      # CLI flag: -dataobj-consumer.availability-zone\n      [availability_zone: <string> | default = \"\"]\n\n      # Unregister from the ring upon clean shutdown. It can be useful to\n      # disable for rolling restarts with consistent naming in conjunction with\n      # -distributor.extend-writes=false.\n      # CLI flag: -dataobj-consumer.unregister-on-shutdown\n      [unregister_on_shutdown: <boolean> | default = true]\n\n      # When enabled the readiness probe succeeds only after all instances are\n      # ACTIVE and healthy in the ring, otherwise only the instance itself is\n      # checked. This option should be disabled if in your cluster multiple\n      # instances can be rolled out simultaneously, otherwise rolling updates\n      # may be slowed down.\n      # CLI flag: -dataobj-consumer.readiness-check-ring-health\n      [readiness_check_ring_health: <boolean> | default = true]\n\n      # IP address to advertise in the ring.\n      # CLI flag: -dataobj-consumer.lifecycler.addr\n      [address: <string> | default = \"\"]\n\n      # port to advertise in consul (defaults to server.grpc-listen-port).\n      # CLI flag: -dataobj-consumer.lifecycler.port\n      [port: <int> | default = 0]\n\n      # ID to register in the ring.\n      # CLI flag: -dataobj-consumer.lifecycler.ID\n      [id: <string> | default = \"<hostname>\"]\n\n    partition_ring:\n      # The key-value store used to share the hash ring across multiple\n      # instances. This option needs be set on ingesters, distributors,\n      # queriers, and rulers when running in microservices mode.\n      kvstore:\n        # Backend storage to use for the ring. Supported values are: consul,\n        # etcd, inmemory, memberlist, multi.\n        # CLI flag: -dataobj-consumer.partition-ring.store\n        [store: <string> | default = \"memberlist\"]\n\n        # The prefix for the keys in the store. Should end with a /.\n        # CLI flag: -dataobj-consumer.partition-ring.prefix\n        [prefix: <string> | default = \"collectors/\"]\n\n        # Configuration for a Consul client. Only applies if the selected\n        # kvstore is consul.\n        # The CLI flags prefix for this block configuration is:\n        # dataobj-consumer.partition-ring\n        [consul: <consul>]\n\n        # Configuration for an ETCD v3 client. Only applies if the selected\n        # kvstore is etcd.\n        # The CLI flags prefix for this block configuration is:\n        # dataobj-consumer.partition-ring\n        [etcd: <etcd>]\n\n        multi:\n          # Primary backend storage used by multi-client.\n          # CLI flag: -dataobj-consumer.partition-ring.multi.primary\n          [primary: <string> | default = \"\"]\n\n          # Secondary backend storage used by multi-client.\n          # CLI flag: -dataobj-consumer.partition-ring.multi.secondary\n          [secondary: <string> | default = \"\"]\n\n          # Mirror writes to the secondary store.\n          # CLI flag: -dataobj-consumer.partition-ring.multi.mirror-enabled\n          [mirror_enabled: <boolean> | default = false]\n\n          # Timeout for storing a value to the secondary store.\n          # CLI flag: -dataobj-consumer.partition-ring.multi.mirror-timeout\n          [mirror_timeout: <duration> | default = 2s]\n\n      # Minimum number of owners to wait before a PENDING partition gets\n      # switched to ACTIVE.\n      # CLI flag: -dataobj-consumer.partition-ring.min-partition-owners-count\n      [min_partition_owners_count: <int> | default = 1]\n\n      # How long the minimum number of owners are enforced before a PENDING\n      # partition gets switched to ACTIVE.\n      # CLI flag: -dataobj-consumer.partition-ring.min-partition-owners-duration\n      [min_partition_owners_duration: <duration> | default = 10s]\n\n      # How long to wait before an INACTIVE partition is eligible for deletion.\n      # The partition is deleted only if it has been in INACTIVE state for at\n      # least the configured duration and it has no owners registered. A value\n      # of 0 disables partitions deletion.\n      # CLI flag: -dataobj-consumer.partition-ring.delete-inactive-partition-after\n      [delete_inactive_partition_after: <duration> | default = 13h]\n\n    uploader:\n      # The size of the SHA prefix to use for generating object storage keys for\n      # data objects.\n      # CLI flag: -dataobj-consumer.sha-prefix-size\n      [shaprefixsize: <int> | default = 2]\n\n    # The maximum amount of time to wait in seconds before flushing an object\n    # that is no longer receiving new writes\n    # CLI flag: -dataobj-consumer.idle-flush-timeout\n    [idle_flush_timeout: <duration> | default = 1h]\n\n    # The maximum amount of time to accumulate data in a builder before flushing\n    # it. Defaults to 1 hour.\n    # CLI flag: -dataobj-consumer.max-builder-age\n    [max_builder_age: <duration> | default = 1h]\n\n    # The name of the Kafka topic\n    # CLI flag: -dataobj-consumer.topic\n    [topic: <string> | default = \"\"]\n\n  index:\n    # The target maximum amount of uncompressed data to hold in data pages (for\n    # columnar sections). Uncompressed size is used for consistent I/O and\n    # planning.\n    # CLI flag: -dataobj-index-builder.target-page-size\n    [target_page_size: <int> | default = 128KiB]\n\n    # The maximum row count for pages to use for the data object builder. A\n    # value of 0 means no limit.\n    # CLI flag: -dataobj-index-builder.max-page-rows\n    [max_page_rows: <int> | default = 0]\n\n    # The target maximum size of the encoded object and all of its encoded\n    # sections (after compression), to limit memory usage of a builder.\n    # CLI flag: -dataobj-index-builder.target-builder-memory-limit\n    [target_object_size: <int> | default = 64MiB]\n\n    # The target maximum amount of uncompressed data to hold in sections, for\n    # sections that support being limited by size. Uncompressed size is used for\n    # consistent I/O and planning.\n    # CLI flag: -dataobj-index-builder.target-section-size\n    [target_section_size: <int> | default = 16MiB]\n\n    # The size of logs to buffer in memory before adding into columnar builders,\n    # used to reduce CPU load of sorting.\n    # CLI flag: -dataobj-index-builder.buffer-size\n    [buffer_size: <int> | default = 2MiB]\n\n    # The maximum number of dataobj section stripes to merge into a section at\n    # once. Must be greater than 1.\n    # CLI flag: -dataobj-index-builder.section-stripe-merge-limit\n    [section_stripe_merge_limit: <int> | default = 2]\n\n    # Experimental: The number of events to batch before building an index\n    # CLI flag: -dataobj-index-builder.events-per-index\n    [events_per_index: <int> | default = 32]\n\n    # Experimental: How often to check for stale partitions to flush\n    # CLI flag: -dataobj-index-builder.flush-interval\n    [flush_interval: <duration> | default = 1m]\n\n    # Experimental: Maximum time to wait before flushing buffered events\n    # CLI flag: -dataobj-index-builder.max-idle-time\n    [max_idle_time: <duration> | default = 30m]\n\n  metastore:\n    # Experimental: A prefix to use for storing indexes in object storage. Used\n    # for testing only.\n    # CLI flag: -dataobj-metastore.index-storage-prefix\n    [index_storage_prefix: <string> | default = \"index/v0\"]\n\n    # Experimental: The ratio of log partitions to metastore partitions. For\n    # example, a value of 10 means there is 1 metastore partition for every 10\n    # log partitions.\n    # CLI flag: -dataobj-metastore.partition-ratio\n    [partition_ratio: <int> | default = 10]\n\n  # The prefix to use for the storage bucket.\n  # CLI flag: -dataobj-storage-bucket-prefix\n  [storage_bucket_prefix: <string> | default = \"dataobj/\"]\n\n  # Enable data objects.\n  # CLI flag: -dataobj.enabled\n  [enabled: <boolean> | default = false]\n\ningest_limits:\n  # Enable the ingest limits service.\n  # CLI flag: -ingest-limits.enabled\n  [enabled: <boolean> | default = false]\n\n  # The duration for which which streams are considered active. Streams that\n  # have not been updated within this window are considered inactive and not\n  # counted towards limits.\n  # CLI flag: -ingest-limits.active-window\n  [active_window: <duration> | default = 2h]\n\n  # The time window for rate calculation. This should match the window used in\n  # Prometheus rate() queries for consistency.\n  # CLI flag: -ingest-limits.rate-window\n  [rate_window: <duration> | default = 5m]\n\n  # The size of the buckets used to calculate stream rates. Smaller buckets\n  # provide more precise rates but require more memory.\n  # CLI flag: -ingest-limits.bucket-size\n  [bucket_size: <duration> | default = 1m]\n\n  # The interval at which old streams are evicted.\n  # CLI flag: -ingest-limits.eviction-interval\n  [eviction_interval: <duration> | default = 10m]\n\n  # The number of partitions for the Kafka topic used to read and write stream\n  # metadata. It is fixed, not a maximum.\n  # CLI flag: -ingest-limits.num-partitions\n  [num_partitions: <int> | default = 64]\n\n  lifecycler:\n    ring:\n      kvstore:\n        # Backend storage to use for the ring. Supported values are: consul,\n        # etcd, inmemory, memberlist, multi.\n        # CLI flag: -ingest-limits.store\n        [store: <string> | default = \"consul\"]\n\n        # The prefix for the keys in the store. Should end with a /.\n        # CLI flag: -ingest-limits.prefix\n        [prefix: <string> | default = \"collectors/\"]\n\n        # Configuration for a Consul client. Only applies if the selected\n        # kvstore is consul.\n        # The CLI flags prefix for this block configuration is: ingest-limits\n        [consul: <consul>]\n\n        # Configuration for an ETCD v3 client. Only applies if the selected\n        # kvstore is etcd.\n        # The CLI flags prefix for this block configuration is: ingest-limits\n        [etcd: <etcd>]\n\n        multi:\n          # Primary backend storage used by multi-client.\n          # CLI flag: -ingest-limits.multi.primary\n          [primary: <string> | default = \"\"]\n\n          # Secondary backend storage used by multi-client.\n          # CLI flag: -ingest-limits.multi.secondary\n          [secondary: <string> | default = \"\"]\n\n          # Mirror writes to the secondary store.\n          # CLI flag: -ingest-limits.multi.mirror-enabled\n          [mirror_enabled: <boolean> | default = false]\n\n          # Timeout for storing a value to the secondary store.\n          # CLI flag: -ingest-limits.multi.mirror-timeout\n          [mirror_timeout: <duration> | default = 2s]\n\n      # The heartbeat timeout after which ingesters are skipped for\n      # reads/writes.\n      # CLI flag: -ingest-limits.ring.heartbeat-timeout\n      [heartbeat_timeout: <duration> | default = 1m]\n\n      # The number of ingesters to write to and read from.\n      # CLI flag: -ingest-limits.distributor.replication-factor\n      [replication_factor: <int> | default = 3]\n\n      # True to enable the zone-awareness and replicate ingested samples across\n      # different availability zones.\n      # CLI flag: -ingest-limits.distributor.zone-awareness-enabled\n      [zone_awareness_enabled: <boolean> | default = false]\n\n      # Comma-separated list of zones to exclude from the ring. Instances in\n      # excluded zones will be filtered out from the ring.\n      # CLI flag: -ingest-limits.distributor.excluded-zones\n      [excluded_zones: <string> | default = \"\"]\n\n    # Number of tokens for each ingester.\n    # CLI flag: -ingest-limits.num-tokens\n    [num_tokens: <int> | default = 128]\n\n    # Period at which to heartbeat to consul.\n    # CLI flag: -ingest-limits.heartbeat-period\n    [heartbeat_period: <duration> | default = 5s]\n\n    # Heartbeat timeout after which instance is assumed to be unhealthy.\n    # CLI flag: -ingest-limits.heartbeat-timeout\n    [heartbeat_timeout: <duration> | default = 1m]\n\n    # Observe tokens after generating to resolve collisions. Useful when using\n    # gossiping ring.\n    # CLI flag: -ingest-limits.observe-period\n    [observe_period: <duration> | default = 0s]\n\n    # Period to wait for a claim from another member; will join automatically\n    # after this.\n    # CLI flag: -ingest-limits.join-after\n    [join_after: <duration> | default = 0s]\n\n    # Minimum duration to wait after the internal readiness checks have passed\n    # but before succeeding the readiness endpoint. This is used to slowdown\n    # deployment controllers (eg. Kubernetes) after an instance is ready and\n    # before they proceed with a rolling update, to give the rest of the cluster\n    # instances enough time to receive ring updates.\n    # CLI flag: -ingest-limits.min-ready-duration\n    [min_ready_duration: <duration> | default = 15s]\n\n    # Name of network interface to read address from.\n    # CLI flag: -ingest-limits.lifecycler.interface\n    [interface_names: <list of strings> | default = [<private network interfaces>]]\n\n    # Enable IPv6 support. Required to make use of IP addresses from IPv6\n    # interfaces.\n    # CLI flag: -ingest-limits.enable-inet6\n    [enable_inet6: <boolean> | default = false]\n\n    # Duration to sleep for before exiting, to ensure metrics are scraped.\n    # CLI flag: -ingest-limits.final-sleep\n    [final_sleep: <duration> | default = 0s]\n\n    # File path where tokens are stored. If empty, tokens are not stored at\n    # shutdown and restored at startup.\n    # CLI flag: -ingest-limits.tokens-file-path\n    [tokens_file_path: <string> | default = \"\"]\n\n    # The availability zone where this instance is running.\n    # CLI flag: -ingest-limits.availability-zone\n    [availability_zone: <string> | default = \"\"]\n\n    # Unregister from the ring upon clean shutdown. It can be useful to disable\n    # for rolling restarts with consistent naming in conjunction with\n    # -distributor.extend-writes=false.\n    # CLI flag: -ingest-limits.unregister-on-shutdown\n    [unregister_on_shutdown: <boolean> | default = true]\n\n    # When enabled the readiness probe succeeds only after all instances are\n    # ACTIVE and healthy in the ring, otherwise only the instance itself is\n    # checked. This option should be disabled if in your cluster multiple\n    # instances can be rolled out simultaneously, otherwise rolling updates may\n    # be slowed down.\n    # CLI flag: -ingest-limits.readiness-check-ring-health\n    [readiness_check_ring_health: <boolean> | default = true]\n\n    # IP address to advertise in the ring.\n    # CLI flag: -ingest-limits.lifecycler.addr\n    [address: <string> | default = \"\"]\n\n    # port to advertise in consul (defaults to server.grpc-listen-port).\n    # CLI flag: -ingest-limits.lifecycler.port\n    [port: <int> | default = 0]\n\n    # ID to register in the ring.\n    # CLI flag: -ingest-limits.lifecycler.ID\n    [id: <string> | default = \"<hostname>\"]\n\n  # The consumer group for the Kafka topic used to read stream metadata records.\n  # CLI flag: -ingest-limits.consumer-group\n  [consumer_group: <string> | default = \"ingest-limits\"]\n\n  # The topic for the Kafka topic used to read and write stream metadata\n  # records.\n  # CLI flag: -ingest-limits.topic\n  [topic: <string> | default = \"\"]\n\ningest_limits_frontend:\n  client_config:\n    # Configures client gRPC connections to limits service.\n    # The CLI flags prefix for this block configuration is:\n    # ingest-limits-frontend.limits-client\n    [grpc_client_config: <grpc_client>]\n\n    # Configures client gRPC connections pool to limits service.\n    pool_config:\n      # How frequently to clean up clients for ingest-limits that have gone\n      # away.\n      # CLI flag: -ingest-limits-frontend.client-cleanup-period\n      [client_cleanup_period: <duration> | default = 15s]\n\n      # Run a health check on each ingest-limits client during periodic cleanup.\n      # CLI flag: -ingest-limits-frontend.health-check-ingest-limits\n      [health_check_ingest_limits: <boolean> | default = true]\n\n      # Timeout for the health check.\n      # CLI flag: -ingest-limits-frontend.remote-timeout\n      [remote_timeout: <duration> | default = 1s]\n\n  lifecycler:\n    ring:\n      kvstore:\n        # Backend storage to use for the ring. Supported values are: consul,\n        # etcd, inmemory, memberlist, multi.\n        # CLI flag: -ingest-limits-frontend.store\n        [store: <string> | default = \"consul\"]\n\n        # The prefix for the keys in the store. Should end with a /.\n        # CLI flag: -ingest-limits-frontend.prefix\n        [prefix: <string> | default = \"collectors/\"]\n\n        # Configuration for a Consul client. Only applies if the selected\n        # kvstore is consul.\n        # The CLI flags prefix for this block configuration is:\n        # ingest-limits-frontend\n        [consul: <consul>]\n\n        # Configuration for an ETCD v3 client. Only applies if the selected\n        # kvstore is etcd.\n        # The CLI flags prefix for this block configuration is:\n        # ingest-limits-frontend\n        [etcd: <etcd>]\n\n        multi:\n          # Primary backend storage used by multi-client.\n          # CLI flag: -ingest-limits-frontend.multi.primary\n          [primary: <string> | default = \"\"]\n\n          # Secondary backend storage used by multi-client.\n          # CLI flag: -ingest-limits-frontend.multi.secondary\n          [secondary: <string> | default = \"\"]\n\n          # Mirror writes to the secondary store.\n          # CLI flag: -ingest-limits-frontend.multi.mirror-enabled\n          [mirror_enabled: <boolean> | default = false]\n\n          # Timeout for storing a value to the secondary store.\n          # CLI flag: -ingest-limits-frontend.multi.mirror-timeout\n          [mirror_timeout: <duration> | default = 2s]\n\n      # The heartbeat timeout after which ingesters are skipped for\n      # reads/writes.\n      # CLI flag: -ingest-limits-frontend.ring.heartbeat-timeout\n      [heartbeat_timeout: <duration> | default = 1m]\n\n      # The number of ingesters to write to and read from.\n      # CLI flag: -ingest-limits-frontend.distributor.replication-factor\n      [replication_factor: <int> | default = 3]\n\n      # True to enable the zone-awareness and replicate ingested samples across\n      # different availability zones.\n      # CLI flag: -ingest-limits-frontend.distributor.zone-awareness-enabled\n      [zone_awareness_enabled: <boolean> | default = false]\n\n      # Comma-separated list of zones to exclude from the ring. Instances in\n      # excluded zones will be filtered out from the ring.\n      # CLI flag: -ingest-limits-frontend.distributor.excluded-zones\n      [excluded_zones: <string> | default = \"\"]\n\n    # Number of tokens for each ingester.\n    # CLI flag: -ingest-limits-frontend.num-tokens\n    [num_tokens: <int> | default = 128]\n\n    # Period at which to heartbeat to consul.\n    # CLI flag: -ingest-limits-frontend.heartbeat-period\n    [heartbeat_period: <duration> | default = 5s]\n\n    # Heartbeat timeout after which instance is assumed to be unhealthy.\n    # CLI flag: -ingest-limits-frontend.heartbeat-timeout\n    [heartbeat_timeout: <duration> | default = 1m]\n\n    # Observe tokens after generating to resolve collisions. Useful when using\n    # gossiping ring.\n    # CLI flag: -ingest-limits-frontend.observe-period\n    [observe_period: <duration> | default = 0s]\n\n    # Period to wait for a claim from another member; will join automatically\n    # after this.\n    # CLI flag: -ingest-limits-frontend.join-after\n    [join_after: <duration> | default = 0s]\n\n    # Minimum duration to wait after the internal readiness checks have passed\n    # but before succeeding the readiness endpoint. This is used to slowdown\n    # deployment controllers (eg. Kubernetes) after an instance is ready and\n    # before they proceed with a rolling update, to give the rest of the cluster\n    # instances enough time to receive ring updates.\n    # CLI flag: -ingest-limits-frontend.min-ready-duration\n    [min_ready_duration: <duration> | default = 15s]\n\n    # Name of network interface to read address from.\n    # CLI flag: -ingest-limits-frontend.lifecycler.interface\n    [interface_names: <list of strings> | default = [<private network interfaces>]]\n\n    # Enable IPv6 support. Required to make use of IP addresses from IPv6\n    # interfaces.\n    # CLI flag: -ingest-limits-frontend.enable-inet6\n    [enable_inet6: <boolean> | default = false]\n\n    # Duration to sleep for before exiting, to ensure metrics are scraped.\n    # CLI flag: -ingest-limits-frontend.final-sleep\n    [final_sleep: <duration> | default = 0s]\n\n    # File path where tokens are stored. If empty, tokens are not stored at\n    # shutdown and restored at startup.\n    # CLI flag: -ingest-limits-frontend.tokens-file-path\n    [tokens_file_path: <string> | default = \"\"]\n\n    # The availability zone where this instance is running.\n    # CLI flag: -ingest-limits-frontend.availability-zone\n    [availability_zone: <string> | default = \"\"]\n\n    # Unregister from the ring upon clean shutdown. It can be useful to disable\n    # for rolling restarts with consistent naming in conjunction with\n    # -distributor.extend-writes=false.\n    # CLI flag: -ingest-limits-frontend.unregister-on-shutdown\n    [unregister_on_shutdown: <boolean> | default = true]\n\n    # When enabled the readiness probe succeeds only after all instances are\n    # ACTIVE and healthy in the ring, otherwise only the instance itself is\n    # checked. This option should be disabled if in your cluster multiple\n    # instances can be rolled out simultaneously, otherwise rolling updates may\n    # be slowed down.\n    # CLI flag: -ingest-limits-frontend.readiness-check-ring-health\n    [readiness_check_ring_health: <boolean> | default = true]\n\n    # IP address to advertise in the ring.\n    # CLI flag: -ingest-limits-frontend.lifecycler.addr\n    [address: <string> | default = \"\"]\n\n    # port to advertise in consul (defaults to server.grpc-listen-port).\n    # CLI flag: -ingest-limits-frontend.lifecycler.port\n    [port: <int> | default = 0]\n\n    # ID to register in the ring.\n    # CLI flag: -ingest-limits-frontend.lifecycler.ID\n    [id: <string> | default = \"<hostname>\"]\n\n  # The number of partitions to use for the ring.\n  # CLI flag: -ingest-limits-frontend.num-partitions\n  [num_partitions: <int> | default = 64]\n\n  # The TTL for the assigned partitions cache. 0 disables the cache.\n  # CLI flag: -ingest-limits-frontend.assigned-partitions-cache-ttl\n  [assigned_partitions_cache_ttl: <duration> | default = 1m]\n\ningest_limits_frontend_client:\n  # Configures client gRPC connections to limits service.\n  # The CLI flags prefix for this block configuration is:\n  # ingest-limits-frontend-client\n  [grpc_client_config: <grpc_client>]\n\n  # Configures client gRPC connections pool to limits service.\n  pool_config:\n    # How frequently to clean up clients for ingest-limits-frontend that have\n    # gone away.\n    # CLI flag: -ingest-limits-frontend-client.client-cleanup-period\n    [client_cleanup_period: <duration> | default = 15s]\n\n    # Run a health check on each ingest-limits-frontend client during periodic\n    # cleanup.\n    # CLI flag: -ingest-limits-frontend-client.health-check-ingest-limits\n    [health_check_ingest_limits: <boolean> | default = true]\n\n    # Timeout for the health check.\n    # CLI flag: -ingest-limits-frontend-client.remote-timeout\n    [remote_timeout: <duration> | default = 1s]\n\n# Configuration for 'runtime config' module, responsible for reloading runtime\n# configuration file.\n[runtime_config: <runtime_config>]\n\n# These are values which allow you to control aspects of Loki's operation, most\n# commonly used for controlling types of higher verbosity logging, the values\n# here can be overridden in the `configs` section of the `runtime_config` file.\n[operational_config: <operational_config>]\n\n# Configuration for tracing.\n[tracing: <tracing>]\n\n# Configuration for analytics.\n[analytics: <analytics>]\n\n# Configuration for profiling options.\n[profiling: <profiling>]\n\n# List of limit fields to publish from the tenant limits endpoint. If empty, all\n# fields are returned. Use YAML field names (e.g., 'retention_period',\n# 'max_query_series').\n# CLI flag: -limits.tenant-limits-allow-publish\n[tenant_limits_allow_publish: <list of strings> | default = [discover_log_levels discover_service_name log_level_fields max_entries_limit_per_query max_line_size_truncate max_query_bytes_read max_query_length max_query_lookback max_query_range max_query_series metric_aggregation_enabled otlp_config pattern_persistence_enabled query_timeout retention_period retention_stream volume_enabled volume_max_series]]\n\n# Common configuration to be shared between multiple modules. If a more specific\n# configuration is given in other sections, the related configuration within\n# this section will be ignored.\n[common: <common>]\n\n# How long to wait between SIGTERM and shutdown. After receiving SIGTERM, Loki\n# will report 503 Service Unavailable status via /ready endpoint.\n# CLI flag: -shutdown-delay\n[shutdown_delay: <duration> | default = 0s]\n\n# Namespace of the metrics that in previous releases had cortex as namespace.\n# This setting is deprecated and will be removed in the next minor release.\n# CLI flag: -metrics-namespace\n[metrics_namespace: <string> | default = \"loki\"]\n```\n\n### alibabacloud_storage_config\n\nThe `alibabacloud_storage_config` block configures the connection to Alibaba Cloud Storage object storage backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n\u00a0\n\n```yaml\n# Name of OSS bucket.\n# CLI flag: -<prefix>.oss.bucketname\n[bucket: <string> | default = \"\"]\n\n# oss Endpoint to connect to.\n# CLI flag: -<prefix>.oss.endpoint\n[endpoint: <string> | default = \"\"]\n\n# alibabacloud Access Key ID\n# CLI flag: -<prefix>.oss.access-key-id\n[access_key_id: <string> | default = \"\"]\n\n# alibabacloud Secret Access Key\n# CLI flag: -<prefix>.oss.secret-access-key\n[secret_access_key: <string> | default = \"\"]\n\n# Connection timeout in seconds\n# CLI flag: -<prefix>.oss.conn-timeout-sec\n[conn_timeout_sec: <int> | default = 30]\n\n# Read/Write timeout in seconds\n# CLI flag: -<prefix>.oss.read-write-timeout-sec\n[read_write_timeout_sec: <int> | default = 60]\n```\n\n### analytics\n\nConfiguration for `analytics`.\n\n```yaml\n# Enable anonymous usage reporting.\n# CLI flag: -reporting.enabled\n[reporting_enabled: <boolean> | default = true]\n\n# URL to which reports are sent\n# CLI flag: -reporting.usage-stats-url\n[usage_stats_url: <string> | default = \"https://stats.grafana.org/loki-usage-report\"]\n\n# URL to the proxy server\n# CLI flag: -reporting.proxy-url\n[proxy_url: <string> | default = \"\"]\n\n# The TLS configuration.\n# The CLI flags prefix for this block configuration is: reporting.tls-config\n[tls_config: <tls_config>]\n```\n\n### attributes_config\n\nDefine actions for matching OpenTelemetry (OTEL) attributes.\n\n```yaml\n# Configures action to take on matching attributes. It allows one of\n# [structured_metadata, drop] for all attribute types. It additionally allows\n# index_label action for resource attributes\n[action: <string> | default = \"\"]\n\n# List of attributes to configure how to store them or drop them altogether\n[attributes: <list of strings>]\n\n# Regex to choose attributes to configure how to store them or drop them\n# altogether\n[regex: <Regexp>]\n```\n\n### aws_storage_config\n\nThe `aws_storage_config` block configures the connection to dynamoDB and S3 object storage. Either one of them or both can be configured.\n\n```yaml\n# Deprecated: Configures storing indexes in DynamoDB.\ndynamodb:\n  # DynamoDB endpoint URL with escaped Key and Secret encoded. If only region is\n  # specified as a host, proper endpoint will be deduced. Use\n  # inmemory:///<table-name> to use a mock in-memory implementation.\n  # CLI flag: -dynamodb.url\n  [dynamodb_url: <url>]\n\n  # DynamoDB table management requests per second limit.\n  # CLI flag: -dynamodb.api-limit\n  [api_limit: <float> | default = 2]\n\n  # DynamoDB rate cap to back off when throttled.\n  # CLI flag: -dynamodb.throttle-limit\n  [throttle_limit: <float> | default = 10]\n\n  metrics:\n    # Use metrics-based autoscaling, via this query URL\n    # CLI flag: -metrics.url\n    [url: <string> | default = \"\"]\n\n    # Queue length above which we will scale up capacity\n    # CLI flag: -metrics.target-queue-length\n    [target_queue_length: <int> | default = 100000]\n\n    # Scale up capacity by this multiple\n    # CLI flag: -metrics.scale-up-factor\n    [scale_up_factor: <float> | default = 1.3]\n\n    # Ignore throttling below this level (rate per second)\n    # CLI flag: -metrics.ignore-throttle-below\n    [ignore_throttle_below: <float> | default = 1]\n\n    # query to fetch ingester queue length\n    # CLI flag: -metrics.queue-length-query\n    [queue_length_query: <string> | default = \"sum(avg_over_time(loki_ingester_flush_queue_length{job=\\\"cortex/ingester\\\"}[2m])) or sum(avg_over_time(cortex_ingester_flush_queue_length{job=\\\"cortex/ingester\\\"}[2m]))\"]\n\n    # query to fetch throttle rates per table\n    # CLI flag: -metrics.write-throttle-query\n    [write_throttle_query: <string> | default = \"sum(rate(cortex_dynamo_throttled_total{operation=\\\"DynamoDB.BatchWriteItem\\\"}[1m])) by (table) > 0\"]\n\n    # query to fetch write capacity usage per table\n    # CLI flag: -metrics.usage-query\n    [write_usage_query: <string> | default = \"sum(rate(cortex_dynamo_consumed_capacity_total{operation=\\\"DynamoDB.BatchWriteItem\\\"}[15m])) by (table) > 0\"]\n\n    # query to fetch read capacity usage per table\n    # CLI flag: -metrics.read-usage-query\n    [read_usage_query: <string> | default = \"sum(rate(cortex_dynamo_consumed_capacity_total{operation=\\\"DynamoDB.QueryPages\\\"}[1h])) by (table) > 0\"]\n\n    # query to fetch read errors per table\n    # CLI flag: -metrics.read-error-query\n    [read_error_query: <string> | default = \"sum(increase(cortex_dynamo_failures_total{operation=\\\"DynamoDB.QueryPages\\\",error=\\\"ProvisionedThroughputExceededException\\\"}[1m])) by (table) > 0\"]\n\n  # Number of chunks to group together to parallelise fetches (zero to disable)\n  # CLI flag: -dynamodb.chunk-gang-size\n  [chunk_gang_size: <int> | default = 10]\n\n  # Max number of chunk-get operations to start in parallel\n  # CLI flag: -dynamodb.chunk.get-max-parallelism\n  [chunk_get_max_parallelism: <int> | default = 32]\n\n  backoff_config:\n    # Minimum backoff time\n    # CLI flag: -dynamodb.min-backoff\n    [min_period: <duration> | default = 100ms]\n\n    # Maximum backoff time\n    # CLI flag: -dynamodb.max-backoff\n    [max_period: <duration> | default = 50s]\n\n    # Maximum number of times to retry an operation\n    # CLI flag: -dynamodb.max-retries\n    [max_retries: <int> | default = 20]\n\n  # KMS key used for encrypting DynamoDB items.  DynamoDB will use an Amazon\n  # owned KMS key if not provided.\n  # CLI flag: -dynamodb.kms-key-id\n  [kms_key_id: <string> | default = \"\"]\n\n# The s3_storage_config block configures the connection to Amazon S3 object\n# storage backend.\n[<s3_storage_config>]\n```\n\n### azure_storage_config\n\nThe `azure_storage_config` block configures the connection to Azure object storage backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n\u00a0\n\n```yaml\n# Azure Cloud environment. Supported values are: AzureGlobal, AzureChinaCloud,\n# AzureGermanCloud, AzureUSGovernment.\n# CLI flag: -<prefix>.azure.environment\n[environment: <string> | default = \"AzureGlobal\"]\n\n# Azure storage account name.\n# CLI flag: -<prefix>.azure.account-name\n[account_name: <string> | default = \"\"]\n\n# Azure storage account key.\n# CLI flag: -<prefix>.azure.account-key\n[account_key: <string> | default = \"\"]\n\n# If `connection-string` is set, the values of `account-name` and\n# `endpoint-suffix` values will not be used. Use this method over `account-key`\n# if you need to authenticate via a SAS token. Or if you use the Azurite\n# emulator.\n# CLI flag: -<prefix>.azure.connection-string\n[connection_string: <string> | default = \"\"]\n\n# Name of the storage account blob container used to store chunks. This\n# container must be created before running cortex.\n# CLI flag: -<prefix>.azure.container-name\n[container_name: <string> | default = \"loki\"]\n\n# Azure active directory endpoint override. Use when the Azure SDK does not\n# support your environment.\n# CLI flag: -<prefix>.azure.active-directory-endpoint\n[active_directory_endpoint: <string> | default = \"\"]\n\n# Azure storage endpoint suffix without schema. The storage account name will be\n# prefixed to this value to create the FQDN.\n# CLI flag: -<prefix>.azure.endpoint-suffix\n[endpoint_suffix: <string> | default = \"\"]\n\n# Use Managed Identity to authenticate to the Azure storage account.\n# CLI flag: -<prefix>.azure.use-managed-identity\n[use_managed_identity: <boolean> | default = false]\n\n# Use Federated Token to authenticate to the Azure storage account.\n# CLI flag: -<prefix>.azure.use-federated-token\n[use_federated_token: <boolean> | default = false]\n\n# User assigned identity ID to authenticate to the Azure storage account.\n# CLI flag: -<prefix>.azure.user-assigned-id\n[user_assigned_id: <string> | default = \"\"]\n\n# Use Service Principal to authenticate through Azure OAuth.\n# CLI flag: -<prefix>.azure.use-service-principal\n[use_service_principal: <boolean> | default = false]\n\n# Azure Service Principal ID(GUID).\n# CLI flag: -<prefix>.azure.client-id\n[client_id: <string> | default = \"\"]\n\n# Azure Service Principal secret key.\n# CLI flag: -<prefix>.azure.client-secret\n[client_secret: <string> | default = \"\"]\n\n# Azure Tenant ID is used to authenticate through Azure OAuth.\n# CLI flag: -<prefix>.azure.tenant-id\n[tenant_id: <string> | default = \"\"]\n\n# Chunk delimiter for blob ID to be used\n# CLI flag: -<prefix>.azure.chunk-delimiter\n[chunk_delimiter: <string> | default = \"-\"]\n\n# Preallocated buffer size for downloads.\n# CLI flag: -<prefix>.azure.download-buffer-size\n[download_buffer_size: <int> | default = 512000]\n\n# Preallocated buffer size for uploads.\n# CLI flag: -<prefix>.azure.upload-buffer-size\n[upload_buffer_size: <int> | default = 256000]\n\n# Number of buffers used to used to upload a chunk.\n# CLI flag: -<prefix>.azure.download-buffer-count\n[upload_buffer_count: <int> | default = 1]\n\n# Timeout for requests made against azure blob storage.\n# CLI flag: -<prefix>.azure.request-timeout\n[request_timeout: <duration> | default = 30s]\n\n# Number of retries for a request which times out.\n# CLI flag: -<prefix>.azure.max-retries\n[max_retries: <int> | default = 5]\n\n# Minimum time to wait before retrying a request.\n# CLI flag: -<prefix>.azure.min-retry-delay\n[min_retry_delay: <duration> | default = 10ms]\n\n# Maximum time to wait before retrying a request.\n# CLI flag: -<prefix>.azure.max-retry-delay\n[max_retry_delay: <duration> | default = 500ms]\n```\n\n### bloom_build\n\nExperimental: The `bloom_build` block configures the Loki bloom planner and builder servers, responsible for building bloom filters.\n\n```yaml\n# Flag to enable or disable the usage of the bloom-planner and bloom-builder\n# components.\n# CLI flag: -bloom-build.enabled\n[enabled: <boolean> | default = false]\n\nplanner:\n  # Interval at which to re-run the bloom creation planning.\n  # CLI flag: -bloom-build.planner.interval\n  [planning_interval: <duration> | default = 8h]\n\n  # Newest day-table offset (from today, inclusive) to build blooms for. 0 start\n  # building from today, 1 from yesterday and so on. Increase to lower cost by\n  # not re-writing data to object storage too frequently since recent data\n  # changes more often at the cost of not having blooms available as quickly.\n  # CLI flag: -bloom-build.planner.min-table-offset\n  [min_table_offset: <int> | default = 0]\n\n  # Oldest day-table offset (from today, inclusive) to build blooms for. 1 till\n  # yesterday, 2 till day before yesterday and so on. This can be used to lower\n  # cost by not trying to build blooms for older data which doesn't change. This\n  # can be optimized by aligning it with the maximum\n  # `reject_old_samples_max_age` setting of any tenant.\n  # CLI flag: -bloom-build.planner.max-table-offset\n  [max_table_offset: <int> | default = 1]\n\n  retention:\n    # Enable bloom retention.\n    # CLI flag: -bloom-build.planner.retention.enabled\n    [enabled: <boolean> | default = false]\n\n  queue:\n    # Maximum number of tasks to queue per tenant.\n    # CLI flag: -bloom-build.planner.queue.max-tasks-per-tenant\n    [max_queued_tasks_per_tenant: <int> | default = 30000]\n\n    # Whether to store tasks on disk.\n    # CLI flag: -bloom-build.planner.queue.store-tasks-on-disk\n    [store_tasks_on_disk: <boolean> | default = false]\n\n    # Directory to store tasks on disk.\n    # CLI flag: -bloom-build.planner.queue.tasks-disk-directory\n    [tasks_disk_directory: <string> | default = \"/tmp/bloom-planner-queue\"]\n\n    # Whether to clean the tasks directory on startup.\n    # CLI flag: -bloom-build.planner.queue.clean-tasks-directory\n    [clean_tasks_directory: <boolean> | default = false]\n\nbuilder:\n  # The grpc_client block configures the gRPC client used to communicate between\n  # a client and server component in Loki.\n  # The CLI flags prefix for this block configuration is:\n  # bloom-build.builder.grpc\n  [grpc_config: <grpc_client>]\n\n  # Hostname (and port) of the bloom planner\n  # CLI flag: -bloom-build.builder.planner-address\n  [planner_address: <string> | default = \"\"]\n\n  backoff_config:\n    # Minimum delay when backing off.\n    # CLI flag: -bloom-build.builder.backoff.backoff-min-period\n    [min_period: <duration> | default = 100ms]\n\n    # Maximum delay when backing off.\n    # CLI flag: -bloom-build.builder.backoff.backoff-max-period\n    [max_period: <duration> | default = 10s]\n\n    # Number of times to backoff and retry before failing.\n    # CLI flag: -bloom-build.builder.backoff.backoff-retries\n    [max_retries: <int> | default = 10]\n```\n\n### bloom_gateway\n\nExperimental: The `bloom_gateway` block configures the Loki bloom gateway server, responsible for serving queries for filtering chunks based on filter expressions.\n\n```yaml\n# Flag to enable or disable the bloom gateway component globally.\n# CLI flag: -bloom-gateway.enabled\n[enabled: <boolean> | default = false]\n\nclient:\n  # Configures the behavior of the connection pool.\n  pool_config:\n    # How frequently to update the list of servers.\n    # CLI flag: -bloom-gateway-client.pool.check-interval\n    [check_interval: <duration> | default = 15s]\n\n  # The grpc_client block configures the gRPC client used to communicate between\n  # a client and server component in Loki.\n  # The CLI flags prefix for this block configuration is:\n  # bloom-gateway-client.grpc\n  [grpc_client_config: <grpc_client>]\n\n  # Comma separated addresses list in DNS Service Discovery format:\n  # https://grafana.com/docs/mimir/latest/configure/about-dns-service-discovery/#supported-discovery-modes\n  # CLI flag: -bloom-gateway-client.addresses\n  [addresses: <string> | default = \"\"]\n\n# Number of workers to use for filtering chunks concurrently. Usually set to 1x\n# number of CPU cores.\n# CLI flag: -bloom-gateway.worker-concurrency\n[worker_concurrency: <int> | default = 4]\n\n# Number of blocks processed concurrently on a single worker. Usually set to 2x\n# number of CPU cores.\n# CLI flag: -bloom-gateway.block-query-concurrency\n[block_query_concurrency: <int> | default = 8]\n\n# Maximum number of outstanding tasks per tenant.\n# CLI flag: -bloom-gateway.max-outstanding-per-tenant\n[max_outstanding_per_tenant: <int> | default = 1024]\n\n# How many tasks are multiplexed at once.\n# CLI flag: -bloom-gateway.num-multiplex-tasks\n[num_multiplex_tasks: <int> | default = 512]\n```\n\n### bos_storage_config\n\nThe `bos_storage_config` block configures the connection to Baidu Object Storage (BOS) object storage backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n\u00a0\n\n```yaml\n# Name of BOS bucket.\n# CLI flag: -<prefix>.bos.bucket-name\n[bucket_name: <string> | default = \"\"]\n\n# BOS endpoint to connect to.\n# CLI flag: -<prefix>.bos.endpoint\n[endpoint: <string> | default = \"bj.bcebos.com\"]\n\n# Baidu Cloud Engine (BCE) Access Key ID.\n# CLI flag: -<prefix>.bos.access-key-id\n[access_key_id: <string> | default = \"\"]\n\n# Baidu Cloud Engine (BCE) Secret Access Key.\n# CLI flag: -<prefix>.bos.secret-access-key\n[secret_access_key: <string> | default = \"\"]\n```\n\n### cache_config\n\nThe `cache_config` block configures the cache backend for a specific Loki component. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `bloom.metas-cache`\n- `frontend`\n- `frontend.index-stats-results-cache`\n- `frontend.instant-metric-results-cache`\n- `frontend.label-results-cache`\n- `frontend.series-results-cache`\n- `frontend.volume-results-cache`\n- `store.chunks-cache`\n- `store.chunks-cache-l2`\n- `store.index-cache-read`\n- `store.index-cache-write`\n\n\u00a0\n\n```yaml\n# The default validity of entries for caches unless overridden.\n# CLI flag: -<prefix>.default-validity\n[default_validity: <duration> | default = 1h]\n\nbackground:\n  # At what concurrency to write back to cache.\n  # CLI flag: -<prefix>.background.write-back-concurrency\n  [writeback_goroutines: <int> | default = 1]\n\n  # How many key batches to buffer for background write-back. Default is large\n  # to prefer size based limiting.\n  # CLI flag: -<prefix>.background.write-back-buffer\n  [writeback_buffer: <int> | default = 500000]\n\n  # Size limit in bytes for background write-back.\n  # CLI flag: -<prefix>.background.write-back-size-limit\n  [writeback_size_limit: <int> | default = 500MB]\n\nmemcached:\n  # How long keys stay in the memcache.\n  # CLI flag: -<prefix>.memcached.expiration\n  [expiration: <duration> | default = 0s]\n\n  # How many keys to fetch in each batch.\n  # CLI flag: -<prefix>.memcached.batchsize\n  [batch_size: <int> | default = 4]\n\n  # Maximum active requests to memcache.\n  # CLI flag: -<prefix>.memcached.parallelism\n  [parallelism: <int> | default = 5]\n\nmemcached_client:\n  # Hostname for memcached service to use. If empty and if addresses is unset,\n  # no memcached will be used.\n  # CLI flag: -<prefix>.memcached.hostname\n  [host: <string> | default = \"\"]\n\n  # SRV service used to discover memcache servers.\n  # CLI flag: -<prefix>.memcached.service\n  [service: <string> | default = \"memcached\"]\n\n  # Comma separated addresses list in DNS Service Discovery format:\n  # https://grafana.com/docs/mimir/latest/configure/about-dns-service-discovery/#supported-discovery-modes\n  # CLI flag: -<prefix>.memcached.addresses\n  [addresses: <string> | default = \"\"]\n\n  # Maximum time to wait before giving up on memcached requests.\n  # CLI flag: -<prefix>.memcached.timeout\n  [timeout: <duration> | default = 100ms]\n\n  # Maximum number of idle connections in pool.\n  # CLI flag: -<prefix>.memcached.max-idle-conns\n  [max_idle_conns: <int> | default = 16]\n\n  # The maximum size of an item stored in memcached. Bigger items are not\n  # stored. If set to 0, no maximum size is enforced.\n  # CLI flag: -<prefix>.memcached.max-item-size\n  [max_item_size: <int> | default = 0]\n\n  # Period with which to poll DNS for memcache servers.\n  # CLI flag: -<prefix>.memcached.update-interval\n  [update_interval: <duration> | default = 1m]\n\n  # Use consistent hashing to distribute to memcache servers.\n  # CLI flag: -<prefix>.memcached.consistent-hash\n  [consistent_hash: <boolean> | default = true]\n\n  # Trip circuit-breaker after this number of consecutive dial failures (if zero\n  # then circuit-breaker is disabled).\n  # CLI flag: -<prefix>.memcached.circuit-breaker-consecutive-failures\n  [circuit_breaker_consecutive_failures: <int> | default = 10]\n\n  # Duration circuit-breaker remains open after tripping (if zero then 60\n  # seconds is used).\n  # CLI flag: -<prefix>.memcached.circuit-breaker-timeout\n  [circuit_breaker_timeout: <duration> | default = 10s]\n\n  # Reset circuit-breaker counts after this long (if zero then never reset).\n  # CLI flag: -<prefix>.memcached.circuit-breaker-interval\n  [circuit_breaker_interval: <duration> | default = 10s]\n\n  # Enable connecting to Memcached with TLS.\n  # CLI flag: -<prefix>.memcached.tls-enabled\n  [tls_enabled: <boolean> | default = false]\n\n  # The TLS configuration.\n  # The CLI flags prefix for this block configuration is:\n  # store.index-cache-write.memcached\n  [<tls_config>]\n\nredis:\n  # Redis Server or Cluster configuration endpoint to use for caching. A\n  # comma-separated list of endpoints for Redis Cluster or Redis Sentinel. If\n  # empty, no redis will be used.\n  # CLI flag: -<prefix>.redis.endpoint\n  [endpoint: <string> | default = \"\"]\n\n  # Redis Sentinel master name. An empty string for Redis Server or Redis\n  # Cluster.\n  # CLI flag: -<prefix>.redis.master-name\n  [master_name: <string> | default = \"\"]\n\n  # Maximum time to wait before giving up on redis requests.\n  # CLI flag: -<prefix>.redis.timeout\n  [timeout: <duration> | default = 500ms]\n\n  # How long keys stay in the redis.\n  # CLI flag: -<prefix>.redis.expiration\n  [expiration: <duration> | default = 0s]\n\n  # Database index.\n  # CLI flag: -<prefix>.redis.db\n  [db: <int> | default = 0]\n\n  # Maximum number of connections in the pool.\n  # CLI flag: -<prefix>.redis.pool-size\n  [pool_size: <int> | default = 0]\n\n  # Username to use when connecting to redis.\n  # CLI flag: -<prefix>.redis.username\n  [username: <string> | default = \"\"]\n\n  # Password to use when connecting to redis.\n  # CLI flag: -<prefix>.redis.password\n  [password: <string> | default = \"\"]\n\n  # Enable connecting to redis with TLS.\n  # CLI flag: -<prefix>.redis.tls-enabled\n  [tls_enabled: <boolean> | default = false]\n\n  # Skip validating server certificate.\n  # CLI flag: -<prefix>.redis.tls-insecure-skip-verify\n  [tls_insecure_skip_verify: <boolean> | default = false]\n\n  # Close connections after remaining idle for this duration. If the value is\n  # zero, then idle connections are not closed.\n  # CLI flag: -<prefix>.redis.idle-timeout\n  [idle_timeout: <duration> | default = 0s]\n\n  # Close connections older than this duration. If the value is zero, then the\n  # pool does not close connections based on age.\n  # CLI flag: -<prefix>.redis.max-connection-age\n  [max_connection_age: <duration> | default = 0s]\n\n  # By default, the Redis client only reads from the master node. Enabling this\n  # option can lower pressure on the master node by randomly routing read-only\n  # commands to the master and any available replicas.\n  # CLI flag: -<prefix>.redis.route-randomly\n  [route_randomly: <boolean> | default = false]\n\nembedded_cache:\n  # Whether embedded cache is enabled.\n  # CLI flag: -<prefix>.embedded-cache.enabled\n  [enabled: <boolean> | default = false]\n\n  # Maximum memory size of the cache in MB.\n  # CLI flag: -<prefix>.embedded-cache.max-size-mb\n  [max_size_mb: <int> | default = 100]\n\n  # Maximum number of entries in the cache.\n  # CLI flag: -<prefix>.embedded-cache.max-size-items\n  [max_size_items: <int> | default = 0]\n\n  # The time to live for items in the cache before they get purged.\n  # CLI flag: -<prefix>.embedded-cache.ttl\n  [ttl: <duration> | default = 1h]\n```\n\n### chunk_store_config\n\nThe `chunk_store_config` block configures how chunks will be cached and how long to wait before saving them to the backing store.\n\n```yaml\n# The cache_config block configures the cache backend for a specific Loki\n# component.\n# The CLI flags prefix for this block configuration is: store.chunks-cache\n[chunk_cache_config: <cache_config>]\n\n# The cache_config block configures the cache backend for a specific Loki\n# component.\n# The CLI flags prefix for this block configuration is: store.chunks-cache-l2\n[chunk_cache_config_l2: <cache_config>]\n\n# Write dedupe cache is deprecated along with legacy index types (aws,\n# aws-dynamo, bigtable, bigtable-hashed, cassandra, gcp, gcp-columnkey,\n# grpc-store).\n# Consider using TSDB index which does not require a write dedupe cache.\n# The CLI flags prefix for this block configuration is: store.index-cache-write\n[write_dedupe_cache_config: <cache_config>]\n\n# Chunks fetched from queriers before this duration will not be written to the\n# cache. A value of 0 will write all chunks to the cache\n# CLI flag: -store.skip-query-writeback-older-than\n[skip_query_writeback_cache_older_than: <duration> | default = 0s]\n\n# Chunks will be handed off to the L2 cache after this duration. 0 to disable L2\n# cache.\n# CLI flag: -store.chunks-cache-l2.handoff\n[l2_chunk_cache_handoff: <duration> | default = 0s]\n\n# Cache index entries older than this period. 0 to disable.\n# CLI flag: -store.cache-lookups-older-than\n[cache_lookups_older_than: <duration> | default = 0s]\n```\n\n### common\n\nCommon configuration to be shared between multiple modules. If a more specific configuration is given in other sections, the related configuration within this section will be ignored.\n\n```yaml\n# prefix for the path\n# CLI flag: -common.path-prefix\n[path_prefix: <string> | default = \"\"]\n\nstorage:\n  # The s3_storage_config block configures the connection to Amazon S3 object\n  # storage backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [s3: <s3_storage_config>]\n\n  # The gcs_storage_config block configures the connection to Google Cloud\n  # Storage object storage backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [gcs: <gcs_storage_config>]\n\n  # The azure_storage_config block configures the connection to Azure object\n  # storage backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [azure: <azure_storage_config>]\n\n  # The alibabacloud_storage_config block configures the connection to Alibaba\n  # Cloud Storage object storage backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [alibabacloud: <alibabacloud_storage_config>]\n\n  # The bos_storage_config block configures the connection to Baidu Object\n  # Storage (BOS) object storage backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [bos: <bos_storage_config>]\n\n  # The swift_storage_config block configures the connection to OpenStack Object\n  # Storage (Swift) object storage backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [swift: <swift_storage_config>]\n\n  filesystem:\n    # Directory to store chunks in.\n    # CLI flag: -common.storage.filesystem.chunk-directory\n    [chunks_directory: <string> | default = \"\"]\n\n    # Directory to store rules in.\n    # CLI flag: -common.storage.filesystem.rules-directory\n    [rules_directory: <string> | default = \"\"]\n\n  hedging:\n    # If set to a non-zero value a second request will be issued at the provided\n    # duration. Default is 0 (disabled)\n    # CLI flag: -common.storage.hedge-requests-at\n    [at: <duration> | default = 0s]\n\n    # The maximum of hedge requests allowed.\n    # CLI flag: -common.storage.hedge-requests-up-to\n    [up_to: <int> | default = 2]\n\n    # The maximum of hedge requests allowed per seconds.\n    # CLI flag: -common.storage.hedge-max-per-second\n    [max_per_second: <int> | default = 5]\n\n  # The cos_storage_config block configures the connection to IBM Cloud Object\n  # Storage (COS) backend.\n  # The CLI flags prefix for this block configuration is: common.storage\n  [cos: <cos_storage_config>]\n\n  congestion_control:\n    # Use storage congestion control (default: disabled).\n    # CLI flag: -common.storage.congestion-control.enabled\n    [enabled: <boolean> | default = false]\n\n    controller:\n      # Congestion control strategy to use (default: none, options: 'aimd').\n      # CLI flag: -common.storage.congestion-control.strategy\n      [strategy: <string> | default = \"\"]\n\n      aimd:\n        # AIMD starting throughput window size: how many requests can be sent\n        # per second (default: 2000).\n        # CLI flag: -common.storage.congestion-control.strategy.aimd.start\n        [start: <int> | default = 2000]\n\n        # AIMD maximum throughput window size: upper limit of requests sent per\n        # second (default: 10000).\n        # CLI flag: -common.storage.congestion-control.strategy.aimd.upper-bound\n        [upper_bound: <int> | default = 10000]\n\n        # AIMD backoff factor when upstream service is throttled to decrease\n        # number of requests sent per second (default: 0.5).\n        # CLI flag: -common.storage.congestion-control.strategy.aimd.backoff-factor\n        [backoff_factor: <float> | default = 0.5]\n\n    retry:\n      # Congestion control retry strategy to use (default: none, options:\n      # 'limited').\n      # CLI flag: -common.storage.congestion-control.retry.strategy\n      [strategy: <string> | default = \"\"]\n\n      # Maximum number of retries allowed.\n      # CLI flag: -common.storage.congestion-control.retry.strategy.limited.limit\n      [limit: <int> | default = 2]\n\n    hedging:\n      config:\n        [at: <duration>]\n\n        [up_to: <int>]\n\n        [max_per_second: <int>]\n\n      # Congestion control hedge strategy to use (default: none, options:\n      # 'limited').\n      # CLI flag: -common.storage.congestion-control.hedge.strategy\n      [strategy: <string> | default = \"\"]\n\n  # The thanos_object_store_config block configures the connection to object\n  # storage backend using thanos-io/objstore clients. This will become the\n  # default way of configuring object store clients in future releases.\n  # Currently this is opt-in and takes effect only when `-use-thanos-objstore`\n  # is set to true.\n  # The CLI flags prefix for this block configuration is:\n  # common.storage.object-store\n  [object_store: <thanos_object_store_config>]\n\n[persist_tokens: <boolean>]\n\n[replication_factor: <int>]\n\nring:\n  kvstore:\n    # Backend storage to use for the ring. Supported values are: consul, etcd,\n    # inmemory, memberlist, multi.\n    # CLI flag: -common.storage.ring.store\n    [store: <string> | default = \"consul\"]\n\n    # The prefix for the keys in the store. Should end with a /.\n    # CLI flag: -common.storage.ring.prefix\n    [prefix: <string> | default = \"collectors/\"]\n\n    # Configuration for a Consul client. Only applies if the selected kvstore is\n    # consul.\n    # The CLI flags prefix for this block configuration is: common.storage.ring\n    [consul: <consul>]\n\n    # Configuration for an ETCD v3 client. Only applies if the selected kvstore\n    # is etcd.\n    # The CLI flags prefix for this block configuration is: common.storage.ring\n    [etcd: <etcd>]\n\n    multi:\n      # Primary backend storage used by multi-client.\n      # CLI flag: -common.storage.ring.multi.primary\n      [primary: <string> | default = \"\"]\n\n      # Secondary backend storage used by multi-client.\n      # CLI flag: -common.storage.ring.multi.secondary\n      [secondary: <string> | default = \"\"]\n\n      # Mirror writes to the secondary store.\n      # CLI flag: -common.storage.ring.multi.mirror-enabled\n      [mirror_enabled: <boolean> | default = false]\n\n      # Timeout for storing a value to the secondary store.\n      # CLI flag: -common.storage.ring.multi.mirror-timeout\n      [mirror_timeout: <duration> | default = 2s]\n\n  # Period at which to heartbeat to the ring.\n  # CLI flag: -common.storage.ring.heartbeat-period\n  [heartbeat_period: <duration> | default = 15s]\n\n  # The heartbeat timeout after which compactors are considered unhealthy within\n  # the ring. 0 = never (timeout disabled).\n  # CLI flag: -common.storage.ring.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # File path where tokens are stored. If empty, tokens are not stored at\n  # shutdown and restored at startup.\n  # CLI flag: -common.storage.ring.tokens-file-path\n  [tokens_file_path: <string> | default = \"\"]\n\n  # True to enable zone-awareness and replicate blocks across different\n  # availability zones.\n  # CLI flag: -common.storage.ring.zone-awareness-enabled\n  [zone_awareness_enabled: <boolean> | default = false]\n\n  # Number of tokens to own in the ring.\n  # CLI flag: -common.storage.ring.num-tokens\n  [num_tokens: <int> | default = 128]\n\n  # Factor for data replication.\n  # CLI flag: -common.storage.ring.replication-factor\n  [replication_factor: <int> | default = 3]\n\n  # Instance ID to register in the ring.\n  # CLI flag: -common.storage.ring.instance-id\n  [instance_id: <string> | default = \"<hostname>\"]\n\n  # Name of network interface to read address from.\n  # CLI flag: -common.storage.ring.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # Port to advertise in the ring (defaults to server.grpc-listen-port).\n  # CLI flag: -common.storage.ring.instance-port\n  [instance_port: <int> | default = 0]\n\n  # IP address to advertise in the ring.\n  # CLI flag: -common.storage.ring.instance-addr\n  [instance_addr: <string> | default = \"\"]\n\n  # The availability zone where this instance is running. Required if\n  # zone-awareness is enabled.\n  # CLI flag: -common.storage.ring.instance-availability-zone\n  [instance_availability_zone: <string> | default = \"\"]\n\n  # Enable using a IPv6 instance address.\n  # CLI flag: -common.storage.ring.instance-enable-ipv6\n  [instance_enable_ipv6: <boolean> | default = false]\n\n[instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n[instance_addr: <string> | default = \"\"]\n\n# the http address of the compactor in the form http://host:port\n# CLI flag: -common.compactor-address\n[compactor_address: <string> | default = \"\"]\n\n# the grpc address of the compactor in the form host:port\n# CLI flag: -common.compactor-grpc-address\n[compactor_grpc_address: <string> | default = \"\"]\n\n# Experimental: path to use for temporary data, where scratch data is supported.\n# CLI flag: -common.scratch-path\n[scratch_path: <string> | default = \"\"]\n```\n\n### compactor\n\nThe `compactor` block configures the compactor component, which compacts index shards for performance.\n\n```yaml\n# Directory where files can be downloaded for compaction.\n# CLI flag: -compactor.working-directory\n[working_directory: <string> | default = \"/var/loki/compactor\"]\n\n# Interval at which to re-run the compaction operation.\n# CLI flag: -compactor.compaction-interval\n[compaction_interval: <duration> | default = 10m]\n\n# Interval at which to apply/enforce retention. 0 means run at same interval as\n# compaction. If non-zero, it should always be a multiple of compaction\n# interval.\n# CLI flag: -compactor.apply-retention-interval\n[apply_retention_interval: <duration> | default = 0s]\n\n# Activate custom (per-stream,per-tenant) retention.\n# CLI flag: -compactor.retention-enabled\n[retention_enabled: <boolean> | default = false]\n\n# Delay after which chunks will be fully deleted during retention.\n# CLI flag: -compactor.retention-delete-delay\n[retention_delete_delay: <duration> | default = 2h]\n\n# The total amount of worker to use to delete chunks.\n# CLI flag: -compactor.retention-delete-worker-count\n[retention_delete_worker_count: <int> | default = 150]\n\n# The maximum amount of time to spend running retention and deletion on any\n# given table in the index.\n# CLI flag: -compactor.retention-table-timeout\n[retention_table_timeout: <duration> | default = 0s]\n\nretention_backoff_config:\n  # Minimum delay when backing off.\n  # CLI flag: -compactor.retention-backoff-config.backoff-min-period\n  [min_period: <duration> | default = 100ms]\n\n  # Maximum delay when backing off.\n  # CLI flag: -compactor.retention-backoff-config.backoff-max-period\n  [max_period: <duration> | default = 10s]\n\n  # Number of times to backoff and retry before failing.\n  # CLI flag: -compactor.retention-backoff-config.backoff-retries\n  [max_retries: <int> | default = 10]\n\n# Store used for managing delete requests.\n# CLI flag: -compactor.delete-request-store\n[delete_request_store: <string> | default = \"\"]\n\n# Path prefix for storing delete requests.\n# CLI flag: -compactor.delete-request-store.key-prefix\n[delete_request_store_key_prefix: <string> | default = \"index/\"]\n\n# Type of DB to use for storing delete requests. Supported types: boltdb, sqlite\n# CLI flag: -compactor.delete-request-store.db-type\n[delete_request_store_db_type: <string> | default = \"boltdb\"]\n\n# Type of DB to use as backup for storing delete requests. Backup DB should\n# ideally be used while migrating from one DB type to another. Supported\n# type(s): boltdb\n# CLI flag: -compactor.delete-request-store.backup-db-type\n[backup_delete_request_store_db_type: <string> | default = \"\"]\n\n# The max number of delete requests to run per compaction cycle.\n# CLI flag: -compactor.delete-batch-size\n[delete_batch_size: <int> | default = 70]\n\n# Allow cancellation of delete request until duration after they are created.\n# Data would be deleted only after delete requests have been older than this\n# duration. Ideally this should be set to at least 24h.\n# CLI flag: -compactor.delete-request-cancel-period\n[delete_request_cancel_period: <duration> | default = 24h]\n\n# Constrain the size of any single delete request with line filters. When a\n# delete request > delete_max_interval is input, the request is sharded into\n# smaller requests of no more than delete_max_interval\n# CLI flag: -compactor.delete-max-interval\n[delete_max_interval: <duration> | default = 24h]\n\n# Maximum number of tables to compact in parallel. While increasing this value,\n# please make sure compactor has enough disk space allocated to be able to store\n# and compact as many tables.\n# CLI flag: -compactor.max-compaction-parallelism\n[max_compaction_parallelism: <int> | default = 1]\n\n# Number of upload/remove operations to execute in parallel when finalizing a\n# compaction. NOTE: This setting is per compaction operation, which can be\n# executed in parallel. The upper bound on the number of concurrent uploads is\n# upload_parallelism * max_compaction_parallelism.\n# CLI flag: -compactor.upload-parallelism\n[upload_parallelism: <int> | default = 10]\n\n# The hash ring configuration used by compactors to elect a single instance for\n# running compactions. The CLI flags prefix for this block config is:\n# compactor.ring\ncompactor_ring:\n  kvstore:\n    # Backend storage to use for the ring. Supported values are: consul, etcd,\n    # inmemory, memberlist, multi.\n    # CLI flag: -compactor.ring.store\n    [store: <string> | default = \"consul\"]\n\n    # The prefix for the keys in the store. Should end with a /.\n    # CLI flag: -compactor.ring.prefix\n    [prefix: <string> | default = \"collectors/\"]\n\n    # Configuration for a Consul client. Only applies if the selected kvstore is\n    # consul.\n    # The CLI flags prefix for this block configuration is: compactor.ring\n    [consul: <consul>]\n\n    # Configuration for an ETCD v3 client. Only applies if the selected kvstore\n    # is etcd.\n    # The CLI flags prefix for this block configuration is: compactor.ring\n    [etcd: <etcd>]\n\n    multi:\n      # Primary backend storage used by multi-client.\n      # CLI flag: -compactor.ring.multi.primary\n      [primary: <string> | default = \"\"]\n\n      # Secondary backend storage used by multi-client.\n      # CLI flag: -compactor.ring.multi.secondary\n      [secondary: <string> | default = \"\"]\n\n      # Mirror writes to the secondary store.\n      # CLI flag: -compactor.ring.multi.mirror-enabled\n      [mirror_enabled: <boolean> | default = false]\n\n      # Timeout for storing a value to the secondary store.\n      # CLI flag: -compactor.ring.multi.mirror-timeout\n      [mirror_timeout: <duration> | default = 2s]\n\n  # Period at which to heartbeat to the ring.\n  # CLI flag: -compactor.ring.heartbeat-period\n  [heartbeat_period: <duration> | default = 15s]\n\n  # The heartbeat timeout after which compactors are considered unhealthy within\n  # the ring. 0 = never (timeout disabled).\n  # CLI flag: -compactor.ring.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # File path where tokens are stored. If empty, tokens are not stored at\n  # shutdown and restored at startup.\n  # CLI flag: -compactor.ring.tokens-file-path\n  [tokens_file_path: <string> | default = \"\"]\n\n  # True to enable zone-awareness and replicate blocks across different\n  # availability zones.\n  # CLI flag: -compactor.ring.zone-awareness-enabled\n  [zone_awareness_enabled: <boolean> | default = false]\n\n  # Instance ID to register in the ring.\n  # CLI flag: -compactor.ring.instance-id\n  [instance_id: <string> | default = \"<hostname>\"]\n\n  # Name of network interface to read address from.\n  # CLI flag: -compactor.ring.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # Port to advertise in the ring (defaults to server.grpc-listen-port).\n  # CLI flag: -compactor.ring.instance-port\n  [instance_port: <int> | default = 0]\n\n  # IP address to advertise in the ring.\n  # CLI flag: -compactor.ring.instance-addr\n  [instance_addr: <string> | default = \"\"]\n\n  # The availability zone where this instance is running. Required if\n  # zone-awareness is enabled.\n  # CLI flag: -compactor.ring.instance-availability-zone\n  [instance_availability_zone: <string> | default = \"\"]\n\n  # Enable using a IPv6 instance address.\n  # CLI flag: -compactor.ring.instance-enable-ipv6\n  [instance_enable_ipv6: <boolean> | default = false]\n\n# Number of tables that compactor will try to compact. Newer tables are chosen\n# when this is less than the number of tables available.\n# CLI flag: -compactor.tables-to-compact\n[tables_to_compact: <int> | default = 0]\n\n# Do not compact N latest tables. Together with -compactor.run-once and\n# -compactor.tables-to-compact, this is useful when clearing compactor backlogs.\n# CLI flag: -compactor.skip-latest-n-tables\n[skip_latest_n_tables: <int> | default = 0]\n\n# Experimental: Configuration to turn on and run horizontally scalable\n# compactor. Supported modes - [disabled]: Keeps the horizontal scaling mode\n# disabled. Locally runs all the functions of the compactor.[main]: Runs all\n# functions of the compactor. Distributes work to workers where\n# possible.[worker]: Runs the compactor in worker mode, only working on jobs\n# built by the main compactor.\n# CLI flag: -compactor.horizontal-scaling-mode\n[horizontal_scaling_mode: <string> | default = \"disabled\"]\n\nworker_config:\n  # Number of sub-workers to run for concurrent processing of jobs.\n  # CLI flag: -compactor.worker.num-sub-workers\n  [num_sub_workers: <int> | default = 4]\n\njobs_config:\n  deletion:\n    # Object storage path prefix for storing deletion manifests.\n    # CLI flag: -compactor.jobs.deletion.deletion-manifest-store-prefix\n    [deletion_manifest_store_prefix: <string> | default = \"__deletion_manifest__/\"]\n\n    # Maximum number of chunks to process concurrently in each worker.\n    # CLI flag: -compactor.jobs.deletion.chunk-processing-concurrency\n    [chunk_processing_concurrency: <int> | default = 3]\n\n    # Maximum time to wait for a job before considering it failed and retrying.\n    # CLI flag: -compactor.jobs.deletion.timeout\n    [timeout: <duration> | default = 15m]\n\n    # Maximum number of times to retry a failed or timed out job.\n    # CLI flag: -compactor.jobs.deletion.max-retries\n    [max_retries: <int> | default = 3]\n\n# Object storage path prefix for storing deletion markers. The prefix must end\n# with a forward slash(/). Leave empty to continue to store deletion markers on\n# the local disk.\n# CLI flag: -compactor.deletion-marker-object-store-prefix\n[deletion_marker_object_store_prefix: <string> | default = \"\"]\n```\n\n### consul\n\nConfiguration for a Consul client. Only applies if the selected kvstore is `consul`. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage.ring`\n- `compactor.ring`\n- `dataobj-consumer`\n- `dataobj-consumer.partition-ring`\n- `distributor.ring`\n- `index-gateway.ring`\n- `ingest-limits`\n- `ingest-limits-frontend`\n- `ingester.partition-ring`\n- `pattern-ingester`\n- `query-scheduler.ring`\n- `ruler.ring`\n- `ui.ring`\n\n\u00a0\n\n```yaml\n# Hostname and port of Consul.\n# CLI flag: -<prefix>.consul.hostname\n[host: <string> | default = \"localhost:8500\"]\n\n# ACL Token used to interact with Consul.\n# CLI flag: -<prefix>.consul.acl-token\n[acl_token: <string> | default = \"\"]\n\n# HTTP timeout when talking to Consul\n# CLI flag: -<prefix>.consul.client-timeout\n[http_client_timeout: <duration> | default = 20s]\n\n# Enable consistent reads to Consul.\n# CLI flag: -<prefix>.consul.consistent-reads\n[consistent_reads: <boolean> | default = false]\n\n# Rate limit when watching key or prefix in Consul, in requests per second. 0\n# disables the rate limit.\n# CLI flag: -<prefix>.consul.watch-rate-limit\n[watch_rate_limit: <float> | default = 1]\n\n# Burst size used in rate limit. Values less than 1 are treated as 1.\n# CLI flag: -<prefix>.consul.watch-burst-size\n[watch_burst_size: <int> | default = 1]\n\n# Maximum duration to wait before retrying a Compare And Swap (CAS) operation.\n# CLI flag: -<prefix>.consul.cas-retry-delay\n[cas_retry_delay: <duration> | default = 1s]\n```\n\n### cos_storage_config\n\nThe `cos_storage_config` block configures the connection to IBM Cloud Object Storage (COS) backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n\u00a0\n\n```yaml\n# Set this to `true` to force the request to use path-style addressing.\n# CLI flag: -<prefix>.cos.force-path-style\n[forcepathstyle: <boolean> | default = false]\n\n# Comma separated list of bucket names to evenly distribute chunks over.\n# CLI flag: -<prefix>.cos.buckets\n[bucketnames: <string> | default = \"\"]\n\n# COS Endpoint to connect to.\n# CLI flag: -<prefix>.cos.endpoint\n[endpoint: <string> | default = \"\"]\n\n# COS region to use.\n# CLI flag: -<prefix>.cos.region\n[region: <string> | default = \"\"]\n\n# COS HMAC Access Key ID.\n# CLI flag: -<prefix>.cos.access-key-id\n[access_key_id: <string> | default = \"\"]\n\n# COS HMAC Secret Access Key.\n# CLI flag: -<prefix>.cos.secret-access-key\n[secret_access_key: <string> | default = \"\"]\n\nhttp_config:\n  # The maximum amount of time an idle connection will be held open.\n  # CLI flag: -<prefix>.cos.http.idle-conn-timeout\n  [idle_conn_timeout: <duration> | default = 1m30s]\n\n  # If non-zero, specifies the amount of time to wait for a server's response\n  # headers after fully writing the request.\n  # CLI flag: -<prefix>.cos.http.response-header-timeout\n  [response_header_timeout: <duration> | default = 0s]\n\n# Configures back off when cos get Object.\nbackoff_config:\n  # Minimum backoff time when cos get Object.\n  # CLI flag: -<prefix>.cos.min-backoff\n  [min_period: <duration> | default = 100ms]\n\n  # Maximum backoff time when cos get Object.\n  # CLI flag: -<prefix>.cos.max-backoff\n  [max_period: <duration> | default = 3s]\n\n  # Maximum number of times to retry when cos get Object.\n  # CLI flag: -<prefix>.cos.max-retries\n  [max_retries: <int> | default = 5]\n\n# IAM API key to access COS.\n# CLI flag: -<prefix>.cos.api-key\n[api_key: <string> | default = \"\"]\n\n# COS service instance id to use.\n# CLI flag: -<prefix>.cos.service-instance-id\n[service_instance_id: <string> | default = \"\"]\n\n# IAM Auth Endpoint for authentication.\n# CLI flag: -<prefix>.cos.auth-endpoint\n[auth_endpoint: <string> | default = \"https://iam.cloud.ibm.com/identity/token\"]\n\n# Compute resource token file path.\n# CLI flag: -<prefix>.cos.cr-token-file-path\n[cr_token_file_path: <string> | default = \"\"]\n\n# Name of the trusted profile.\n# CLI flag: -<prefix>.cos.trusted-profile-name\n[trusted_profile_name: <string> | default = \"\"]\n\n# ID of the trusted profile.\n# CLI flag: -<prefix>.cos.trusted-profile-id\n[trusted_profile_id: <string> | default = \"\"]\n```\n\n### distributor\n\nConfigures the `distributor`.\n\n```yaml\nring:\n  kvstore:\n    # Backend storage to use for the ring. Supported values are: consul, etcd,\n    # inmemory, memberlist, multi.\n    # CLI flag: -distributor.ring.store\n    [store: <string> | default = \"consul\"]\n\n    # The prefix for the keys in the store. Should end with a /.\n    # CLI flag: -distributor.ring.prefix\n    [prefix: <string> | default = \"collectors/\"]\n\n    # Configuration for a Consul client. Only applies if the selected kvstore is\n    # consul.\n    # The CLI flags prefix for this block configuration is: distributor.ring\n    [consul: <consul>]\n\n    # Configuration for an ETCD v3 client. Only applies if the selected kvstore\n    # is etcd.\n    # The CLI flags prefix for this block configuration is: distributor.ring\n    [etcd: <etcd>]\n\n    multi:\n      # Primary backend storage used by multi-client.\n      # CLI flag: -distributor.ring.multi.primary\n      [primary: <string> | default = \"\"]\n\n      # Secondary backend storage used by multi-client.\n      # CLI flag: -distributor.ring.multi.secondary\n      [secondary: <string> | default = \"\"]\n\n      # Mirror writes to the secondary store.\n      # CLI flag: -distributor.ring.multi.mirror-enabled\n      [mirror_enabled: <boolean> | default = false]\n\n      # Timeout for storing a value to the secondary store.\n      # CLI flag: -distributor.ring.multi.mirror-timeout\n      [mirror_timeout: <duration> | default = 2s]\n\n  # Period at which to heartbeat to the ring.\n  # CLI flag: -distributor.ring.heartbeat-period\n  [heartbeat_period: <duration> | default = 5s]\n\n  # The heartbeat timeout after which distributors are considered unhealthy\n  # within the ring. 0 = never (timeout disabled).\n  # CLI flag: -distributor.ring.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # Name of network interface to read address from.\n  # CLI flag: -distributor.ring.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n# Number of workers to push batches to ingesters.\n# CLI flag: -distributor.push-worker-count\n[push_worker_count: <int> | default = 256]\n\n# The maximum size of a received message.\n# CLI flag: -distributor.max-recv-msg-size\n[max_recv_msg_size: <int> | default = 104857600]\n\n# The maximum size of a decompressed message. Defaults to 50x max-recv-msg-size.\n# CLI flag: -distributor.max-decompressed-size\n[max_decompressed_size: <int> | default = 5242880000]\n\nrate_store:\n  # The max number of concurrent requests to make to ingester stream apis\n  # CLI flag: -distributor.rate-store.max-request-parallelism\n  [max_request_parallelism: <int> | default = 200]\n\n  # The interval on which distributors will update current stream rates from\n  # ingesters\n  # CLI flag: -distributor.rate-store.stream-rate-update-interval\n  [stream_rate_update_interval: <duration> | default = 1s]\n\n  # Timeout for communication between distributors and any given ingester when\n  # updating rates\n  # CLI flag: -distributor.rate-store.ingester-request-timeout\n  [ingester_request_timeout: <duration> | default = 500ms]\n\n  # If enabled, detailed logs and spans will be emitted.\n  # CLI flag: -distributor.rate-store.debug\n  [debug: <boolean> | default = false]\n\n# Customize the logging of write failures.\nwrite_failures_logging:\n  # Log volume allowed (per second). Default: 1KB.\n  # CLI flag: -distributor.write-failures-logging.rate\n  [rate: <int> | default = 1KB]\n\n  # Whether a insight=true key should be logged or not. Default: false.\n  # CLI flag: -distributor.write-failures-logging.add-insights-label\n  [add_insights_label: <boolean> | default = false]\n\notlp_config:\n  # List of default otlp resource attributes to be picked as index labels\n  # CLI flag: -distributor.otlp.default_resource_attributes_as_index_labels\n  [default_resource_attributes_as_index_labels: <list of strings> | default = [service.name service.namespace service.instance.id deployment.environment deployment.environment.name cloud.region cloud.availability_zone k8s.cluster.name k8s.namespace.name k8s.pod.name k8s.container.name container.name k8s.replicaset.name k8s.deployment.name k8s.statefulset.name k8s.daemonset.name k8s.cronjob.name k8s.job.name]]\n\n# Default policy stream mappings that are merged with per-tenant mappings.\n[default_policy_stream_mappings: <map of string to list of PriorityStreams>]\n\n# Enable writes to Kafka during Push requests.\n# CLI flag: -distributor.kafka-writes-enabled\n[kafka_writes_enabled: <boolean> | default = false]\n\n# Enable writes to Ingesters during Push requests. Defaults to true.\n# CLI flag: -distributor.ingester-writes-enabled\n[ingester_writes_enabled: <boolean> | default = true]\n\n# Enable checking limits against the ingest-limits service. Defaults to false.\n# CLI flag: -distributor.ingest-limits-enabled\n[ingest_limits_enabled: <boolean> | default = false]\n\n# Enable dry-run mode where limits are checked the ingest-limits service, but\n# not enforced. Defaults to false.\n# CLI flag: -distributor.ingest-limits-dry-run-enabled\n[ingest_limits_dry_run_enabled: <boolean> | default = false]\n\ndataobj_tee:\n  # Enable data object tee.\n  # CLI flag: -distributor.dataobj-tee.enabled\n  [enabled: <boolean> | default = false]\n\n  # Topic for data object tee.\n  # CLI flag: -distributor.dataobj-tee.topic\n  [topic: <string> | default = \"\"]\n\n  # Maximum number of bytes to buffer.\n  # CLI flag: -distributor.dataobj-tee.max-buffered-bytes\n  [max_buffered_bytes: <int> | default = 104857600]\n\n  # The per-tenant partition rate (bytes/sec).\n  # CLI flag: -distributor.dataobj-tee.per-partition-rate-bytes\n  [per_partition_rate_bytes: <int> | default = 1048576]\n\n  # Enables optional debug metrics.\n  # CLI flag: -distributor.dataobj-tee.debug-metrics-enabled\n  [debug_metrics_enabled: <boolean> | default = false]\n```\n\n### etcd\n\nConfiguration for an ETCD v3 client. Only applies if the selected kvstore is `etcd`. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage.ring`\n- `compactor.ring`\n- `dataobj-consumer`\n- `dataobj-consumer.partition-ring`\n- `distributor.ring`\n- `index-gateway.ring`\n- `ingest-limits`\n- `ingest-limits-frontend`\n- `ingester.partition-ring`\n- `pattern-ingester`\n- `query-scheduler.ring`\n- `ruler.ring`\n- `ui.ring`\n\n\u00a0\n\n```yaml\n# The etcd endpoints to connect to.\n# CLI flag: -<prefix>.etcd.endpoints\n[endpoints: <list of strings> | default = []]\n\n# The dial timeout for the etcd connection.\n# CLI flag: -<prefix>.etcd.dial-timeout\n[dial_timeout: <duration> | default = 10s]\n\n# The maximum number of retries to do for failed ops.\n# CLI flag: -<prefix>.etcd.max-retries\n[max_retries: <int> | default = 10]\n\n# Enable TLS.\n# CLI flag: -<prefix>.etcd.tls-enabled\n[tls_enabled: <boolean> | default = false]\n\n# The TLS configuration.\n# The CLI flags prefix for this block configuration is: ui.ring.etcd\n[<tls_config>]\n\n# Etcd username.\n# CLI flag: -<prefix>.etcd.username\n[username: <string> | default = \"\"]\n\n# Etcd password.\n# CLI flag: -<prefix>.etcd.password\n[password: <string> | default = \"\"]\n```\n\n### frontend\n\nThe `frontend` block configures the Loki query-frontend.\n\n```yaml\n# Log queries that are slower than the specified duration. Set to 0 to disable.\n# Set to < 0 to enable on all queries.\n# CLI flag: -frontend.log-queries-longer-than\n[log_queries_longer_than: <duration> | default = 0s]\n\n# Comma-separated list of request header names to include in query logs. Applies\n# to both query stats and slow queries logs.\n# CLI flag: -frontend.log-query-request-headers\n[log_query_request_headers: <string> | default = \"\"]\n\n# Max body size for downstream prometheus.\n# CLI flag: -frontend.max-body-size\n[max_body_size: <int> | default = 10485760]\n\n# True to enable query statistics tracking. When enabled, a message with some\n# statistics is logged for every query.\n# CLI flag: -frontend.query-stats-enabled\n[query_stats_enabled: <boolean> | default = false]\n\n# Maximum number of outstanding requests per tenant per frontend; requests\n# beyond this error with HTTP 429.\n# CLI flag: -querier.max-outstanding-requests-per-tenant\n[max_outstanding_per_tenant: <int> | default = 2048]\n\n# In the event a tenant is repeatedly sending queries that lead the querier to\n# crash or be killed due to an out-of-memory error, the crashed querier will be\n# disconnected from the query frontend and a new querier will be immediately\n# assigned to the tenant\u2019s shard. This invalidates the assumption that shuffle\n# sharding can be used to reduce the impact on tenants. This option mitigates\n# the impact by configuring a delay between when a querier disconnects because\n# of a crash and when the crashed querier is actually removed from the tenant's\n# shard.\n# CLI flag: -query-frontend.querier-forget-delay\n[querier_forget_delay: <duration> | default = 0s]\n\n# DNS hostname used for finding query-schedulers.\n# CLI flag: -frontend.scheduler-address\n[scheduler_address: <string> | default = \"\"]\n\n# How often to resolve the scheduler-address, in order to look for new\n# query-scheduler instances. Also used to determine how often to poll the\n# scheduler-ring for addresses if the scheduler-ring is configured.\n# CLI flag: -frontend.scheduler-dns-lookup-period\n[scheduler_dns_lookup_period: <duration> | default = 10s]\n\n# Number of concurrent workers forwarding queries to single query-scheduler.\n# CLI flag: -frontend.scheduler-worker-concurrency\n[scheduler_worker_concurrency: <int> | default = 5]\n\n# The grpc_client block configures the gRPC client used to communicate between a\n# client and server component in Loki.\n# The CLI flags prefix for this block configuration is:\n# frontend.grpc-client-config\n[grpc_client_config: <grpc_client>]\n\n# Time to wait for inflight requests to finish before forcefully shutting down.\n# This needs to be aligned with the query timeout and the graceful termination\n# period of the process orchestrator.\n# CLI flag: -frontend.graceful-shutdown-timeout\n[graceful_shutdown_timeout: <duration> | default = 5m]\n\n# Name of network interface to read address from. This address is sent to\n# query-scheduler and querier, which uses it to send the query response back to\n# query-frontend.\n# CLI flag: -frontend.instance-interface-names\n[instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n# Enable using a IPv6 instance address (default false).\n# CLI flag: -frontend.instance-enable-ipv6\n[instance_enable_ipv6: <boolean> | default = false]\n\n# Defines the encoding for requests to and responses from the scheduler and\n# querier. Can be 'json' or 'protobuf' (defaults to 'json').\n# CLI flag: -frontend.encoding\n[encoding: <string> | default = \"json\"]\n\n# Compress HTTP responses.\n# CLI flag: -querier.compress-http-responses\n[compress_responses: <boolean> | default = true]\n\n# URL of downstream Loki.\n# CLI flag: -frontend.downstream-url\n[downstream_url: <string> | default = \"\"]\n\n# URL of querier for tail proxy.\n# CLI flag: -frontend.tail-proxy-url\n[tail_proxy_url: <string> | default = \"\"]\n\n# The TLS configuration.\n# The CLI flags prefix for this block configuration is: frontend.tail-tls-config\n[tail_tls_config: <tls_config>]\n\n# Support 'application/vnd.apache.parquet' content type in HTTP responses.\n[support_parquet_encoding: <boolean>]\n```\n\n### frontend_worker\n\nThe `frontend_worker` configures the worker - running within the Loki querier - picking up and executing queries enqueued by the query-frontend.\n\n```yaml\n# Address of query frontend service, in host:port format. If\n# -querier.scheduler-address is set as well, querier will use scheduler instead.\n# Only one of -querier.frontend-address or -querier.scheduler-address can be\n# set. If neither is set, queries are only received via HTTP endpoint.\n# CLI flag: -querier.frontend-address\n[frontend_address: <string> | default = \"\"]\n\n# Hostname (and port) of scheduler that querier will periodically resolve,\n# connect to and receive queries from. Only one of -querier.frontend-address or\n# -querier.scheduler-address can be set. If neither is set, queries are only\n# received via HTTP endpoint.\n# CLI flag: -querier.scheduler-address\n[scheduler_address: <string> | default = \"\"]\n\n# How often to query DNS for query-frontend or query-scheduler address. Also\n# used to determine how often to poll the scheduler-ring for addresses if the\n# scheduler-ring is configured.\n# CLI flag: -querier.dns-lookup-period\n[dns_lookup_duration: <duration> | default = 3s]\n\n# Querier ID, sent to frontend service to identify requests from the same\n# querier. Defaults to hostname.\n# CLI flag: -querier.id\n[id: <string> | default = \"\"]\n\n# Configures the querier gRPC client used to communicate with the\n# query-frontend. This can't be used in conjunction with 'grpc_client_config'.\n# The CLI flags prefix for this block configuration is:\n# querier.frontend-grpc-client\n[query_frontend_grpc_client: <grpc_client>]\n\n# Configures the querier gRPC client used to communicate with the query-frontend\n# and with the query-scheduler. This can't be used in conjunction with\n# 'query_frontend_grpc_client' or 'query_scheduler_grpc_client'.\n# The CLI flags prefix for this block configuration is: querier.frontend-client\n[grpc_client_config: <grpc_client>]\n\n# Configures the querier gRPC client used to communicate with the\n# query-scheduler. This can't be used in conjunction with 'grpc_client_config'.\n# The CLI flags prefix for this block configuration is:\n# querier.scheduler-grpc-client\n[query_scheduler_grpc_client: <grpc_client>]\n```\n\n### gcs_storage_config\n\nThe `gcs_storage_config` block configures the connection to Google Cloud Storage object storage backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n\u00a0\n\n```yaml\n# Name of GCS bucket. Please refer to\n# https://cloud.google.com/docs/authentication/production for more information\n# about how to configure authentication.\n# CLI flag: -<prefix>.gcs.bucketname\n[bucket_name: <string> | default = \"\"]\n\n# Custom GCS endpoint URL.\n# CLI flag: -<prefix>.gcs.endpoint\n[endpoint: <string> | default = \"\"]\n\n# Service account key content in JSON format, refer to\n# https://cloud.google.com/iam/docs/creating-managing-service-account-keys for\n# creation.\n# CLI flag: -<prefix>.gcs.service-account\n[service_account: <string> | default = \"\"]\n\n# The size of the buffer that GCS client for each PUT request. 0 to disable\n# buffering.\n# CLI flag: -<prefix>.gcs.chunk-buffer-size\n[chunk_buffer_size: <int> | default = 0]\n\n# The duration after which the requests to GCS should be timed out.\n# CLI flag: -<prefix>.gcs.request-timeout\n[request_timeout: <duration> | default = 0s]\n\n# Enable OpenCensus (OC) instrumentation for all requests.\n# CLI flag: -<prefix>.gcs.enable-opencensus\n[enable_opencensus: <boolean> | default = true]\n\n# Enable HTTP2 connections.\n# CLI flag: -<prefix>.gcs.enable-http2\n[enable_http2: <boolean> | default = true]\n\n# Enable automatic retries of failed idempotent requests.\n# CLI flag: -<prefix>.gcs.enable-retries\n[enable_retries: <boolean> | default = true]\n```\n\n### grpc_client\n\nThe `grpc_client` block configures the gRPC client used to communicate between a client and server component in Loki. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `bigtable`\n- `bloom-build.builder.grpc`\n- `bloom-gateway-client.grpc`\n- `boltdb.shipper.index-gateway-client.grpc`\n- `compactor.grpc-client`\n- `frontend.grpc-client-config`\n- `ingest-limits-frontend-client`\n- `ingest-limits-frontend.limits-client`\n- `ingester.client`\n- `pattern-ingester.client`\n- `querier.frontend-client`\n- `querier.frontend-grpc-client`\n- `querier.scheduler-grpc-client`\n- `query-scheduler.grpc-client-config`\n- `ruler.client`\n- `tsdb.shipper.index-gateway-client.grpc`\n\n\u00a0\n\n```yaml\n# gRPC client max receive message size (bytes).\n# CLI flag: -<prefix>.grpc-max-recv-msg-size\n[max_recv_msg_size: <int> | default = 104857600]\n\n# gRPC client max send message size (bytes).\n# CLI flag: -<prefix>.grpc-max-send-msg-size\n[max_send_msg_size: <int> | default = 104857600]\n\n# Use compression when sending messages. Supported values are: 'gzip', 'snappy'\n# and '' (disable compression)\n# CLI flag: -<prefix>.grpc-compression\n[grpc_compression: <string> | default = \"\"]\n\n# Rate limit for gRPC client; 0 means disabled.\n# CLI flag: -<prefix>.grpc-client-rate-limit\n[rate_limit: <float> | default = 0]\n\n# Rate limit burst for gRPC client.\n# CLI flag: -<prefix>.grpc-client-rate-limit-burst\n[rate_limit_burst: <int> | default = 0]\n\n# Enable backoff and retry when we hit rate limits.\n# CLI flag: -<prefix>.backoff-on-ratelimits\n[backoff_on_ratelimits: <boolean> | default = false]\n\nbackoff_config:\n  # Minimum delay when backing off.\n  # CLI flag: -<prefix>.backoff-min-period\n  [min_period: <duration> | default = 100ms]\n\n  # Maximum delay when backing off.\n  # CLI flag: -<prefix>.backoff-max-period\n  [max_period: <duration> | default = 10s]\n\n  # Number of times to backoff and retry before failing.\n  # CLI flag: -<prefix>.backoff-retries\n  [max_retries: <int> | default = 10]\n\n# Initial stream window size. Values less than the default are not supported and\n# are ignored. Setting this to a value other than the default disables the BDP\n# estimator.\n# CLI flag: -<prefix>.initial-stream-window-size\n[initial_stream_window_size: <int> | default = 63KiB1023B]\n\n# Initial connection window size. Values less than the default are not supported\n# and are ignored. Setting this to a value other than the default disables the\n# BDP estimator.\n# CLI flag: -<prefix>.initial-connection-window-size\n[initial_connection_window_size: <int> | default = 63KiB1023B]\n\n# Enable TLS in the gRPC client. This flag needs to be enabled when any other\n# TLS flag is set. If set to false, insecure connection to gRPC server will be\n# used.\n# CLI flag: -<prefix>.tls-enabled\n[tls_enabled: <boolean> | default = false]\n\n# The TLS configuration.\n# The CLI flags prefix for this block configuration is:\n# tsdb.shipper.index-gateway-client.grpc\n[<tls_config>]\n\n# The maximum amount of time to establish a connection. A value of 0 means\n# default gRPC client connect timeout and backoff.\n# CLI flag: -<prefix>.connect-timeout\n[connect_timeout: <duration> | default = 5s]\n\n# Initial backoff delay after first connection failure. Only relevant if\n# ConnectTimeout > 0.\n# CLI flag: -<prefix>.connect-backoff-base-delay\n[connect_backoff_base_delay: <duration> | default = 1s]\n\n# Maximum backoff delay when establishing a connection. Only relevant if\n# ConnectTimeout > 0.\n# CLI flag: -<prefix>.connect-backoff-max-delay\n[connect_backoff_max_delay: <duration> | default = 5s]\n\ncluster_validation:\n  # Primary cluster validation label.\n  # CLI flag: -<prefix>.cluster-validation.label\n  [label: <string> | default = \"\"]\n```\n\n### index_gateway\n\nThe `index_gateway` block configures the Loki index gateway server, responsible for serving index queries without the need to constantly interact with the object store.\n\n```yaml\n# Defines in which mode the index gateway server will operate (default to\n# 'simple'). It supports two modes:\n# - 'simple': an index gateway server instance is responsible for handling,\n# storing and returning requests for all indices for all tenants.\n# - 'ring': an index gateway server instance is responsible for a subset of\n# tenants instead of all tenants.\n# CLI flag: -index-gateway.mode\n[mode: <string> | default = \"simple\"]\n\n# Defines the ring to be used by the index gateway servers and clients in case\n# the servers are configured to run in 'ring' mode. In case this isn't\n# configured, this block supports inheriting configuration from the common ring\n# section.\nring:\n  kvstore:\n    # Backend storage to use for the ring. Supported values are: consul, etcd,\n    # inmemory, memberlist, multi.\n    # CLI flag: -index-gateway.ring.store\n    [store: <string> | default = \"consul\"]\n\n    # The prefix for the keys in the store. Should end with a /.\n    # CLI flag: -index-gateway.ring.prefix\n    [prefix: <string> | default = \"collectors/\"]\n\n    # Configuration for a Consul client. Only applies if the selected kvstore is\n    # consul.\n    # The CLI flags prefix for this block configuration is: index-gateway.ring\n    [consul: <consul>]\n\n    # Configuration for an ETCD v3 client. Only applies if the selected kvstore\n    # is etcd.\n    # The CLI flags prefix for this block configuration is: index-gateway.ring\n    [etcd: <etcd>]\n\n    multi:\n      # Primary backend storage used by multi-client.\n      # CLI flag: -index-gateway.ring.multi.primary\n      [primary: <string> | default = \"\"]\n\n      # Secondary backend storage used by multi-client.\n      # CLI flag: -index-gateway.ring.multi.secondary\n      [secondary: <string> | default = \"\"]\n\n      # Mirror writes to the secondary store.\n      # CLI flag: -index-gateway.ring.multi.mirror-enabled\n      [mirror_enabled: <boolean> | default = false]\n\n      # Timeout for storing a value to the secondary store.\n      # CLI flag: -index-gateway.ring.multi.mirror-timeout\n      [mirror_timeout: <duration> | default = 2s]\n\n  # Period at which to heartbeat to the ring.\n  # CLI flag: -index-gateway.ring.heartbeat-period\n  [heartbeat_period: <duration> | default = 15s]\n\n  # The heartbeat timeout after which compactors are considered unhealthy within\n  # the ring. 0 = never (timeout disabled).\n  # CLI flag: -index-gateway.ring.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # File path where tokens are stored. If empty, tokens are not stored at\n  # shutdown and restored at startup.\n  # CLI flag: -index-gateway.ring.tokens-file-path\n  [tokens_file_path: <string> | default = \"\"]\n\n  # True to enable zone-awareness and replicate blocks across different\n  # availability zones.\n  # CLI flag: -index-gateway.ring.zone-awareness-enabled\n  [zone_awareness_enabled: <boolean> | default = false]\n\n  # Deprecated: How many index gateway instances are assigned to each tenant.\n  # Use -index-gateway.shard-size instead. The shard size is also a per-tenant\n  # setting.\n  # CLI flag: -replication-factor\n  [replication_factor: <int> | default = 3]\n\n  # Instance ID to register in the ring.\n  # CLI flag: -index-gateway.ring.instance-id\n  [instance_id: <string> | default = \"<hostname>\"]\n\n  # Name of network interface to read address from.\n  # CLI flag: -index-gateway.ring.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # Port to advertise in the ring (defaults to server.grpc-listen-port).\n  # CLI flag: -index-gateway.ring.instance-port\n  [instance_port: <int> | default = 0]\n\n  # IP address to advertise in the ring.\n  # CLI flag: -index-gateway.ring.instance-addr\n  [instance_addr: <string> | default = \"\"]\n\n  # The availability zone where this instance is running. Required if\n  # zone-awareness is enabled.\n  # CLI flag: -index-gateway.ring.instance-availability-zone\n  [instance_availability_zone: <string> | default = \"\"]\n\n  # Enable using a IPv6 instance address.\n  # CLI flag: -index-gateway.ring.instance-enable-ipv6\n  [instance_enable_ipv6: <boolean> | default = false]\n```\n\n### ingester\n\nThe `ingester` block configures the ingester and how the ingester will register itself to a key value store.\n\n```yaml\n# Configures how the lifecycle of the ingester will operate and where it will\n# register for discovery.\nlifecycler:\n  ring:\n    kvstore:\n      # Backend storage to use for the ring. Supported values are: consul, etcd,\n      # inmemory, memberlist, multi.\n      # CLI flag: -ring.store\n      [store: <string> | default = \"consul\"]\n\n      # The prefix for the keys in the store. Should end with a /.\n      # CLI flag: -ring.prefix\n      [prefix: <string> | default = \"collectors/\"]\n\n      # Configuration for a Consul client. Only applies if the selected kvstore\n      # is consul.\n      [consul: <consul>]\n\n      # Configuration for an ETCD v3 client. Only applies if the selected\n      # kvstore is etcd.\n      [etcd: <etcd>]\n\n      multi:\n        # Primary backend storage used by multi-client.\n        # CLI flag: -multi.primary\n        [primary: <string> | default = \"\"]\n\n        # Secondary backend storage used by multi-client.\n        # CLI flag: -multi.secondary\n        [secondary: <string> | default = \"\"]\n\n        # Mirror writes to the secondary store.\n        # CLI flag: -multi.mirror-enabled\n        [mirror_enabled: <boolean> | default = false]\n\n        # Timeout for storing a value to the secondary store.\n        # CLI flag: -multi.mirror-timeout\n        [mirror_timeout: <duration> | default = 2s]\n\n    # The heartbeat timeout after which ingesters are skipped for reads/writes.\n    # CLI flag: -ring.heartbeat-timeout\n    [heartbeat_timeout: <duration> | default = 1m]\n\n    # The number of ingesters to write to and read from.\n    # CLI flag: -distributor.replication-factor\n    [replication_factor: <int> | default = 3]\n\n    # True to enable the zone-awareness and replicate ingested samples across\n    # different availability zones.\n    # CLI flag: -distributor.zone-awareness-enabled\n    [zone_awareness_enabled: <boolean> | default = false]\n\n    # Comma-separated list of zones to exclude from the ring. Instances in\n    # excluded zones will be filtered out from the ring.\n    # CLI flag: -distributor.excluded-zones\n    [excluded_zones: <string> | default = \"\"]\n\n  # Number of tokens for each ingester.\n  # CLI flag: -ingester.num-tokens\n  [num_tokens: <int> | default = 128]\n\n  # Period at which to heartbeat to consul.\n  # CLI flag: -ingester.heartbeat-period\n  [heartbeat_period: <duration> | default = 5s]\n\n  # Heartbeat timeout after which instance is assumed to be unhealthy.\n  # CLI flag: -ingester.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # Observe tokens after generating to resolve collisions. Useful when using\n  # gossiping ring.\n  # CLI flag: -ingester.observe-period\n  [observe_period: <duration> | default = 0s]\n\n  # Period to wait for a claim from another member; will join automatically\n  # after this.\n  # CLI flag: -ingester.join-after\n  [join_after: <duration> | default = 0s]\n\n  # Minimum duration to wait after the internal readiness checks have passed but\n  # before succeeding the readiness endpoint. This is used to slowdown\n  # deployment controllers (eg. Kubernetes) after an instance is ready and\n  # before they proceed with a rolling update, to give the rest of the cluster\n  # instances enough time to receive ring updates.\n  # CLI flag: -ingester.min-ready-duration\n  [min_ready_duration: <duration> | default = 15s]\n\n  # Name of network interface to read address from.\n  # CLI flag: -ingester.lifecycler.interface\n  [interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # Enable IPv6 support. Required to make use of IP addresses from IPv6\n  # interfaces.\n  # CLI flag: -ingester.enable-inet6\n  [enable_inet6: <boolean> | default = false]\n\n  # Duration to sleep for before exiting, to ensure metrics are scraped.\n  # CLI flag: -ingester.final-sleep\n  [final_sleep: <duration> | default = 0s]\n\n  # File path where tokens are stored. If empty, tokens are not stored at\n  # shutdown and restored at startup.\n  # CLI flag: -ingester.tokens-file-path\n  [tokens_file_path: <string> | default = \"\"]\n\n  # The availability zone where this instance is running.\n  # CLI flag: -ingester.availability-zone\n  [availability_zone: <string> | default = \"\"]\n\n  # Unregister from the ring upon clean shutdown. It can be useful to disable\n  # for rolling restarts with consistent naming in conjunction with\n  # -distributor.extend-writes=false.\n  # CLI flag: -ingester.unregister-on-shutdown\n  [unregister_on_shutdown: <boolean> | default = true]\n\n  # When enabled the readiness probe succeeds only after all instances are\n  # ACTIVE and healthy in the ring, otherwise only the instance itself is\n  # checked. This option should be disabled if in your cluster multiple\n  # instances can be rolled out simultaneously, otherwise rolling updates may be\n  # slowed down.\n  # CLI flag: -ingester.readiness-check-ring-health\n  [readiness_check_ring_health: <boolean> | default = true]\n\n  # IP address to advertise in the ring.\n  # CLI flag: -ingester.lifecycler.addr\n  [address: <string> | default = \"\"]\n\n  # port to advertise in consul (defaults to server.grpc-listen-port).\n  # CLI flag: -ingester.lifecycler.port\n  [port: <int> | default = 0]\n\n  # ID to register in the ring.\n  # CLI flag: -ingester.lifecycler.ID\n  [id: <string> | default = \"<hostname>\"]\n\n# How many flushes can happen concurrently from each stream.\n# CLI flag: -ingester.concurrent-flushes\n[concurrent_flushes: <int> | default = 32]\n\n# How often should the ingester see if there are any blocks to flush. The first\n# flush check is delayed by a random time up to 0.8x the flush check period.\n# Additionally, there is +/- 1% jitter added to the interval.\n# CLI flag: -ingester.flush-check-period\n[flush_check_period: <duration> | default = 30s]\n\nflush_op_backoff:\n  # Minimum backoff period when a flush fails. Each concurrent flush has its own\n  # backoff, see `ingester.concurrent-flushes`.\n  # CLI flag: -ingester.flush-op-backoff-min-period\n  [min_period: <duration> | default = 10s]\n\n  # Maximum backoff period when a flush fails. Each concurrent flush has its own\n  # backoff, see `ingester.concurrent-flushes`.\n  # CLI flag: -ingester.flush-op-backoff-max-period\n  [max_period: <duration> | default = 1m]\n\n  # Maximum retries for failed flushes.\n  # CLI flag: -ingester.flush-op-backoff-retries\n  [max_retries: <int> | default = 10]\n\n# The timeout for an individual flush. Will be retried up to\n# `flush-op-backoff-retries` times.\n# CLI flag: -ingester.flush-op-timeout\n[flush_op_timeout: <duration> | default = 10m]\n\n# How long chunks should be retained in-memory after they've been flushed.\n# CLI flag: -ingester.chunks-retain-period\n[chunk_retain_period: <duration> | default = 0s]\n\n# How long chunks should sit in-memory with no updates before being flushed if\n# they don't hit the max block size. This means that half-empty chunks will\n# still be flushed after a certain period as long as they receive no further\n# activity.\n# CLI flag: -ingester.chunks-idle-period\n[chunk_idle_period: <duration> | default = 30m]\n\n# The targeted _uncompressed_ size in bytes of a chunk block When this threshold\n# is exceeded the head block will be cut and compressed inside the chunk.\n# CLI flag: -ingester.chunks-block-size\n[chunk_block_size: <int> | default = 262144]\n\n# A target _compressed_ size in bytes for chunks. This is a desired size not an\n# exact size, chunks may be slightly bigger or significantly smaller if they get\n# flushed for other reasons (e.g. chunk_idle_period). A value of 0 creates\n# chunks with a fixed 10 blocks, a non zero value will create chunks with a\n# variable number of blocks to meet the target size.\n# CLI flag: -ingester.chunk-target-size\n[chunk_target_size: <int> | default = 1572864]\n\n# The algorithm to use for compressing chunk. (none, gzip, lz4-64k, snappy,\n# lz4-256k, lz4-1M, lz4, flate, zstd)\n# CLI flag: -ingester.chunk-encoding\n[chunk_encoding: <string> | default = \"gzip\"]\n\n# The maximum duration of a timeseries chunk in memory. If a timeseries runs for\n# longer than this, the current chunk will be flushed to the store and a new\n# chunk created.\n# CLI flag: -ingester.max-chunk-age\n[max_chunk_age: <duration> | default = 2h]\n\n# Forget about ingesters having heartbeat timestamps older than\n# `ring.kvstore.heartbeat_timeout`. This is equivalent to clicking on the\n# `/ring` `forget` button in the UI: the ingester is removed from the ring. This\n# is a useful setting when you are sure that an unhealthy node won't return. An\n# example is when not using stateful sets or the equivalent. Use\n# `memberlist.rejoin_interval` > 0 to handle network partition cases when using\n# a memberlist.\n# CLI flag: -ingester.autoforget-unhealthy\n[autoforget_unhealthy: <boolean> | default = false]\n\n# Parameters used to synchronize ingesters to cut chunks at the same moment.\n# Sync period is used to roll over incoming entry to a new chunk. If chunk's\n# utilization isn't high enough (eg. less than 50% when sync_min_utilization is\n# set to 0.5), then this chunk rollover doesn't happen.\n# CLI flag: -ingester.sync-period\n[sync_period: <duration> | default = 1h]\n\n# Minimum utilization of chunk when doing synchronization.\n# CLI flag: -ingester.sync-min-utilization\n[sync_min_utilization: <float> | default = 0.1]\n\n# The maximum number of errors a stream will report to the user when a push\n# fails. 0 to make unlimited.\n# CLI flag: -ingester.max-ignored-stream-errors\n[max_returned_stream_errors: <int> | default = 10]\n\n# How far back should an ingester be allowed to query the store for data, for\n# use only with boltdb-shipper/tsdb index and filesystem object store. -1 for\n# infinite.\n# CLI flag: -ingester.query-store-max-look-back-period\n[query_store_max_look_back_period: <duration> | default = 0s]\n\n# The ingester WAL (Write Ahead Log) records incoming logs and stores them on\n# the local file systems in order to guarantee persistence of acknowledged data\n# in the event of a process crash.\nwal:\n  # Enable writing of ingested data into WAL.\n  # CLI flag: -ingester.wal-enabled\n  [enabled: <boolean> | default = true]\n\n  # Directory where the WAL data is stored and/or recovered from.\n  # CLI flag: -ingester.wal-dir\n  [dir: <string> | default = \"wal\"]\n\n  # Interval at which checkpoints should be created.\n  # CLI flag: -ingester.checkpoint-duration\n  [checkpoint_duration: <duration> | default = 5m]\n\n  # When WAL is enabled, should chunks be flushed to long-term storage on\n  # shutdown.\n  # CLI flag: -ingester.flush-on-shutdown\n  [flush_on_shutdown: <boolean> | default = false]\n\n  # Maximum memory size the WAL may use during replay. After hitting this, it\n  # will flush data to storage before continuing. A unit suffix (KB, MB, GB) may\n  # be applied.\n  # CLI flag: -ingester.wal-replay-memory-ceiling\n  [replay_memory_ceiling: <int> | default = 4GB]\n\n  # Threshold for disk usage (0.0 to 1.0) at which the WAL will throttle\n  # incoming writes. Set to 0 to disable throttling.\n  # CLI flag: -ingester.wal-disk-full-threshold\n  [disk_full_threshold: <float> | default = 0.9]\n\n# Shard factor used in the ingesters for the in process reverse index. This MUST\n# be evenly divisible by ALL schema shard factors or Loki will not start.\n# CLI flag: -ingester.index-shards\n[index_shards: <int> | default = 32]\n\n# Maximum number of dropped streams to keep in memory during tailing.\n# CLI flag: -ingester.tailer.max-dropped-streams\n[max_dropped_streams: <int> | default = 10]\n\n# Path where the shutdown marker file is stored. If not set and\n# common.path_prefix is set then common.path_prefix will be used.\n# CLI flag: -ingester.shutdown-marker-path\n[shutdown_marker_path: <string> | default = \"\"]\n\n# Interval at which the ingester ownedStreamService checks for changes in the\n# ring to recalculate owned streams.\n# CLI flag: -ingester.owned-streams-check-interval\n[owned_streams_check_interval: <duration> | default = 30s]\n\nkafka_ingestion:\n  # Whether the kafka ingester is enabled.\n  # CLI flag: -ingester.kafka-ingestion-enabled\n  [enabled: <boolean> | default = false]\n\n  partition_ring:\n    # The key-value store used to share the hash ring across multiple instances.\n    # This option needs be set on ingesters, distributors, queriers, and rulers\n    # when running in microservices mode.\n    kvstore:\n      # Backend storage to use for the ring. Supported values are: consul, etcd,\n      # inmemory, memberlist, multi.\n      # CLI flag: -ingester.partition-ring.store\n      [store: <string> | default = \"memberlist\"]\n\n      # The prefix for the keys in the store. Should end with a /.\n      # CLI flag: -ingester.partition-ring.prefix\n      [prefix: <string> | default = \"collectors/\"]\n\n      # Configuration for a Consul client. Only applies if the selected kvstore\n      # is consul.\n      # The CLI flags prefix for this block configuration is:\n      # ingester.partition-ring\n      [consul: <consul>]\n\n      # Configuration for an ETCD v3 client. Only applies if the selected\n      # kvstore is etcd.\n      # The CLI flags prefix for this block configuration is:\n      # ingester.partition-ring\n      [etcd: <etcd>]\n\n      multi:\n        # Primary backend storage used by multi-client.\n        # CLI flag: -ingester.partition-ring.multi.primary\n        [primary: <string> | default = \"\"]\n\n        # Secondary backend storage used by multi-client.\n        # CLI flag: -ingester.partition-ring.multi.secondary\n        [secondary: <string> | default = \"\"]\n\n        # Mirror writes to the secondary store.\n        # CLI flag: -ingester.partition-ring.multi.mirror-enabled\n        [mirror_enabled: <boolean> | default = false]\n\n        # Timeout for storing a value to the secondary store.\n        # CLI flag: -ingester.partition-ring.multi.mirror-timeout\n        [mirror_timeout: <duration> | default = 2s]\n\n    # Minimum number of owners to wait before a PENDING partition gets switched\n    # to ACTIVE.\n    # CLI flag: -ingester.partition-ring.min-partition-owners-count\n    [min_partition_owners_count: <int> | default = 1]\n\n    # How long the minimum number of owners are enforced before a PENDING\n    # partition gets switched to ACTIVE.\n    # CLI flag: -ingester.partition-ring.min-partition-owners-duration\n    [min_partition_owners_duration: <duration> | default = 10s]\n\n    # How long to wait before an INACTIVE partition is eligible for deletion.\n    # The partition is deleted only if it has been in INACTIVE state for at\n    # least the configured duration and it has no owners registered. A value of\n    # 0 disables partitions deletion.\n    # CLI flag: -ingester.partition-ring.delete-inactive-partition-after\n    [delete_inactive_partition_after: <duration> | default = 13h]\n```\n\n### ingester_client\n\nThe `ingester_client` block configures how the distributor will connect to ingesters. Only appropriate when running all components, the distributor, or the querier.\n\n```yaml\n# Configures how connections are pooled.\npool_config:\n  # How frequently to clean up clients for ingesters that have gone away.\n  # CLI flag: -distributor.client-cleanup-period\n  [client_cleanup_period: <duration> | default = 15s]\n\n  # Run a health check on each ingester client during periodic cleanup.\n  # CLI flag: -distributor.health-check-ingesters\n  [health_check_ingesters: <boolean> | default = true]\n\n  # How quickly a dead client will be removed after it has been detected to\n  # disappear. Set this to a value to allow time for a secondary health check to\n  # recover the missing client.\n  # CLI flag: -ingester.client.healthcheck-timeout\n  [remote_timeout: <duration> | default = 1s]\n\n# The remote request timeout on the client side.\n# CLI flag: -ingester.client.timeout\n[remote_timeout: <duration> | default = 5s]\n\n# Configures how the gRPC connection to ingesters work as a client.\n# The CLI flags prefix for this block configuration is: ingester.client\n[grpc_client_config: <grpc_client>]\n```\n\n### limits_config\n\nThe `limits_config` block configures global and per-tenant limits in Loki. The values here can be overridden in the `overrides` section of the runtime_config file\n\n```yaml\n# Whether the ingestion rate limit should be applied individually to each\n# distributor instance (local), or evenly shared across the cluster (global).\n# The ingestion rate strategy cannot be overridden on a per-tenant basis.\n# - local: enforces the limit on a per distributor basis. The actual effective\n# rate limit will be N times higher, where N is the number of distributor\n# replicas.\n# - global: enforces the limit globally, configuring a per-distributor local\n# rate limiter as 'ingestion_rate / N', where N is the number of distributor\n# replicas (it's automatically adjusted if the number of replicas change). The\n# global strategy requires the distributors to form their own ring, which is\n# used to keep track of the current number of healthy distributor replicas.\n# CLI flag: -distributor.ingestion-rate-limit-strategy\n[ingestion_rate_strategy: <string> | default = \"global\"]\n\n# Per-user ingestion rate limit in sample size per second. Sample size includes\n# size of the logs line and the size of structured metadata labels. Units in MB.\n# CLI flag: -distributor.ingestion-rate-limit-mb\n[ingestion_rate_mb: <float> | default = 4]\n\n# Per-user allowed ingestion burst size (in sample size). Units in MB. The burst\n# size refers to the per-distributor local rate limiter even in the case of the\n# 'global' strategy, and should be set at least to the maximum logs size\n# expected in a single push request.\n# CLI flag: -distributor.ingestion-burst-size-mb\n[ingestion_burst_size_mb: <float> | default = 6]\n\n# Maximum length accepted for label names.\n# CLI flag: -validation.max-length-label-name\n[max_label_name_length: <int> | default = 1024]\n\n# Maximum length accepted for label value. This setting also applies to the\n# metric name.\n# CLI flag: -validation.max-length-label-value\n[max_label_value_length: <int> | default = 2048]\n\n# Maximum number of label names per series.\n# CLI flag: -validation.max-label-names-per-series\n[max_label_names_per_series: <int> | default = 15]\n\n# Whether or not old samples will be rejected.\n# CLI flag: -validation.reject-old-samples\n[reject_old_samples: <boolean> | default = true]\n\n# Maximum accepted sample age before rejecting.\n# CLI flag: -validation.reject-old-samples.max-age\n[reject_old_samples_max_age: <duration> | default = 1w]\n\n# Duration which table will be created/deleted before/after it's needed; we\n# won't accept sample from before this time.\n# CLI flag: -validation.create-grace-period\n[creation_grace_period: <duration> | default = 10m]\n\n# Maximum line size on ingestion path. Example: 256kb. Any log line exceeding\n# this limit will be discarded unless `distributor.max-line-size-truncate` is\n# set, in which case it is truncated rather than discarded completely. There is\n# no limit when set to 0.\n# CLI flag: -distributor.max-line-size\n[max_line_size: <int> | default = 256KB]\n\n# Whether to truncate lines that exceed max_line_size.\n# CLI flag: -distributor.max-line-size-truncate\n[max_line_size_truncate: <boolean> | default = false]\n\n# Identifier that is added at the end of a truncated log line.\n# CLI flag: -distributor.max-line-size-truncate-identifier\n[max_line_size_truncate_identifier: <string> | default = \"\"]\n\n# Alter the log line timestamp during ingestion when the timestamp is the same\n# as the previous entry for the same stream. When enabled, if a log line in a\n# push request has the same timestamp as the previous line for the same stream,\n# one nanosecond is added to the log line. This will preserve the received order\n# of log lines with the exact same timestamp when they are queried, by slightly\n# altering their stored timestamp. NOTE: This is imperfect, because Loki accepts\n# out of order writes, and another push request for the same stream could\n# contain duplicate timestamps to existing entries and they will not be\n# incremented.\n# CLI flag: -validation.increment-duplicate-timestamps\n[increment_duplicate_timestamp: <boolean> | default = false]\n\n# Simulated latency to add to push requests. Used for testing. Set to 0s to\n# disable.\n# CLI flag: -limits.simulated-push-latency\n[simulated_push_latency: <duration> | default = 0s]\n\n# Enable experimental support for running multiple query variants over the same\n# underlying data. For example, running both a rate() and count_over_time()\n# query over the same range selector.\n# CLI flag: -limits.enable-multi-variant-queries\n[enable_multi_variant_queries: <boolean> | default = false]\n\n# Experimental: Detect fields from stream labels, structured metadata, or\n# json/logfmt formatted log line and put them into structured metadata of the\n# log entry.\ndiscover_generic_fields:\n  [fields: <map of string to list of strings>]\n\n# If no service_name label exists, Loki maps a single label from the configured\n# list to service_name. If none of the configured labels exist in the stream,\n# label is set to unknown_service. Empty list disables setting the label.\n# CLI flag: -validation.discover-service-name\n[discover_service_name: <list of strings> | default = [service app application app_name name app_kubernetes_io_name container container_name k8s_container_name component workload job k8s_job_name]]\n\n# Discover and add log levels during ingestion, if not present already. Levels\n# would be added to Structured Metadata with name\n# level/LEVEL/Level/Severity/severity/SEVERITY/lvl/LVL/Lvl (case-sensitive) and\n# one of the values from 'trace', 'debug', 'info', 'warn', 'error', 'critical',\n# 'fatal' (case insensitive).\n# CLI flag: -validation.discover-log-levels\n[discover_log_levels: <boolean> | default = true]\n\n# Field name to use for log levels. If not set, log level would be detected\n# based on pre-defined labels as mentioned above.\n# CLI flag: -validation.log-level-fields\n[log_level_fields: <list of strings> | default = [level LEVEL Level log.level severity SEVERITY Severity SeverityText lvl LVL Lvl severity_text Severity_Text SEVERITY_TEXT]]\n\n# Maximum depth to search for log level fields in JSON logs. A value of 0 or\n# less means unlimited depth. Default is 2 which searches the first 2 levels of\n# the JSON object.\n# CLI flag: -validation.log-level-from-json-max-depth\n[log_level_from_json_max_depth: <int> | default = 2]\n\n# When true an ingester takes into account only the streams that it owns\n# according to the ring while applying the stream limit.\n# CLI flag: -ingester.use-owned-stream-count\n[use_owned_stream_count: <boolean> | default = false]\n\n# Maximum number of active streams per user, per ingester. 0 to disable.\n# CLI flag: -ingester.max-streams-per-user\n[max_streams_per_user: <int> | default = 0]\n\n# Maximum number of active streams per user, across the cluster. 0 to disable.\n# When the global limit is enabled, each ingester is configured with a dynamic\n# local limit based on the replication factor and the current number of healthy\n# ingesters, and is kept updated whenever the number of ingesters change.\n# CLI flag: -ingester.max-global-streams-per-user\n[max_global_streams_per_user: <int> | default = 5000]\n\n# Deprecated. When true, out-of-order writes are accepted.\n# CLI flag: -ingester.unordered-writes\n[unordered_writes: <boolean> | default = true]\n\n# Maximum byte rate per second per stream, also expressible in human readable\n# forms (1MB, 256KB, etc).\n# CLI flag: -ingester.per-stream-rate-limit\n[per_stream_rate_limit: <int> | default = 3MB]\n\n# Maximum burst bytes per stream, also expressible in human readable forms (1MB,\n# 256KB, etc). This is how far above the rate limit a stream can 'burst' before\n# the stream is limited.\n# CLI flag: -ingester.per-stream-rate-limit-burst\n[per_stream_rate_limit_burst: <int> | default = 15MB]\n\n# Maximum number of chunks that can be fetched in a single query.\n# CLI flag: -store.query-chunk-limit\n[max_chunks_per_query: <int> | default = 2000000]\n\n# Limit the maximum of unique series that is returned by a metric query. When\n# the limit is reached an error is returned.\n# CLI flag: -querier.max-query-series\n[max_query_series: <int> | default = 500]\n\n# Limit how far back in time series data and metadata can be queried, up until\n# lookback duration ago. This limit is enforced in the query frontend, the\n# querier and the ruler. If the requested time range is outside the allowed\n# range, the request will not fail, but will be modified to only query data\n# within the allowed time range. The default value of 0 does not set a limit.\n# CLI flag: -querier.max-query-lookback\n[max_query_lookback: <duration> | default = 0s]\n\n# The limit to length of chunk store queries. 0 to disable.\n# CLI flag: -store.max-query-length\n[max_query_length: <duration> | default = 30d1h]\n\n# Limit the length of the [range] inside a range query. Default is 0 or\n# unlimited\n# CLI flag: -querier.max-query-range\n[max_query_range: <duration> | default = 0s]\n\n# Maximum number of queries that will be scheduled in parallel by the frontend.\n# CLI flag: -querier.max-query-parallelism\n[max_query_parallelism: <int> | default = 32]\n\n# Maximum number of queries will be scheduled in parallel by the frontend for\n# TSDB schemas.\n# CLI flag: -querier.tsdb-max-query-parallelism\n[tsdb_max_query_parallelism: <int> | default = 128]\n\n# Target maximum number of bytes assigned to a single sharded query. Also\n# expressible in human readable forms (1GB, etc). Note: This is a _target_ and\n# not an absolute limit. The actual limit can be higher, but the query planner\n# will try to build shards up to this limit.\n# CLI flag: -querier.tsdb-max-bytes-per-shard\n[tsdb_max_bytes_per_shard: <int> | default = 600MB]\n\n# sharding strategy to use in query planning. Suggested to use bounded once all\n# nodes can recognize it.\n# CLI flag: -limits.tsdb-sharding-strategy\n[tsdb_sharding_strategy: <string> | default = \"power_of_two\"]\n\n# Precompute chunks for TSDB queries. This can improve query performance at the\n# cost of increased memory usage by computing chunks once during planning,\n# reducing index calls.\n# CLI flag: -querier.tsdb-precompute-chunks\n[tsdb_precompute_chunks: <boolean> | default = false]\n\n# Cardinality limit for index queries.\n# CLI flag: -store.cardinality-limit\n[cardinality_limit: <int> | default = 100000]\n\n# Maximum number of stream matchers per query.\n# CLI flag: -querier.max-streams-matcher-per-query\n[max_streams_matchers_per_query: <int> | default = 1000]\n\n# Maximum number of concurrent tail requests.\n# CLI flag: -querier.max-concurrent-tail-requests\n[max_concurrent_tail_requests: <int> | default = 10]\n\n# Maximum number of log entries that will be returned for a query.\n# CLI flag: -validation.max-entries-limit\n[max_entries_limit_per_query: <int> | default = 5000]\n\n# Most recent allowed cacheable result per-tenant, to prevent caching very\n# recent results that might still be in flux.\n# CLI flag: -frontend.max-cache-freshness\n[max_cache_freshness_per_query: <duration> | default = 10m]\n\n# Do not cache metadata request if the end time is within the\n# frontend.max-metadata-cache-freshness window. Set this to 0 to apply no such\n# limits. Defaults to 24h.\n# CLI flag: -frontend.max-metadata-cache-freshness\n[max_metadata_cache_freshness: <duration> | default = 1d]\n\n# Do not cache requests with an end time that falls within Now minus this\n# duration. 0 disables this feature (default).\n# CLI flag: -frontend.max-stats-cache-freshness\n[max_stats_cache_freshness: <duration> | default = 10m]\n\n# Maximum number of queriers that can handle requests for a single tenant. If\n# set to 0 or value higher than number of available queriers, *all* queriers\n# will handle requests for the tenant. Each frontend (or query-scheduler, if\n# used) will select the same set of queriers for the same tenant (given that all\n# queriers are connected to all frontends / query-schedulers). This option only\n# works with queriers connecting to the query-frontend / query-scheduler, not\n# when using downstream URL.\n# CLI flag: -frontend.max-queriers-per-tenant\n[max_queriers_per_tenant: <int> | default = 0]\n\n# How much of the available query capacity (\"querier\" components in distributed\n# mode, \"read\" components in SSD mode) can be used by a single tenant. Allowed\n# values are 0.0 to 1.0. For example, setting this to 0.5 would allow a tenant\n# to use half of the available queriers for processing the query workload. If\n# set to 0, query capacity is determined by frontend.max-queriers-per-tenant.\n# When both frontend.max-queriers-per-tenant and frontend.max-query-capacity are\n# configured, smaller value of the resulting querier replica count is\n# considered: min(frontend.max-queriers-per-tenant, ceil(querier_replicas *\n# frontend.max-query-capacity)). *All* queriers will handle requests for the\n# tenant if neither limits are applied. This option only works with queriers\n# connecting to the query-frontend / query-scheduler, not when using downstream\n# URL. Use this feature in a multi-tenant setup where you need to limit query\n# capacity for certain tenants.\n# CLI flag: -frontend.max-query-capacity\n[max_query_capacity: <float> | default = 0]\n\n# Number of days of index to be kept always downloaded for queries. Applies only\n# to per user index in boltdb-shipper index store. 0 to disable.\n# CLI flag: -store.query-ready-index-num-days\n[query_ready_index_num_days: <int> | default = 0]\n\n# Timeout when querying backends (ingesters or storage) during the execution of\n# a query request. When a specific per-tenant timeout is used, the global\n# timeout is ignored.\n# CLI flag: -querier.query-timeout\n[query_timeout: <duration> | default = 1m]\n\n# Split queries by a time interval and execute in parallel. The value 0 disables\n# splitting by time. This also determines how cache keys are chosen when result\n# caching is enabled.\n# CLI flag: -querier.split-queries-by-interval\n[split_queries_by_interval: <duration> | default = 1h]\n\n# Split metadata queries by a time interval and execute in parallel. The value 0\n# disables splitting metadata queries by time. This also determines how cache\n# keys are chosen when label/series result caching is enabled.\n# CLI flag: -querier.split-metadata-queries-by-interval\n[split_metadata_queries_by_interval: <duration> | default = 1d]\n\n# Experimental. Split interval to use for the portion of metadata request that\n# falls within `recent_metadata_query_window`. Rest of the request which is\n# outside the window still uses `split_metadata_queries_by_interval`. If set to\n# 0, the entire request defaults to using a split interval of\n# `split_metadata_queries_by_interval.`.\n# CLI flag: -experimental.querier.split-recent-metadata-queries-by-interval\n[split_recent_metadata_queries_by_interval: <duration> | default = 1h]\n\n# Experimental. Metadata query window inside which\n# `split_recent_metadata_queries_by_interval` gets applied, portion of the\n# metadata request that falls in this window is split using\n# `split_recent_metadata_queries_by_interval`. The value 0 disables using a\n# different split interval for recent metadata queries.\n# \n# This is added to improve cacheability of recent metadata queries. Query split\n# interval also determines the interval used in cache key. The default split\n# interval of 24h is useful for caching long queries, each cache key holding 1\n# day's results. But metadata queries are often shorter than 24h, to cache them\n# effectively we need a smaller split interval. `recent_metadata_query_window`\n# along with `split_recent_metadata_queries_by_interval` help configure a\n# shorter split interval for recent metadata queries.\n# CLI flag: -experimental.querier.recent-metadata-query-window\n[recent_metadata_query_window: <duration> | default = 0s]\n\n# Split instant metric queries by a time interval and execute in parallel. The\n# value 0 disables splitting instant metric queries by time. This also\n# determines how cache keys are chosen when instant metric query result caching\n# is enabled.\n# CLI flag: -querier.split-instant-metric-queries-by-interval\n[split_instant_metric_queries_by_interval: <duration> | default = 1h]\n\n# Interval to use for time-based splitting when a request is within the\n# `query_ingesters_within` window; defaults to `split-queries-by-interval` by\n# setting to 0.\n# CLI flag: -querier.split-ingester-queries-by-interval\n[split_ingester_queries_by_interval: <duration> | default = 0s]\n\n# Limit queries that can be sharded. Queries within the time range of now and\n# now minus this sharding lookback are not sharded. The default value of 0s\n# disables the lookback, causing sharding of all queries at all times.\n# CLI flag: -frontend.min-sharding-lookback\n[min_sharding_lookback: <duration> | default = 0s]\n\n# Max number of bytes a query can fetch. Enforced in log and metric queries only\n# when TSDB is used. This limit is not enforced on log queries without filters.\n# The default value of 0 disables this limit.\n# CLI flag: -frontend.max-query-bytes-read\n[max_query_bytes_read: <int> | default = 0B]\n\n# Max number of bytes a query can fetch after splitting and sharding. Enforced\n# in log and metric queries only when TSDB is used. This limit is not enforced\n# on log queries without filters. The default value of 0 disables this limit.\n# CLI flag: -frontend.max-querier-bytes-read\n[max_querier_bytes_read: <int> | default = 150GB]\n\n# Enable log-volume endpoints.\n# CLI flag: -limits.volume-enabled\n[volume_enabled: <boolean> | default = true]\n\n# The maximum number of aggregated series in a log-volume response\n# CLI flag: -limits.volume-max-series\n[volume_max_series: <int> | default = 1000]\n\n# Maximum number of rules per rule group per-tenant. 0 to disable.\n# CLI flag: -ruler.max-rules-per-rule-group\n[ruler_max_rules_per_rule_group: <int> | default = 0]\n\n# Maximum number of rule groups per-tenant. 0 to disable.\n# CLI flag: -ruler.max-rule-groups-per-tenant\n[ruler_max_rule_groups_per_tenant: <int> | default = 0]\n\n# The default tenant's shard size when shuffle-sharding is enabled in the ruler.\n# When this setting is specified in the per-tenant overrides, a value of 0\n# disables shuffle sharding for the tenant.\n# CLI flag: -ruler.tenant-shard-size\n[ruler_tenant_shard_size: <int> | default = 0]\n\n# Enable WAL replay on ruler startup. Disabling this can reduce memory usage on\n# startup at the cost of not recovering in-memory WAL metrics on restart.\n# CLI flag: -ruler.enable-wal-replay\n[ruler_enable_wal_replay: <boolean> | default = true]\n\n# Disable recording rules remote-write.\n[ruler_remote_write_disabled: <boolean>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. The URL of the endpoint\n# to send samples to.\n[ruler_remote_write_url: <string> | default = \"\"]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Timeout for requests to\n# the remote write endpoint.\n[ruler_remote_write_timeout: <duration>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Custom HTTP headers to be\n# sent along with each remote write request. Be aware that headers that are set\n# by Loki itself can't be overwritten.\n[ruler_remote_write_headers: <headers>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. List of remote write\n# relabel configurations.\n[ruler_remote_write_relabel_configs: <relabel_config...>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Number of samples to\n# buffer per shard before we block reading of more samples from the WAL. It is\n# recommended to have enough capacity in each shard to buffer several requests\n# to keep throughput up while processing occasional slow remote requests.\n[ruler_remote_write_queue_capacity: <int>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Minimum number of shards,\n# i.e. amount of concurrency.\n[ruler_remote_write_queue_min_shards: <int>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Maximum number of shards,\n# i.e. amount of concurrency.\n[ruler_remote_write_queue_max_shards: <int>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Maximum number of samples\n# per send.\n[ruler_remote_write_queue_max_samples_per_send: <int>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Maximum time a sample\n# will wait in buffer.\n[ruler_remote_write_queue_batch_send_deadline: <duration>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Initial retry delay. Gets\n# doubled for every retry.\n[ruler_remote_write_queue_min_backoff: <duration>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Maximum retry delay.\n[ruler_remote_write_queue_max_backoff: <duration>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Retry upon receiving a\n# 429 status code from the remote-write storage. This is experimental and might\n# change in the future.\n[ruler_remote_write_queue_retry_on_ratelimit: <boolean>]\n\n# Deprecated: Use 'ruler_remote_write_config' instead. Configures AWS's\n# Signature Verification 4 signing process to sign every remote write request.\nruler_remote_write_sigv4_config:\n  [region: <string> | default = \"\"]\n\n  [access_key: <string> | default = \"\"]\n\n  [secret_key: <string> | default = \"\"]\n\n  [profile: <string> | default = \"\"]\n\n  [role_arn: <string> | default = \"\"]\n\n# Configures global and per-tenant limits for remote write clients. A map with\n# remote client id as key.\n[ruler_remote_write_config: <map of string to RemoteWriteConfig>]\n\n# Timeout for a remote rule evaluation. Defaults to the value of\n# 'querier.query-timeout'.\n[ruler_remote_evaluation_timeout: <duration>]\n\n# Maximum size (in bytes) of the allowable response size from a remote rule\n# evaluation. Set to 0 to allow any response size (default).\n[ruler_remote_evaluation_max_response_size: <int>]\n\n# Deletion mode. Can be one of 'disabled', 'filter-only', or\n# 'filter-and-delete'. When set to 'filter-only' or 'filter-and-delete', and if\n# retention_enabled is true, then the log entry deletion API endpoints are\n# available.\n# CLI flag: -compactor.deletion-mode\n[deletion_mode: <string> | default = \"filter-and-delete\"]\n\n# Retention period to apply to stored data, only applies if retention_enabled is\n# true in the compactor config. As of version 2.8.0, a zero value of 0 or 0s\n# disables retention. In previous releases, Loki did not properly honor a zero\n# value to disable retention and a really large value should be used instead.\n# CLI flag: -store.retention\n[retention_period: <duration> | default = 0s]\n\n# Per-stream retention to apply, if the retention is enabled on the compactor\n# side.\n# Example:\n#  retention_stream:\n#  - selector: '{namespace=\"dev\"}'\n#  priority: 1\n#  period: 24h\n# - selector: '{container=\"nginx\"}'\n#  priority: 1\n#  period: 744h\n# Selector is a Prometheus labels matchers that will apply the 'period'\n# retention only if the stream is matching. In case multiple streams are\n# matching, the highest priority will be picked. If no rule is matched the\n# 'retention_period' is used.\n[retention_stream: <list of StreamRetentions>]\n\n# Feature renamed to 'runtime configuration', flag deprecated in favor of\n# -runtime-config.file (runtime_config.file in YAML).\n# CLI flag: -limits.per-user-override-config\n[per_tenant_override_config: <string> | default = \"\"]\n\n# Feature renamed to 'runtime configuration'; flag deprecated in favor of\n# -runtime-config.reload-period (runtime_config.period in YAML).\n# CLI flag: -limits.per-user-override-period\n[per_tenant_override_period: <duration> | default = 10s]\n\n# Deprecated: Use deletion_mode per tenant configuration instead.\n[allow_deletes: <boolean>]\n\n# Define streams sharding behavior.\nshard_streams:\n  # Automatically shard streams to keep them under the per-stream rate limit.\n  # Sharding is dictated by the desired rate.\n  # CLI flag: -shard-streams.enabled\n  [enabled: <boolean> | default = true]\n\n  # Automatically shard streams by adding a __time_shard__ label, with values\n  # calculated from the log timestamps divided by MaxChunkAge/2. This allows the\n  # out-of-order ingestion of very old logs. If both flags are enabled,\n  # time-based sharding will happen before rate-based sharding.\n  # CLI flag: -shard-streams.time-sharding-enabled\n  [time_sharding_enabled: <boolean> | default = false]\n\n  # Logs with timestamps that are newer than this value will not be\n  # time-sharded.\n  # CLI flag: -shard-streams.time-sharding-ignore-recent\n  [time_sharding_ignore_recent: <duration> | default = 40m]\n\n  # Whether to log sharding streams behavior or not. Not recommended for\n  # production environments.\n  # CLI flag: -shard-streams.logging-enabled\n  [logging_enabled: <boolean> | default = false]\n\n  # Threshold used to cut a new shard. Default (1536KB) means if a rate is above\n  # 1536KB/s, it will be sharded into two streams.\n  # CLI flag: -shard-streams.desired-rate\n  [desired_rate: <int> | default = 1536KB]\n\n[blocked_queries: <blocked_query...>]\n\n# Define a list of required selector labels.\n[required_labels: <list of strings>]\n\n# Minimum number of label matchers a query should contain.\n[minimum_labels_number: <int>]\n\n# The shard size defines how many index gateways should be used by a tenant for\n# querying. If the global shard factor is 0, the global shard factor is set to\n# the deprecated -replication-factor for backwards compatibility reasons.\n# CLI flag: -index-gateway.shard-size\n[index_gateway_shard_size: <int> | default = 0]\n\n# Experimental. Defines a fraction (between 0.0 and 1.0) of the total index\n# gateways available for a each tenant. A value of 0.0 has the same effect as\n# 1.0, meaning all available index gateways. This setting only applies to simple\n# mode.\n# CLI flag: -index-gateway.max-capacity\n[index_gateway_max_capacity: <float> | default = 1]\n\n# Experimental. Whether to use the bloom gateway component in the read path to\n# filter chunks.\n# CLI flag: -bloom-gateway.enable-filtering\n[bloom_gateway_enable_filtering: <boolean> | default = false]\n\n# Experimental. Maximum number of builders to use when building blooms. 0 allows\n# unlimited builders.\n# CLI flag: -bloom-build.max-builders\n[bloom_build_max_builders: <int> | default = 0]\n\n# Experimental. Maximum number of retries for a failed task. If a task fails\n# more than this number of times, it is considered failed and will not be\n# retried. A value of 0 disables this limit.\n# CLI flag: -bloom-build.task-max-retries\n[bloom_build_task_max_retries: <int> | default = 3]\n\n# Experimental. Timeout for a builder to finish a task. If a builder does not\n# respond within this time, it is considered failed and the task will be\n# requeued. 0 disables the timeout.\n# CLI flag: -bloom-build.builder-response-timeout\n[bloom_build_builder_response_timeout: <duration> | default = 0s]\n\n# Experimental. Whether to create blooms for the tenant.\n# CLI flag: -bloom-build.enable\n[bloom_creation_enabled: <boolean> | default = false]\n\n# Experimental. Bloom planning strategy to use in bloom creation. Can be one of:\n# 'split_keyspace_by_factor', 'split_by_series_chunks_size'\n# CLI flag: -bloom-build.planning-strategy\n[bloom_planning_strategy: <string> | default = \"split_keyspace_by_factor\"]\n\n# Experimental. Only if `bloom-build.planning-strategy` is 'split'. Number of\n# splits to create for the series keyspace when building blooms. The series\n# keyspace is split into this many parts to parallelize bloom creation.\n# CLI flag: -bloom-build.split-keyspace-by\n[bloom_split_series_keyspace_by: <int> | default = 256]\n\n# Experimental. Target chunk size in bytes for bloom tasks. Default is 20GB.\n# CLI flag: -bloom-build.split-target-series-chunk-size\n[bloom_task_target_series_chunk_size: <int> | default = 20GB]\n\n# Experimental. Compression algorithm for bloom block pages.\n# CLI flag: -bloom-build.block-encoding\n[bloom_block_encoding: <string> | default = \"none\"]\n\n# Experimental. Prefetch blocks on bloom gateways as soon as they are built.\n# CLI flag: -bloom-build.prefetch-blocks\n[bloom_prefetch_blocks: <boolean> | default = false]\n\n# Experimental. The maximum bloom block size. A value of 0 sets an unlimited\n# size. Default is 200MB. The actual block size might exceed this limit since\n# blooms will be added to blocks until the block exceeds the maximum block size.\n# CLI flag: -bloom-build.max-block-size\n[bloom_max_block_size: <int> | default = 200MB]\n\n# Experimental. The maximum bloom size per log stream. A log stream whose\n# generated bloom filter exceeds this size will be discarded. A value of 0 sets\n# an unlimited size. Default is 128MB.\n# CLI flag: -bloom-build.max-bloom-size\n[bloom_max_bloom_size: <int> | default = 128MB]\n\n# Allow user to send structured metadata in push payload.\n# CLI flag: -validation.allow-structured-metadata\n[allow_structured_metadata: <boolean> | default = true]\n\n# Maximum size accepted for structured metadata per log line.\n# CLI flag: -limits.max-structured-metadata-size\n[max_structured_metadata_size: <int> | default = 64KB]\n\n# Maximum number of structured metadata entries per log line.\n# CLI flag: -limits.max-structured-metadata-entries-count\n[max_structured_metadata_entries_count: <int> | default = 128]\n\n# OTLP log ingestion configurations\notlp_config:\n  # Configuration for resource attributes to store them as index labels or\n  # Structured Metadata or drop them altogether\n  resource_attributes:\n    # Configure whether to ignore the default list of resource attributes set in\n    # 'distributor.otlp.default_resource_attributes_as_index_labels' to be\n    # stored as index labels and only use the given resource attributes config\n    [ignore_defaults: <boolean> | default = false]\n\n    [attributes_config: <list of attributes_configs>]\n\n  # Configuration for scope attributes to store them as Structured Metadata or\n  # drop them altogether\n  [scope_attributes: <list of attributes_configs>]\n\n  # Configuration for log attributes to store them as index labels or Structured\n  # Metadata or drop them altogether\n  [log_attributes: <list of attributes_configs>]\n\n  # When true, the severity_text field from log records will be stored as an\n  # index label. It is recommended not to use this option unless absolutely\n  # necessary\n  [severity_text_as_label: <boolean> | default = false]\n\n# Block ingestion for policy until the configured date. The policy '*' is the\n# global policy, which is applied to all streams not matching a policy and can\n# be overridden by other policies. The time should be in RFC3339 format. The\n# policy is based on the policy_stream_mapping configuration.\n[block_ingestion_policy_until: <map of string to Time>]\n\n# Block ingestion until the configured date. The time should be in RFC3339\n# format.\n# CLI flag: -limits.block-ingestion-until\n[block_ingestion_until: <time> | default = 0]\n\n# HTTP status code to return when ingestion is blocked. If 200, the ingestion\n# will be blocked without returning an error to the client. By Default, a custom\n# status code (260) is returned to the client along with an error message.\n# CLI flag: -limits.block-ingestion-status-code\n[block_ingestion_status_code: <int> | default = 260]\n\n# List of labels that must be present in the stream. If any of the labels are\n# missing, the stream will be discarded. This flag configures it globally for\n# all tenants. Experimental.\n# CLI flag: -validation.enforced-labels\n[enforced_labels: <list of strings> | default = []]\n\n# Map of policies to enforced labels. The policy '*' is the global policy, which\n# is applied to all streams and can be extended by other policies. Example:\n#  policy_enforced_labels: \n#   policy1: \n#     - label1 \n#     - label2 \n#   policy2: \n#     - label3 \n#     - label4\n#   '*':\n#     - label5\n[policy_enforced_labels: <map of string to list of strings>]\n\n# Map of policies to stream selectors with a priority. Experimental.  Example:\n#  policy_stream_mapping: \n#   finance: \n#     - selector: '{namespace=\"prod\", container=\"billing\"}' \n#       priority: 2 \n#   ops: \n#     - selector: '{namespace=\"prod\", container=\"ops\"}' \n#       priority: 1 \n#   staging: \n#     - selector: '{namespace=\"staging\"}' \n#       priority: 1\n[policy_stream_mapping: <map of string to list of PriorityStreams>]\n\n# The number of partitions a tenant's data should be sharded to when using kafka\n# ingestion. Tenants are sharded across partitions using shuffle-sharding. 0\n# disables shuffle sharding and tenant is sharded across all partitions.\n# CLI flag: -limits.ingestion-partition-tenant-shard-size\n[ingestion_partitions_tenant_shard_size: <int> | default = 0]\n\n# List of LogQL vector and range aggregations that should be sharded.\n[shard_aggregations: <list of strings>]\n\n# Default list of JSON fields to tokenize for pattern detection. It is recommend\n# to append to or delete from the defaults rather than replacing them.\n# CLI flag: -limits.pattern-ingester-tokenizable-json-fields\n[pattern_ingester_tokenizable_json_fields_default: <string> | default = \"log,message,msg,msg_,_msg,content\"]\n\n# List of additional JSON fields to tokenize for pattern detection.\n# CLI flag: -limits.pattern-ingester-tokenizable-json-fields-append\n[pattern_ingester_tokenizable_json_fields_append: <string> | default = \"\"]\n\n# List of JSON fields to excluded from the defaults to tokenize for pattern\n# detection.\n# CLI flag: -limits.pattern-ingester-tokenizable-json-fields-delete\n[pattern_ingester_tokenizable_json_fields_delete: <string> | default = \"\"]\n\n# Enable metric aggregation. When enabled, pushed streams will be sampled for\n# bytes and line counts. These metrics will be written back into Loki as a\n# special __aggregated_metric__ stream.\n# CLI flag: -limits.aggregation-enabled\n[metric_aggregation_enabled: <boolean> | default = false]\n\n# Enable persistence of patterns detected at ingest. When enabled, patterns for\n# pushed streams will be written back into Loki as a special __pattern__ stream.\n# CLI flag: -limits.pattern-persistence-enabled\n[pattern_persistence_enabled: <boolean> | default = false]\n\n# The time granularity for persisting patterns. Controls how many data points\n# are written when patterns are flushed. Set to 0 to use the default from the\n# pattern ingester configuration.\n# CLI flag: -limits.pattern-persistence-granularity\n[pattern_persistence_granularity: <duration> | default = 0s]\n\n# Minimum pattern rate (samples per second) required for a pattern to be\n# persisted. Patterns with lower rates will be filtered out during persistence.\n# CLI flag: -limits.pattern-rate-threshold\n[pattern_rate_threshold: <float> | default = 1]\n\n# S3 server-side encryption type. Required to enable server-side encryption\n# overrides for a specific tenant. If not set, the default S3 client settings\n# are used.\n[s3_sse_type: <string> | default = \"\"]\n\n# S3 server-side encryption KMS Key ID. Ignored if the SSE type override is not\n# set.\n[s3_sse_kms_key_id: <string> | default = \"\"]\n\n# S3 server-side encryption KMS encryption context. If unset and the key ID\n# override is set, the encryption context will not be provided to S3. Ignored if\n# the SSE type override is not set.\n[s3_sse_kms_encryption_context: <string> | default = \"\"]\n\n# Experimental: Controls the amount of scan tasks that can be running in\n# parallel in the new query engine. The default of 0 means unlimited parallelism\n# and all tasks will be scheduled at once.\n# CLI flag: -limits.max-scan-task-parallelism\n[max_scan_task_parallelism: <int> | default = 0]\n\n# Experimental: Toggles verbose debug logging of tasks in the new query engine.\n# CLI flag: -limits.debug-engine-tasks\n[debug_engine_tasks: <boolean> | default = false]\n\n# Experimental: Toggles verbose debug logging of data streams in the new query\n# engine.\n# CLI flag: -limits.debug-engine-streams\n[debug_engine_streams: <boolean> | default = false]\n```\n\n### local_storage_config\n\nThe `local_storage_config` block configures the usage of local file system as object storage backend.\n\n```yaml\n# Directory to store chunks in.\n# CLI flag: -local.chunk-directory\n[directory: <string> | default = \"\"]\n```\n\n### memberlist\n\nConfiguration for `memberlist` client. Only applies if the selected kvstore is memberlist.\n\nWhen a memberlist config with atleast 1 join_members is defined, kvstore of type memberlist is automatically selected for all the components that require a ring unless otherwise specified in the component's configuration section.\n\n```yaml\n# Name of the node in memberlist cluster. Defaults to hostname.\n# CLI flag: -memberlist.nodename\n[node_name: <string> | default = \"\"]\n\n# Add random suffix to the node name.\n# CLI flag: -memberlist.randomize-node-name\n[randomize_node_name: <boolean> | default = true]\n\n# The timeout for establishing a connection with a remote node, and for\n# read/write operations.\n# CLI flag: -memberlist.stream-timeout\n[stream_timeout: <duration> | default = 2s]\n\n# Multiplication factor used when sending out messages (factor * log(N+1)).\n# CLI flag: -memberlist.retransmit-factor\n[retransmit_factor: <int> | default = 4]\n\n# How often to use pull/push sync.\n# CLI flag: -memberlist.pullpush-interval\n[pull_push_interval: <duration> | default = 30s]\n\n# How often to gossip.\n# CLI flag: -memberlist.gossip-interval\n[gossip_interval: <duration> | default = 200ms]\n\n# How many nodes to gossip to.\n# CLI flag: -memberlist.gossip-nodes\n[gossip_nodes: <int> | default = 3]\n\n# How long to keep gossiping to dead nodes, to give them chance to refute their\n# death.\n# CLI flag: -memberlist.gossip-to-dead-nodes-time\n[gossip_to_dead_nodes_time: <duration> | default = 30s]\n\n# How soon can dead node's name be reclaimed with new address. 0 to disable.\n# CLI flag: -memberlist.dead-node-reclaim-time\n[dead_node_reclaim_time: <duration> | default = 0s]\n\n# Enable message compression. This can be used to reduce bandwidth usage at the\n# cost of slightly more CPU utilization.\n# CLI flag: -memberlist.compression-enabled\n[compression_enabled: <boolean> | default = true]\n\n# How frequently to notify watchers when a key changes. Can reduce CPU activity\n# in large memberlist deployments. 0 to notify without delay.\n# CLI flag: -memberlist.notify-interval\n[notify_interval: <duration> | default = 0s]\n\n# Gossip address to advertise to other members in the cluster. Used for NAT\n# traversal.\n# CLI flag: -memberlist.advertise-addr\n[advertise_addr: <string> | default = \"\"]\n\n# Gossip port to advertise to other members in the cluster. Used for NAT\n# traversal.\n# CLI flag: -memberlist.advertise-port\n[advertise_port: <int> | default = 7946]\n\n# The cluster label is an optional string to include in outbound packets and\n# gossip streams. Other members in the memberlist cluster will discard any\n# message whose label doesn't match the configured one, unless the\n# 'cluster-label-verification-disabled' configuration option is set to true.\n# CLI flag: -memberlist.cluster-label\n[cluster_label: <string> | default = \"\"]\n\n# When true, memberlist doesn't verify that inbound packets and gossip streams\n# have the cluster label matching the configured one. This verification should\n# be disabled while rolling out the change to the configured cluster label in a\n# live memberlist cluster.\n# CLI flag: -memberlist.cluster-label-verification-disabled\n[cluster_label_verification_disabled: <boolean> | default = false]\n\n# Other cluster members to join. Can be specified multiple times. It can be an\n# IP, hostname or an entry specified in the DNS Service Discovery format.\n# CLI flag: -memberlist.join\n[join_members: <list of strings> | default = []]\n\n# Min backoff duration to join other cluster members.\n# CLI flag: -memberlist.min-join-backoff\n[min_join_backoff: <duration> | default = 1s]\n\n# Max backoff duration to join other cluster members.\n# CLI flag: -memberlist.max-join-backoff\n[max_join_backoff: <duration> | default = 1m]\n\n# Max number of retries to join other cluster members.\n# CLI flag: -memberlist.max-join-retries\n[max_join_retries: <int> | default = 10]\n\n# Abort if this node fails the fast memberlist cluster joining procedure at\n# startup. When enabled, it's guaranteed that other services, depending on\n# memberlist, have an updated view over the cluster state when they're started.\n# CLI flag: -memberlist.abort-if-fast-join-fails\n[abort_if_cluster_fast_join_fails: <boolean> | default = false]\n\n# Abort if this node fails to join memberlist cluster at startup. When enabled,\n# it's not guaranteed that other services are started only after the cluster\n# state has been successfully updated; use 'abort-if-fast-join-fails' instead.\n# CLI flag: -memberlist.abort-if-join-fails\n[abort_if_cluster_join_fails: <boolean> | default = false]\n\n# If not 0, how often to rejoin the cluster. Occasional rejoin can help to fix\n# the cluster split issue, and is harmless otherwise. For example when using\n# only few components as a seed nodes (via -memberlist.join), then it's\n# recommended to use rejoin. If -memberlist.join points to dynamic service that\n# resolves to all gossiping nodes (eg. Kubernetes headless service), then rejoin\n# is not needed.\n# CLI flag: -memberlist.rejoin-interval\n[rejoin_interval: <duration> | default = 0s]\n\n# How long to keep LEFT ingesters in the ring.\n# CLI flag: -memberlist.left-ingesters-timeout\n[left_ingesters_timeout: <duration> | default = 5m]\n\n# How long to keep obsolete entries in the KV store.\n# CLI flag: -memberlist.obsolete-entries-timeout\n[obsolete_entries_timeout: <duration> | default = 30s]\n\n# Timeout for leaving memberlist cluster.\n# CLI flag: -memberlist.leave-timeout\n[leave_timeout: <duration> | default = 20s]\n\n# Timeout for broadcasting all remaining locally-generated updates to other\n# nodes when shutting down. Only used if there are nodes left in the memberlist\n# cluster, and only applies to locally-generated updates, not to broadcast\n# messages that are result of incoming gossip updates. 0 = no timeout, wait\n# until all locally-generated updates are sent.\n# CLI flag: -memberlist.broadcast-timeout-for-local-updates-on-shutdown\n[broadcast_timeout_for_local_updates_on_shutdown: <duration> | default = 10s]\n\n# How much space to use for keeping received and sent messages in memory for\n# troubleshooting (two buffers). 0 to disable.\n# CLI flag: -memberlist.message-history-buffer-bytes\n[message_history_buffer_bytes: <int> | default = 0]\n\n# Size of the buffered channel for the WatchPrefix function.\n# CLI flag: -memberlist.watch-prefix-buffer-size\n[watch_prefix_buffer_size: <int> | default = 128]\n\n# IP address to listen on for gossip messages. Multiple addresses may be\n# specified. Defaults to 0.0.0.0\n# CLI flag: -memberlist.bind-addr\n[bind_addr: <list of strings> | default = []]\n\n# Port to listen on for gossip messages.\n# CLI flag: -memberlist.bind-port\n[bind_port: <int> | default = 7946]\n\n# Timeout used when connecting to other nodes to send packet.\n# CLI flag: -memberlist.packet-dial-timeout\n[packet_dial_timeout: <duration> | default = 2s]\n\n# Timeout for writing 'packet' data.\n# CLI flag: -memberlist.packet-write-timeout\n[packet_write_timeout: <duration> | default = 5s]\n\n# Maximum number of concurrent writes to other nodes.\n# CLI flag: -memberlist.max-concurrent-writes\n[max_concurrent_writes: <int> | default = 3]\n\n# Timeout for acquiring one of the concurrent write slots. After this time, the\n# message will be dropped.\n# CLI flag: -memberlist.acquire-writer-timeout\n[acquire_writer_timeout: <duration> | default = 250ms]\n\n# Enable TLS on the memberlist transport layer.\n# CLI flag: -memberlist.tls-enabled\n[tls_enabled: <boolean> | default = false]\n\n# The TLS configuration.\n# The CLI flags prefix for this block configuration is: memberlist\n[<tls_config>]\n\nzone_aware_routing:\n  # Enable zone-aware routing for memberlist gossip.\n  # CLI flag: -memberlist.zone-aware-routing.enabled\n  [enabled: <boolean> | default = false]\n\n  # Availability zone where this node is running.\n  # CLI flag: -memberlist.zone-aware-routing.instance-availability-zone\n  [instance_availability_zone: <string> | default = \"\"]\n\n  # Role of this node in the cluster. Valid values: member, bridge.\n  # CLI flag: -memberlist.zone-aware-routing.role\n  [role: <string> | default = \"member\"]\n```\n\n### named_stores_config\n\nConfigures additional object stores for a given storage provider.\nSupported stores: aws, azure, bos, filesystem, gcs, swift.\nExample:\n```yaml\n    storage_config:\n      named_stores:\n        aws:\n          store-1:\n            endpoint: s3://foo-bucket\n            region: us-west1\n```\nNamed store from this example can be used by setting object_store to store-1 in period_config.\n\n```yaml\n[aws: <map of string to aws_storage_config>]\n\n[azure: <map of string to azure_storage_config>]\n\n[bos: <map of string to bos_storage_config>]\n\n[filesystem: <map of string to local_storage_config>]\n\n[gcs: <map of string to gcs_storage_config>]\n\n[alibabacloud: <map of string to alibabacloud_storage_config>]\n\n[swift: <map of string to swift_storage_config>]\n\n[cos: <map of string to cos_storage_config>]\n```\n\n### operational_config\n\nThese are values which allow you to control aspects of Loki's operation, most commonly used for controlling types of higher verbosity logging, the values here can be overridden in the `configs` section of the `runtime_config` file.\n\n```yaml\n# Log every new stream created by a push request (very verbose, recommend to\n# enable via runtime config only).\n# CLI flag: -operation-config.log-stream-creation\n[log_stream_creation: <boolean> | default = false]\n\n# Log every push request (very verbose, recommend to enable via runtime config\n# only).\n# CLI flag: -operation-config.log-push-request\n[log_push_request: <boolean> | default = false]\n\n# Log a commutative hash of the labels for all streams in a push request. In\n# some cases this can potentially be used as an identifier of the agent sending\n# the stream. Calculating hashes is epensive so only enable as needed.\n# CLI flag: -operation-config.log-hash-of-labels\n[log_hash_of_labels: <boolean> | default = false]\n\n# Log every stream in a push request (very verbose, recommend to enable via\n# runtime config only).\n# CLI flag: -operation-config.log-push-request-streams\n[log_push_request_streams: <boolean> | default = false]\n\n# Only show streams that match a provided IP address, LogPushRequestStreams must\n# be enabled. Can be used multiple times to filter by multiple IPs.\n# CLI flag: -operation-config.filter-push-request-streams-ips\n[filter_push_request_streams_ips: <list of strings> | default = []]\n\n# Log service name discovery (very verbose, recommend to enable via runtime\n# config only).\n# CLI flag: -operation-config.log-service-name-discovery\n[log_service_name_discovery: <boolean> | default = false]\n\n# Log metrics for duplicate lines received.\n# CLI flag: -operation-config.log-duplicate-metrics\n[log_duplicate_metrics: <boolean> | default = false]\n\n# Log stream info for duplicate lines received\n# CLI flag: -operation-config.log-duplicate-stream-info\n[log_duplicate_stream_info: <boolean> | default = false]\n\n# Log push errors with a rate limited logger, will show client push errors\n# without overly spamming logs.\n# CLI flag: -operation-config.limited-log-push-errors\n[limited_log_push_errors: <boolean> | default = true]\n```\n\n### period_config\n\nThe `period_config` block configures what index schemas should be used for from specific time periods.\n\n```yaml\n# The date of the first day that index buckets should be created. Use a date in\n# the past if this is your only period_config, otherwise use a date when you\n# want the schema to switch over. In YYYY-MM-DD format, for example: 2018-04-15.\n[from: <daytime>]\n\n# store and object_store below affect which <storage_config> key is used. Which\n# index to use. Either tsdb or boltdb-shipper. Following stores are deprecated:\n# aws, aws-dynamo, gcp, gcp-columnkey, bigtable, bigtable-hashed, cassandra,\n# grpc.\n[store: <string> | default = \"\"]\n\n# Which store to use for the chunks. Either aws (alias s3), azure, gcs,\n# alibabacloud, bos, cos, swift, filesystem, or a named_store (refer to\n# named_stores_config). Following stores are deprecated: aws-dynamo, gcp,\n# gcp-columnkey, bigtable, bigtable-hashed, cassandra, grpc.\n[object_store: <string> | default = \"\"]\n\n# The schema version to use, current recommended schema is v13.\n[schema: <string> | default = \"\"]\n\n# Configures how the index is updated and stored.\nindex:\n  # Path prefix for index tables. Prefix always needs to end with a path\n  # delimiter '/', except when the prefix is empty.\n  [path_prefix: <string> | default = \"index/\"]\n\n  # Table prefix for all period tables.\n  [prefix: <string> | default = \"\"]\n\n  # Table period.\n  [period: <duration>]\n\n  # A map to be added to all managed tables.\n  [tags: <map of string to string>]\n\n# Configured how the chunks are updated and stored.\nchunks:\n  # Table prefix for all period tables.\n  [prefix: <string> | default = \"\"]\n\n  # Table period.\n  [period: <duration>]\n\n  # A map to be added to all managed tables.\n  [tags: <map of string to string>]\n\n# How many shards will be created. Only used if schema is v10 or greater.\n[row_shards: <int> | default = 16]\n```\n\n### profiling\n\nConfiguration for `profiling` options.\n\n```yaml\n# Sets the value for runtime.SetBlockProfilingRate\n# CLI flag: -profiling.block-profile-rate\n[block_profile_rate: <int> | default = 0]\n\n# Sets the value for runtime.SetCPUProfileRate\n# CLI flag: -profiling.cpu-profile-rate\n[cpu_profile_rate: <int> | default = 0]\n\n# Sets the value for runtime.SetMutexProfileFraction\n# CLI flag: -profiling.mutex-profile-fraction\n[mutex_profile_fraction: <int> | default = 0]\n```\n\n### querier\n\nConfigures the `querier`. Only appropriate when running all modules or just the querier.\n\n```yaml\n# Maximum duration for which the live tailing requests are served.\n# CLI flag: -querier.tail-max-duration\n[tail_max_duration: <duration> | default = 1h]\n\n# Time to wait before sending more than the minimum successful query requests.\n# CLI flag: -querier.extra-query-delay\n[extra_query_delay: <duration> | default = 0s]\n\n# Maximum lookback beyond which queries are not sent to ingester. 0 means all\n# queries are sent to ingester.\n# CLI flag: -querier.query-ingesters-within\n[query_ingesters_within: <duration> | default = 3h]\n\nengine:\n  # The maximum amount of time to look back for log lines. Used only for instant\n  # log queries.\n  # CLI flag: -querier.engine.max-lookback-period\n  [max_look_back_period: <duration> | default = 30s]\n\n  # The maximum number of labels the heap of a topk query using a count min\n  # sketch can track.\n  # CLI flag: -querier.engine.max-count-min-sketch-heap-size\n  [max_count_min_sketch_heap_size: <int> | default = 10000]\n\n# The maximum number of queries that can be simultaneously processed by the\n# querier.\n# CLI flag: -querier.max-concurrent\n[max_concurrent: <int> | default = 4]\n\n# Only query the store, and not attempt any ingesters. This is useful for\n# running a standalone querier pool operating only against stored data.\n# CLI flag: -querier.query-store-only\n[query_store_only: <boolean> | default = false]\n\n# When true, queriers only query the ingesters, and not stored data. This is\n# useful when the object store is unavailable.\n# CLI flag: -querier.query-ingester-only\n[query_ingester_only: <boolean> | default = false]\n\n# When true, allow queries to span multiple tenants.\n# CLI flag: -querier.multi-tenant-queries-enabled\n[multi_tenant_queries_enabled: <boolean> | default = false]\n\n# When true, querier limits sent via a header are enforced.\n# CLI flag: -querier.per-request-limits-enabled\n[per_request_limits_enabled: <boolean> | default = false]\n\n# When true, querier directs ingester queries to the partition-ingesters instead\n# of the normal ingesters.\n# CLI flag: -querier.query-partition-ingesters\n[query_partition_ingesters: <boolean> | default = false]\n```\n\n### query_range\n\nThe `query_range` block configures the query splitting and caching in the Loki query-frontend.\n\n```yaml\n# Mutate incoming queries to align their start and end with their step.\n# CLI flag: -querier.align-querier-with-step\n[align_queries_with_step: <boolean> | default = false]\n\nresults_cache:\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is: frontend\n  [cache: <cache_config>]\n\n  # Use compression in cache. The default is an empty value '', which disables\n  # compression. Supported values are: 'snappy' and ''.\n  # CLI flag: -frontend.compression\n  [compression: <string> | default = \"\"]\n\n# Cache query results.\n# CLI flag: -querier.cache-results\n[cache_results: <boolean> | default = false]\n\n# Maximum number of retries for a single request; beyond this, the downstream\n# error is returned.\n# CLI flag: -querier.max-retries-per-request\n[max_retries: <int> | default = 5]\n\n# Perform query parallelisations based on storage sharding configuration and\n# query ASTs. This feature is supported only by the chunks storage engine.\n# CLI flag: -querier.parallelise-shardable-queries\n[parallelise_shardable_queries: <boolean> | default = true]\n\n# A comma-separated list of LogQL vector and range aggregations that should be\n# sharded. Possible values 'quantile_over_time', 'last_over_time',\n# 'first_over_time'.\n# CLI flag: -querier.shard-aggregations\n[shard_aggregations: <string> | default = \"\"]\n\n# Cache index stats query results.\n# CLI flag: -querier.cache-index-stats-results\n[cache_index_stats_results: <boolean> | default = true]\n\n# If a cache config is not specified and cache_index_stats_results is true, the\n# config for the results cache is used.\nindex_stats_results_cache:\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is:\n  # frontend.index-stats-results-cache\n  [cache: <cache_config>]\n\n  # Use compression in cache. The default is an empty value '', which disables\n  # compression. Supported values are: 'snappy' and ''.\n  # CLI flag: -frontend.index-stats-results-cache.compression\n  [compression: <string> | default = \"\"]\n\n# Cache volume query results.\n# CLI flag: -querier.cache-volume-results\n[cache_volume_results: <boolean> | default = true]\n\n# If a cache config is not specified and cache_volume_results is true, the\n# config for the results cache is used.\nvolume_results_cache:\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is:\n  # frontend.volume-results-cache\n  [cache: <cache_config>]\n\n  # Use compression in cache. The default is an empty value '', which disables\n  # compression. Supported values are: 'snappy' and ''.\n  # CLI flag: -frontend.volume-results-cache.compression\n  [compression: <string> | default = \"\"]\n\n# Cache instant metric query results.\n# CLI flag: -querier.cache-instant-metric-results\n[cache_instant_metric_results: <boolean> | default = false]\n\n# If a cache config is not specified and cache_instant_metric_results is true,\n# the config for the results cache is used.\ninstant_metric_results_cache:\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is:\n  # frontend.instant-metric-results-cache\n  [cache: <cache_config>]\n\n  # Use compression in cache. The default is an empty value '', which disables\n  # compression. Supported values are: 'snappy' and ''.\n  # CLI flag: -frontend.instant-metric-results-cache.compression\n  [compression: <string> | default = \"\"]\n\n# Whether to align the splits of instant metric query with splitByInterval and\n# query's exec time. Useful when instant_metric_cache is enabled\n# CLI flag: -querier.instant-metric-query-split-align\n[instant_metric_query_split_align: <boolean> | default = false]\n\n# Cache series query results.\n# CLI flag: -querier.cache-series-results\n[cache_series_results: <boolean> | default = true]\n\n# If series_results_cache is not configured and cache_series_results is true,\n# the config for the results cache is used.\nseries_results_cache:\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is:\n  # frontend.series-results-cache\n  [cache: <cache_config>]\n\n  # Use compression in cache. The default is an empty value '', which disables\n  # compression. Supported values are: 'snappy' and ''.\n  # CLI flag: -frontend.series-results-cache.compression\n  [compression: <string> | default = \"\"]\n\n# Cache label query results.\n# CLI flag: -querier.cache-label-results\n[cache_label_results: <boolean> | default = true]\n\n# If label_results_cache is not configured and cache_label_results is true, the\n# config for the results cache is used.\nlabel_results_cache:\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is:\n  # frontend.label-results-cache\n  [cache: <cache_config>]\n\n  # Use compression in cache. The default is an empty value '', which disables\n  # compression. Supported values are: 'snappy' and ''.\n  # CLI flag: -frontend.label-results-cache.compression\n  [compression: <string> | default = \"\"]\n```\n\n### query_scheduler\n\nThe `query_scheduler` block configures the Loki query scheduler. When configured it separates the tenant query queues from the query-frontend.\n\n```yaml\n# Maximum number of outstanding requests per tenant per query-scheduler.\n# In-flight requests above this limit will fail with HTTP response status code\n# 429.\n# CLI flag: -query-scheduler.max-outstanding-requests-per-tenant\n[max_outstanding_requests_per_tenant: <int> | default = 32000]\n\n# Maximum number of levels of nesting of hierarchical queues. 0 means that\n# hierarchical queues are disabled.\n# CLI flag: -query-scheduler.max-queue-hierarchy-levels\n[max_queue_hierarchy_levels: <int> | default = 3]\n\n# If a querier disconnects without sending notification about graceful shutdown,\n# the query-scheduler will keep the querier in the tenant's shard until the\n# forget delay has passed. This feature is useful to reduce the blast radius\n# when shuffle-sharding is enabled.\n# CLI flag: -query-scheduler.querier-forget-delay\n[querier_forget_delay: <duration> | default = 0s]\n\n# This configures the gRPC client used to report errors back to the\n# query-frontend.\n# The CLI flags prefix for this block configuration is:\n# query-scheduler.grpc-client-config\n[grpc_client_config: <grpc_client>]\n\n# Set to true to have the query schedulers create and place themselves in a\n# ring. If no frontend_address or scheduler_address are present anywhere else in\n# the configuration, Loki will toggle this value to true.\n# CLI flag: -query-scheduler.use-scheduler-ring\n[use_scheduler_ring: <boolean> | default = false]\n\n# The hash ring configuration. This option is required only if\n# use_scheduler_ring is true.\nscheduler_ring:\n  kvstore:\n    # Backend storage to use for the ring. Supported values are: consul, etcd,\n    # inmemory, memberlist, multi.\n    # CLI flag: -query-scheduler.ring.store\n    [store: <string> | default = \"consul\"]\n\n    # The prefix for the keys in the store. Should end with a /.\n    # CLI flag: -query-scheduler.ring.prefix\n    [prefix: <string> | default = \"collectors/\"]\n\n    # Configuration for a Consul client. Only applies if the selected kvstore is\n    # consul.\n    # The CLI flags prefix for this block configuration is: query-scheduler.ring\n    [consul: <consul>]\n\n    # Configuration for an ETCD v3 client. Only applies if the selected kvstore\n    # is etcd.\n    # The CLI flags prefix for this block configuration is: query-scheduler.ring\n    [etcd: <etcd>]\n\n    multi:\n      # Primary backend storage used by multi-client.\n      # CLI flag: -query-scheduler.ring.multi.primary\n      [primary: <string> | default = \"\"]\n\n      # Secondary backend storage used by multi-client.\n      # CLI flag: -query-scheduler.ring.multi.secondary\n      [secondary: <string> | default = \"\"]\n\n      # Mirror writes to the secondary store.\n      # CLI flag: -query-scheduler.ring.multi.mirror-enabled\n      [mirror_enabled: <boolean> | default = false]\n\n      # Timeout for storing a value to the secondary store.\n      # CLI flag: -query-scheduler.ring.multi.mirror-timeout\n      [mirror_timeout: <duration> | default = 2s]\n\n  # Period at which to heartbeat to the ring.\n  # CLI flag: -query-scheduler.ring.heartbeat-period\n  [heartbeat_period: <duration> | default = 15s]\n\n  # The heartbeat timeout after which compactors are considered unhealthy within\n  # the ring. 0 = never (timeout disabled).\n  # CLI flag: -query-scheduler.ring.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # File path where tokens are stored. If empty, tokens are not stored at\n  # shutdown and restored at startup.\n  # CLI flag: -query-scheduler.ring.tokens-file-path\n  [tokens_file_path: <string> | default = \"\"]\n\n  # True to enable zone-awareness and replicate blocks across different\n  # availability zones.\n  # CLI flag: -query-scheduler.ring.zone-awareness-enabled\n  [zone_awareness_enabled: <boolean> | default = false]\n\n  # Instance ID to register in the ring.\n  # CLI flag: -query-scheduler.ring.instance-id\n  [instance_id: <string> | default = \"<hostname>\"]\n\n  # Name of network interface to read address from.\n  # CLI flag: -query-scheduler.ring.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # Port to advertise in the ring (defaults to server.grpc-listen-port).\n  # CLI flag: -query-scheduler.ring.instance-port\n  [instance_port: <int> | default = 0]\n\n  # IP address to advertise in the ring.\n  # CLI flag: -query-scheduler.ring.instance-addr\n  [instance_addr: <string> | default = \"\"]\n\n  # The availability zone where this instance is running. Required if\n  # zone-awareness is enabled.\n  # CLI flag: -query-scheduler.ring.instance-availability-zone\n  [instance_availability_zone: <string> | default = \"\"]\n\n  # Enable using a IPv6 instance address.\n  # CLI flag: -query-scheduler.ring.instance-enable-ipv6\n  [instance_enable_ipv6: <boolean> | default = false]\n```\n\n### ruler\n\nThe `ruler` block configures the Loki ruler.\n\n```yaml\n# Base URL of the Grafana instance.\n# CLI flag: -ruler.external.url\n[external_url: <url>]\n\n# Datasource UID for the dashboard.\n# CLI flag: -ruler.datasource-uid\n[datasource_uid: <string> | default = \"\"]\n\n# Labels to add to all alerts.\nexternal_labels:\n\n# The grpc_client block configures the gRPC client used to communicate between a\n# client and server component in Loki.\n# The CLI flags prefix for this block configuration is: ruler.client\n[ruler_client: <grpc_client>]\n\n# How frequently to evaluate rules.\n# CLI flag: -ruler.evaluation-interval\n[evaluation_interval: <duration> | default = 1m]\n\n# How frequently to poll for rule changes.\n# CLI flag: -ruler.poll-interval\n[poll_interval: <duration> | default = 1m]\n\n# Deprecated: Use -ruler-storage. CLI flags and their respective YAML config\n# options instead.\nstorage:\n  # Method to use for backend rule storage (configdb, azure, gcs, s3, swift,\n  # local, bos, cos)\n  # CLI flag: -ruler.storage.type\n  [type: <string> | default = \"\"]\n\n  # Configures backend rule storage for Azure.\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [azure: <azure_storage_config>]\n\n  # Configures backend rule storage for AlibabaCloud Object Storage (OSS).\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [alibabacloud: <alibabacloud_storage_config>]\n\n  # Configures backend rule storage for GCS.\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [gcs: <gcs_storage_config>]\n\n  # Configures backend rule storage for S3.\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [s3: <s3_storage_config>]\n\n  # Configures backend rule storage for Baidu Object Storage (BOS).\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [bos: <bos_storage_config>]\n\n  # Configures backend rule storage for Swift.\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [swift: <swift_storage_config>]\n\n  # Configures backend rule storage for IBM Cloud Object Storage (COS).\n  # The CLI flags prefix for this block configuration is: ruler.storage\n  [cos: <cos_storage_config>]\n\n  # Configures backend rule storage for a local file system directory.\n  local:\n    # Directory to scan for rules\n    # CLI flag: -ruler.storage.local.directory\n    [directory: <string> | default = \"\"]\n\n# File path to store temporary rule files.\n# CLI flag: -ruler.rule-path\n[rule_path: <string> | default = \"/rules\"]\n\n# Comma-separated list of Alertmanager URLs to send notifications to. Each\n# Alertmanager URL is treated as a separate group in the configuration. Multiple\n# Alertmanagers in HA per group can be supported by using DNS resolution via\n# '-ruler.alertmanager-discovery'.\n# CLI flag: -ruler.alertmanager-url\n[alertmanager_url: <string> | default = \"\"]\n\n# Use DNS SRV records to discover Alertmanager hosts.\n# CLI flag: -ruler.alertmanager-discovery\n[enable_alertmanager_discovery: <boolean> | default = false]\n\n# How long to wait between refreshing DNS resolutions of Alertmanager hosts.\n# CLI flag: -ruler.alertmanager-refresh-interval\n[alertmanager_refresh_interval: <duration> | default = 1m]\n\n# Use Alertmanager APIv2. APIv1 was deprecated in Alertmanager 0.16.0 and is\n# removed as of 0.27.0.\n# CLI flag: -ruler.alertmanager-use-v2\n[enable_alertmanager_v2: <boolean> | default = true]\n\n# List of alert relabel configs.\n[alert_relabel_configs: <relabel_config...>]\n\n# Capacity of the queue for notifications to be sent to the Alertmanager.\n# CLI flag: -ruler.notification-queue-capacity\n[notification_queue_capacity: <int> | default = 10000]\n\n# HTTP timeout duration when sending notifications to the Alertmanager.\n# CLI flag: -ruler.notification-timeout\n[notification_timeout: <duration> | default = 10s]\n\nalertmanager_client:\n  # The TLS configuration.\n  # The CLI flags prefix for this block configuration is:\n  # ruler.alertmanager-client\n  [<tls_config>]\n\n  # HTTP Basic authentication username. It overrides the username set in the URL\n  # (if any).\n  # CLI flag: -ruler.alertmanager-client.basic-auth-username\n  [basic_auth_username: <string> | default = \"\"]\n\n  # HTTP Basic authentication password. It overrides the password set in the URL\n  # (if any).\n  # CLI flag: -ruler.alertmanager-client.basic-auth-password\n  [basic_auth_password: <string> | default = \"\"]\n\n  # HTTP Header authorization type (default: Bearer).\n  # CLI flag: -ruler.alertmanager-client.type\n  [type: <string> | default = \"Bearer\"]\n\n  # HTTP Header authorization credentials.\n  # CLI flag: -ruler.alertmanager-client.credentials\n  [credentials: <string> | default = \"\"]\n\n  # HTTP Header authorization credentials file.\n  # CLI flag: -ruler.alertmanager-client.credentials-file\n  [credentials_file: <string> | default = \"\"]\n\n# Max time to tolerate outage for restoring \"for\" state of alert.\n# CLI flag: -ruler.for-outage-tolerance\n[for_outage_tolerance: <duration> | default = 1h]\n\n# Minimum duration between alert and restored \"for\" state. This is maintained\n# only for alerts with configured \"for\" time greater than the grace period.\n# CLI flag: -ruler.for-grace-period\n[for_grace_period: <duration> | default = 10m]\n\n# Minimum amount of time to wait before resending an alert to Alertmanager.\n# CLI flag: -ruler.resend-delay\n[resend_delay: <duration> | default = 1m]\n\n# Distribute rule evaluation using ring backend.\n# CLI flag: -ruler.enable-sharding\n[enable_sharding: <boolean> | default = false]\n\n# The sharding strategy to use. Supported values are: default, shuffle-sharding.\n# CLI flag: -ruler.sharding-strategy\n[sharding_strategy: <string> | default = \"default\"]\n\n# The sharding algorithm to use for deciding how rules & groups are sharded.\n# Supported values are: by-group, by-rule.\n# CLI flag: -ruler.sharding-algo\n[sharding_algo: <string> | default = \"by-group\"]\n\n# Time to spend searching for a pending ruler when shutting down.\n# CLI flag: -ruler.search-pending-for\n[search_pending_for: <duration> | default = 5m]\n\n# Ring used by Loki ruler. The CLI flags prefix for this block configuration is\n# 'ruler.ring'.\nring:\n  kvstore:\n    # Backend storage to use for the ring. Supported values are: consul, etcd,\n    # inmemory, memberlist, multi.\n    # CLI flag: -ruler.ring.store\n    [store: <string> | default = \"consul\"]\n\n    # The prefix for the keys in the store. Should end with a /.\n    # CLI flag: -ruler.ring.prefix\n    [prefix: <string> | default = \"rulers/\"]\n\n    # Configuration for a Consul client. Only applies if the selected kvstore is\n    # consul.\n    # The CLI flags prefix for this block configuration is: ruler.ring\n    [consul: <consul>]\n\n    # Configuration for an ETCD v3 client. Only applies if the selected kvstore\n    # is etcd.\n    # The CLI flags prefix for this block configuration is: ruler.ring\n    [etcd: <etcd>]\n\n    multi:\n      # Primary backend storage used by multi-client.\n      # CLI flag: -ruler.ring.multi.primary\n      [primary: <string> | default = \"\"]\n\n      # Secondary backend storage used by multi-client.\n      # CLI flag: -ruler.ring.multi.secondary\n      [secondary: <string> | default = \"\"]\n\n      # Mirror writes to the secondary store.\n      # CLI flag: -ruler.ring.multi.mirror-enabled\n      [mirror_enabled: <boolean> | default = false]\n\n      # Timeout for storing a value to the secondary store.\n      # CLI flag: -ruler.ring.multi.mirror-timeout\n      [mirror_timeout: <duration> | default = 2s]\n\n  # Interval between heartbeats sent to the ring.\n  # CLI flag: -ruler.ring.heartbeat-period\n  [heartbeat_period: <duration> | default = 5s]\n\n  # The heartbeat timeout after which ruler ring members are considered\n  # unhealthy within the ring. 0 = never (timeout disabled).\n  # CLI flag: -ruler.ring.heartbeat-timeout\n  [heartbeat_timeout: <duration> | default = 1m]\n\n  # Name of network interface to read addresses from.\n  # CLI flag: -ruler.ring.instance-interface-names\n  [instance_interface_names: <list of strings> | default = [<private network interfaces>]]\n\n  # The number of tokens the lifecycler will generate and put into the ring if\n  # it joined without transferring tokens from another lifecycler.\n  # CLI flag: -ruler.ring.num-tokens\n  [num_tokens: <int> | default = 128]\n\n# Period with which to attempt to flush rule groups.\n# CLI flag: -ruler.flush-period\n[flush_period: <duration> | default = 1m]\n\n# Enable the ruler API.\n# CLI flag: -ruler.enable-api\n[enable_api: <boolean> | default = true]\n\n# Comma separated list of tenants whose rules this ruler can evaluate. If\n# specified, only these tenants will be handled by ruler, otherwise this ruler\n# can process rules from all tenants. Subject to sharding.\n# CLI flag: -ruler.enabled-tenants\n[enabled_tenants: <string> | default = \"\"]\n\n# Comma separated list of tenants whose rules this ruler cannot evaluate. If\n# specified, a ruler that would normally pick the specified tenant(s) for\n# processing will ignore them instead. Subject to sharding.\n# CLI flag: -ruler.disabled-tenants\n[disabled_tenants: <string> | default = \"\"]\n\n# Report the wall time for ruler queries to complete as a per user metric and as\n# an info level log message.\n# CLI flag: -ruler.query-stats-enabled\n[query_stats_enabled: <boolean> | default = false]\n\n# Disable the rule_group label on exported metrics.\n# CLI flag: -ruler.disable-rule-group-label\n[disable_rule_group_label: <boolean> | default = false]\n\nwal:\n  # The directory in which to write tenant WAL files. Each tenant will have its\n  # own directory one level below this directory.\n  # CLI flag: -ruler.wal.dir\n  [dir: <string> | default = \"ruler-wal\"]\n\n  # Frequency with which to run the WAL truncation process.\n  # CLI flag: -ruler.wal.truncate-frequency\n  [truncate_frequency: <duration> | default = 1h]\n\n  # Minimum age that samples must exist in the WAL before being truncated.\n  # CLI flag: -ruler.wal.min-age\n  [min_age: <duration> | default = 5m]\n\n  # Maximum age that samples must exist in the WAL before being truncated.\n  # CLI flag: -ruler.wal.max-age\n  [max_age: <duration> | default = 4h]\n\nwal_cleaner:\n  # The minimum age of a WAL to consider for cleaning.\n  # CLI flag: -ruler.wal-cleaner.min-age\n  [min_age: <duration> | default = 12h]\n\n  # How often to run the WAL cleaner. 0 = disabled.\n  # CLI flag: -ruler.wal-cleaner.period\n  [period: <duration> | default = 0s]\n\n# Remote-write configuration to send rule samples to a Prometheus remote-write\n# endpoint.\nremote_write:\n  # Deprecated: Use 'clients' instead. Configure remote write client.\n  [client: <RemoteWriteConfig>]\n\n  # Configure remote write clients. A map with remote client id as key. For\n  # details, see\n  # https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write\n  # Specifying a header with key 'X-Scope-OrgID' under the 'headers' section of\n  # RemoteWriteConfig is not permitted. If specified, it will be dropped during\n  # config parsing.\n  [clients: <map of string to RemoteWriteConfig>]\n\n  # Enable remote-write functionality.\n  # CLI flag: -ruler.remote-write.enabled\n  [enabled: <boolean> | default = false]\n\n  # Minimum period to wait between refreshing remote-write reconfigurations.\n  # This should be greater than or equivalent to\n  # -limits.per-user-override-period.\n  # CLI flag: -ruler.remote-write.config-refresh-period\n  [config_refresh_period: <duration> | default = 10s]\n\n  # Add an X-Scope-OrgID header in remote write requests with the tenant ID of a\n  # Loki tenant that the recording rules are part of.\n  # CLI flag: -ruler.remote-write.add-org-id-header\n  [add_org_id_header: <boolean> | default = true]\n\n# Configuration for rule evaluation.\nevaluation:\n  # The evaluation mode for the ruler. Can be either 'local' or 'remote'. If set\n  # to 'local', the ruler will evaluate rules locally. If set to 'remote', the\n  # ruler will evaluate rules remotely. If unset, the ruler will evaluate rules\n  # locally.\n  # CLI flag: -ruler.evaluation.mode\n  [mode: <string> | default = \"local\"]\n\n  # Upper bound of random duration to wait before rule evaluation to avoid\n  # contention during concurrent execution of rules. Jitter is calculated\n  # consistently for a given rule. Set 0 to disable (default).\n  # CLI flag: -ruler.evaluation.max-jitter\n  [max_jitter: <duration> | default = 0s]\n\n  query_frontend:\n    # GRPC listen address of the query-frontend(s). Must be a DNS address\n    # (prefixed with dns:///) to enable client side load balancing.\n    # CLI flag: -ruler.evaluation.query-frontend.address\n    [address: <string> | default = \"\"]\n\n    # Set to true if query-frontend connection requires TLS.\n    # CLI flag: -ruler.evaluation.query-frontend.tls-enabled\n    [tls_enabled: <boolean> | default = false]\n\n    # The TLS configuration.\n    # The CLI flags prefix for this block configuration is:\n    # ruler.evaluation.query-frontend\n    [<tls_config>]\n```\n\n### runtime_config\n\nConfiguration for 'runtime config' module, responsible for reloading runtime configuration file.\n\n```yaml\n# How often to check runtime config files.\n# CLI flag: -runtime-config.reload-period\n[period: <duration> | default = 10s]\n\n# Comma separated list of yaml files with the configuration that can be updated\n# at runtime. Runtime config files will be merged from left to right.\n# CLI flag: -runtime-config.file\n[file: <string> | default = \"\"]\n```\n\n### s3_storage_config\n\nThe `s3_storage_config` block configures the connection to Amazon S3 object storage backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n&nbsp;\n\n```yaml\n# S3 endpoint URL with escaped Key and Secret encoded. If only region is\n# specified as a host, proper endpoint will be deduced. Use\n# inmemory:///<bucket-name> to use a mock in-memory implementation.\n# CLI flag: -<prefix>.s3.url\n[s3: <url>]\n\n# Set this to `true` to force the request to use path-style addressing.\n# CLI flag: -<prefix>.s3.force-path-style\n[s3forcepathstyle: <boolean> | default = false]\n\n# Comma separated list of bucket names to evenly distribute chunks over.\n# Overrides any buckets specified in s3.url flag\n# CLI flag: -<prefix>.s3.buckets\n[bucketnames: <string> | default = \"\"]\n\n# S3 Endpoint to connect to.\n# CLI flag: -<prefix>.s3.endpoint\n[endpoint: <string> | default = \"\"]\n\n# AWS region to use.\n# CLI flag: -<prefix>.s3.region\n[region: <string> | default = \"\"]\n\n# AWS Access Key ID\n# CLI flag: -<prefix>.s3.access-key-id\n[access_key_id: <string> | default = \"\"]\n\n# AWS Secret Access Key\n# CLI flag: -<prefix>.s3.secret-access-key\n[secret_access_key: <string> | default = \"\"]\n\n# AWS Session Token\n# CLI flag: -<prefix>.s3.session-token\n[session_token: <string> | default = \"\"]\n\n# Disable https on s3 connection.\n# CLI flag: -<prefix>.s3.insecure\n[insecure: <boolean> | default = false]\n\n# Delimiter used to replace the default delimiter ':' in chunk IDs when storing\n# chunks. This is mainly intended when you run a MinIO instance on a Windows\n# machine. You should not change this value inflight.\n# CLI flag: -<prefix>.s3.chunk-delimiter\n[chunk_delimiter: <string> | default = \"\"]\n\nhttp_config:\n  # Timeout specifies a time limit for requests made by s3 Client.\n  # CLI flag: -<prefix>.s3.http.timeout\n  [timeout: <duration> | default = 0s]\n\n  # The maximum amount of time an idle connection will be held open.\n  # CLI flag: -<prefix>.s3.http.idle-conn-timeout\n  [idle_conn_timeout: <duration> | default = 1m30s]\n\n  # If non-zero, specifies the amount of time to wait for a server's response\n  # headers after fully writing the request.\n  # CLI flag: -<prefix>.s3.http.response-header-timeout\n  [response_header_timeout: <duration> | default = 0s]\n\n  # Set to true to skip verifying the certificate chain and hostname.\n  # CLI flag: -<prefix>.s3.http.insecure-skip-verify\n  [insecure_skip_verify: <boolean> | default = false]\n\n  # Path to the trusted CA file that signed the SSL certificate of the S3\n  # endpoint.\n  # CLI flag: -<prefix>.s3.http.ca-file\n  [ca_file: <string> | default = \"\"]\n\n# The signature version to use for authenticating against S3. Supported values\n# are: v4.\n# CLI flag: -<prefix>.s3.signature-version\n[signature_version: <string> | default = \"v4\"]\n\n# The S3 storage class which objects will use. Supported values are: GLACIER,\n# DEEP_ARCHIVE, GLACIER_IR, INTELLIGENT_TIERING, ONEZONE_IA, OUTPOSTS,\n# REDUCED_REDUNDANCY, STANDARD, STANDARD_IA.\n# CLI flag: -<prefix>.s3.storage-class\n[storage_class: <string> | default = \"STANDARD\"]\n\nsse:\n  # Enable AWS Server Side Encryption. Supported values: SSE-KMS, SSE-S3.\n  # CLI flag: -<prefix>.s3.sse.type\n  [type: <string> | default = \"\"]\n\n  # KMS Key ID used to encrypt objects in S3\n  # CLI flag: -<prefix>.s3.sse.kms-key-id\n  [kms_key_id: <string> | default = \"\"]\n\n  # KMS Encryption Context used for object encryption. It expects JSON formatted\n  # string.\n  # CLI flag: -<prefix>.s3.sse.kms-encryption-context\n  [kms_encryption_context: <string> | default = \"\"]\n\n# Configures back off when S3 get Object.\nbackoff_config:\n  # Minimum backoff time when s3 get Object\n  # CLI flag: -<prefix>.s3.min-backoff\n  [min_period: <duration> | default = 100ms]\n\n  # Maximum backoff time when s3 get Object\n  # CLI flag: -<prefix>.s3.max-backoff\n  [max_period: <duration> | default = 3s]\n\n  # Maximum number of times to retry for s3 GetObject or ObjectExists\n  # CLI flag: -<prefix>.s3.max-retries\n  [max_retries: <int> | default = 5]\n\n# Disable forcing S3 dualstack endpoint usage.\n# CLI flag: -<prefix>.s3.disable-dualstack\n[disable_dualstack: <boolean> | default = false]\n```\n\n### schema_config\n\nConfigures the chunk index schema and where it is stored.\n\n```yaml\n[configs: <list of period_configs>]\n```\n\n### server\n\nConfigures the `server` of the launched module(s).\n\n```yaml\n# HTTP server listen network, default tcp\n# CLI flag: -server.http-listen-network\n[http_listen_network: <string> | default = \"tcp\"]\n\n# HTTP server listen address.\n# CLI flag: -server.http-listen-address\n[http_listen_address: <string> | default = \"\"]\n\n# HTTP server listen port.\n# CLI flag: -server.http-listen-port\n[http_listen_port: <int> | default = 3100]\n\n# Maximum number of simultaneous http connections, <=0 to disable\n# CLI flag: -server.http-conn-limit\n[http_listen_conn_limit: <int> | default = 0]\n\n# gRPC server listen network\n# CLI flag: -server.grpc-listen-network\n[grpc_listen_network: <string> | default = \"tcp\"]\n\n# gRPC server listen address.\n# CLI flag: -server.grpc-listen-address\n[grpc_listen_address: <string> | default = \"\"]\n\n# gRPC server listen port.\n# CLI flag: -server.grpc-listen-port\n[grpc_listen_port: <int> | default = 9095]\n\n# Maximum number of simultaneous grpc connections, <=0 to disable\n# CLI flag: -server.grpc-conn-limit\n[grpc_listen_conn_limit: <int> | default = 0]\n\n# If true, the max streams by connection gauge will be collected.\n# CLI flag: -server.grpc-collect-max-streams-by-conn\n[grpc_collect_max_streams_by_conn: <boolean> | default = true]\n\n# Enables PROXY protocol.\n# CLI flag: -server.proxy-protocol-enabled\n[proxy_protocol_enabled: <boolean> | default = false]\n\n# Comma-separated list of cipher suites to use. If blank, the default Go cipher\n# suites is used.\n# CLI flag: -server.tls-cipher-suites\n[tls_cipher_suites: <string> | default = \"\"]\n\n# Minimum TLS version to use. Allowed values: VersionTLS10, VersionTLS11,\n# VersionTLS12, VersionTLS13. If blank, the Go TLS minimum version is used.\n# CLI flag: -server.tls-min-version\n[tls_min_version: <string> | default = \"\"]\n\nhttp_tls_config:\n  # Server TLS certificate. This configuration parameter is YAML only.\n  [cert: <string> | default = \"\"]\n\n  # Server TLS key. This configuration parameter is YAML only.\n  [key: <string> | default = \"\"]\n\n  # Root certificate authority used to verify client certificates. This\n  # configuration parameter is YAML only.\n  [client_ca: <string> | default = \"\"]\n\n  # HTTP server cert path.\n  # CLI flag: -server.http-tls-cert-path\n  [cert_file: <string> | default = \"\"]\n\n  # HTTP server key path.\n  # CLI flag: -server.http-tls-key-path\n  [key_file: <string> | default = \"\"]\n\n  # HTTP TLS Client Auth type.\n  # CLI flag: -server.http-tls-client-auth\n  [client_auth_type: <string> | default = \"\"]\n\n  # HTTP TLS Client CA path.\n  # CLI flag: -server.http-tls-ca-path\n  [client_ca_file: <string> | default = \"\"]\n\ngrpc_tls_config:\n  # Server TLS certificate. This configuration parameter is YAML only.\n  [cert: <string> | default = \"\"]\n\n  # Server TLS key. This configuration parameter is YAML only.\n  [key: <string> | default = \"\"]\n\n  # Root certificate authority used to verify client certificates. This\n  # configuration parameter is YAML only.\n  [client_ca: <string> | default = \"\"]\n\n  # GRPC TLS server cert path.\n  # CLI flag: -server.grpc-tls-cert-path\n  [cert_file: <string> | default = \"\"]\n\n  # GRPC TLS server key path.\n  # CLI flag: -server.grpc-tls-key-path\n  [key_file: <string> | default = \"\"]\n\n  # GRPC TLS Client Auth type.\n  # CLI flag: -server.grpc-tls-client-auth\n  [client_auth_type: <string> | default = \"\"]\n\n  # GRPC TLS Client CA path.\n  # CLI flag: -server.grpc-tls-ca-path\n  [client_ca_file: <string> | default = \"\"]\n\n# Register the intrumentation handlers (/metrics etc).\n# CLI flag: -server.register-instrumentation\n[register_instrumentation: <boolean> | default = true]\n\n# If set to true, gRPC statuses will be reported in instrumentation labels with\n# their string representations. Otherwise, they will be reported as \"error\".\n# CLI flag: -server.report-grpc-codes-in-instrumentation-label-enabled\n[report_grpc_codes_in_instrumentation_label_enabled: <boolean> | default = false]\n\n# Timeout for graceful shutdowns\n# CLI flag: -server.graceful-shutdown-timeout\n[graceful_shutdown_timeout: <duration> | default = 30s]\n\n# Read timeout for entire HTTP request, including headers and body.\n# CLI flag: -server.http-read-timeout\n[http_server_read_timeout: <duration> | default = 30s]\n\n# Read timeout for HTTP request headers. If set to 0, value of\n# -server.http-read-timeout is used.\n# CLI flag: -server.http-read-header-timeout\n[http_server_read_header_timeout: <duration> | default = 0s]\n\n# Write timeout for HTTP server\n# CLI flag: -server.http-write-timeout\n[http_server_write_timeout: <duration> | default = 30s]\n\n# Idle timeout for HTTP server\n# CLI flag: -server.http-idle-timeout\n[http_server_idle_timeout: <duration> | default = 2m]\n\n# Log closed connections that did not receive any response, most likely because\n# client didn't send any request within timeout.\n# CLI flag: -server.http-log-closed-connections-without-response-enabled\n[http_log_closed_connections_without_response_enabled: <boolean> | default = false]\n\n# Limit on the size of a gRPC message this server can receive (bytes).\n# CLI flag: -server.grpc-max-recv-msg-size-bytes\n[grpc_server_max_recv_msg_size: <int> | default = 4194304]\n\n# Limit on the size of a gRPC message this server can send (bytes).\n# CLI flag: -server.grpc-max-send-msg-size-bytes\n[grpc_server_max_send_msg_size: <int> | default = 4194304]\n\n# Limit on the number of concurrent streams for gRPC calls per client connection\n# (0 = unlimited)\n# CLI flag: -server.grpc-max-concurrent-streams\n[grpc_server_max_concurrent_streams: <int> | default = 100]\n\n# The duration after which an idle connection should be closed. Default:\n# infinity\n# CLI flag: -server.grpc.keepalive.max-connection-idle\n[grpc_server_max_connection_idle: <duration> | default = 2562047h47m16.854775807s]\n\n# The duration for the maximum amount of time a connection may exist before it\n# will be closed. Default: infinity\n# CLI flag: -server.grpc.keepalive.max-connection-age\n[grpc_server_max_connection_age: <duration> | default = 2562047h47m16.854775807s]\n\n# An additive period after max-connection-age after which the connection will be\n# forcibly closed. Default: infinity\n# CLI flag: -server.grpc.keepalive.max-connection-age-grace\n[grpc_server_max_connection_age_grace: <duration> | default = 2562047h47m16.854775807s]\n\n# Duration after which a keepalive probe is sent in case of no activity over the\n# connection., Default: 2h\n# CLI flag: -server.grpc.keepalive.time\n[grpc_server_keepalive_time: <duration> | default = 2h]\n\n# After having pinged for keepalive check, the duration after which an idle\n# connection should be closed, Default: 20s\n# CLI flag: -server.grpc.keepalive.timeout\n[grpc_server_keepalive_timeout: <duration> | default = 20s]\n\n# Minimum amount of time a client should wait before sending a keepalive ping.\n# If client sends keepalive ping more often, server will send GOAWAY and close\n# the connection.\n# CLI flag: -server.grpc.keepalive.min-time-between-pings\n[grpc_server_min_time_between_pings: <duration> | default = 10s]\n\n# If true, server allows keepalive pings even when there are no active\n# streams(RPCs). If false, and client sends ping when there are no active\n# streams, server will send GOAWAY and close the connection.\n# CLI flag: -server.grpc.keepalive.ping-without-stream-allowed\n[grpc_server_ping_without_stream_allowed: <boolean> | default = true]\n\n# If non-zero, configures the amount of GRPC server workers used to serve the\n# requests.\n# CLI flag: -server.grpc.num-workers\n[grpc_server_num_workers: <int> | default = 0]\n\n# If true, the request_message_bytes, response_message_bytes, and\n# inflight_requests metrics will be tracked. Enabling this option prevents the\n# use of memory pools for parsing gRPC request bodies and may lead to more\n# memory allocations.\n# CLI flag: -server.grpc.stats-tracking-enabled\n[grpc_server_stats_tracking_enabled: <boolean> | default = true]\n\n# Deprecated option, has no effect and will be removed in a future version.\n# CLI flag: -server.grpc.recv-buffer-pools-enabled\n[grpc_server_recv_buffer_pools_enabled: <boolean> | default = false]\n\n# Output log messages in the given format. Valid formats: [logfmt, json]\n# CLI flag: -log.format\n[log_format: <string> | default = \"logfmt\"]\n\n# Only log messages with the given severity or above. Valid levels: [debug,\n# info, warn, error]\n# CLI flag: -log.level\n[log_level: <string> | default = \"info\"]\n\n# Optionally log the source IPs.\n# CLI flag: -server.log-source-ips-enabled\n[log_source_ips_enabled: <boolean> | default = false]\n\n# Log all source IPs instead of only the originating one. Only used if\n# server.log-source-ips-enabled is true\n# CLI flag: -server.log-source-ips-full\n[log_source_ips_full: <boolean> | default = false]\n\n# Header field storing the source IPs. Only used if\n# server.log-source-ips-enabled is true. If not set the default Forwarded,\n# X-Real-IP and X-Forwarded-For headers are used\n# CLI flag: -server.log-source-ips-header\n[log_source_ips_header: <string> | default = \"\"]\n\n# Regex for matching the source IPs. Only used if server.log-source-ips-enabled\n# is true. If not set the default Forwarded, X-Real-IP and X-Forwarded-For\n# headers are used\n# CLI flag: -server.log-source-ips-regex\n[log_source_ips_regex: <string> | default = \"\"]\n\n# Optionally log request headers.\n# CLI flag: -server.log-request-headers\n[log_request_headers: <boolean> | default = false]\n\n# Optionally log requests at info level instead of debug level. Applies to\n# request headers as well if server.log-request-headers is enabled.\n# CLI flag: -server.log-request-at-info-level-enabled\n[log_request_at_info_level_enabled: <boolean> | default = false]\n\n# Comma separated list of headers to exclude from loggin. Only used if\n# server.log-request-headers is true.\n# CLI flag: -server.log-request-headers-exclude-list\n[log_request_exclude_headers_list: <string> | default = \"\"]\n\n# Optionally add request headers to tracing spans.\n# CLI flag: -server.trace-request-headers\n[trace_request_headers: <boolean> | default = false]\n\n# Comma separated list of headers to exclude from tracing spans. Only used if\n# server.trace-request-headers is true. The following headers are always\n# excluded: Authorization, Cookie, X-Access-Token, X-Csrf-Token, X-Grafana-Id.\n# CLI flag: -server.trace-request-headers-exclude-list\n[trace_request_exclude_headers_list: <string> | default = \"\"]\n\n# Base path to serve all API routes from (e.g. /v1/)\n# CLI flag: -server.path-prefix\n[http_path_prefix: <string> | default = \"\"]\n\ncluster_validation:\n  # Primary cluster validation label.\n  # CLI flag: -server.cluster-validation.label\n  [label: <string> | default = \"\"]\n\n  # Comma-separated list of additional cluster validation labels that the server\n  # will accept from incoming requests.\n  # CLI flag: -server.cluster-validation.additional-labels\n  [additional_labels: <string> | default = \"\"]\n\n  grpc:\n    # When enabled, cluster label validation is executed: configured cluster\n    # validation label is compared with the cluster validation label received\n    # through the requests.\n    # CLI flag: -server.cluster-validation.grpc.enabled\n    [enabled: <boolean> | default = false]\n\n    # When enabled, soft cluster label validation is executed. Can be enabled\n    # only together with server.cluster-validation.grpc.enabled\n    # CLI flag: -server.cluster-validation.grpc.soft-validation\n    [soft_validation: <boolean> | default = false]\n\n  http:\n    # When enabled, cluster label validation is executed: configured cluster\n    # validation label is compared with the cluster validation label received\n    # through the requests.\n    # CLI flag: -server.cluster-validation.http.enabled\n    [enabled: <boolean> | default = false]\n\n    # When enabled, soft cluster label validation is executed. Can be enabled\n    # only together with server.cluster-validation.http.enabled\n    # CLI flag: -server.cluster-validation.http.soft-validation\n    [soft_validation: <boolean> | default = false]\n\n    # Comma-separated list of url paths that are excluded from the cluster\n    # validation check.\n    # CLI flag: -server.cluster-validation.http.excluded-paths\n    [excluded_paths: <string> | default = \"\"]\n\n    # Comma-separated list of user agents that are excluded from the cluster\n    # validation check.\n    # CLI flag: -server.cluster-validation.http.excluded-user-agents\n    [excluded_user_agents: <string> | default = \"\"]\n```\n\n### storage_config\n\nThe `storage_config` block configures one of many possible stores for both the index and chunks. Which configuration to be picked should be defined in schema_config block.\n\n```yaml\n# The alibabacloud_storage_config block configures the connection to Alibaba\n# Cloud Storage object storage backend.\n[alibabacloud: <alibabacloud_storage_config>]\n\n# The aws_storage_config block configures the connection to dynamoDB and S3\n# object storage. Either one of them or both can be configured.\n[aws: <aws_storage_config>]\n\n# The azure_storage_config block configures the connection to Azure object\n# storage backend.\n[azure: <azure_storage_config>]\n\n# The bos_storage_config block configures the connection to Baidu Object Storage\n# (BOS) object storage backend.\n[bos: <bos_storage_config>]\n\n# Deprecated: Configures storing indexes in Bigtable. Required fields only\n# required when bigtable is defined in config.\nbigtable:\n  # Bigtable project ID.\n  # CLI flag: -bigtable.project\n  [project: <string> | default = \"\"]\n\n  # Bigtable instance ID. Please refer to\n  # https://cloud.google.com/docs/authentication/production for more information\n  # about how to configure authentication.\n  # CLI flag: -bigtable.instance\n  [instance: <string> | default = \"\"]\n\n  # The grpc_client block configures the gRPC client used to communicate between\n  # a client and server component in Loki.\n  # The CLI flags prefix for this block configuration is: bigtable\n  [grpc_client_config: <grpc_client>]\n\n  # If enabled, once a tables info is fetched, it is cached.\n  # CLI flag: -bigtable.table-cache.enabled\n  [table_cache_enabled: <boolean> | default = true]\n\n  # Duration to cache tables before checking again.\n  # CLI flag: -bigtable.table-cache.expiration\n  [table_cache_expiration: <duration> | default = 30m]\n\n# Configures storing chunks in GCS. Required fields only required when gcs is\n# defined in config.\n[gcs: <gcs_storage_config>]\n\n# Deprecated: Configures storing chunks and/or the index in Cassandra.\ncassandra:\n  # Comma-separated hostnames or IPs of Cassandra instances.\n  # CLI flag: -cassandra.addresses\n  [addresses: <string> | default = \"\"]\n\n  # Port that Cassandra is running on\n  # CLI flag: -cassandra.port\n  [port: <int> | default = 9042]\n\n  # Keyspace to use in Cassandra.\n  # CLI flag: -cassandra.keyspace\n  [keyspace: <string> | default = \"\"]\n\n  # Consistency level for Cassandra.\n  # CLI flag: -cassandra.consistency\n  [consistency: <string> | default = \"QUORUM\"]\n\n  # Replication factor to use in Cassandra.\n  # CLI flag: -cassandra.replication-factor\n  [replication_factor: <int> | default = 3]\n\n  # Instruct the cassandra driver to not attempt to get host info from the\n  # system.peers table.\n  # CLI flag: -cassandra.disable-initial-host-lookup\n  [disable_initial_host_lookup: <boolean> | default = false]\n\n  # Use SSL when connecting to cassandra instances.\n  # CLI flag: -cassandra.ssl\n  [SSL: <boolean> | default = false]\n\n  # Require SSL certificate validation.\n  # CLI flag: -cassandra.host-verification\n  [host_verification: <boolean> | default = true]\n\n  # Policy for selecting Cassandra host. Supported values are: round-robin,\n  # token-aware.\n  # CLI flag: -cassandra.host-selection-policy\n  [host_selection_policy: <string> | default = \"round-robin\"]\n\n  # Path to certificate file to verify the peer.\n  # CLI flag: -cassandra.ca-path\n  [CA_path: <string> | default = \"\"]\n\n  # Path to certificate file used by TLS.\n  # CLI flag: -cassandra.tls-cert-path\n  [tls_cert_path: <string> | default = \"\"]\n\n  # Path to private key file used by TLS.\n  # CLI flag: -cassandra.tls-key-path\n  [tls_key_path: <string> | default = \"\"]\n\n  # Enable password authentication when connecting to cassandra.\n  # CLI flag: -cassandra.auth\n  [auth: <boolean> | default = false]\n\n  # Username to use when connecting to cassandra.\n  # CLI flag: -cassandra.username\n  [username: <string> | default = \"\"]\n\n  # Password to use when connecting to cassandra.\n  # CLI flag: -cassandra.password\n  [password: <string> | default = \"\"]\n\n  # File containing password to use when connecting to cassandra.\n  # CLI flag: -cassandra.password-file\n  [password_file: <string> | default = \"\"]\n\n  # If set, when authenticating with cassandra a custom authenticator will be\n  # expected during the handshake. This flag can be set multiple times.\n  # CLI flag: -cassandra.custom-authenticator\n  [custom_authenticators: <list of strings> | default = []]\n\n  # Timeout when connecting to cassandra.\n  # CLI flag: -cassandra.timeout\n  [timeout: <duration> | default = 2s]\n\n  # Initial connection timeout, used during initial dial to server.\n  # CLI flag: -cassandra.connect-timeout\n  [connect_timeout: <duration> | default = 5s]\n\n  # Interval to retry connecting to cassandra nodes marked as DOWN.\n  # CLI flag: -cassandra.reconnent-interval\n  [reconnect_interval: <duration> | default = 1s]\n\n  # Number of retries to perform on a request. Set to 0 to disable retries.\n  # CLI flag: -cassandra.max-retries\n  [max_retries: <int> | default = 0]\n\n  # Maximum time to wait before retrying a failed request.\n  # CLI flag: -cassandra.retry-max-backoff\n  [retry_max_backoff: <duration> | default = 10s]\n\n  # Minimum time to wait before retrying a failed request.\n  # CLI flag: -cassandra.retry-min-backoff\n  [retry_min_backoff: <duration> | default = 100ms]\n\n  # Limit number of concurrent queries to Cassandra. Set to 0 to disable the\n  # limit.\n  # CLI flag: -cassandra.query-concurrency\n  [query_concurrency: <int> | default = 0]\n\n  # Number of TCP connections per host.\n  # CLI flag: -cassandra.num-connections\n  [num_connections: <int> | default = 2]\n\n  # Convict hosts of being down on failure.\n  # CLI flag: -cassandra.convict-hosts-on-failure\n  [convict_hosts_on_failure: <boolean> | default = true]\n\n  # Table options used to create index or chunk tables. This value is used as\n  # plain text in the table `WITH` like this, \"CREATE TABLE\n  # <generated_by_cortex> (...) WITH <cassandra.table-options>\". For details,\n  # see https://cortexmetrics.io/docs/production/cassandra. By default it will\n  # use the default table options of your Cassandra cluster.\n  # CLI flag: -cassandra.table-options\n  [table_options: <string> | default = \"\"]\n\n# Deprecated: Configures storing index in BoltDB. Required fields only required\n# when boltdb is present in the configuration.\nboltdb:\n  # Location of BoltDB index files.\n  # CLI flag: -boltdb.dir\n  [directory: <string> | default = \"\"]\n\n# Configures storing the chunks on the local file system. Required fields only\n# required when filesystem is present in the configuration.\n[filesystem: <local_storage_config>]\n\n# The swift_storage_config block configures the connection to OpenStack Object\n# Storage (Swift) object storage backend.\n[swift: <swift_storage_config>]\n\n# Deprecated:\ngrpc_store:\n  # Hostname or IP of the gRPC store instance.\n  # CLI flag: -grpc-store.server-address\n  [server_address: <string> | default = \"\"]\n\nhedging:\n  # If set to a non-zero value a second request will be issued at the provided\n  # duration. Default is 0 (disabled)\n  # CLI flag: -store.hedge-requests-at\n  [at: <duration> | default = 0s]\n\n  # The maximum of hedge requests allowed.\n  # CLI flag: -store.hedge-requests-up-to\n  [up_to: <int> | default = 2]\n\n  # The maximum of hedge requests allowed per seconds.\n  # CLI flag: -store.hedge-max-per-second\n  [max_per_second: <int> | default = 5]\n\n# Configures additional object stores for a given storage provider.\n# Supported stores: aws, azure, bos, filesystem, gcs, swift.\n# Example:\n# ```yaml\n#     storage_config:\n#       named_stores:\n#         aws:\n#           store-1:\n#             endpoint: s3://foo-bucket\n#             region: us-west1\n# ```\n# Named store from this example can be used by setting object_store to store-1\n# in period_config.\n[named_stores: <named_stores_config>]\n\n# The cos_storage_config block configures the connection to IBM Cloud Object\n# Storage (COS) backend.\n[cos: <cos_storage_config>]\n\n# Cache validity for active index entries. Should be no higher than\n# -ingester.max-chunk-idle.\n# CLI flag: -store.index-cache-validity\n[index_cache_validity: <duration> | default = 5m]\n\ncongestion_control:\n  # Use storage congestion control (default: disabled).\n  # CLI flag: -store.congestion-control.enabled\n  [enabled: <boolean> | default = false]\n\n  controller:\n    # Congestion control strategy to use (default: none, options: 'aimd').\n    # CLI flag: -store.congestion-control.strategy\n    [strategy: <string> | default = \"\"]\n\n    aimd:\n      # AIMD starting throughput window size: how many requests can be sent per\n      # second (default: 2000).\n      # CLI flag: -store.congestion-control.strategy.aimd.start\n      [start: <int> | default = 2000]\n\n      # AIMD maximum throughput window size: upper limit of requests sent per\n      # second (default: 10000).\n      # CLI flag: -store.congestion-control.strategy.aimd.upper-bound\n      [upper_bound: <int> | default = 10000]\n\n      # AIMD backoff factor when upstream service is throttled to decrease\n      # number of requests sent per second (default: 0.5).\n      # CLI flag: -store.congestion-control.strategy.aimd.backoff-factor\n      [backoff_factor: <float> | default = 0.5]\n\n  retry:\n    # Congestion control retry strategy to use (default: none, options:\n    # 'limited').\n    # CLI flag: -store.congestion-control.retry.strategy\n    [strategy: <string> | default = \"\"]\n\n    # Maximum number of retries allowed.\n    # CLI flag: -store.congestion-control.retry.strategy.limited.limit\n    [limit: <int> | default = 2]\n\n  hedging:\n    config:\n      [at: <duration>]\n\n      [up_to: <int>]\n\n      [max_per_second: <int>]\n\n    # Congestion control hedge strategy to use (default: none, options:\n    # 'limited').\n    # CLI flag: -store.congestion-control.hedge.strategy\n    [strategy: <string> | default = \"\"]\n\n# Experimental. Sets a constant prefix for all keys inserted into object\n# storage. Example: loki/\n# CLI flag: -store.object-prefix\n[object_prefix: <string> | default = \"\"]\n\n# The cache_config block configures the cache backend for a specific Loki\n# component.\n# The CLI flags prefix for this block configuration is: store.index-cache-read\n[index_queries_cache_config: <cache_config>]\n\n# Disable broad index queries which results in reduced cache usage and faster\n# query performance at the expense of somewhat higher QPS on the index store.\n# CLI flag: -store.disable-broad-index-queries\n[disable_broad_index_queries: <boolean> | default = false]\n\n# Maximum number of parallel chunk reads.\n# CLI flag: -store.max-parallel-get-chunk\n[max_parallel_get_chunk: <int> | default = 150]\n\n# Enables the use of thanos-io/objstore clients for connecting to object\n# storage. When set to true, the configuration inside\n# `storage_config.object_store` or `common.storage.object_store` block takes\n# effect.\n# CLI flag: -use-thanos-objstore\n[use_thanos_objstore: <boolean> | default = false]\n\nobject_store:\n  # The thanos_object_store_config block configures the connection to object\n  # storage backend using thanos-io/objstore clients. This will become the\n  # default way of configuring object store clients in future releases.\n  # Currently this is opt-in and takes effect only when `-use-thanos-objstore`\n  # is set to true.\n  # The CLI flags prefix for this block configuration is: object-store\n  [<thanos_object_store_config>]\n\n  named_stores:\n    [azure: <map of string to NamedAzureStorageConfig>]\n\n    [filesystem: <map of string to NamedFilesystemStorageConfig>]\n\n    [gcs: <map of string to NamedGCSStorageConfig>]\n\n    [s3: <map of string to NamedS3StorageConfig>]\n\n    [swift: <map of string to NamedSwiftStorageConfig>]\n\n# The maximum number of chunks to fetch per batch.\n# CLI flag: -store.max-chunk-batch-size\n[max_chunk_batch_size: <int> | default = 50]\n\n# Configures storing index in an Object Store\n# (GCS/S3/Azure/Swift/COS/Filesystem) in the form of boltdb files. Required\n# fields only required when boltdb-shipper is defined in config.\nboltdb_shipper:\n  # Directory where ingesters would write index files which would then be\n  # uploaded by shipper to configured storage\n  # CLI flag: -boltdb.shipper.active-index-directory\n  [active_index_directory: <string> | default = \"\"]\n\n  # Cache location for restoring index files from storage for queries\n  # CLI flag: -boltdb.shipper.cache-location\n  [cache_location: <string> | default = \"\"]\n\n  # TTL for index files restored in cache for queries\n  # CLI flag: -boltdb.shipper.cache-ttl\n  [cache_ttl: <duration> | default = 24h]\n\n  # Resync downloaded files with the storage\n  # CLI flag: -boltdb.shipper.resync-interval\n  [resync_interval: <duration> | default = 5m]\n\n  # Number of days of common index to be kept downloaded for queries. For per\n  # tenant index query readiness, use limits overrides config.\n  # CLI flag: -boltdb.shipper.query-ready-num-days\n  [query_ready_num_days: <int> | default = 0]\n\n  index_gateway_client:\n    # The grpc_client block configures the gRPC client used to communicate\n    # between a client and server component in Loki.\n    # The CLI flags prefix for this block configuration is:\n    # boltdb.shipper.index-gateway-client.grpc\n    [grpc_client_config: <grpc_client>]\n\n    # Hostname or IP of the Index Gateway gRPC server running in simple mode.\n    # Can also be prefixed with dns+, dnssrv+, or dnssrvnoa+ to resolve a DNS A\n    # record with multiple IP's, a DNS SRV record with a followup A record\n    # lookup, or a DNS SRV record without a followup A record lookup,\n    # respectively.\n    # CLI flag: -boltdb.shipper.index-gateway-client.server-address\n    [server_address: <string> | default = \"\"]\n\n    # Whether requests sent to the gateway should be logged or not.\n    # CLI flag: -boltdb.shipper.index-gateway-client.log-gateway-requests\n    [log_gateway_requests: <boolean> | default = false]\n\n    # Experimental: Defines buckets for time-based sharding. Time based sharding\n    # only takes affect when index gateways run in simple mode. To enable client\n    # side time-based sharding of queries across index gateway instances set at\n    # least one bucket in the format of a string representation of a\n    # time.Duration, e.g. ['168h', '336h', '504h']\n    # CLI flag: -boltdb.shipper.index-gateway-client.time-based-sharding-buckets\n    [time_based_sharding_buckets: <list of strings> | default = []]\n\n  [ingestername: <string> | default = \"\"]\n\n  [mode: <string> | default = \"\"]\n\n  [ingesterdbretainperiod: <duration>]\n\n  # Build per tenant index files\n  # CLI flag: -boltdb.shipper.build-per-tenant-index\n  [build_per_tenant_index: <boolean> | default = false]\n\n# Configures storing index in an Object Store\n# (GCS/S3/Azure/Swift/COS/Filesystem) in a prometheus TSDB-like format. Required\n# fields only required when TSDB is defined in config.\ntsdb_shipper:\n  # Directory where ingesters would write index files which would then be\n  # uploaded by shipper to configured storage\n  # CLI flag: -tsdb.shipper.active-index-directory\n  [active_index_directory: <string> | default = \"\"]\n\n  # Cache location for restoring index files from storage for queries\n  # CLI flag: -tsdb.shipper.cache-location\n  [cache_location: <string> | default = \"\"]\n\n  # TTL for index files restored in cache for queries\n  # CLI flag: -tsdb.shipper.cache-ttl\n  [cache_ttl: <duration> | default = 24h]\n\n  # Resync downloaded files with the storage\n  # CLI flag: -tsdb.shipper.resync-interval\n  [resync_interval: <duration> | default = 5m]\n\n  # Number of days of common index to be kept downloaded for queries. For per\n  # tenant index query readiness, use limits overrides config.\n  # CLI flag: -tsdb.shipper.query-ready-num-days\n  [query_ready_num_days: <int> | default = 0]\n\n  index_gateway_client:\n    # The grpc_client block configures the gRPC client used to communicate\n    # between a client and server component in Loki.\n    # The CLI flags prefix for this block configuration is:\n    # tsdb.shipper.index-gateway-client.grpc\n    [grpc_client_config: <grpc_client>]\n\n    # Hostname or IP of the Index Gateway gRPC server running in simple mode.\n    # Can also be prefixed with dns+, dnssrv+, or dnssrvnoa+ to resolve a DNS A\n    # record with multiple IP's, a DNS SRV record with a followup A record\n    # lookup, or a DNS SRV record without a followup A record lookup,\n    # respectively.\n    # CLI flag: -tsdb.shipper.index-gateway-client.server-address\n    [server_address: <string> | default = \"\"]\n\n    # Whether requests sent to the gateway should be logged or not.\n    # CLI flag: -tsdb.shipper.index-gateway-client.log-gateway-requests\n    [log_gateway_requests: <boolean> | default = false]\n\n    # Experimental: Defines buckets for time-based sharding. Time based sharding\n    # only takes affect when index gateways run in simple mode. To enable client\n    # side time-based sharding of queries across index gateway instances set at\n    # least one bucket in the format of a string representation of a\n    # time.Duration, e.g. ['168h', '336h', '504h']\n    # CLI flag: -tsdb.shipper.index-gateway-client.time-based-sharding-buckets\n    [time_based_sharding_buckets: <list of strings> | default = []]\n\n  [ingestername: <string> | default = \"\"]\n\n  [mode: <string> | default = \"\"]\n\n  [ingesterdbretainperiod: <duration>]\n\n# Experimental: Configures the bloom shipper component, which contains the store\n# abstraction to fetch bloom filters from and put them to object storage.\nbloom_shipper:\n  # Working directory to store downloaded bloom blocks. Supports multiple\n  # directories, separated by comma.\n  # CLI flag: -bloom.shipper.working-directory\n  [working_directory: <string> | default = \"/data/blooms\"]\n\n  # Maximum size of bloom pages that should be queried. Larger pages than this\n  # limit are skipped when querying blooms to limit memory usage.\n  # CLI flag: -bloom.max-query-page-size\n  [max_query_page_size: <int> | default = 64MiB]\n\n  # The amount of maximum concurrent bloom blocks downloads. Usually set to 2x\n  # number of CPU cores.\n  # CLI flag: -bloom.download-parallelism\n  [download_parallelism: <int> | default = 8]\n\n  blocks_cache:\n    # Cache for bloom blocks. Soft limit of the cache in bytes. Exceeding this\n    # limit will trigger evictions of least recently used items in the\n    # background.\n    # CLI flag: -bloom.blocks-cache.soft-limit\n    [soft_limit: <int> | default = 32GiB]\n\n    # Cache for bloom blocks. Hard limit of the cache in bytes. Exceeding this\n    # limit will block execution until soft limit is deceeded.\n    # CLI flag: -bloom.blocks-cache.hard-limit\n    [hard_limit: <int> | default = 64GiB]\n\n    # Cache for bloom blocks. The time to live for items in the cache before\n    # they get purged.\n    # CLI flag: -bloom.blocks-cache.ttl\n    [ttl: <duration> | default = 24h]\n\n  # The cache_config block configures the cache backend for a specific Loki\n  # component.\n  # The CLI flags prefix for this block configuration is: bloom.metas-cache\n  [metas_cache: <cache_config>]\n\n  metas_lru_cache:\n    # In-memory LRU cache for bloom metas. Whether embedded cache is enabled.\n    # CLI flag: -bloom.metas-lru-cache.enabled\n    [enabled: <boolean> | default = false]\n\n    # In-memory LRU cache for bloom metas. Maximum memory size of the cache in\n    # MB.\n    # CLI flag: -bloom.metas-lru-cache.max-size-mb\n    [max_size_mb: <int> | default = 100]\n\n    # In-memory LRU cache for bloom metas. Maximum number of entries in the\n    # cache.\n    # CLI flag: -bloom.metas-lru-cache.max-size-items\n    [max_size_items: <int> | default = 0]\n\n    # In-memory LRU cache for bloom metas. The time to live for items in the\n    # cache before they get purged.\n    # CLI flag: -bloom.metas-lru-cache.ttl\n    [ttl: <duration> | default = 1h]\n```\n\n### swift_storage_config\n\nThe `swift_storage_config` block configures the connection to OpenStack Object Storage (Swift) object storage backend. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage`\n- `ruler.storage`\n\n\u00a0\n\n```yaml\n# OpenStack Swift authentication API version. 0 to autodetect.\n# CLI flag: -<prefix>.swift.auth-version\n[auth_version: <int> | default = 0]\n\n# OpenStack Swift authentication URL\n# CLI flag: -<prefix>.swift.auth-url\n[auth_url: <string> | default = \"\"]\n\n# Set this to true to use the internal OpenStack Swift endpoint URL\n# CLI flag: -<prefix>.swift.internal\n[internal: <boolean> | default = false]\n\n# OpenStack Swift username.\n# CLI flag: -<prefix>.swift.username\n[username: <string> | default = \"\"]\n\n# OpenStack Swift user's domain name.\n# CLI flag: -<prefix>.swift.user-domain-name\n[user_domain_name: <string> | default = \"\"]\n\n# OpenStack Swift user's domain ID.\n# CLI flag: -<prefix>.swift.user-domain-id\n[user_domain_id: <string> | default = \"\"]\n\n# OpenStack Swift user ID.\n# CLI flag: -<prefix>.swift.user-id\n[user_id: <string> | default = \"\"]\n\n# OpenStack Swift API key.\n# CLI flag: -<prefix>.swift.password\n[password: <string> | default = \"\"]\n\n# OpenStack Swift user's domain ID.\n# CLI flag: -<prefix>.swift.domain-id\n[domain_id: <string> | default = \"\"]\n\n# OpenStack Swift user's domain name.\n# CLI flag: -<prefix>.swift.domain-name\n[domain_name: <string> | default = \"\"]\n\n# OpenStack Swift project ID (v2,v3 auth only).\n# CLI flag: -<prefix>.swift.project-id\n[project_id: <string> | default = \"\"]\n\n# OpenStack Swift project name (v2,v3 auth only).\n# CLI flag: -<prefix>.swift.project-name\n[project_name: <string> | default = \"\"]\n\n# ID of the OpenStack Swift project's domain (v3 auth only), only needed if it\n# differs the from user domain.\n# CLI flag: -<prefix>.swift.project-domain-id\n[project_domain_id: <string> | default = \"\"]\n\n# Name of the OpenStack Swift project's domain (v3 auth only), only needed if it\n# differs from the user domain.\n# CLI flag: -<prefix>.swift.project-domain-name\n[project_domain_name: <string> | default = \"\"]\n\n# OpenStack Swift Region to use (v2,v3 auth only).\n# CLI flag: -<prefix>.swift.region-name\n[region_name: <string> | default = \"\"]\n\n# Name of the OpenStack Swift container to put chunks in.\n# CLI flag: -<prefix>.swift.container-name\n[container_name: <string> | default = \"\"]\n\n# Max retries on requests error.\n# CLI flag: -<prefix>.swift.max-retries\n[max_retries: <int> | default = 3]\n\n# Time after which a connection attempt is aborted.\n# CLI flag: -<prefix>.swift.connect-timeout\n[connect_timeout: <duration> | default = 10s]\n\n# Time after which an idle request is aborted. The timeout watchdog is reset\n# each time some data is received, so the timeout triggers after X time no data\n# is received on a request.\n# CLI flag: -<prefix>.swift.request-timeout\n[request_timeout: <duration> | default = 5s]\n\nhttp:\n  # Path to the CA certificates to validate server certificate against. If not\n  # set, the host's root CA certificates are used.\n  # CLI flag: -<prefix>.swift.http.tls-ca-path\n  [tls_ca_path: <string> | default = \"\"]\n```\n\n### table_manager\n\nThe `table_manager` block configures the table manager for retention.\n\n```yaml\n# If true, disable all changes to DB capacity\n# CLI flag: -table-manager.throughput-updates-disabled\n[throughput_updates_disabled: <boolean> | default = false]\n\n# If true, enables retention deletes of DB tables\n# CLI flag: -table-manager.retention-deletes-enabled\n[retention_deletes_enabled: <boolean> | default = false]\n\n# Tables older than this retention period are deleted. Must be either 0\n# (disabled) or a multiple of 24h. When enabled, be aware this setting is\n# destructive to data!\n# CLI flag: -table-manager.retention-period\n[retention_period: <duration> | default = 0s]\n\n# How frequently to poll backend to learn our capacity.\n# CLI flag: -table-manager.poll-interval\n[poll_interval: <duration> | default = 2m]\n\n# Periodic tables grace period (duration which table will be created/deleted\n# before/after it's needed).\n# CLI flag: -table-manager.periodic-table.grace-period\n[creation_grace_period: <duration> | default = 10m]\n\nindex_tables_provisioning:\n  # Enables on demand throughput provisioning for the storage provider (if\n  # supported). Applies only to tables which are not autoscaled. Supported by\n  # DynamoDB\n  # CLI flag: -table-manager.index-table.enable-ondemand-throughput-mode\n  [enable_ondemand_throughput_mode: <boolean> | default = false]\n\n  # Table default write throughput. Supported by DynamoDB\n  # CLI flag: -table-manager.index-table.write-throughput\n  [provisioned_write_throughput: <int> | default = 1000]\n\n  # Table default read throughput. Supported by DynamoDB\n  # CLI flag: -table-manager.index-table.read-throughput\n  [provisioned_read_throughput: <int> | default = 300]\n\n  write_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.index-table.write-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.index-table.write-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.index-table.write-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.index-table.write-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.index-table.write-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.index-table.write-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.index-table.write-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  read_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.index-table.read-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.index-table.read-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.index-table.read-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.index-table.read-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.index-table.read-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.index-table.read-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.index-table.read-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  # Enables on demand throughput provisioning for the storage provider (if\n  # supported). Applies only to tables which are not autoscaled. Supported by\n  # DynamoDB\n  # CLI flag: -table-manager.index-table.inactive-enable-ondemand-throughput-mode\n  [enable_inactive_throughput_on_demand_mode: <boolean> | default = false]\n\n  # Table write throughput for inactive tables. Supported by DynamoDB\n  # CLI flag: -table-manager.index-table.inactive-write-throughput\n  [inactive_write_throughput: <int> | default = 1]\n\n  # Table read throughput for inactive tables. Supported by DynamoDB\n  # CLI flag: -table-manager.index-table.inactive-read-throughput\n  [inactive_read_throughput: <int> | default = 300]\n\n  inactive_write_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  inactive_read_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  # Number of last inactive tables to enable write autoscale.\n  # CLI flag: -table-manager.index-table.inactive-write-throughput.scale-last-n\n  [inactive_write_scale_lastn: <int> | default = 4]\n\n  # Number of last inactive tables to enable read autoscale.\n  # CLI flag: -table-manager.index-table.inactive-read-throughput.scale-last-n\n  [inactive_read_scale_lastn: <int> | default = 4]\n\nchunk_tables_provisioning:\n  # Enables on demand throughput provisioning for the storage provider (if\n  # supported). Applies only to tables which are not autoscaled. Supported by\n  # DynamoDB\n  # CLI flag: -table-manager.chunk-table.enable-ondemand-throughput-mode\n  [enable_ondemand_throughput_mode: <boolean> | default = false]\n\n  # Table default write throughput. Supported by DynamoDB\n  # CLI flag: -table-manager.chunk-table.write-throughput\n  [provisioned_write_throughput: <int> | default = 1000]\n\n  # Table default read throughput. Supported by DynamoDB\n  # CLI flag: -table-manager.chunk-table.read-throughput\n  [provisioned_read_throughput: <int> | default = 300]\n\n  write_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.chunk-table.write-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  read_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.chunk-table.read-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  # Enables on demand throughput provisioning for the storage provider (if\n  # supported). Applies only to tables which are not autoscaled. Supported by\n  # DynamoDB\n  # CLI flag: -table-manager.chunk-table.inactive-enable-ondemand-throughput-mode\n  [enable_inactive_throughput_on_demand_mode: <boolean> | default = false]\n\n  # Table write throughput for inactive tables. Supported by DynamoDB\n  # CLI flag: -table-manager.chunk-table.inactive-write-throughput\n  [inactive_write_throughput: <int> | default = 1]\n\n  # Table read throughput for inactive tables. Supported by DynamoDB\n  # CLI flag: -table-manager.chunk-table.inactive-read-throughput\n  [inactive_read_throughput: <int> | default = 300]\n\n  inactive_write_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  inactive_read_scale:\n    # Should we enable autoscale for the table.\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.enabled\n    [enabled: <boolean> | default = false]\n\n    # AWS AutoScaling role ARN\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.role-arn\n    [role_arn: <string> | default = \"\"]\n\n    # DynamoDB minimum provision capacity.\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.min-capacity\n    [min_capacity: <int> | default = 3000]\n\n    # DynamoDB maximum provision capacity.\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.max-capacity\n    [max_capacity: <int> | default = 6000]\n\n    # DynamoDB minimum seconds between each autoscale up.\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.out-cooldown\n    [out_cooldown: <int> | default = 1800]\n\n    # DynamoDB minimum seconds between each autoscale down.\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.in-cooldown\n    [in_cooldown: <int> | default = 1800]\n\n    # DynamoDB target ratio of consumed capacity to provisioned capacity.\n    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.target-value\n    [target: <float> | default = 80]\n\n  # Number of last inactive tables to enable write autoscale.\n  # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale-last-n\n  [inactive_write_scale_lastn: <int> | default = 4]\n\n  # Number of last inactive tables to enable read autoscale.\n  # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale-last-n\n  [inactive_read_scale_lastn: <int> | default = 4]\n```\n\n### thanos_object_store_config\n\nThe `thanos_object_store_config` block configures the connection to object storage backend using thanos-io/objstore clients. This will become the default way of configuring object store clients in future releases.\nCurrently this is opt-in and takes effect only when `-use-thanos-objstore` is set to true. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `common.storage.object-store`\n- `object-store`\n- `ruler-storage`\n- `ui.goldfish.results`\n\n\u00a0\n\n```yaml\ns3:\n  # The S3 bucket endpoint. It could be an AWS S3 endpoint listed at\n  # https://docs.aws.amazon.com/general/latest/gr/s3.html or the address of an\n  # S3-compatible service in hostname:port format.\n  # CLI flag: -<prefix>.s3.endpoint\n  [endpoint: <string> | default = \"\"]\n\n  # S3 region. If unset, the client will issue a S3 GetBucketLocation API call\n  # to autodetect it.\n  # CLI flag: -<prefix>.s3.region\n  [region: <string> | default = \"\"]\n\n  # S3 bucket name\n  # CLI flag: -<prefix>.s3.bucket-name\n  [bucket_name: <string> | default = \"\"]\n\n  # S3 secret access key\n  # CLI flag: -<prefix>.s3.secret-access-key\n  [secret_access_key: <string> | default = \"\"]\n\n  # S3 access key ID\n  # CLI flag: -<prefix>.s3.access-key-id\n  [access_key_id: <string> | default = \"\"]\n\n  # S3 session token\n  # CLI flag: -<prefix>.s3.session-token\n  [session_token: <string> | default = \"\"]\n\n  # If enabled, use http:// for the S3 endpoint instead of https://. This could\n  # be useful in local dev/test environments while using an S3-compatible\n  # backend storage, like Minio.\n  # CLI flag: -<prefix>.s3.insecure\n  [insecure: <boolean> | default = false]\n\n  # Use a specific version of the S3 list object API. Supported values are v1 or\n  # v2. Default is unset.\n  # CLI flag: -<prefix>.s3.list-objects-version\n  [list_objects_version: <string> | default = \"\"]\n\n  # Bucket lookup style type, used to access bucket in S3-compatible service.\n  # Default is auto. Supported values are: auto, path, virtual-hosted.\n  # CLI flag: -<prefix>.s3.bucket-lookup-type\n  [bucket_lookup_type: <int> | default = auto]\n\n  # When enabled, direct all AWS S3 requests to the dual-stack IPv4/IPv6\n  # endpoint for the configured region.\n  # CLI flag: -<prefix>.s3.dualstack-enabled\n  [dualstack_enabled: <boolean> | default = true]\n\n  # The S3 storage class to use, not set by default. Details can be found at\n  # https://aws.amazon.com/s3/storage-classes/. Supported values are: STANDARD,\n  # REDUCED_REDUNDANCY, GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING,\n  # DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR, SNOW, EXPRESS_ONEZONE, FSX_OPENZFS,\n  # FSX_ONTAP\n  # CLI flag: -<prefix>.s3.storage-class\n  [storage_class: <string> | default = \"\"]\n\n  # If enabled, it will use the default authentication methods of the AWS SDK\n  # for go based on known environment variables and known AWS config files.\n  # CLI flag: -<prefix>.s3.native-aws-auth-enabled\n  [native_aws_auth_enabled: <boolean> | default = false]\n\n  # The minimum file size in bytes used for multipart uploads. If 0, the value\n  # is optimally computed for each object.\n  # CLI flag: -<prefix>.s3.part-size\n  [part_size: <int> | default = 0]\n\n  # If enabled, a Content-MD5 header is sent with S3 Put Object requests.\n  # Consumes more resources to compute the MD5, but may improve compatibility\n  # with object storage services that do not support checksums.\n  # CLI flag: -<prefix>.s3.send-content-md5\n  [send_content_md5: <boolean> | default = false]\n\n  # Accessing S3 resources using temporary, secure credentials provided by AWS\n  # Security Token Service.\n  # CLI flag: -<prefix>.s3.sts-endpoint\n  [sts_endpoint: <string> | default = \"\"]\n\n  # The maximum number of retries for S3 requests that are retryable. Default is\n  # 10, set this to 1 to disable retries.\n  # CLI flag: -<prefix>.s3.max-retries\n  [max_retries: <int> | default = 10]\n\n  sse:\n    # Enable AWS Server Side Encryption. Supported values: SSE-KMS, SSE-S3.\n    # CLI flag: -<prefix>.s3.sse.type\n    [type: <string> | default = \"\"]\n\n    # KMS Key ID used to encrypt objects in S3\n    # CLI flag: -<prefix>.s3.sse.kms-key-id\n    [kms_key_id: <string> | default = \"\"]\n\n    # KMS Encryption Context used for object encryption. It expects JSON\n    # formatted string.\n    # CLI flag: -<prefix>.s3.sse.kms-encryption-context\n    [kms_encryption_context: <string> | default = \"\"]\n\n  http:\n    # The time an idle connection will remain idle before closing.\n    # CLI flag: -<prefix>.s3.http.idle-conn-timeout\n    [idle_conn_timeout: <duration> | default = 1m30s]\n\n    # The amount of time the client will wait for a servers response headers.\n    # CLI flag: -<prefix>.s3.http.response-header-timeout\n    [response_header_timeout: <duration> | default = 2m]\n\n    # If the client connects via HTTPS and this option is enabled, the client\n    # will accept any certificate and hostname.\n    # CLI flag: -<prefix>.s3.http.insecure-skip-verify\n    [insecure_skip_verify: <boolean> | default = false]\n\n    # Maximum time to wait for a TLS handshake. 0 means no limit.\n    # CLI flag: -<prefix>.s3.tls-handshake-timeout\n    [tls_handshake_timeout: <duration> | default = 10s]\n\n    # The time to wait for a server's first response headers after fully writing\n    # the request headers if the request has an Expect header. 0 to send the\n    # request body immediately.\n    # CLI flag: -<prefix>.s3.expect-continue-timeout\n    [expect_continue_timeout: <duration> | default = 1s]\n\n    # Maximum number of idle (keep-alive) connections across all hosts. 0 means\n    # no limit.\n    # CLI flag: -<prefix>.s3.max-idle-connections\n    [max_idle_connections: <int> | default = 100]\n\n    # Maximum number of idle (keep-alive) connections to keep per-host. If 0, a\n    # built-in default value is used.\n    # CLI flag: -<prefix>.s3.max-idle-connections-per-host\n    [max_idle_connections_per_host: <int> | default = 100]\n\n    # Maximum number of connections per host. 0 means no limit.\n    # CLI flag: -<prefix>.s3.max-connections-per-host\n    [max_connections_per_host: <int> | default = 0]\n\n    # Path to the CA certificates to validate server certificate against. If not\n    # set, the host's root CA certificates are used.\n    # CLI flag: -<prefix>.s3.http.tls-ca-path\n    [tls_ca_path: <string> | default = \"\"]\n\n    # Path to the client certificate, which will be used for authenticating with\n    # the server. Also requires the key path to be configured.\n    # CLI flag: -<prefix>.s3.http.tls-cert-path\n    [tls_cert_path: <string> | default = \"\"]\n\n    # Path to the key for the client certificate. Also requires the client\n    # certificate to be configured.\n    # CLI flag: -<prefix>.s3.http.tls-key-path\n    [tls_key_path: <string> | default = \"\"]\n\n    # Override the expected name on the server certificate.\n    # CLI flag: -<prefix>.s3.http.tls-server-name\n    [tls_server_name: <string> | default = \"\"]\n\n  trace:\n    # When enabled, low-level S3 HTTP operation information is logged at the\n    # debug level.\n    # CLI flag: -<prefix>.s3.trace.enabled\n    [enabled: <boolean> | default = false]\n\ngcs:\n  # GCS bucket name\n  # CLI flag: -<prefix>.gcs.bucket-name\n  [bucket_name: <string> | default = \"\"]\n\n  # JSON either from a Google Developers Console client_credentials.json file,\n  # or a Google Developers service account key. Needs to be valid JSON, not a\n  # filesystem path. If empty, fallback to Google default logic:\n  # 1. A JSON file whose path is specified by the GOOGLE_APPLICATION_CREDENTIALS\n  # environment variable. For workload identity federation, refer to\n  # https://cloud.google.com/iam/docs/how-to#using-workload-identity-federation\n  # on how to generate the JSON configuration file for on-prem/non-Google cloud\n  # platforms.\n  # 2. A JSON file in a location known to the gcloud command-line tool:\n  # $HOME/.config/gcloud/application_default_credentials.json.\n  # 3. On Google Compute Engine it fetches credentials from the metadata server.\n  # CLI flag: -<prefix>.gcs.service-account\n  [service_account: <string> | default = \"\"]\n\n  # The maximum size of the buffer that GCS client for a single PUT request. 0\n  # to disable buffering.\n  # CLI flag: -<prefix>.gcs.chunk-buffer-size\n  [chunk_buffer_size: <int> | default = 0]\n\n  # The maximum number of retries for idempotent operations. Overrides the\n  # default gcs storage client behavior if this value is greater than 0. Set\n  # this to 1 to disable retries.\n  # CLI flag: -<prefix>.gcs.max-retries\n  [max_retries: <int> | default = 10]\n\nazure:\n  # Azure storage account name\n  # CLI flag: -<prefix>.azure.account-name\n  [account_name: <string> | default = \"\"]\n\n  # Azure storage account key. If unset, Azure managed identities will be used\n  # for authentication instead.\n  # CLI flag: -<prefix>.azure.account-key\n  [account_key: <string> | default = \"\"]\n\n  # If `connection-string` is set, the value of `endpoint-suffix` will not be\n  # used. Use this method over `account-key` if you need to authenticate via a\n  # SAS token. Or if you use the Azurite emulator.\n  # CLI flag: -<prefix>.azure.connection-string\n  [connection_string: <string> | default = \"\"]\n\n  # Azure storage container name\n  # CLI flag: -<prefix>.azure.container-name\n  [container_name: <string> | default = \"\"]\n\n  # Azure storage endpoint suffix without schema. The account name will be\n  # prefixed to this value to create the FQDN. If set to empty string, default\n  # endpoint suffix is used.\n  # CLI flag: -<prefix>.azure.endpoint-suffix\n  [endpoint_suffix: <string> | default = \"\"]\n\n  # Number of retries for recoverable errors\n  # CLI flag: -<prefix>.azure.max-retries\n  [max_retries: <int> | default = 20]\n\n  # User assigned managed identity. If empty, then System assigned identity is\n  # used.\n  # CLI flag: -<prefix>.azure.user-assigned-id\n  [user_assigned_id: <string> | default = \"\"]\n\n  # Delimiter used to replace ':' in chunk IDs when storing chunks\n  # CLI flag: -<prefix>.azure.chunk-delimiter\n  [chunk_delimiter: <string> | default = \"-\"]\n\nswift:\n  # OpenStack Swift application credential id\n  # CLI flag: -<prefix>.swift.application-credential-id\n  [application_credential_id: <string> | default = \"\"]\n\n  # OpenStack Swift application credential name\n  # CLI flag: -<prefix>.swift.application-credential-name\n  [application_credential_name: <string> | default = \"\"]\n\n  # OpenStack Swift application credential secret\n  # CLI flag: -<prefix>.swift.application-credential-secret\n  [application_credential_secret: <string> | default = \"\"]\n\n  # OpenStack Swift authentication API version. 0 to autodetect.\n  # CLI flag: -<prefix>.swift.auth-version\n  [auth_version: <int> | default = 0]\n\n  # OpenStack Swift authentication URL\n  # CLI flag: -<prefix>.swift.auth-url\n  [auth_url: <string> | default = \"\"]\n\n  # OpenStack Swift username.\n  # CLI flag: -<prefix>.swift.username\n  [username: <string> | default = \"\"]\n\n  # OpenStack Swift user's domain name.\n  # CLI flag: -<prefix>.swift.user-domain-name\n  [user_domain_name: <string> | default = \"\"]\n\n  # OpenStack Swift user's domain ID.\n  # CLI flag: -<prefix>.swift.user-domain-id\n  [user_domain_id: <string> | default = \"\"]\n\n  # OpenStack Swift user ID.\n  # CLI flag: -<prefix>.swift.user-id\n  [user_id: <string> | default = \"\"]\n\n  # OpenStack Swift API key.\n  # CLI flag: -<prefix>.swift.password\n  [password: <string> | default = \"\"]\n\n  # OpenStack Swift user's domain ID.\n  # CLI flag: -<prefix>.swift.domain-id\n  [domain_id: <string> | default = \"\"]\n\n  # OpenStack Swift user's domain name.\n  # CLI flag: -<prefix>.swift.domain-name\n  [domain_name: <string> | default = \"\"]\n\n  # OpenStack Swift project ID (v2,v3 auth only).\n  # CLI flag: -<prefix>.swift.project-id\n  [project_id: <string> | default = \"\"]\n\n  # OpenStack Swift project name (v2,v3 auth only).\n  # CLI flag: -<prefix>.swift.project-name\n  [project_name: <string> | default = \"\"]\n\n  # ID of the OpenStack Swift project's domain (v3 auth only), only needed if it\n  # differs the from user domain.\n  # CLI flag: -<prefix>.swift.project-domain-id\n  [project_domain_id: <string> | default = \"\"]\n\n  # Name of the OpenStack Swift project's domain (v3 auth only), only needed if\n  # it differs from the user domain.\n  # CLI flag: -<prefix>.swift.project-domain-name\n  [project_domain_name: <string> | default = \"\"]\n\n  # OpenStack Swift Region to use (v2,v3 auth only).\n  # CLI flag: -<prefix>.swift.region-name\n  [region_name: <string> | default = \"\"]\n\n  # Name of the OpenStack Swift container to put chunks in.\n  # CLI flag: -<prefix>.swift.container-name\n  [container_name: <string> | default = \"\"]\n\n  # Max retries on requests error.\n  # CLI flag: -<prefix>.swift.max-retries\n  [max_retries: <int> | default = 3]\n\n  # Time after which a connection attempt is aborted.\n  # CLI flag: -<prefix>.swift.connect-timeout\n  [connect_timeout: <duration> | default = 10s]\n\n  # Time after which an idle request is aborted. The timeout watchdog is reset\n  # each time some data is received, so the timeout triggers after X time no\n  # data is received on a request.\n  # CLI flag: -<prefix>.swift.request-timeout\n  [request_timeout: <duration> | default = 5s]\n\n  http:\n    # The time an idle connection will remain idle before closing.\n    # CLI flag: -<prefix>.swift.http.idle-conn-timeout\n    [idle_conn_timeout: <duration> | default = 1m30s]\n\n    # The amount of time the client will wait for a servers response headers.\n    # CLI flag: -<prefix>.swift.http.response-header-timeout\n    [response_header_timeout: <duration> | default = 2m]\n\n    # If the client connects via HTTPS and this option is enabled, the client\n    # will accept any certificate and hostname.\n    # CLI flag: -<prefix>.swift.http.insecure-skip-verify\n    [insecure_skip_verify: <boolean> | default = false]\n\n    # Maximum time to wait for a TLS handshake. 0 means no limit.\n    # CLI flag: -<prefix>.swift.tls-handshake-timeout\n    [tls_handshake_timeout: <duration> | default = 10s]\n\n    # The time to wait for a server's first response headers after fully writing\n    # the request headers if the request has an Expect header. 0 to send the\n    # request body immediately.\n    # CLI flag: -<prefix>.swift.expect-continue-timeout\n    [expect_continue_timeout: <duration> | default = 1s]\n\n    # Maximum number of idle (keep-alive) connections across all hosts. 0 means\n    # no limit.\n    # CLI flag: -<prefix>.swift.max-idle-connections\n    [max_idle_connections: <int> | default = 100]\n\n    # Maximum number of idle (keep-alive) connections to keep per-host. If 0, a\n    # built-in default value is used.\n    # CLI flag: -<prefix>.swift.max-idle-connections-per-host\n    [max_idle_connections_per_host: <int> | default = 100]\n\n    # Maximum number of connections per host. 0 means no limit.\n    # CLI flag: -<prefix>.swift.max-connections-per-host\n    [max_connections_per_host: <int> | default = 0]\n\n    # Path to the CA certificates to validate server certificate against. If not\n    # set, the host's root CA certificates are used.\n    # CLI flag: -<prefix>.swift.http.tls-ca-path\n    [tls_ca_path: <string> | default = \"\"]\n\n    # Path to the client certificate, which will be used for authenticating with\n    # the server. Also requires the key path to be configured.\n    # CLI flag: -<prefix>.swift.http.tls-cert-path\n    [tls_cert_path: <string> | default = \"\"]\n\n    # Path to the key for the client certificate. Also requires the client\n    # certificate to be configured.\n    # CLI flag: -<prefix>.swift.http.tls-key-path\n    [tls_key_path: <string> | default = \"\"]\n\n    # Override the expected name on the server certificate.\n    # CLI flag: -<prefix>.swift.http.tls-server-name\n    [tls_server_name: <string> | default = \"\"]\n\nfilesystem:\n  # Local filesystem storage directory.\n  # CLI flag: -<prefix>.filesystem.dir\n  [dir: <string> | default = \"\"]\n\nalibaba:\n  # Endpoint to connect to.\n  # CLI flag: -<prefix>.oss.endpoint\n  [endpoint: <string> | default = \"\"]\n\n  # Name of OSS bucket.\n  # CLI flag: -<prefix>.oss.bucketname\n  [bucket: <string> | default = \"\"]\n\n  # alibabacloud Access Key ID\n  # CLI flag: -<prefix>.oss.access-key-id\n  [access_key_id: <string> | default = \"\"]\n\n  # alibabacloud Secret Access Key\n  # CLI flag: -<prefix>.oss.access-key-secret\n  [access_key_secret: <string> | default = \"\"]\n\nbos:\n  # Name of BOS bucket.\n  # CLI flag: -<prefix>.bos.bucket\n  [bucket: <string> | default = \"\"]\n\n  # BOS endpoint to connect to.\n  # CLI flag: -<prefix>.bos.endpoint\n  [endpoint: <string> | default = \"\"]\n\n  # Baidu Cloud Engine (BCE) Access Key ID.\n  # CLI flag: -<prefix>.bos.access-key\n  [access_key: <string> | default = \"\"]\n\n  # Baidu Cloud Engine (BCE) Secret Access Key.\n  # CLI flag: -<prefix>.bos.secret-key\n  [secret_key: <string> | default = \"\"]\n\n# Prefix for all objects stored in the backend storage. For simplicity, it may\n# only contain digits, English alphabet letters and dashes.\n# CLI flag: -<prefix>.storage-prefix\n[storage_prefix: <string> | default = \"\"]\n```\n\n### tls_config\n\nThe TLS configuration. The supported CLI flags ` ` used to reference this configuration block are:\n\n- `bigtable`\n- `bloom-build.builder.grpc`\n- `bloom-gateway-client.grpc`\n- `bloom.metas-cache.memcached`\n- `boltdb.shipper.index-gateway-client.grpc`\n- `common.storage.ring.etcd`\n- `compactor.grpc-client`\n- `compactor.ring.etcd`\n- `dataobj-consumer.etcd`\n- `dataobj-consumer.partition-ring.etcd`\n- `distributor.ring.etcd`\n- `etcd`\n- `frontend.grpc-client-config`\n- `frontend.index-stats-results-cache.memcached`\n- `frontend.instant-metric-results-cache.memcached`\n- `frontend.label-results-cache.memcached`\n- `frontend.memcached`\n- `frontend.series-results-cache.memcached`\n- `frontend.tail-tls-config`\n- `frontend.volume-results-cache.memcached`\n- `index-gateway.ring.etcd`\n- `ingest-limits-frontend-client`\n- `ingest-limits-frontend.etcd`\n- `ingest-limits-frontend.limits-client`\n- `ingest-limits.etcd`\n- `ingester.client`\n- `ingester.partition-ring.etcd`\n- `memberlist`\n- `pattern-ingester.client`\n- `pattern-ingester.etcd`\n- `querier.frontend-client`\n- `querier.frontend-grpc-client`\n- `querier.scheduler-grpc-client`\n- `query-scheduler.grpc-client-config`\n- `query-scheduler.ring.etcd`\n- `reporting.tls-config`\n- `ruler.alertmanager-client`\n- `ruler.client`\n- `ruler.evaluation.query-frontend`\n- `ruler.ring.etcd`\n- `store.chunks-cache-l2.memcached`\n- `store.chunks-cache.memcached`\n- `store.index-cache-read.memcached`\n- `store.index-cache-write.memcached`\n- `tsdb.shipper.index-gateway-client.grpc`\n- `ui.ring.etcd`\n\n\u00a0\n\n```yaml\n# Path to the client certificate, which will be used for authenticating with the\n# server. Also requires the key path to be configured.\n# CLI flag: -<prefix>.tls-cert-path\n[tls_cert_path: <string> | default = \"\"]\n\n# Path to the key for the client certificate. Also requires the client\n# certificate to be configured.\n# CLI flag: -<prefix>.tls-key-path\n[tls_key_path: <string> | default = \"\"]\n\n# Path to the CA certificates to validate server certificate against. If not\n# set, the host's root CA certificates are used.\n# CLI flag: -<prefix>.tls-ca-path\n[tls_ca_path: <string> | default = \"\"]\n\n# Override the expected name on the server certificate.\n# CLI flag: -<prefix>.tls-server-name\n[tls_server_name: <string> | default = \"\"]\n\n# Skip validating server certificate.\n# CLI flag: -<prefix>.tls-insecure-skip-verify\n[tls_insecure_skip_verify: <boolean> | default = false]\n\n# Override the default cipher suite list (separated by commas). Allowed values:\n# \n# Secure Ciphers:\n# - TLS_AES_128_GCM_SHA256\n# - TLS_AES_256_GCM_SHA384\n# - TLS_CHACHA20_POLY1305_SHA256\n# - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA\n# - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA\n# - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA\n# - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA\n# - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256\n# - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384\n# - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\n# - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384\n# - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256\n# - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256\n# \n# Insecure Ciphers:\n# - TLS_RSA_WITH_RC4_128_SHA\n# - TLS_RSA_WITH_3DES_EDE_CBC_SHA\n# - TLS_RSA_WITH_AES_128_CBC_SHA\n# - TLS_RSA_WITH_AES_256_CBC_SHA\n# - TLS_RSA_WITH_AES_128_CBC_SHA256\n# - TLS_RSA_WITH_AES_128_GCM_SHA256\n# - TLS_RSA_WITH_AES_256_GCM_SHA384\n# - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA\n# - TLS_ECDHE_RSA_WITH_RC4_128_SHA\n# - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA\n# - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256\n# - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256\n# CLI flag: -<prefix>.tls-cipher-suites\n[tls_cipher_suites: <string> | default = \"\"]\n\n# Override the default minimum TLS version. Allowed values: VersionTLS10,\n# VersionTLS11, VersionTLS12, VersionTLS13\n# CLI flag: -<prefix>.tls-min-version\n[tls_min_version: <string> | default = \"\"]\n```\n\n### tracing\n\nConfiguration for `tracing`.\n\n```yaml\n# Set to false to disable tracing.\n# CLI flag: -tracing.enabled\n[enabled: <boolean> | default = true]\n```\n\n \n\n## Runtime Configuration file\n\nLoki 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= ` flag and reload period (which defaults to 10 seconds) can be changed by `-runtime-config.reload-period= ` flag. Previously this mechanism was only used by limits overrides, and flags were called `-limits.per-user-override-config= ` and `-limits.per-user-override-period=10s` respectively. These are still used, if `-runtime-config.file= ` is not specified.\n\nAt the moment, two components use runtime configuration: limits and multi KV store.\n\nOptions for runtime configuration reload can also be configured via YAML:\n\n```yaml\n# Configuration file to periodically check and reload.\n[file: <string>: default = empty]\n\n# How often to check the file.\n[period: <duration>: default 10s]\n```\n\nExample runtime configuration file:\n\n```yaml\noverrides:\n  tenant1:\n    ingestion_rate_mb: 10\n    max_streams_per_user: 100000\n    max_chunks_per_query: 100000\n  tenant2:\n    max_streams_per_user: 1000000\n    max_chunks_per_query: 1000000\n\nmulti_kv_config:\n    mirror-enabled: false\n    primary: consul\n```\n\n## Accept out-of-order writes\n\nSince the beginning of Loki, log entries had to be written to Loki in order\nby time.\nThis limitation has been lifted.\nOut-of-order writes are enabled globally by default, but can be disabled/enabled\non a cluster or per-tenant basis.\n\n- To disable out-of-order writes for all tenants,\nplace in the `limits_config` section:\n\n    ```yaml\n    limits_config:\n        unordered_writes: false\n    ```\n\n- To disable out-of-order writes for specific tenants,\nconfigure a runtime configuration file:\n\n    ```yaml\n    runtime_config:\n      file: overrides.yaml\n    ```\n\n In the `overrides.yaml` file, add `unordered_writes` for each tenant\n permitted to have out-of-order writes:\n\n    ```yaml\n    overrides:\n      \"tenantA\":\n        unordered_writes: false\n    ```\n\nHow far into the past accepted out-of-order log entries may be\nis configurable with `max_chunk_age`.\n`max_chunk_age` defaults to 2 hour.\nLoki calculates the earliest time that out-of-order entries may have\nand be accepted with\n\n```yaml\ntime_of_most_recent_line - (max_chunk_age/2)\n```\n\nLog entries with timestamps that are after this earliest time are accepted.\nLog entries further back in time return an out-of-order error.\n\nFor example, if `max_chunk_age` is 2 hours\nand the stream `{foo=\"bar\"}` has one entry at `8:00`,\nLoki will accept data for that stream as far back in time as `7:00`.\nIf another log line is written at `10:00`,\nLoki will accept data for that stream as far back in time as `9:00`.\n"
      }
    ],
    "searchTime": 788,
    "costDollars": {
      "total": 0.007,
      "search": {
        "neural": 0.007
      }
    }
  }
}