<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Loki reference topics on Grafana Labs</title><link>https://grafana.com/docs/loki/v3.7.x/reference/</link><description>Recent content in Loki reference topics on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/loki/v3.7.x/reference/index.xml" rel="self" type="application/rss+xml"/><item><title>Grafana Loki configuration parameters</title><link>https://grafana.com/docs/loki/v3.7.x/reference/loki-config-ref/</link><pubDate>Thu, 09 Apr 2026 02:28:18 +0000</pubDate><guid>https://grafana.com/docs/loki/v3.7.x/reference/loki-config-ref/</guid><content><![CDATA[&lt;h1 id=&#34;grafana-loki-configuration-parameters&#34;&gt;Grafana Loki configuration parameters&lt;/h1&gt;
&lt;p&gt;Grafana Loki is configured in a YAML file (usually referred to as &lt;code&gt;loki.yaml&lt;/code&gt; )
which contains information on the Loki server and its individual components,
depending on which mode Loki is launched in.&lt;/p&gt;
&lt;p&gt;Configuration examples can be found in the 
    &lt;a href=&#34;/docs/loki/v3.7.x/configure/examples/configuration-examples/&#34;&gt;Configuration Examples&lt;/a&gt; document.&lt;/p&gt;
&lt;!-- The shared `configuration.md` file is generated from `/docs/templates/configuration.template`. To make changes to the included content, modify the template file and run `make doc` from root directory to regenerate the shared file. --&gt;


&lt;div data-shared=&#34;configuration.md&#34;&gt;
            &lt;!-- DO NOT EDIT THIS FILE - This file has been automatically generated from its .template, regenerate with `make doc` from root directory. --&gt;
&lt;h2 id=&#34;printing-loki-config-at-runtime&#34;&gt;Printing Loki config at runtime&lt;/h2&gt;
&lt;p&gt;If you pass Loki the flag &lt;code&gt;-print-config-stderr&lt;/code&gt; or &lt;code&gt;-log-config-reverse-order&lt;/code&gt;, (or &lt;code&gt;-print-config-stderr=true&lt;/code&gt;)
Loki will dump the entire config object it has created from the built-in defaults combined first with
overrides from config file, and second by overrides from flags.&lt;/p&gt;
&lt;p&gt;The result is the value for every config object in the Loki config struct, which is very large&amp;hellip;&lt;/p&gt;
&lt;p&gt;Many values will not be relevant to your install such as storage configs which you are not using and which you did not define,
this is expected as every option has a default value if it is being used or not.&lt;/p&gt;
&lt;p&gt;This config is what Loki will use to run, it can be invaluable for debugging issues related to configuration and
is especially useful in making sure your config files and flags are being read and loaded properly.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-print-config-stderr&lt;/code&gt; is nice when running Loki directly e.g. &lt;code&gt;./loki &lt;/code&gt; as you can get a quick output of the entire Loki config.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-log-config-reverse-order&lt;/code&gt; is the flag we run Loki with in all our environments, the config entries are reversed so
that the order of configs reads correctly top to bottom when viewed in Grafana&amp;rsquo;s Explore.&lt;/p&gt;
&lt;h2 id=&#34;configuration-file-reference&#34;&gt;Configuration file reference&lt;/h2&gt;
&lt;p&gt;To specify which configuration file to load, pass the &lt;code&gt;-config.file&lt;/code&gt; flag at the
command line. The value can be a list of comma separated paths, then the first
file that exists will be used.
If no &lt;code&gt;-config.file&lt;/code&gt; argument is specified, Loki will look up the &lt;code&gt;config.yaml&lt;/code&gt; in the
current working directory and the &lt;code&gt;config/&lt;/code&gt; subdirectory and try to use that.&lt;/p&gt;
&lt;p&gt;The file is written in &lt;a href=&#34;https://en.wikipedia.org/wiki/YAML&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;YAML
format&lt;/a&gt;, defined by the scheme below.
Brackets indicate that a parameter is optional. For non-list parameters the
value is set to the specified default.&lt;/p&gt;
&lt;h3 id=&#34;use-environment-variables-in-the-configuration&#34;&gt;Use environment variables in the configuration&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This feature is only available in Loki 2.1&#43;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;You can use environment variable references in the configuration file to set values that need to be configurable during deployment.
To do this, pass &lt;code&gt;-config.expand-env=true&lt;/code&gt; and use:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;${VAR}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Where VAR is the name of the environment variable.&lt;/p&gt;
&lt;p&gt;Each variable reference is replaced at startup by the value of the environment variable.
The replacement is case-sensitive and occurs before the YAML file is parsed.
References to undefined variables are replaced by empty strings unless you specify a default value or custom error text.&lt;/p&gt;
&lt;p&gt;To specify a default value, use:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;${VAR:-default_value}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Where default_value is the value to use if the environment variable is undefined.&lt;/p&gt;
&lt;p&gt;Pass the &lt;code&gt;-config.expand-env&lt;/code&gt; flag at the command line to enable this way of setting configs.&lt;/p&gt;
&lt;h3 id=&#34;generic-placeholders&#34;&gt;Generic placeholders&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;boolean&amp;gt;&lt;/code&gt; : a boolean that can take the values &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;int&amp;gt;&lt;/code&gt; : A plain integer (for example, &lt;code&gt;0&lt;/code&gt;, &lt;code&gt;1024&lt;/code&gt;, &lt;code&gt;5000&lt;/code&gt;) or a size in bytes with optional unit suffix (for example, &lt;code&gt;1024&lt;/code&gt;, &lt;code&gt;256KB&lt;/code&gt;, &lt;code&gt;64MB&lt;/code&gt;, &lt;code&gt;4GB&lt;/code&gt;). Supported units: &lt;code&gt;B&lt;/code&gt;, &lt;code&gt;KB&lt;/code&gt;, &lt;code&gt;MB&lt;/code&gt;, &lt;code&gt;GB&lt;/code&gt;, &lt;code&gt;TB&lt;/code&gt;, &lt;code&gt;PB&lt;/code&gt;, &lt;code&gt;EB&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;duration&amp;gt;&lt;/code&gt; : a duration with required unit suffix. Supported units: &lt;code&gt;ms&lt;/code&gt;, &lt;code&gt;s&lt;/code&gt;, &lt;code&gt;m&lt;/code&gt;, &lt;code&gt;h&lt;/code&gt;, &lt;code&gt;d&lt;/code&gt;, &lt;code&gt;w&lt;/code&gt;, &lt;code&gt;y &lt;/code&gt;(for example, &lt;code&gt;30s&lt;/code&gt;, &lt;code&gt;5m&lt;/code&gt;, &lt;code&gt;1h&lt;/code&gt;, &lt;code&gt;1d&lt;/code&gt;, &lt;code&gt;1w&lt;/code&gt;). Note: &lt;code&gt;0&lt;/code&gt; is allowed without a unit. Some fields using Go&amp;rsquo;s native duration type may also support &lt;code&gt;ns&lt;/code&gt; and &lt;code&gt;us&lt;/code&gt;/&lt;code&gt;µs&lt;/code&gt; but not &lt;code&gt;d&lt;/code&gt;, &lt;code&gt;w&lt;/code&gt;, &lt;code&gt;y&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;labelname&amp;gt;&lt;/code&gt; : a string matching the regular expression &lt;code&gt;[a-zA-Z_][a-zA-Z0-9_]*&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;labelvalue&amp;gt;&lt;/code&gt; : a string of unicode characters&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;filename&amp;gt;&lt;/code&gt; : a valid path relative to current working directory or an absolute path.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;host&amp;gt;&lt;/code&gt; : a valid string consisting of a hostname or IP followed by an optional port number&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;string&amp;gt;&lt;/code&gt; : a string&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;secret&amp;gt;&lt;/code&gt; : a string that represents a secret, such as a password&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;supported-contents-and-default-values-of-lokiyaml&#34;&gt;Supported contents and default values of &lt;code&gt;loki.yaml&lt;/code&gt;&lt;/h3&gt;
&lt;!-- vale Grafana.Spelling = NO --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# A comma-separated list of components to run. The default value &amp;#39;all&amp;#39; runs Loki
# in single binary mode. The value &amp;#39;read&amp;#39; is an alias to run only read-path
# related components such as the querier and query-frontend, but all in the same
# process. The value &amp;#39;write&amp;#39; is an alias to run only write-path related
# components such as the distributor and compactor, but all in the same process.
# Supported values: all, compactor, distributor, ingester, querier,
# query-scheduler, ingester-querier, query-frontend, index-gateway, ruler,
# table-manager, read, write. A full list of available targets can be printed
# when running Loki with the &amp;#39;-list-targets&amp;#39; command line flag.
# CLI flag: -target
[target: &amp;lt;string&amp;gt; | default = &amp;#34;all&amp;#34;]

# Enables authentication through the X-Scope-OrgID header, which must be present
# if true. If false, the OrgID will always be set to &amp;#39;fake&amp;#39;.
# CLI flag: -auth.enabled
[auth_enabled: &amp;lt;boolean&amp;gt; | default = true]

# The amount of virtual memory in bytes to reserve as ballast in order to
# optimize garbage collection. Larger ballasts result in fewer garbage
# collection passes, reducing CPU overhead at the cost of heap size. The ballast
# will not consume physical memory, because it is never read from. It will,
# however, distort metrics, because it is counted as live memory.
# CLI flag: -config.ballast-bytes
[ballast_bytes: &amp;lt;int&amp;gt; | default = 0]

# Configures the server of the launched module(s).
[server: &amp;lt;server&amp;gt;]

ui:
  # Enable the experimental Loki UI.
  # CLI flag: -ui.enabled
  [enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Enable debug logging for the UI.
  # CLI flag: -ui.debug
  [debug: &amp;lt;boolean&amp;gt; | default = false]

  goldfish:
    # Enable the Goldfish query comparison feature.
    # CLI flag: -ui.goldfish.enable
    [enable: &amp;lt;boolean&amp;gt; | default = false]

    storage:
      # Storage backend type (cloudsql, rds, or empty for no storage)
      # CLI flag: -ui.goldfish.storage.type
      [type: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # CloudSQL host for Goldfish database.
      # CLI flag: -ui.goldfish.storage.cloudsql.host
      [cloudsql_host: &amp;lt;string&amp;gt; | default = &amp;#34;127.0.0.1&amp;#34;]

      # CloudSQL port for Goldfish database.
      # CLI flag: -ui.goldfish.storage.cloudsql.port
      [cloudsql_port: &amp;lt;int&amp;gt; | default = 3306]

      # CloudSQL database name for Goldfish.
      # CLI flag: -ui.goldfish.storage.cloudsql.database
      [cloudsql_database: &amp;lt;string&amp;gt; | default = &amp;#34;goldfish&amp;#34;]

      # CloudSQL username for Goldfish database.
      # CLI flag: -ui.goldfish.storage.cloudsql.user
      [cloudsql_user: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # RDS endpoint (host:port)
      # CLI flag: -ui.goldfish.storage.rds.endpoint
      [rds_endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # RDS database name
      # CLI flag: -ui.goldfish.storage.rds.database
      [rds_database: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # RDS database user
      # CLI flag: -ui.goldfish.storage.rds.user
      [rds_user: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Maximum number of database connections for Goldfish.
      # CLI flag: -ui.goldfish.max-connections
      [max_connections: &amp;lt;int&amp;gt; | default = 10]

      # Maximum idle time for database connections in seconds.
      # CLI flag: -ui.goldfish.max-idle-time
      [max_idle_time_seconds: &amp;lt;int&amp;gt; | default = 300]

    # Base URL of Grafana instance for explore links.
    # CLI flag: -ui.goldfish.grafana-url
    [grafana_url: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # UID of the traces datasource in Grafana.
    # CLI flag: -ui.goldfish.traces-datasource-uid
    [traces_datasource_uid: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # UID of the Loki datasource in Grafana.
    # CLI flag: -ui.goldfish.logs-datasource-uid
    [logs_datasource_uid: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Namespace for Cell A logs.
    # CLI flag: -ui.goldfish.cell-a-namespace
    [cell_a_namespace: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Namespace for Cell B logs.
    # CLI flag: -ui.goldfish.cell-b-namespace
    [cell_b_namespace: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Results storage backend (gcs, s3) for fetching stored query results.
    # CLI flag: -ui.goldfish.results-backend
    [results_backend: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # The 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.
    # Currently this is opt-in and takes effect only when `-use-thanos-objstore`
    # is set to true.
    # The CLI flags prefix for this block configuration is: ui.goldfish.results
    [results_bucket: &amp;lt;thanos_object_store_config&amp;gt;]

  ring:
    kvstore:
      # Backend storage to use for the ring. Supported values are: consul, etcd,
      # inmemory, memberlist, multi.
      # CLI flag: -ui.ring.store
      [store: &amp;lt;string&amp;gt; | default = &amp;#34;consul&amp;#34;]

      # The prefix for the keys in the store. Should end with a /.
      # CLI flag: -ui.ring.prefix
      [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

      # Configuration for a Consul client. Only applies if the selected kvstore
      # is consul.
      # The CLI flags prefix for this block configuration is: ui.ring
      [consul: &amp;lt;consul&amp;gt;]

      # Configuration for an ETCD v3 client. Only applies if the selected
      # kvstore is etcd.
      # The CLI flags prefix for this block configuration is: ui.ring
      [etcd: &amp;lt;etcd&amp;gt;]

      multi:
        # Primary backend storage used by multi-client.
        # CLI flag: -ui.ring.multi.primary
        [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        # Secondary backend storage used by multi-client.
        # CLI flag: -ui.ring.multi.secondary
        [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        # Mirror writes to the secondary store.
        # CLI flag: -ui.ring.multi.mirror-enabled
        [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

        # Timeout for storing a value to the secondary store.
        # CLI flag: -ui.ring.multi.mirror-timeout
        [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

    # Period at which to heartbeat to the ring.
    # CLI flag: -ui.ring.heartbeat-period
    [heartbeat_period: &amp;lt;duration&amp;gt; | default = 15s]

    # The heartbeat timeout after which compactors are considered unhealthy
    # within the ring. 0 = never (timeout disabled).
    # CLI flag: -ui.ring.heartbeat-timeout
    [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

    # File path where tokens are stored. If empty, tokens are not stored at
    # shutdown and restored at startup.
    # CLI flag: -ui.ring.tokens-file-path
    [tokens_file_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # True to enable zone-awareness and replicate blocks across different
    # availability zones.
    # CLI flag: -ui.ring.zone-awareness-enabled
    [zone_awareness_enabled: &amp;lt;boolean&amp;gt; | default = false]

    # Number of tokens to own in the ring.
    # CLI flag: -ui.ring.num-tokens
    [num_tokens: &amp;lt;int&amp;gt; | default = 128]

    # Factor for data replication.
    # CLI flag: -ui.ring.replication-factor
    [replication_factor: &amp;lt;int&amp;gt; | default = 3]

    # Instance ID to register in the ring.
    # CLI flag: -ui.ring.instance-id
    [instance_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;lt;hostname&amp;gt;&amp;#34;]

    # Name of network interface to read address from.
    # CLI flag: -ui.ring.instance-interface-names
    [instance_interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

    # Port to advertise in the ring (defaults to server.grpc-listen-port).
    # CLI flag: -ui.ring.instance-port
    [instance_port: &amp;lt;int&amp;gt; | default = 0]

    # IP address to advertise in the ring.
    # CLI flag: -ui.ring.instance-addr
    [instance_addr: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # The availability zone where this instance is running. Required if
    # zone-awareness is enabled.
    # CLI flag: -ui.ring.instance-availability-zone
    [instance_availability_zone: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Enable using a IPv6 instance address.
    # CLI flag: -ui.ring.instance-enable-ipv6
    [instance_enable_ipv6: &amp;lt;boolean&amp;gt; | default = false]

# Configures the distributor.
[distributor: &amp;lt;distributor&amp;gt;]

# Configures the querier. Only appropriate when running all modules or just the
# querier.
[querier: &amp;lt;querier&amp;gt;]

query_engine:
  # Experimental: Enable next generation query engine for supported queries.
  # CLI flag: -query-engine.enable
  [enable: &amp;lt;boolean&amp;gt; | default = false]

  # Experimental: Enable distributed query execution.
  # CLI flag: -query-engine.distributed
  [distributed: &amp;lt;boolean&amp;gt; | default = false]

  # Experimental: Name of network interface to read an advertise address from
  # for accepting incoming traffic from query-engine-worker instances when
  # distributed execution is enabled.
  # CLI flag: -query-engine.instance-interface-names
  [instance_interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

  # Experimental: Batch size of the next generation query engine.
  # CLI flag: -query-engine.batch-size
  [batch_size: &amp;lt;int&amp;gt; | default = 100]

  # Experimental: Number of bytes to prefetch when opening a data object for
  # decoding metadata and overlapping section reads. Clamps to at least 16KiB.
  # CLI flag: -query-engine.prefetch-bytes
  [prefetch_bytes: &amp;lt;int&amp;gt; | default = 16KiB]

  # Experimental: The number of inputs that are prefetched simultaneously by any
  # Merge node. A value of 0 means that only the currently processed input is
  # prefetched, 1 means that only the next input is prefetched, and so on. A
  # negative value means that all inputs are be prefetched in parallel.
  # CLI flag: -query-engine.merge-prefetch-count
  [merge_prefetch_count: &amp;lt;int&amp;gt; | default = 0]

  # Configures how to read byte ranges from object storage when using the V2
  # engine.
  range_reads:
    # Experimental: maximum number of parallel reads
    # CLI flag: -query-engine.range-reads.max-parallelism
    [max_parallelism: &amp;lt;int&amp;gt; | default = 10]

    # Experimental: maximum distance (in bytes) between ranges that causes them
    # to be coalesced into a single range
    # CLI flag: -query-engine.range-reads.coalesce-size
    [coalesce_size: &amp;lt;int&amp;gt; | default = 1048576]

    # Experimental: maximum size of a byte range
    # CLI flag: -query-engine.range-reads.max-range-size
    [max_range_size: &amp;lt;int&amp;gt; | default = 8388608]

    # Experimental: minimum size of a byte range
    # CLI flag: -query-engine.range-reads.min-range-size
    [min_range_size: &amp;lt;int&amp;gt; | default = 1048576]

  # Experimental: Number of worker threads to spawn. Each worker thread runs one
  # task at a time. 0 means to use GOMAXPROCS value.
  # CLI flag: -query-engine.worker-threads
  [worker_threads: &amp;lt;int&amp;gt; | default = 0]

  # Experimental: Address holding DNS SRV records of schedulers to connect to.
  # CLI flag: -query-engine.scheduler-lookup-address
  [scheduler_lookup_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Experimental: Interval at which to lookup new schedulers by DNS SRV records.
  # CLI flag: -query-engine.scheduler-lookup-interval
  [scheduler_lookup_interval: &amp;lt;duration&amp;gt; | default = 10s]

  # Amount of time until data objects are available.
  # CLI flag: -query-engine.storage-lag
  [storage_lag: &amp;lt;duration&amp;gt; | default = 1h]

  # Initial date when data objects became available. Format YYYY-MM-DD. If not
  # set, assume data objects are always available no matter how far back.
  # CLI flag: -query-engine.storage-start-date
  [storage_start_date: &amp;lt;time&amp;gt; | default = 0]

  # Lifecycle of data objects in days. If set, queries falling outside of the
  # retention period will not be supported. When both storage-start-date and
  # storage-retention-days are set, the more restrictive of the two will apply.
  # CLI flag: -query-engine.storage-retention-days
  [storage_retention_days: &amp;lt;int&amp;gt; | default = 0]

  # Enable routing of query splits in the query frontend to the next generation
  # engine when they fall within the configured time range.
  # CLI flag: -query-engine.enable-engine-router
  [enable_engine_router: &amp;lt;boolean&amp;gt; | default = false]

  # Downstream address to send query splits to. This is the HTTP handler address
  # of the query engine scheduler.
  # CLI flag: -query-engine.downstream-address
  [downstream_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # When enabled, query results exclude log lines that match overlapping delete
  # requests (not just pending requests). Disable to return all logs without
  # considering delete requests.
  # CLI flag: -query-engine.enable-delete-req-filtering
  [enable_delete_req_filtering: &amp;lt;boolean&amp;gt; | default = true]

  # Enforce tenant retention limits. Queries falling outside tenant&amp;#39;s retention
  # period are either adjusted or rejected.
  # CLI flag: -query-engine.enforce-retention-period
  [enforce_retention_period: &amp;lt;boolean&amp;gt; | default = false]

  # Mutate incoming queries to align their start and end with their step.
  # CLI flag: -query-engine.align-queries-with-step
  [align_queries_with_step: &amp;lt;boolean&amp;gt; | default = false]

  # Experimental: When enabled, the tenant&amp;#39;s MaxQuerySeries limit is applied.
  # Otherwise, no limit is enforced.
  # CLI flag: -query-engine.enforce-max-query-series-limit
  [enforce_max_query_series_limit: &amp;lt;boolean&amp;gt; | default = false]

  results_cache:
    # The cache_config block configures the cache backend for a specific Loki
    # component.
    # The CLI flags prefix for this block configuration is:
    # query-engine.results-cache
    [cache: &amp;lt;cache_config&amp;gt;]

    # Use compression in cache. The default is an empty value &amp;#39;&amp;#39;, which disables
    # compression. Supported values are: &amp;#39;snappy&amp;#39; and &amp;#39;&amp;#39;.
    # CLI flag: -query-engine.results-cache.compression
    [compression: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# The query_scheduler block configures the Loki query scheduler. When configured
# it separates the tenant query queues from the query-frontend.
[query_scheduler: &amp;lt;query_scheduler&amp;gt;]

# The frontend block configures the Loki query-frontend.
[frontend: &amp;lt;frontend&amp;gt;]

# The query_range block configures the query splitting and caching in the Loki
# query-frontend.
[query_range: &amp;lt;query_range&amp;gt;]

# The ruler block configures the Loki ruler.
[ruler: &amp;lt;ruler&amp;gt;]

ruler_storage:
  # The 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.
  # Currently this is opt-in and takes effect only when `-use-thanos-objstore`
  # is set to true.
  # The CLI flags prefix for this block configuration is: ruler-storage
  [&amp;lt;thanos_object_store_config&amp;gt;]

  # Backend storage to use. Supported backends are: local, s3, gcs, azure,
  # swift, filesystem, alibabacloud, bos
  # CLI flag: -ruler-storage.backend
  [backend: &amp;lt;string&amp;gt; | default = &amp;#34;filesystem&amp;#34;]

  local:
    # Directory to scan for rules
    # CLI flag: -ruler-storage.local.directory
    [directory: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# The ingester_client block configures how the distributor will connect to
# ingesters. Only appropriate when running all components, the distributor, or
# the querier.
[ingester_client: &amp;lt;ingester_client&amp;gt;]

# The ingester block configures the ingester and how the ingester will register
# itself to a key value store.
[ingester: &amp;lt;ingester&amp;gt;]

pattern_ingester:
  # Whether the pattern ingester is enabled.
  # CLI flag: -pattern-ingester.enabled
  [enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Configures how the lifecycle of the pattern ingester will operate and where
  # it will register for discovery.
  lifecycler:
    ring:
      kvstore:
        # Backend storage to use for the ring. Supported values are: consul,
        # etcd, inmemory, memberlist, multi.
        # CLI flag: -pattern-ingester.store
        [store: &amp;lt;string&amp;gt; | default = &amp;#34;consul&amp;#34;]

        # The prefix for the keys in the store. Should end with a /.
        # CLI flag: -pattern-ingester.prefix
        [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

        # Configuration for a Consul client. Only applies if the selected
        # kvstore is consul.
        # The CLI flags prefix for this block configuration is: pattern-ingester
        [consul: &amp;lt;consul&amp;gt;]

        # Configuration for an ETCD v3 client. Only applies if the selected
        # kvstore is etcd.
        # The CLI flags prefix for this block configuration is: pattern-ingester
        [etcd: &amp;lt;etcd&amp;gt;]

        multi:
          # Primary backend storage used by multi-client.
          # CLI flag: -pattern-ingester.multi.primary
          [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          # Secondary backend storage used by multi-client.
          # CLI flag: -pattern-ingester.multi.secondary
          [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          # Mirror writes to the secondary store.
          # CLI flag: -pattern-ingester.multi.mirror-enabled
          [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

          # Timeout for storing a value to the secondary store.
          # CLI flag: -pattern-ingester.multi.mirror-timeout
          [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

      # The heartbeat timeout after which ingesters are skipped for
      # reads/writes.
      # CLI flag: -pattern-ingester.ring.heartbeat-timeout
      [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

      # The number of ingesters to write to and read from.
      # CLI flag: -pattern-ingester.distributor.replication-factor
      [replication_factor: &amp;lt;int&amp;gt; | default = 1]

      # True to enable the zone-awareness and replicate ingested samples across
      # different availability zones.
      # CLI flag: -pattern-ingester.distributor.zone-awareness-enabled
      [zone_awareness_enabled: &amp;lt;boolean&amp;gt; | default = false]

      # Comma-separated list of zones to exclude from the ring. Instances in
      # excluded zones will be filtered out from the ring.
      # CLI flag: -pattern-ingester.distributor.excluded-zones
      [excluded_zones: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Number of tokens for each ingester.
    # CLI flag: -pattern-ingester.num-tokens
    [num_tokens: &amp;lt;int&amp;gt; | default = 128]

    # Period at which to heartbeat to consul.
    # CLI flag: -pattern-ingester.heartbeat-period
    [heartbeat_period: &amp;lt;duration&amp;gt; | default = 5s]

    # Heartbeat timeout after which instance is assumed to be unhealthy.
    # CLI flag: -pattern-ingester.heartbeat-timeout
    [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

    # Observe tokens after generating to resolve collisions. Useful when using
    # gossiping ring.
    # CLI flag: -pattern-ingester.observe-period
    [observe_period: &amp;lt;duration&amp;gt; | default = 0s]

    # Period to wait for a claim from another member; will join automatically
    # after this.
    # CLI flag: -pattern-ingester.join-after
    [join_after: &amp;lt;duration&amp;gt; | default = 0s]

    # Minimum duration to wait after the internal readiness checks have passed
    # but before succeeding the readiness endpoint. This is used to slowdown
    # deployment controllers (eg. Kubernetes) after an instance is ready and
    # before they proceed with a rolling update, to give the rest of the cluster
    # instances enough time to receive ring updates.
    # CLI flag: -pattern-ingester.min-ready-duration
    [min_ready_duration: &amp;lt;duration&amp;gt; | default = 15s]

    # Name of network interface to read address from.
    # CLI flag: -pattern-ingester.lifecycler.interface
    [interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

    # Enable IPv6 support. Required to make use of IP addresses from IPv6
    # interfaces.
    # CLI flag: -pattern-ingester.enable-inet6
    [enable_inet6: &amp;lt;boolean&amp;gt; | default = false]

    # Duration to sleep for before exiting, to ensure metrics are scraped.
    # CLI flag: -pattern-ingester.final-sleep
    [final_sleep: &amp;lt;duration&amp;gt; | default = 0s]

    # File path where tokens are stored. If empty, tokens are not stored at
    # shutdown and restored at startup.
    # CLI flag: -pattern-ingester.tokens-file-path
    [tokens_file_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # The availability zone where this instance is running.
    # CLI flag: -pattern-ingester.availability-zone
    [availability_zone: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Unregister from the ring upon clean shutdown. It can be useful to disable
    # for rolling restarts with consistent naming in conjunction with
    # -distributor.extend-writes=false.
    # CLI flag: -pattern-ingester.unregister-on-shutdown
    [unregister_on_shutdown: &amp;lt;boolean&amp;gt; | default = true]

    # When enabled the readiness probe succeeds only after all instances are
    # ACTIVE and healthy in the ring, otherwise only the instance itself is
    # checked. This option should be disabled if in your cluster multiple
    # instances can be rolled out simultaneously, otherwise rolling updates may
    # be slowed down.
    # CLI flag: -pattern-ingester.readiness-check-ring-health
    [readiness_check_ring_health: &amp;lt;boolean&amp;gt; | default = true]

    # IP address to advertise in the ring.
    # CLI flag: -pattern-ingester.lifecycler.addr
    [address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # port to advertise in consul (defaults to server.grpc-listen-port).
    # CLI flag: -pattern-ingester.lifecycler.port
    [port: &amp;lt;int&amp;gt; | default = 0]

    # ID to register in the ring.
    # CLI flag: -pattern-ingester.lifecycler.ID
    [id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;lt;hostname&amp;gt;&amp;#34;]

  # Configures how the pattern ingester will connect to the ingesters.
  client_config:
    # Configures how connections are pooled.
    pool_config:
      # How frequently to clean up clients for ingesters that have gone away.
      # CLI flag: -pattern-ingester.client-cleanup-period
      [client_cleanup_period: &amp;lt;duration&amp;gt; | default = 15s]

      # Run a health check on each ingester client during periodic cleanup.
      # CLI flag: -pattern-ingester.health-check-ingesters
      [health_check_ingesters: &amp;lt;boolean&amp;gt; | default = true]

      # Timeout for the health check.
      # CLI flag: -pattern-ingester.remote-timeout
      [remote_timeout: &amp;lt;duration&amp;gt; | default = 1s]

    # The remote request timeout on the client side.
    # CLI flag: -pattern-ingester.client.timeout
    [remote_timeout: &amp;lt;duration&amp;gt; | default = 5s]

    # Configures how the gRPC connection to ingesters work as a client.
    # The CLI flags prefix for this block configuration is:
    # pattern-ingester.client
    [grpc_client_config: &amp;lt;grpc_client&amp;gt;]

  # How many flushes can happen concurrently from each stream.
  # CLI flag: -pattern-ingester.concurrent-flushes
  [concurrent_flushes: &amp;lt;int&amp;gt; | default = 32]

  # How often should the ingester see if there are any blocks to flush. The
  # first flush check is delayed by a random time up to 0.8x the flush check
  # period. Additionally, there is &amp;#43;/- 1% jitter added to the interval.
  # CLI flag: -pattern-ingester.flush-check-period
  [flush_check_period: &amp;lt;duration&amp;gt; | default = 1m]

  # The maximum number of detected pattern clusters that can be created by
  # streams.
  # CLI flag: -pattern-ingester.max-clusters
  [max_clusters: &amp;lt;int&amp;gt; | default = 300]

  # The maximum eviction ratio of patterns per stream. Once that ratio is
  # reached, the stream will throttled pattern detection.
  # CLI flag: -pattern-ingester.max-eviction-ratio
  [max_eviction_ratio: &amp;lt;float&amp;gt; | default = 0.25]

  # Configures the metric aggregation and storage behavior of the pattern
  # ingester.
  metric_aggregation:
    # How often to sample metrics and patterns from raw push observations.
    # CLI flag: -pattern-ingester.metric-aggregation.downsample-period
    [sample_period: &amp;lt;duration&amp;gt; | default = 10s]

    # The address of the Loki instance to push aggregated metrics to.
    # CLI flag: -pattern-ingester.metric-aggregation.loki-address
    [loki_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # The timeout for writing to Loki.
    # CLI flag: -pattern-ingester.metric-aggregation.timeout
    [timeout: &amp;lt;duration&amp;gt; | default = 10s]

    # How long to wait in between pushes to Loki.
    # CLI flag: -pattern-ingester.metric-aggregation.push-period
    [push_period: &amp;lt;duration&amp;gt; | default = 30s]

    # The HTTP client configuration for pushing metrics to Loki.
    http_client_config:
      basic_auth:
        [username: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [username_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [username_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [password: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [password_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [password_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      authorization:
        [type: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [credentials: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [credentials_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [credentials_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      oauth2:
        [client_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_secret: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_secret_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_secret_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_certificate_key_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_certificate_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_certificate_key_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_certificate_key_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [grant_type: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [signature_algorithm: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [iss: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [audience: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [claims: &amp;lt;map of string to &amp;gt;]

        [scopes: &amp;lt;list of strings&amp;gt;]

        [token_url: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [endpoint_params: &amp;lt;map of string to string&amp;gt;]

        tls_config:
          [ca: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [cert: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [ca_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [cert_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [key_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [ca_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [cert_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [key_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [server_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [insecure_skip_verify: &amp;lt;boolean&amp;gt;]

          [min_version: &amp;lt;int&amp;gt;]

          [max_version: &amp;lt;int&amp;gt;]

        proxy_url:
          [url: &amp;lt;url&amp;gt;]

        [no_proxy: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [proxy_from_environment: &amp;lt;boolean&amp;gt;]

        [proxy_connect_header: &amp;lt;map of string to list of strings&amp;gt;]

      [bearer_token: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      [bearer_token_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      tls_config:
        [ca: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [cert: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [ca_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [cert_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [key_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [ca_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [cert_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [key_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [server_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [insecure_skip_verify: &amp;lt;boolean&amp;gt;]

        [min_version: &amp;lt;int&amp;gt;]

        [max_version: &amp;lt;int&amp;gt;]

      [follow_redirects: &amp;lt;boolean&amp;gt;]

      [enable_http2: &amp;lt;boolean&amp;gt;]

      proxy_url:
        [url: &amp;lt;url&amp;gt;]

      [no_proxy: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      [proxy_from_environment: &amp;lt;boolean&amp;gt;]

      [proxy_connect_header: &amp;lt;map of string to list of strings&amp;gt;]

      http_headers:
        [: &amp;lt;map of string to Header&amp;gt;]

    # Whether to use TLS for pushing metrics to Loki.
    # CLI flag: -pattern-ingester.metric-aggregation.tls
    [use_tls: &amp;lt;boolean&amp;gt; | default = false]

    # The basic auth configuration for pushing metrics to Loki.
    basic_auth:
      # Basic auth username for sending aggregations back to Loki.
      # CLI flag: -pattern-ingester.metric-aggregation..basic-auth.username
      [username: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Basic auth password for sending aggregations back to Loki.
      # CLI flag: -pattern-ingester.metric-aggregation..basic-auth.password
      [password: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # The backoff configuration for pushing metrics to Loki.
    backoff_config:
      # Minimum delay when backing off.
      # CLI flag: -pattern-ingester.metric-aggregation...backoff-min-period
      [min_period: &amp;lt;duration&amp;gt; | default = 100ms]

      # Maximum delay when backing off.
      # CLI flag: -pattern-ingester.metric-aggregation...backoff-max-period
      [max_period: &amp;lt;duration&amp;gt; | default = 10s]

      # Number of times to backoff and retry before failing.
      # CLI flag: -pattern-ingester.metric-aggregation...backoff-retries
      [max_retries: &amp;lt;int&amp;gt; | default = 10]

  # Configures how detected patterns are pushed back to Loki for persistence.
  pattern_persistence:
    # The address of the Loki instance to push patterns to.
    # CLI flag: -pattern-ingester.pattern-persistence.loki-address
    [loki_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # The timeout for writing patterns to Loki.
    # CLI flag: -pattern-ingester.pattern-persistence.timeout
    [timeout: &amp;lt;duration&amp;gt; | default = 10s]

    # How long to wait between pattern pushes to Loki.
    # CLI flag: -pattern-ingester.pattern-persistence.push-period
    [push_period: &amp;lt;duration&amp;gt; | default = 1m]

    # The HTTP client configuration for pushing patterns to Loki.
    http_client_config:
      basic_auth:
        [username: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [username_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [username_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [password: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [password_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [password_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      authorization:
        [type: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [credentials: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [credentials_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [credentials_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      oauth2:
        [client_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_secret: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_secret_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_secret_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_certificate_key_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_certificate_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_certificate_key_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [client_certificate_key_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [grant_type: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [signature_algorithm: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [iss: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [audience: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [claims: &amp;lt;map of string to &amp;gt;]

        [scopes: &amp;lt;list of strings&amp;gt;]

        [token_url: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [endpoint_params: &amp;lt;map of string to string&amp;gt;]

        tls_config:
          [ca: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [cert: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [ca_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [cert_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [key_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [ca_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [cert_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [key_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [server_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          [insecure_skip_verify: &amp;lt;boolean&amp;gt;]

          [min_version: &amp;lt;int&amp;gt;]

          [max_version: &amp;lt;int&amp;gt;]

        proxy_url:
          [url: &amp;lt;url&amp;gt;]

        [no_proxy: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [proxy_from_environment: &amp;lt;boolean&amp;gt;]

        [proxy_connect_header: &amp;lt;map of string to list of strings&amp;gt;]

      [bearer_token: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      [bearer_token_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      tls_config:
        [ca: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [cert: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [ca_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [cert_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [key_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [ca_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [cert_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [key_ref: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [server_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        [insecure_skip_verify: &amp;lt;boolean&amp;gt;]

        [min_version: &amp;lt;int&amp;gt;]

        [max_version: &amp;lt;int&amp;gt;]

      [follow_redirects: &amp;lt;boolean&amp;gt;]

      [enable_http2: &amp;lt;boolean&amp;gt;]

      proxy_url:
        [url: &amp;lt;url&amp;gt;]

      [no_proxy: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      [proxy_from_environment: &amp;lt;boolean&amp;gt;]

      [proxy_connect_header: &amp;lt;map of string to list of strings&amp;gt;]

      http_headers:
        [: &amp;lt;map of string to Header&amp;gt;]

    # Whether to use TLS for pushing patterns to Loki.
    # CLI flag: -pattern-ingester.pattern-persistence.tls
    [use_tls: &amp;lt;boolean&amp;gt; | default = false]

    # The basic auth configuration for pushing patterns to Loki.
    basic_auth:
      # Basic auth username for sending patterns back to Loki.
      # CLI flag: -pattern-ingester.pattern-persistence..basic-auth.username
      [username: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Basic auth password for sending patterns back to Loki.
      # CLI flag: -pattern-ingester.pattern-persistence..basic-auth.password
      [password: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # The backoff configuration for pushing patterns to Loki.
    backoff_config:
      # Minimum delay when backing off.
      # CLI flag: -pattern-ingester.pattern-persistence...backoff-min-period
      [min_period: &amp;lt;duration&amp;gt; | default = 100ms]

      # Maximum delay when backing off.
      # CLI flag: -pattern-ingester.pattern-persistence...backoff-max-period
      [max_period: &amp;lt;duration&amp;gt; | default = 10s]

      # Number of times to backoff and retry before failing.
      # CLI flag: -pattern-ingester.pattern-persistence...backoff-retries
      [max_retries: &amp;lt;int&amp;gt; | default = 10]

    # The maximum number of patterns to accumulate before pushing.
    # CLI flag: -pattern-ingester.pattern-persistence.batch-size
    [batch_size: &amp;lt;int&amp;gt; | default = 1000]

  # Configures the pattern tee which forwards requests to the pattern ingester.
  tee_config:
    # The size of the batch of raw logs to send for template mining
    # CLI flag: -pattern-ingester.tee.batch-size
    [batch_size: &amp;lt;int&amp;gt; | default = 5000]

    # The max time between batches of raw logs to send for template mining
    # CLI flag: -pattern-ingester.tee.batch-flush-interval
    [batch_flush_interval: &amp;lt;duration&amp;gt; | default = 1s]

    # The number of log flushes to queue before dropping
    # CLI flag: -pattern-ingester.tee.flush-queue-size
    [flush_queue_size: &amp;lt;int&amp;gt; | default = 1000]

    # the number of concurrent workers sending logs to the template service
    # CLI flag: -pattern-ingester.tee.flush-worker-count
    [flush_worker_count: &amp;lt;int&amp;gt; | default = 100]

    # The max time we will try to flush any remaining logs to be mined when the
    # service is stopped
    # CLI flag: -pattern-ingester.tee.stop-flush-timeout
    [stop_flush_timeout: &amp;lt;duration&amp;gt; | default = 30s]

  # Timeout for connections between the Loki and the pattern ingester.
  # CLI flag: -pattern-ingester.connection-timeout
  [connection_timeout: &amp;lt;duration&amp;gt; | default = 2s]

  # The maximum length of log lines that can be used for pattern detection.
  # CLI flag: -pattern-ingester.max-allowed-line-length
  [max_allowed_line_length: &amp;lt;int&amp;gt; | default = 3000]

  # How long to retain patterns in the pattern ingester after they are pushed.
  # CLI flag: -pattern-ingester.retain-for
  [retain_for: &amp;lt;duration&amp;gt; | default = 3h]

  # The maximum time span for a single pattern chunk.
  # CLI flag: -pattern-ingester.max-chunk-age
  [max_chunk_age: &amp;lt;duration&amp;gt; | default = 1h]

  # The time resolution for pattern samples within chunks.
  # CLI flag: -pattern-ingester.sample-interval
  [pattern_sample_interval: &amp;lt;duration&amp;gt; | default = 10s]

  # The threshold for filtering patterns by volume. Only patterns representing
  # the top X% of log volume will be persisted (0-1).
  # CLI flag: -pattern-ingester.volume-threshold
  [volume_threshold: &amp;lt;float&amp;gt; | default = 0.99]

# The index_gateway block configures the Loki index gateway server, responsible
# for serving index queries without the need to constantly interact with the
# object store.
[index_gateway: &amp;lt;index_gateway&amp;gt;]

# Experimental: The bloom_build block configures the Loki bloom planner and
# builder servers, responsible for building bloom filters.
[bloom_build: &amp;lt;bloom_build&amp;gt;]

# Experimental: The bloom_gateway block configures the Loki bloom gateway
# server, responsible for serving queries for filtering chunks based on filter
# expressions.
[bloom_gateway: &amp;lt;bloom_gateway&amp;gt;]

# The 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.
[storage_config: &amp;lt;storage_config&amp;gt;]

# The chunk_store_config block configures how chunks will be cached and how long
# to wait before saving them to the backing store.
[chunk_store_config: &amp;lt;chunk_store_config&amp;gt;]

# Configures the chunk index schema and where it is stored.
[schema_config: &amp;lt;schema_config&amp;gt;]

# The compactor block configures the compactor component, which compacts index
# shards for performance.
[compactor: &amp;lt;compactor&amp;gt;]

compactor_grpc_client:
  # The grpc_client block configures the gRPC client used to communicate between
  # a client and server component in Loki.
  # The CLI flags prefix for this block configuration is: compactor.grpc-client
  [&amp;lt;grpc_client&amp;gt;]

# The 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
[limits_config: &amp;lt;limits_config&amp;gt;]

# The frontend_worker configures the worker - running within the Loki querier -
# picking up and executing queries enqueued by the query-frontend.
[frontend_worker: &amp;lt;frontend_worker&amp;gt;]

# The table_manager block configures the table manager for retention.
[table_manager: &amp;lt;table_manager&amp;gt;]

# Configuration for memberlist client. Only applies if the selected kvstore is
# memberlist.
# 
# When 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&amp;#39;s configuration section.
[memberlist: &amp;lt;memberlist&amp;gt;]

kafka_config:
  # The Kafka topic name.
  # CLI flag: -kafka.topic
  [topic: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The maximum time allowed to open a connection to a Kafka broker.
  # CLI flag: -kafka.dial-timeout
  [dial_timeout: &amp;lt;duration&amp;gt; | default = 2s]

  # How long to wait for an incoming write request to be successfully committed
  # to the Kafka backend.
  # CLI flag: -kafka.write-timeout
  [write_timeout: &amp;lt;duration&amp;gt; | default = 10s]

  reader_config:
    # The Kafka backend address.
    # CLI flag: -kafka.reader.address
    [address: &amp;lt;string&amp;gt; | default = &amp;#34;localhost:9092&amp;#34;]

    # The Kafka client ID.
    # CLI flag: -kafka.reader.client-id
    [client_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  writer_config:
    # The Kafka backend address.
    # CLI flag: -kafka.writer.address
    [address: &amp;lt;string&amp;gt; | default = &amp;#34;localhost:9092&amp;#34;]

    # The Kafka client ID.
    # CLI flag: -kafka.writer.client-id
    [client_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The SASL username for authentication to Kafka using the PLAIN mechanism.
  # Both username and password must be set.
  # CLI flag: -kafka.sasl-username
  [sasl_username: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The SASL password for authentication to Kafka using the PLAIN mechanism.
  # Both username and password must be set.
  # CLI flag: -kafka.sasl-password
  [sasl_password: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The consumer group used by the consumer to track the last consumed offset.
  # The consumer group must be different for each ingester zone.When empty, Loki
  # uses the ingester instance ID.
  # CLI flag: -kafka.consumer-group
  [consumer_group: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # How frequently a consumer should commit the consumed offset to Kafka. The
  # last committed offset is used at startup to continue the consumption from
  # where it was left.
  # CLI flag: -kafka.consumer-group-offset-commit-interval
  [consumer_group_offset_commit_interval: &amp;lt;duration&amp;gt; | default = 1s]

  # How long to retry a failed request to get the last produced offset.
  # CLI flag: -kafka.last-produced-offset-retry-timeout
  [last_produced_offset_retry_timeout: &amp;lt;duration&amp;gt; | default = 10s]

  # Enable auto-creation of Kafka topic if it doesn&amp;#39;t exist.
  # CLI flag: -kafka.auto-create-topic-enabled
  [auto_create_topic_enabled: &amp;lt;boolean&amp;gt; | default = true]

  # When auto-creation of Kafka topic is enabled and this value is positive,
  # Kafka&amp;#39;s num.partitions configuration option is set on Kafka brokers with
  # this value when Loki component that uses Kafka starts. This configuration
  # option specifies the default number of partitions that the Kafka broker uses
  # for auto-created topics. Note that this is a Kafka-cluster wide setting, and
  # applies to any auto-created topic. If the setting of num.partitions fails,
  # Loki proceeds anyways, but auto-created topics could have an incorrect
  # number of partitions.
  # CLI flag: -kafka.auto-create-topic-default-partitions
  [auto_create_topic_default_partitions: &amp;lt;int&amp;gt; | default = 1000]

  # The maximum size of a Kafka record data that should be generated by the
  # producer. An incoming write request larger than this size is split into
  # multiple Kafka records. We strongly recommend to not change this setting
  # unless for testing purposes.
  # CLI flag: -kafka.producer-max-record-size-bytes
  [producer_max_record_size_bytes: &amp;lt;int&amp;gt; | default = 15983616]

  # The maximum size of (uncompressed) buffered and unacknowledged produced
  # records sent to Kafka. The produce request fails once this limit is reached.
  # This limit is per Kafka client. 0 to disable the limit.
  # CLI flag: -kafka.producer-max-buffered-bytes
  [producer_max_buffered_bytes: &amp;lt;int&amp;gt; | default = 1073741824]

  # The guaranteed maximum lag before a consumer is considered to have caught up
  # reading from a partition at startup, becomes ACTIVE in the hash ring and
  # passes the readiness check. Set -kafka.max-consumer-lag-at-startup to 0 to
  # disable waiting for maximum consumer lag being honored at startup.
  # CLI flag: -kafka.max-consumer-lag-at-startup
  [max_consumer_lag_at_startup: &amp;lt;duration&amp;gt; | default = 15s]

  # The maximum number of workers to use for processing records from Kafka.
  # CLI flag: -kafka.max-consumer-workers
  [max_consumer_workers: &amp;lt;int&amp;gt; | default = 1]

  # Enable collection of the following kafka latency histograms: read-wait,
  # read-timing, write-wait, write-timing
  # CLI flag: -kafka.enable-kafka-histograms
  [enable_kafka_histograms: &amp;lt;boolean&amp;gt; | default = false]

  # Enable tracing.
  # CLI flag: -kafka.tracing-enabled
  [tracing_enabled: &amp;lt;boolean&amp;gt; | default = false]

dataobj:
  consumer:
    builderconfig:
      # The target maximum amount of uncompressed data to hold in data pages
      # (for columnar sections). Uncompressed size is used for consistent I/O
      # and planning.
      # CLI flag: -dataobj-consumer.target-page-size
      [target_page_size: &amp;lt;int&amp;gt; | default = 2MiB]

      # The maximum row count for pages to use for the data object builder. A
      # value of 0 means no limit.
      # CLI flag: -dataobj-consumer.max-page-rows
      [max_page_rows: &amp;lt;int&amp;gt; | default = 0]

      # The target maximum size of the encoded object and all of its encoded
      # sections (after compression), to limit memory usage of a builder.
      # CLI flag: -dataobj-consumer.target-builder-memory-limit
      [target_object_size: &amp;lt;int&amp;gt; | default = 1GiB]

      # The target maximum amount of uncompressed data to hold in sections, for
      # sections that support being limited by size. Uncompressed size is used
      # for consistent I/O and planning.
      # CLI flag: -dataobj-consumer.target-section-size
      [target_section_size: &amp;lt;int&amp;gt; | default = 128MiB]

      # The size of logs to buffer in memory before adding into columnar
      # builders, used to reduce CPU load of sorting.
      # CLI flag: -dataobj-consumer.buffer-size
      [buffer_size: &amp;lt;int&amp;gt; | default = 16MiB]

      # The maximum number of dataobj section stripes to merge into a section at
      # once. Must be greater than 1.
      # CLI flag: -dataobj-consumer.section-stripe-merge-limit
      [section_stripe_merge_limit: &amp;lt;int&amp;gt; | default = 2]

    lifecycler:
      ring:
        kvstore:
          # Backend storage to use for the ring. Supported values are: consul,
          # etcd, inmemory, memberlist, multi.
          # CLI flag: -dataobj-consumer.store
          [store: &amp;lt;string&amp;gt; | default = &amp;#34;consul&amp;#34;]

          # The prefix for the keys in the store. Should end with a /.
          # CLI flag: -dataobj-consumer.prefix
          [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

          # Configuration for a Consul client. Only applies if the selected
          # kvstore is consul.
          # The CLI flags prefix for this block configuration is:
          # dataobj-consumer
          [consul: &amp;lt;consul&amp;gt;]

          # Configuration for an ETCD v3 client. Only applies if the selected
          # kvstore is etcd.
          # The CLI flags prefix for this block configuration is:
          # dataobj-consumer
          [etcd: &amp;lt;etcd&amp;gt;]

          multi:
            # Primary backend storage used by multi-client.
            # CLI flag: -dataobj-consumer.multi.primary
            [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

            # Secondary backend storage used by multi-client.
            # CLI flag: -dataobj-consumer.multi.secondary
            [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

            # Mirror writes to the secondary store.
            # CLI flag: -dataobj-consumer.multi.mirror-enabled
            [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

            # Timeout for storing a value to the secondary store.
            # CLI flag: -dataobj-consumer.multi.mirror-timeout
            [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

        # The heartbeat timeout after which ingesters are skipped for
        # reads/writes.
        # CLI flag: -dataobj-consumer.ring.heartbeat-timeout
        [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

        # The number of ingesters to write to and read from.
        # CLI flag: -dataobj-consumer.distributor.replication-factor
        [replication_factor: &amp;lt;int&amp;gt; | default = 3]

        # True to enable the zone-awareness and replicate ingested samples
        # across different availability zones.
        # CLI flag: -dataobj-consumer.distributor.zone-awareness-enabled
        [zone_awareness_enabled: &amp;lt;boolean&amp;gt; | default = false]

        # Comma-separated list of zones to exclude from the ring. Instances in
        # excluded zones will be filtered out from the ring.
        # CLI flag: -dataobj-consumer.distributor.excluded-zones
        [excluded_zones: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Number of tokens for each ingester.
      # CLI flag: -dataobj-consumer.num-tokens
      [num_tokens: &amp;lt;int&amp;gt; | default = 128]

      # Period at which to heartbeat to consul.
      # CLI flag: -dataobj-consumer.heartbeat-period
      [heartbeat_period: &amp;lt;duration&amp;gt; | default = 5s]

      # Heartbeat timeout after which instance is assumed to be unhealthy.
      # CLI flag: -dataobj-consumer.heartbeat-timeout
      [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

      # Observe tokens after generating to resolve collisions. Useful when using
      # gossiping ring.
      # CLI flag: -dataobj-consumer.observe-period
      [observe_period: &amp;lt;duration&amp;gt; | default = 0s]

      # Period to wait for a claim from another member; will join automatically
      # after this.
      # CLI flag: -dataobj-consumer.join-after
      [join_after: &amp;lt;duration&amp;gt; | default = 0s]

      # Minimum duration to wait after the internal readiness checks have passed
      # but before succeeding the readiness endpoint. This is used to slowdown
      # deployment controllers (eg. Kubernetes) after an instance is ready and
      # before they proceed with a rolling update, to give the rest of the
      # cluster instances enough time to receive ring updates.
      # CLI flag: -dataobj-consumer.min-ready-duration
      [min_ready_duration: &amp;lt;duration&amp;gt; | default = 15s]

      # Name of network interface to read address from.
      # CLI flag: -dataobj-consumer.lifecycler.interface
      [interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

      # Enable IPv6 support. Required to make use of IP addresses from IPv6
      # interfaces.
      # CLI flag: -dataobj-consumer.enable-inet6
      [enable_inet6: &amp;lt;boolean&amp;gt; | default = false]

      # Duration to sleep for before exiting, to ensure metrics are scraped.
      # CLI flag: -dataobj-consumer.final-sleep
      [final_sleep: &amp;lt;duration&amp;gt; | default = 0s]

      # File path where tokens are stored. If empty, tokens are not stored at
      # shutdown and restored at startup.
      # CLI flag: -dataobj-consumer.tokens-file-path
      [tokens_file_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # The availability zone where this instance is running.
      # CLI flag: -dataobj-consumer.availability-zone
      [availability_zone: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Unregister from the ring upon clean shutdown. It can be useful to
      # disable for rolling restarts with consistent naming in conjunction with
      # -distributor.extend-writes=false.
      # CLI flag: -dataobj-consumer.unregister-on-shutdown
      [unregister_on_shutdown: &amp;lt;boolean&amp;gt; | default = true]

      # When enabled the readiness probe succeeds only after all instances are
      # ACTIVE and healthy in the ring, otherwise only the instance itself is
      # checked. This option should be disabled if in your cluster multiple
      # instances can be rolled out simultaneously, otherwise rolling updates
      # may be slowed down.
      # CLI flag: -dataobj-consumer.readiness-check-ring-health
      [readiness_check_ring_health: &amp;lt;boolean&amp;gt; | default = true]

      # IP address to advertise in the ring.
      # CLI flag: -dataobj-consumer.lifecycler.addr
      [address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # port to advertise in consul (defaults to server.grpc-listen-port).
      # CLI flag: -dataobj-consumer.lifecycler.port
      [port: &amp;lt;int&amp;gt; | default = 0]

      # ID to register in the ring.
      # CLI flag: -dataobj-consumer.lifecycler.ID
      [id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;lt;hostname&amp;gt;&amp;#34;]

    partition_ring:
      # The key-value store used to share the hash ring across multiple
      # instances. This option needs be set on ingesters, distributors,
      # queriers, and rulers when running in microservices mode.
      kvstore:
        # Backend storage to use for the ring. Supported values are: consul,
        # etcd, inmemory, memberlist, multi.
        # CLI flag: -dataobj-consumer.partition-ring.store
        [store: &amp;lt;string&amp;gt; | default = &amp;#34;memberlist&amp;#34;]

        # The prefix for the keys in the store. Should end with a /.
        # CLI flag: -dataobj-consumer.partition-ring.prefix
        [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

        # Configuration for a Consul client. Only applies if the selected
        # kvstore is consul.
        # The CLI flags prefix for this block configuration is:
        # dataobj-consumer.partition-ring
        [consul: &amp;lt;consul&amp;gt;]

        # Configuration for an ETCD v3 client. Only applies if the selected
        # kvstore is etcd.
        # The CLI flags prefix for this block configuration is:
        # dataobj-consumer.partition-ring
        [etcd: &amp;lt;etcd&amp;gt;]

        multi:
          # Primary backend storage used by multi-client.
          # CLI flag: -dataobj-consumer.partition-ring.multi.primary
          [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          # Secondary backend storage used by multi-client.
          # CLI flag: -dataobj-consumer.partition-ring.multi.secondary
          [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          # Mirror writes to the secondary store.
          # CLI flag: -dataobj-consumer.partition-ring.multi.mirror-enabled
          [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

          # Timeout for storing a value to the secondary store.
          # CLI flag: -dataobj-consumer.partition-ring.multi.mirror-timeout
          [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

      # Minimum number of owners to wait before a PENDING partition gets
      # switched to ACTIVE.
      # CLI flag: -dataobj-consumer.partition-ring.min-partition-owners-count
      [min_partition_owners_count: &amp;lt;int&amp;gt; | default = 1]

      # How long the minimum number of owners are enforced before a PENDING
      # partition gets switched to ACTIVE.
      # CLI flag: -dataobj-consumer.partition-ring.min-partition-owners-duration
      [min_partition_owners_duration: &amp;lt;duration&amp;gt; | default = 10s]

      # How long to wait before an INACTIVE partition is eligible for deletion.
      # The partition is deleted only if it has been in INACTIVE state for at
      # least the configured duration and it has no owners registered. A value
      # of 0 disables partitions deletion.
      # CLI flag: -dataobj-consumer.partition-ring.delete-inactive-partition-after
      [delete_inactive_partition_after: &amp;lt;duration&amp;gt; | default = 13h]

      # Experimental: The size of the cache used for shuffle sharding. If zero
      # or negative, an unbounded cache is used. If positive, an LRU cache with
      # the specified size is used.
      # CLI flag: -dataobj-consumer.partition-ring.shuffle-shard-cache-size
      [shuffle_shard_cache_size: &amp;lt;int&amp;gt; | default = 0]

    uploader:
      # The size of the SHA prefix to use for generating object storage keys for
      # data objects.
      # CLI flag: -dataobj-consumer.sha-prefix-size
      [shaprefixsize: &amp;lt;int&amp;gt; | default = 2]

    # The maximum amount of time to wait in seconds before flushing an object
    # that is no longer receiving new writes.
    # CLI flag: -dataobj-consumer.idle-flush-timeout
    [idle_flush_timeout: &amp;lt;duration&amp;gt; | default = 1h]

    # The maximum amount of time to accumulate data in a builder before flushing
    # it. Defaults to 1 hour.
    # CLI flag: -dataobj-consumer.max-builder-age
    [max_builder_age: &amp;lt;duration&amp;gt; | default = 1h]

    # The name of the Kafka topic.
    # CLI flag: -dataobj-consumer.topic
    [topic: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  index:
    # The target maximum amount of uncompressed data to hold in data pages (for
    # columnar sections). Uncompressed size is used for consistent I/O and
    # planning.
    # CLI flag: -dataobj-index-builder.target-page-size
    [target_page_size: &amp;lt;int&amp;gt; | default = 128KiB]

    # The maximum row count for pages to use for the data object builder. A
    # value of 0 means no limit.
    # CLI flag: -dataobj-index-builder.max-page-rows
    [max_page_rows: &amp;lt;int&amp;gt; | default = 0]

    # The target maximum size of the encoded object and all of its encoded
    # sections (after compression), to limit memory usage of a builder.
    # CLI flag: -dataobj-index-builder.target-builder-memory-limit
    [target_object_size: &amp;lt;int&amp;gt; | default = 64MiB]

    # The target maximum amount of uncompressed data to hold in sections, for
    # sections that support being limited by size. Uncompressed size is used for
    # consistent I/O and planning.
    # CLI flag: -dataobj-index-builder.target-section-size
    [target_section_size: &amp;lt;int&amp;gt; | default = 16MiB]

    # The size of logs to buffer in memory before adding into columnar builders,
    # used to reduce CPU load of sorting.
    # CLI flag: -dataobj-index-builder.buffer-size
    [buffer_size: &amp;lt;int&amp;gt; | default = 2MiB]

    # The maximum number of dataobj section stripes to merge into a section at
    # once. Must be greater than 1.
    # CLI flag: -dataobj-index-builder.section-stripe-merge-limit
    [section_stripe_merge_limit: &amp;lt;int&amp;gt; | default = 2]

    # Experimental: The number of events to batch before building an index
    # CLI flag: -dataobj-index-builder.events-per-index
    [events_per_index: &amp;lt;int&amp;gt; | default = 32]

    # Experimental: How often to check for stale partitions to flush
    # CLI flag: -dataobj-index-builder.flush-interval
    [flush_interval: &amp;lt;duration&amp;gt; | default = 1m]

    # Experimental: Maximum time to wait before flushing buffered events
    # CLI flag: -dataobj-index-builder.max-idle-time
    [max_idle_time: &amp;lt;duration&amp;gt; | default = 30m]

  metastore:
    # Experimental: A prefix to use for storing indexes in object storage. Used
    # for testing only.
    # CLI flag: -dataobj-metastore.index-storage-prefix
    [index_storage_prefix: &amp;lt;string&amp;gt; | default = &amp;#34;index/v0&amp;#34;]

    # Experimental: The ratio of log partitions to metastore partitions. For
    # example, a value of 10 means there is 1 metastore partition for every 10
    # log partitions.
    # CLI flag: -dataobj-metastore.partition-ratio
    [partition_ratio: &amp;lt;int&amp;gt; | default = 10]

  # The prefix to use for the storage bucket.
  # CLI flag: -dataobj-storage-bucket-prefix
  [storage_bucket_prefix: &amp;lt;string&amp;gt; | default = &amp;#34;dataobj/&amp;#34;]

  # Enable data objects.
  # CLI flag: -dataobj.enabled
  [enabled: &amp;lt;boolean&amp;gt; | default = false]

ingest_limits:
  # Enable the ingest limits service.
  # CLI flag: -ingest-limits.enabled
  [enabled: &amp;lt;boolean&amp;gt; | default = false]

  # The duration for which which streams are considered active. Streams that
  # have not been updated within this window are considered inactive and not
  # counted towards limits.
  # CLI flag: -ingest-limits.active-window
  [active_window: &amp;lt;duration&amp;gt; | default = 2h]

  # The time window for rate calculation. This should match the window used in
  # Prometheus rate() queries for consistency.
  # CLI flag: -ingest-limits.rate-window
  [rate_window: &amp;lt;duration&amp;gt; | default = 5m]

  # The size of the buckets used to calculate stream rates. Smaller buckets
  # provide more precise rates but require more memory.
  # CLI flag: -ingest-limits.bucket-size
  [bucket_size: &amp;lt;duration&amp;gt; | default = 1m]

  # The interval at which old streams are evicted.
  # CLI flag: -ingest-limits.eviction-interval
  [eviction_interval: &amp;lt;duration&amp;gt; | default = 10m]

  # The number of partitions for the Kafka topic used to read and write stream
  # metadata. It is fixed, not a maximum.
  # CLI flag: -ingest-limits.num-partitions
  [num_partitions: &amp;lt;int&amp;gt; | default = 64]

  lifecycler:
    ring:
      kvstore:
        # Backend storage to use for the ring. Supported values are: consul,
        # etcd, inmemory, memberlist, multi.
        # CLI flag: -ingest-limits.store
        [store: &amp;lt;string&amp;gt; | default = &amp;#34;consul&amp;#34;]

        # The prefix for the keys in the store. Should end with a /.
        # CLI flag: -ingest-limits.prefix
        [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

        # Configuration for a Consul client. Only applies if the selected
        # kvstore is consul.
        # The CLI flags prefix for this block configuration is: ingest-limits
        [consul: &amp;lt;consul&amp;gt;]

        # Configuration for an ETCD v3 client. Only applies if the selected
        # kvstore is etcd.
        # The CLI flags prefix for this block configuration is: ingest-limits
        [etcd: &amp;lt;etcd&amp;gt;]

        multi:
          # Primary backend storage used by multi-client.
          # CLI flag: -ingest-limits.multi.primary
          [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          # Secondary backend storage used by multi-client.
          # CLI flag: -ingest-limits.multi.secondary
          [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          # Mirror writes to the secondary store.
          # CLI flag: -ingest-limits.multi.mirror-enabled
          [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

          # Timeout for storing a value to the secondary store.
          # CLI flag: -ingest-limits.multi.mirror-timeout
          [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

      # The heartbeat timeout after which ingesters are skipped for
      # reads/writes.
      # CLI flag: -ingest-limits.ring.heartbeat-timeout
      [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

      # The number of ingesters to write to and read from.
      # CLI flag: -ingest-limits.distributor.replication-factor
      [replication_factor: &amp;lt;int&amp;gt; | default = 3]

      # True to enable the zone-awareness and replicate ingested samples across
      # different availability zones.
      # CLI flag: -ingest-limits.distributor.zone-awareness-enabled
      [zone_awareness_enabled: &amp;lt;boolean&amp;gt; | default = false]

      # Comma-separated list of zones to exclude from the ring. Instances in
      # excluded zones will be filtered out from the ring.
      # CLI flag: -ingest-limits.distributor.excluded-zones
      [excluded_zones: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Number of tokens for each ingester.
    # CLI flag: -ingest-limits.num-tokens
    [num_tokens: &amp;lt;int&amp;gt; | default = 128]

    # Period at which to heartbeat to consul.
    # CLI flag: -ingest-limits.heartbeat-period
    [heartbeat_period: &amp;lt;duration&amp;gt; | default = 5s]

    # Heartbeat timeout after which instance is assumed to be unhealthy.
    # CLI flag: -ingest-limits.heartbeat-timeout
    [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

    # Observe tokens after generating to resolve collisions. Useful when using
    # gossiping ring.
    # CLI flag: -ingest-limits.observe-period
    [observe_period: &amp;lt;duration&amp;gt; | default = 0s]

    # Period to wait for a claim from another member; will join automatically
    # after this.
    # CLI flag: -ingest-limits.join-after
    [join_after: &amp;lt;duration&amp;gt; | default = 0s]

    # Minimum duration to wait after the internal readiness checks have passed
    # but before succeeding the readiness endpoint. This is used to slowdown
    # deployment controllers (eg. Kubernetes) after an instance is ready and
    # before they proceed with a rolling update, to give the rest of the cluster
    # instances enough time to receive ring updates.
    # CLI flag: -ingest-limits.min-ready-duration
    [min_ready_duration: &amp;lt;duration&amp;gt; | default = 15s]

    # Name of network interface to read address from.
    # CLI flag: -ingest-limits.lifecycler.interface
    [interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

    # Enable IPv6 support. Required to make use of IP addresses from IPv6
    # interfaces.
    # CLI flag: -ingest-limits.enable-inet6
    [enable_inet6: &amp;lt;boolean&amp;gt; | default = false]

    # Duration to sleep for before exiting, to ensure metrics are scraped.
    # CLI flag: -ingest-limits.final-sleep
    [final_sleep: &amp;lt;duration&amp;gt; | default = 0s]

    # File path where tokens are stored. If empty, tokens are not stored at
    # shutdown and restored at startup.
    # CLI flag: -ingest-limits.tokens-file-path
    [tokens_file_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # The availability zone where this instance is running.
    # CLI flag: -ingest-limits.availability-zone
    [availability_zone: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Unregister from the ring upon clean shutdown. It can be useful to disable
    # for rolling restarts with consistent naming in conjunction with
    # -distributor.extend-writes=false.
    # CLI flag: -ingest-limits.unregister-on-shutdown
    [unregister_on_shutdown: &amp;lt;boolean&amp;gt; | default = true]

    # When enabled the readiness probe succeeds only after all instances are
    # ACTIVE and healthy in the ring, otherwise only the instance itself is
    # checked. This option should be disabled if in your cluster multiple
    # instances can be rolled out simultaneously, otherwise rolling updates may
    # be slowed down.
    # CLI flag: -ingest-limits.readiness-check-ring-health
    [readiness_check_ring_health: &amp;lt;boolean&amp;gt; | default = true]

    # IP address to advertise in the ring.
    # CLI flag: -ingest-limits.lifecycler.addr
    [address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # port to advertise in consul (defaults to server.grpc-listen-port).
    # CLI flag: -ingest-limits.lifecycler.port
    [port: &amp;lt;int&amp;gt; | default = 0]

    # ID to register in the ring.
    # CLI flag: -ingest-limits.lifecycler.ID
    [id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;lt;hostname&amp;gt;&amp;#34;]

  # The consumer group for the Kafka topic used to read stream metadata records.
  # CLI flag: -ingest-limits.consumer-group
  [consumer_group: &amp;lt;string&amp;gt; | default = &amp;#34;ingest-limits&amp;#34;]

  # The topic for the Kafka topic used to read and write stream metadata
  # records.
  # CLI flag: -ingest-limits.topic
  [topic: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

ingest_limits_frontend:
  client_config:
    # Configures client gRPC connections to limits service.
    # The CLI flags prefix for this block configuration is:
    # ingest-limits-frontend.limits-client
    [grpc_client_config: &amp;lt;grpc_client&amp;gt;]

    # Configures client gRPC connections pool to limits service.
    pool_config:
      # How frequently to clean up clients for ingest-limits that have gone
      # away.
      # CLI flag: -ingest-limits-frontend.client-cleanup-period
      [client_cleanup_period: &amp;lt;duration&amp;gt; | default = 15s]

      # Run a health check on each ingest-limits client during periodic cleanup.
      # CLI flag: -ingest-limits-frontend.health-check-ingest-limits
      [health_check_ingest_limits: &amp;lt;boolean&amp;gt; | default = true]

      # Timeout for the health check.
      # CLI flag: -ingest-limits-frontend.remote-timeout
      [remote_timeout: &amp;lt;duration&amp;gt; | default = 1s]

  lifecycler:
    ring:
      kvstore:
        # Backend storage to use for the ring. Supported values are: consul,
        # etcd, inmemory, memberlist, multi.
        # CLI flag: -ingest-limits-frontend.store
        [store: &amp;lt;string&amp;gt; | default = &amp;#34;consul&amp;#34;]

        # The prefix for the keys in the store. Should end with a /.
        # CLI flag: -ingest-limits-frontend.prefix
        [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

        # Configuration for a Consul client. Only applies if the selected
        # kvstore is consul.
        # The CLI flags prefix for this block configuration is:
        # ingest-limits-frontend
        [consul: &amp;lt;consul&amp;gt;]

        # Configuration for an ETCD v3 client. Only applies if the selected
        # kvstore is etcd.
        # The CLI flags prefix for this block configuration is:
        # ingest-limits-frontend
        [etcd: &amp;lt;etcd&amp;gt;]

        multi:
          # Primary backend storage used by multi-client.
          # CLI flag: -ingest-limits-frontend.multi.primary
          [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          # Secondary backend storage used by multi-client.
          # CLI flag: -ingest-limits-frontend.multi.secondary
          [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

          # Mirror writes to the secondary store.
          # CLI flag: -ingest-limits-frontend.multi.mirror-enabled
          [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

          # Timeout for storing a value to the secondary store.
          # CLI flag: -ingest-limits-frontend.multi.mirror-timeout
          [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

      # The heartbeat timeout after which ingesters are skipped for
      # reads/writes.
      # CLI flag: -ingest-limits-frontend.ring.heartbeat-timeout
      [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

      # The number of ingesters to write to and read from.
      # CLI flag: -ingest-limits-frontend.distributor.replication-factor
      [replication_factor: &amp;lt;int&amp;gt; | default = 3]

      # True to enable the zone-awareness and replicate ingested samples across
      # different availability zones.
      # CLI flag: -ingest-limits-frontend.distributor.zone-awareness-enabled
      [zone_awareness_enabled: &amp;lt;boolean&amp;gt; | default = false]

      # Comma-separated list of zones to exclude from the ring. Instances in
      # excluded zones will be filtered out from the ring.
      # CLI flag: -ingest-limits-frontend.distributor.excluded-zones
      [excluded_zones: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Number of tokens for each ingester.
    # CLI flag: -ingest-limits-frontend.num-tokens
    [num_tokens: &amp;lt;int&amp;gt; | default = 128]

    # Period at which to heartbeat to consul.
    # CLI flag: -ingest-limits-frontend.heartbeat-period
    [heartbeat_period: &amp;lt;duration&amp;gt; | default = 5s]

    # Heartbeat timeout after which instance is assumed to be unhealthy.
    # CLI flag: -ingest-limits-frontend.heartbeat-timeout
    [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

    # Observe tokens after generating to resolve collisions. Useful when using
    # gossiping ring.
    # CLI flag: -ingest-limits-frontend.observe-period
    [observe_period: &amp;lt;duration&amp;gt; | default = 0s]

    # Period to wait for a claim from another member; will join automatically
    # after this.
    # CLI flag: -ingest-limits-frontend.join-after
    [join_after: &amp;lt;duration&amp;gt; | default = 0s]

    # Minimum duration to wait after the internal readiness checks have passed
    # but before succeeding the readiness endpoint. This is used to slowdown
    # deployment controllers (eg. Kubernetes) after an instance is ready and
    # before they proceed with a rolling update, to give the rest of the cluster
    # instances enough time to receive ring updates.
    # CLI flag: -ingest-limits-frontend.min-ready-duration
    [min_ready_duration: &amp;lt;duration&amp;gt; | default = 15s]

    # Name of network interface to read address from.
    # CLI flag: -ingest-limits-frontend.lifecycler.interface
    [interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

    # Enable IPv6 support. Required to make use of IP addresses from IPv6
    # interfaces.
    # CLI flag: -ingest-limits-frontend.enable-inet6
    [enable_inet6: &amp;lt;boolean&amp;gt; | default = false]

    # Duration to sleep for before exiting, to ensure metrics are scraped.
    # CLI flag: -ingest-limits-frontend.final-sleep
    [final_sleep: &amp;lt;duration&amp;gt; | default = 0s]

    # File path where tokens are stored. If empty, tokens are not stored at
    # shutdown and restored at startup.
    # CLI flag: -ingest-limits-frontend.tokens-file-path
    [tokens_file_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # The availability zone where this instance is running.
    # CLI flag: -ingest-limits-frontend.availability-zone
    [availability_zone: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Unregister from the ring upon clean shutdown. It can be useful to disable
    # for rolling restarts with consistent naming in conjunction with
    # -distributor.extend-writes=false.
    # CLI flag: -ingest-limits-frontend.unregister-on-shutdown
    [unregister_on_shutdown: &amp;lt;boolean&amp;gt; | default = true]

    # When enabled the readiness probe succeeds only after all instances are
    # ACTIVE and healthy in the ring, otherwise only the instance itself is
    # checked. This option should be disabled if in your cluster multiple
    # instances can be rolled out simultaneously, otherwise rolling updates may
    # be slowed down.
    # CLI flag: -ingest-limits-frontend.readiness-check-ring-health
    [readiness_check_ring_health: &amp;lt;boolean&amp;gt; | default = true]

    # IP address to advertise in the ring.
    # CLI flag: -ingest-limits-frontend.lifecycler.addr
    [address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # port to advertise in consul (defaults to server.grpc-listen-port).
    # CLI flag: -ingest-limits-frontend.lifecycler.port
    [port: &amp;lt;int&amp;gt; | default = 0]

    # ID to register in the ring.
    # CLI flag: -ingest-limits-frontend.lifecycler.ID
    [id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;lt;hostname&amp;gt;&amp;#34;]

  # The number of partitions to use for the ring.
  # CLI flag: -ingest-limits-frontend.num-partitions
  [num_partitions: &amp;lt;int&amp;gt; | default = 64]

  # Enable the assigned partitions cache.
  # CLI flag: -ingest-limits-frontend.assigned-partitions-cache-enabled
  [assigned_partitions_cache_enabled: &amp;lt;boolean&amp;gt; | default = true]

  # The TTL for the assigned partitions cache.
  # CLI flag: -ingest-limits-frontend.assigned-partitions-cache-ttl
  [assigned_partitions_cache_ttl: &amp;lt;duration&amp;gt; | default = 1m]

  # [Experimental]: Enable the accepted streams cache.
  # CLI flag: -ingest-limits-frontend.accepted-streams-cache-enabled
  [accepted_streams_cache_enabled: &amp;lt;boolean&amp;gt; | default = false]

  # The TTL for the accepted streams cache.
  # CLI flag: -ingest-limits-frontend.accepted-streams-cache-ttl
  [accepted_streams_cache_ttl: &amp;lt;duration&amp;gt; | default = 1m]

  # The jitter to add to the accepted streams cache.
  # CLI flag: -ingest-limits-frontend.accepted-streams-cache-ttl-jitter
  [accepted_streams_cache_ttl_jitter: &amp;lt;duration&amp;gt; | default = 15s]

ingest_limits_frontend_client:
  # Configures client gRPC connections to limits service.
  # The CLI flags prefix for this block configuration is:
  # ingest-limits-frontend-client
  [grpc_client_config: &amp;lt;grpc_client&amp;gt;]

  # Configures client gRPC connections pool to limits service.
  pool_config:
    # How frequently to clean up clients for ingest-limits-frontend that have
    # gone away.
    # CLI flag: -ingest-limits-frontend-client.client-cleanup-period
    [client_cleanup_period: &amp;lt;duration&amp;gt; | default = 15s]

    # Run a health check on each ingest-limits-frontend client during periodic
    # cleanup.
    # CLI flag: -ingest-limits-frontend-client.health-check-ingest-limits
    [health_check_ingest_limits: &amp;lt;boolean&amp;gt; | default = true]

    # Timeout for the health check.
    # CLI flag: -ingest-limits-frontend-client.remote-timeout
    [remote_timeout: &amp;lt;duration&amp;gt; | default = 1s]

# Configuration for &amp;#39;runtime config&amp;#39; module, responsible for reloading runtime
# configuration file.
[runtime_config: &amp;lt;runtime_config&amp;gt;]

# These are values which allow you to control aspects of Loki&amp;#39;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.
[operational_config: &amp;lt;operational_config&amp;gt;]

# Configuration for tracing.
[tracing: &amp;lt;tracing&amp;gt;]

# Configuration for analytics.
[analytics: &amp;lt;analytics&amp;gt;]

# Configuration for profiling options.
[profiling: &amp;lt;profiling&amp;gt;]

# List of limit fields to publish from the tenant limits endpoint. If empty, all
# fields are returned. Use YAML field names (e.g., &amp;#39;retention_period&amp;#39;,
# &amp;#39;max_query_series&amp;#39;).
# CLI flag: -limits.tenant-limits-allow-publish
[tenant_limits_allow_publish: &amp;lt;list of strings&amp;gt; | 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]]

# Common 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.
[common: &amp;lt;common&amp;gt;]

# How long to wait between SIGTERM and shutdown. After receiving SIGTERM, Loki
# will report 503 Service Unavailable status via /ready endpoint.
# CLI flag: -shutdown-delay
[shutdown_delay: &amp;lt;duration&amp;gt; | default = 0s]

# Namespace of the metrics that in previous releases had cortex as namespace.
# This setting is deprecated and will be removed in the next minor release.
# CLI flag: -metrics-namespace
[metrics_namespace: &amp;lt;string&amp;gt; | default = &amp;#34;loki&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;alibabacloud_storage_config&#34;&gt;alibabacloud_storage_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;alibabacloud_storage_config&lt;/code&gt; block configures the connection to Alibaba Cloud Storage object storage backend. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;common.storage&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.storage&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Name of OSS bucket.
# CLI flag: -&amp;lt;prefix&amp;gt;.oss.bucketname
[bucket: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# oss Endpoint to connect to.
# CLI flag: -&amp;lt;prefix&amp;gt;.oss.endpoint
[endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# alibabacloud Access Key ID
# CLI flag: -&amp;lt;prefix&amp;gt;.oss.access-key-id
[access_key_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# alibabacloud Secret Access Key
# CLI flag: -&amp;lt;prefix&amp;gt;.oss.secret-access-key
[secret_access_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Connection timeout in seconds
# CLI flag: -&amp;lt;prefix&amp;gt;.oss.conn-timeout-sec
[conn_timeout_sec: &amp;lt;int&amp;gt; | default = 30]

# Read/Write timeout in seconds
# CLI flag: -&amp;lt;prefix&amp;gt;.oss.read-write-timeout-sec
[read_write_timeout_sec: &amp;lt;int&amp;gt; | default = 60]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;analytics&#34;&gt;analytics&lt;/h3&gt;
&lt;p&gt;Configuration for &lt;code&gt;analytics&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Enable anonymous usage reporting.
# CLI flag: -reporting.enabled
[reporting_enabled: &amp;lt;boolean&amp;gt; | default = true]

# URL to which reports are sent
# CLI flag: -reporting.usage-stats-url
[usage_stats_url: &amp;lt;string&amp;gt; | default = &amp;#34;https://stats.grafana.org/loki-usage-report&amp;#34;]

# URL to the proxy server
# CLI flag: -reporting.proxy-url
[proxy_url: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# The TLS configuration.
# The CLI flags prefix for this block configuration is: reporting.tls-config
[tls_config: &amp;lt;tls_config&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;attributes_config&#34;&gt;attributes_config&lt;/h3&gt;
&lt;p&gt;Define actions for matching OpenTelemetry (OTEL) attributes.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Configures action to take on matching attributes. It allows one of
# [structured_metadata, drop] for all attribute types. It additionally allows
# index_label action for resource attributes
[action: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# List of attributes to configure how to store them or drop them altogether
[attributes: &amp;lt;list of strings&amp;gt;]

# Regex to choose attributes to configure how to store them or drop them
# altogether
[regex: &amp;lt;Regexp&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;aws_storage_config&#34;&gt;aws_storage_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;aws_storage_config&lt;/code&gt; block configures the connection to dynamoDB and S3 object storage. Either one of them or both can be configured.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Deprecated: Configures storing indexes in DynamoDB.
dynamodb:
  # DynamoDB endpoint URL with escaped Key and Secret encoded. If only region is
  # specified as a host, proper endpoint will be deduced. Use
  # inmemory:///&amp;lt;table-name&amp;gt; to use a mock in-memory implementation.
  # CLI flag: -dynamodb.url
  [dynamodb_url: &amp;lt;url&amp;gt;]

  # DynamoDB table management requests per second limit.
  # CLI flag: -dynamodb.api-limit
  [api_limit: &amp;lt;float&amp;gt; | default = 2]

  # DynamoDB rate cap to back off when throttled.
  # CLI flag: -dynamodb.throttle-limit
  [throttle_limit: &amp;lt;float&amp;gt; | default = 10]

  metrics:
    # Use metrics-based autoscaling, via this query URL
    # CLI flag: -metrics.url
    [url: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Queue length above which we will scale up capacity
    # CLI flag: -metrics.target-queue-length
    [target_queue_length: &amp;lt;int&amp;gt; | default = 100000]

    # Scale up capacity by this multiple
    # CLI flag: -metrics.scale-up-factor
    [scale_up_factor: &amp;lt;float&amp;gt; | default = 1.3]

    # Ignore throttling below this level (rate per second)
    # CLI flag: -metrics.ignore-throttle-below
    [ignore_throttle_below: &amp;lt;float&amp;gt; | default = 1]

    # query to fetch ingester queue length
    # CLI flag: -metrics.queue-length-query
    [queue_length_query: &amp;lt;string&amp;gt; | default = &amp;#34;sum(avg_over_time(loki_ingester_flush_queue_length{job=\&amp;#34;cortex/ingester\&amp;#34;}[2m])) or sum(avg_over_time(cortex_ingester_flush_queue_length{job=\&amp;#34;cortex/ingester\&amp;#34;}[2m]))&amp;#34;]

    # query to fetch throttle rates per table
    # CLI flag: -metrics.write-throttle-query
    [write_throttle_query: &amp;lt;string&amp;gt; | default = &amp;#34;sum(rate(cortex_dynamo_throttled_total{operation=\&amp;#34;DynamoDB.BatchWriteItem\&amp;#34;}[1m])) by (table) &amp;gt; 0&amp;#34;]

    # query to fetch write capacity usage per table
    # CLI flag: -metrics.usage-query
    [write_usage_query: &amp;lt;string&amp;gt; | default = &amp;#34;sum(rate(cortex_dynamo_consumed_capacity_total{operation=\&amp;#34;DynamoDB.BatchWriteItem\&amp;#34;}[15m])) by (table) &amp;gt; 0&amp;#34;]

    # query to fetch read capacity usage per table
    # CLI flag: -metrics.read-usage-query
    [read_usage_query: &amp;lt;string&amp;gt; | default = &amp;#34;sum(rate(cortex_dynamo_consumed_capacity_total{operation=\&amp;#34;DynamoDB.QueryPages\&amp;#34;}[1h])) by (table) &amp;gt; 0&amp;#34;]

    # query to fetch read errors per table
    # CLI flag: -metrics.read-error-query
    [read_error_query: &amp;lt;string&amp;gt; | default = &amp;#34;sum(increase(cortex_dynamo_failures_total{operation=\&amp;#34;DynamoDB.QueryPages\&amp;#34;,error=\&amp;#34;ProvisionedThroughputExceededException\&amp;#34;}[1m])) by (table) &amp;gt; 0&amp;#34;]

  # Number of chunks to group together to parallelise fetches (zero to disable)
  # CLI flag: -dynamodb.chunk-gang-size
  [chunk_gang_size: &amp;lt;int&amp;gt; | default = 10]

  # Max number of chunk-get operations to start in parallel
  # CLI flag: -dynamodb.chunk.get-max-parallelism
  [chunk_get_max_parallelism: &amp;lt;int&amp;gt; | default = 32]

  backoff_config:
    # Minimum backoff time
    # CLI flag: -dynamodb.min-backoff
    [min_period: &amp;lt;duration&amp;gt; | default = 100ms]

    # Maximum backoff time
    # CLI flag: -dynamodb.max-backoff
    [max_period: &amp;lt;duration&amp;gt; | default = 50s]

    # Maximum number of times to retry an operation
    # CLI flag: -dynamodb.max-retries
    [max_retries: &amp;lt;int&amp;gt; | default = 20]

  # KMS key used for encrypting DynamoDB items.  DynamoDB will use an Amazon
  # owned KMS key if not provided.
  # CLI flag: -dynamodb.kms-key-id
  [kms_key_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# The s3_storage_config block configures the connection to Amazon S3 object
# storage backend.
[&amp;lt;s3_storage_config&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;azure_storage_config&#34;&gt;azure_storage_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;azure_storage_config&lt;/code&gt; block configures the connection to Azure object storage backend. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;common.storage&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.storage&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Azure Cloud environment. Supported values are: AzureGlobal, AzureChinaCloud,
# AzureGermanCloud, AzureUSGovernment.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.environment
[environment: &amp;lt;string&amp;gt; | default = &amp;#34;AzureGlobal&amp;#34;]

# Azure storage account name.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.account-name
[account_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Azure storage account key.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.account-key
[account_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# If `connection-string` is set, the values of `account-name` and
# `endpoint-suffix` values will not be used. Use this method over `account-key`
# if you need to authenticate via a SAS token. Or if you use the Azurite
# emulator.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.connection-string
[connection_string: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Name of the storage account blob container used to store chunks. This
# container must be created before running cortex.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.container-name
[container_name: &amp;lt;string&amp;gt; | default = &amp;#34;loki&amp;#34;]

# Azure active directory endpoint override. Use when the Azure SDK does not
# support your environment.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.active-directory-endpoint
[active_directory_endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Azure storage endpoint suffix without schema. The storage account name will be
# prefixed to this value to create the FQDN.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.endpoint-suffix
[endpoint_suffix: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Use Managed Identity to authenticate to the Azure storage account.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.use-managed-identity
[use_managed_identity: &amp;lt;boolean&amp;gt; | default = false]

# Use Federated Token to authenticate to the Azure storage account.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.use-federated-token
[use_federated_token: &amp;lt;boolean&amp;gt; | default = false]

# User assigned identity ID to authenticate to the Azure storage account.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.user-assigned-id
[user_assigned_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Use Service Principal to authenticate through Azure OAuth.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.use-service-principal
[use_service_principal: &amp;lt;boolean&amp;gt; | default = false]

# Azure Service Principal ID(GUID).
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.client-id
[client_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Azure Service Principal secret key.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.client-secret
[client_secret: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Azure Tenant ID is used to authenticate through Azure OAuth.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.tenant-id
[tenant_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Chunk delimiter for blob ID to be used
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.chunk-delimiter
[chunk_delimiter: &amp;lt;string&amp;gt; | default = &amp;#34;-&amp;#34;]

# Preallocated buffer size for downloads.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.download-buffer-size
[download_buffer_size: &amp;lt;int&amp;gt; | default = 512000]

# Preallocated buffer size for uploads.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.upload-buffer-size
[upload_buffer_size: &amp;lt;int&amp;gt; | default = 256000]

# Number of buffers used to used to upload a chunk.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.download-buffer-count
[upload_buffer_count: &amp;lt;int&amp;gt; | default = 1]

# Timeout for requests made against azure blob storage.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.request-timeout
[request_timeout: &amp;lt;duration&amp;gt; | default = 30s]

# Number of retries for a request which times out.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.max-retries
[max_retries: &amp;lt;int&amp;gt; | default = 5]

# Minimum time to wait before retrying a request.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.min-retry-delay
[min_retry_delay: &amp;lt;duration&amp;gt; | default = 10ms]

# Maximum time to wait before retrying a request.
# CLI flag: -&amp;lt;prefix&amp;gt;.azure.max-retry-delay
[max_retry_delay: &amp;lt;duration&amp;gt; | default = 500ms]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;bloom_build&#34;&gt;bloom_build&lt;/h3&gt;
&lt;p&gt;Experimental: The &lt;code&gt;bloom_build&lt;/code&gt; block configures the Loki bloom planner and builder servers, responsible for building bloom filters.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Flag to enable or disable the usage of the bloom-planner and bloom-builder
# components.
# CLI flag: -bloom-build.enabled
[enabled: &amp;lt;boolean&amp;gt; | default = false]

planner:
  # Interval at which to re-run the bloom creation planning.
  # CLI flag: -bloom-build.planner.interval
  [planning_interval: &amp;lt;duration&amp;gt; | default = 8h]

  # Newest day-table offset (from today, inclusive) to build blooms for. 0 start
  # building from today, 1 from yesterday and so on. Increase to lower cost by
  # not re-writing data to object storage too frequently since recent data
  # changes more often at the cost of not having blooms available as quickly.
  # CLI flag: -bloom-build.planner.min-table-offset
  [min_table_offset: &amp;lt;int&amp;gt; | default = 0]

  # Oldest day-table offset (from today, inclusive) to build blooms for. 1 till
  # yesterday, 2 till day before yesterday and so on. This can be used to lower
  # cost by not trying to build blooms for older data which doesn&amp;#39;t change. This
  # can be optimized by aligning it with the maximum
  # `reject_old_samples_max_age` setting of any tenant.
  # CLI flag: -bloom-build.planner.max-table-offset
  [max_table_offset: &amp;lt;int&amp;gt; | default = 1]

  retention:
    # Enable bloom retention.
    # CLI flag: -bloom-build.planner.retention.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

  queue:
    # Maximum number of tasks to queue per tenant.
    # CLI flag: -bloom-build.planner.queue.max-tasks-per-tenant
    [max_queued_tasks_per_tenant: &amp;lt;int&amp;gt; | default = 30000]

    # Whether to store tasks on disk.
    # CLI flag: -bloom-build.planner.queue.store-tasks-on-disk
    [store_tasks_on_disk: &amp;lt;boolean&amp;gt; | default = false]

    # Directory to store tasks on disk.
    # CLI flag: -bloom-build.planner.queue.tasks-disk-directory
    [tasks_disk_directory: &amp;lt;string&amp;gt; | default = &amp;#34;/tmp/bloom-planner-queue&amp;#34;]

    # Whether to clean the tasks directory on startup.
    # CLI flag: -bloom-build.planner.queue.clean-tasks-directory
    [clean_tasks_directory: &amp;lt;boolean&amp;gt; | default = false]

builder:
  # The grpc_client block configures the gRPC client used to communicate between
  # a client and server component in Loki.
  # The CLI flags prefix for this block configuration is:
  # bloom-build.builder.grpc
  [grpc_config: &amp;lt;grpc_client&amp;gt;]

  # Hostname (and port) of the bloom planner
  # CLI flag: -bloom-build.builder.planner-address
  [planner_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  backoff_config:
    # Minimum delay when backing off.
    # CLI flag: -bloom-build.builder.backoff.backoff-min-period
    [min_period: &amp;lt;duration&amp;gt; | default = 100ms]

    # Maximum delay when backing off.
    # CLI flag: -bloom-build.builder.backoff.backoff-max-period
    [max_period: &amp;lt;duration&amp;gt; | default = 10s]

    # Number of times to backoff and retry before failing.
    # CLI flag: -bloom-build.builder.backoff.backoff-retries
    [max_retries: &amp;lt;int&amp;gt; | default = 10]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;bloom_gateway&#34;&gt;bloom_gateway&lt;/h3&gt;
&lt;p&gt;Experimental: The &lt;code&gt;bloom_gateway&lt;/code&gt; block configures the Loki bloom gateway server, responsible for serving queries for filtering chunks based on filter expressions.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Flag to enable or disable the bloom gateway component globally.
# CLI flag: -bloom-gateway.enabled
[enabled: &amp;lt;boolean&amp;gt; | default = false]

client:
  # Configures the behavior of the connection pool.
  pool_config:
    # How frequently to update the list of servers.
    # CLI flag: -bloom-gateway-client.pool.check-interval
    [check_interval: &amp;lt;duration&amp;gt; | default = 15s]

  # The grpc_client block configures the gRPC client used to communicate between
  # a client and server component in Loki.
  # The CLI flags prefix for this block configuration is:
  # bloom-gateway-client.grpc
  [grpc_client_config: &amp;lt;grpc_client&amp;gt;]

  # Comma separated addresses list in DNS Service Discovery format:
  # https://grafana.com/docs/mimir/latest/configure/about-dns-service-discovery/#supported-discovery-modes
  # CLI flag: -bloom-gateway-client.addresses
  [addresses: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Number of workers to use for filtering chunks concurrently. Usually set to 1x
# number of CPU cores.
# CLI flag: -bloom-gateway.worker-concurrency
[worker_concurrency: &amp;lt;int&amp;gt; | default = 4]

# Number of blocks processed concurrently on a single worker. Usually set to 2x
# number of CPU cores.
# CLI flag: -bloom-gateway.block-query-concurrency
[block_query_concurrency: &amp;lt;int&amp;gt; | default = 8]

# Maximum number of outstanding tasks per tenant.
# CLI flag: -bloom-gateway.max-outstanding-per-tenant
[max_outstanding_per_tenant: &amp;lt;int&amp;gt; | default = 1024]

# How many tasks are multiplexed at once.
# CLI flag: -bloom-gateway.num-multiplex-tasks
[num_multiplex_tasks: &amp;lt;int&amp;gt; | default = 512]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;bos_storage_config&#34;&gt;bos_storage_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;bos_storage_config&lt;/code&gt; block configures the connection to Baidu Object Storage (BOS) object storage backend. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;common.storage&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.storage&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Name of BOS bucket.
# CLI flag: -&amp;lt;prefix&amp;gt;.bos.bucket-name
[bucket_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# BOS endpoint to connect to.
# CLI flag: -&amp;lt;prefix&amp;gt;.bos.endpoint
[endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;bj.bcebos.com&amp;#34;]

# Baidu Cloud Engine (BCE) Access Key ID.
# CLI flag: -&amp;lt;prefix&amp;gt;.bos.access-key-id
[access_key_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Baidu Cloud Engine (BCE) Secret Access Key.
# CLI flag: -&amp;lt;prefix&amp;gt;.bos.secret-access-key
[secret_access_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;cache_config&#34;&gt;cache_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;cache_config&lt;/code&gt; block configures the cache backend for a specific Loki component. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;bloom.metas-cache&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.index-stats-results-cache&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.instant-metric-results-cache&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.label-results-cache&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.series-results-cache&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.volume-results-cache&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;query-engine.results-cache&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;store.chunks-cache&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;store.chunks-cache-l2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;store.index-cache-read&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;store.index-cache-write&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# The default validity of entries for caches unless overridden.
# CLI flag: -&amp;lt;prefix&amp;gt;.default-validity
[default_validity: &amp;lt;duration&amp;gt; | default = 1h]

background:
  # At what concurrency to write back to cache.
  # CLI flag: -&amp;lt;prefix&amp;gt;.background.write-back-concurrency
  [writeback_goroutines: &amp;lt;int&amp;gt; | default = 1]

  # How many key batches to buffer for background write-back. Default is large
  # to prefer size based limiting.
  # CLI flag: -&amp;lt;prefix&amp;gt;.background.write-back-buffer
  [writeback_buffer: &amp;lt;int&amp;gt; | default = 500000]

  # Size limit in bytes for background write-back.
  # CLI flag: -&amp;lt;prefix&amp;gt;.background.write-back-size-limit
  [writeback_size_limit: &amp;lt;int&amp;gt; | default = 500MB]

memcached:
  # How long keys stay in the memcache.
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.expiration
  [expiration: &amp;lt;duration&amp;gt; | default = 0s]

  # How many keys to fetch in each batch.
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.batchsize
  [batch_size: &amp;lt;int&amp;gt; | default = 4]

  # Maximum active requests to memcache.
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.parallelism
  [parallelism: &amp;lt;int&amp;gt; | default = 5]

memcached_client:
  # Hostname for memcached service to use. If empty and if addresses is unset,
  # no memcached will be used.
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.hostname
  [host: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # SRV service used to discover memcache servers.
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.service
  [service: &amp;lt;string&amp;gt; | default = &amp;#34;memcached&amp;#34;]

  # Comma separated addresses list in DNS Service Discovery format:
  # https://grafana.com/docs/mimir/latest/configure/about-dns-service-discovery/#supported-discovery-modes
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.addresses
  [addresses: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Maximum time to wait before giving up on memcached requests.
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.timeout
  [timeout: &amp;lt;duration&amp;gt; | default = 100ms]

  # Maximum number of idle connections in pool.
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.max-idle-conns
  [max_idle_conns: &amp;lt;int&amp;gt; | default = 16]

  # The maximum size of an item stored in memcached. Bigger items are not
  # stored. If set to 0, no maximum size is enforced.
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.max-item-size
  [max_item_size: &amp;lt;int&amp;gt; | default = 0]

  # Period with which to poll DNS for memcache servers.
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.update-interval
  [update_interval: &amp;lt;duration&amp;gt; | default = 1m]

  # Use consistent hashing to distribute to memcache servers.
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.consistent-hash
  [consistent_hash: &amp;lt;boolean&amp;gt; | default = true]

  # Trip circuit-breaker after this number of consecutive dial failures (if zero
  # then circuit-breaker is disabled).
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.circuit-breaker-consecutive-failures
  [circuit_breaker_consecutive_failures: &amp;lt;int&amp;gt; | default = 10]

  # Duration circuit-breaker remains open after tripping (if zero then 60
  # seconds is used).
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.circuit-breaker-timeout
  [circuit_breaker_timeout: &amp;lt;duration&amp;gt; | default = 10s]

  # Reset circuit-breaker counts after this long (if zero then never reset).
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.circuit-breaker-interval
  [circuit_breaker_interval: &amp;lt;duration&amp;gt; | default = 10s]

  # Enable connecting to Memcached with TLS.
  # CLI flag: -&amp;lt;prefix&amp;gt;.memcached.tls-enabled
  [tls_enabled: &amp;lt;boolean&amp;gt; | default = false]

  # The TLS configuration.
  # The CLI flags prefix for this block configuration is:
  # store.index-cache-write.memcached
  [&amp;lt;tls_config&amp;gt;]

redis:
  # Redis Server or Cluster configuration endpoint to use for caching. A
  # comma-separated list of endpoints for Redis Cluster or Redis Sentinel. If
  # empty, no redis will be used.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.endpoint
  [endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Redis Sentinel master name. An empty string for Redis Server or Redis
  # Cluster.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.master-name
  [master_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Maximum time to wait before giving up on redis requests.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.timeout
  [timeout: &amp;lt;duration&amp;gt; | default = 500ms]

  # How long keys stay in the redis.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.expiration
  [expiration: &amp;lt;duration&amp;gt; | default = 0s]

  # Database index.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.db
  [db: &amp;lt;int&amp;gt; | default = 0]

  # Maximum number of connections in the pool.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.pool-size
  [pool_size: &amp;lt;int&amp;gt; | default = 0]

  # Username to use when connecting to redis.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.username
  [username: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Password to use when connecting to redis.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.password
  [password: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Enable connecting to redis with TLS.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.tls-enabled
  [tls_enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Skip validating server certificate.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.tls-insecure-skip-verify
  [tls_insecure_skip_verify: &amp;lt;boolean&amp;gt; | default = false]

  # Close connections after remaining idle for this duration. If the value is
  # zero, then idle connections are not closed.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.idle-timeout
  [idle_timeout: &amp;lt;duration&amp;gt; | default = 0s]

  # Close connections older than this duration. If the value is zero, then the
  # pool does not close connections based on age.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.max-connection-age
  [max_connection_age: &amp;lt;duration&amp;gt; | default = 0s]

  # By default, the Redis client only reads from the master node. Enabling this
  # option can lower pressure on the master node by randomly routing read-only
  # commands to the master and any available replicas.
  # CLI flag: -&amp;lt;prefix&amp;gt;.redis.route-randomly
  [route_randomly: &amp;lt;boolean&amp;gt; | default = false]

embedded_cache:
  # Whether embedded cache is enabled.
  # CLI flag: -&amp;lt;prefix&amp;gt;.embedded-cache.enabled
  [enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Maximum memory size of the cache in MB.
  # CLI flag: -&amp;lt;prefix&amp;gt;.embedded-cache.max-size-mb
  [max_size_mb: &amp;lt;int&amp;gt; | default = 100]

  # Maximum number of entries in the cache.
  # CLI flag: -&amp;lt;prefix&amp;gt;.embedded-cache.max-size-items
  [max_size_items: &amp;lt;int&amp;gt; | default = 0]

  # The time to live for items in the cache before they get purged.
  # CLI flag: -&amp;lt;prefix&amp;gt;.embedded-cache.ttl
  [ttl: &amp;lt;duration&amp;gt; | default = 1h]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;chunk_store_config&#34;&gt;chunk_store_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;chunk_store_config&lt;/code&gt; block configures how chunks will be cached and how long to wait before saving them to the backing store.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# The cache_config block configures the cache backend for a specific Loki
# component.
# The CLI flags prefix for this block configuration is: store.chunks-cache
[chunk_cache_config: &amp;lt;cache_config&amp;gt;]

# The cache_config block configures the cache backend for a specific Loki
# component.
# The CLI flags prefix for this block configuration is: store.chunks-cache-l2
[chunk_cache_config_l2: &amp;lt;cache_config&amp;gt;]

# Write dedupe cache is deprecated along with legacy index types (aws,
# aws-dynamo, bigtable, bigtable-hashed, cassandra, gcp, gcp-columnkey,
# grpc-store).
# Consider using TSDB index which does not require a write dedupe cache.
# The CLI flags prefix for this block configuration is: store.index-cache-write
[write_dedupe_cache_config: &amp;lt;cache_config&amp;gt;]

# Chunks fetched from queriers before this duration will not be written to the
# cache. A value of 0 will write all chunks to the cache
# CLI flag: -store.skip-query-writeback-older-than
[skip_query_writeback_cache_older_than: &amp;lt;duration&amp;gt; | default = 0s]

# Chunks will be handed off to the L2 cache after this duration. 0 to disable L2
# cache.
# CLI flag: -store.chunks-cache-l2.handoff
[l2_chunk_cache_handoff: &amp;lt;duration&amp;gt; | default = 0s]

# Cache index entries older than this period. 0 to disable.
# CLI flag: -store.cache-lookups-older-than
[cache_lookups_older_than: &amp;lt;duration&amp;gt; | default = 0s]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;common&#34;&gt;common&lt;/h3&gt;
&lt;p&gt;Common 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.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# prefix for the path
# CLI flag: -common.path-prefix
[path_prefix: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

storage:
  # The s3_storage_config block configures the connection to Amazon S3 object
  # storage backend.
  # The CLI flags prefix for this block configuration is: common.storage
  [s3: &amp;lt;s3_storage_config&amp;gt;]

  # The gcs_storage_config block configures the connection to Google Cloud
  # Storage object storage backend.
  # The CLI flags prefix for this block configuration is: common.storage
  [gcs: &amp;lt;gcs_storage_config&amp;gt;]

  # The azure_storage_config block configures the connection to Azure object
  # storage backend.
  # The CLI flags prefix for this block configuration is: common.storage
  [azure: &amp;lt;azure_storage_config&amp;gt;]

  # The alibabacloud_storage_config block configures the connection to Alibaba
  # Cloud Storage object storage backend.
  # The CLI flags prefix for this block configuration is: common.storage
  [alibabacloud: &amp;lt;alibabacloud_storage_config&amp;gt;]

  # The bos_storage_config block configures the connection to Baidu Object
  # Storage (BOS) object storage backend.
  # The CLI flags prefix for this block configuration is: common.storage
  [bos: &amp;lt;bos_storage_config&amp;gt;]

  # The swift_storage_config block configures the connection to OpenStack Object
  # Storage (Swift) object storage backend.
  # The CLI flags prefix for this block configuration is: common.storage
  [swift: &amp;lt;swift_storage_config&amp;gt;]

  filesystem:
    # Directory to store chunks in.
    # CLI flag: -common.storage.filesystem.chunk-directory
    [chunks_directory: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Directory to store rules in.
    # CLI flag: -common.storage.filesystem.rules-directory
    [rules_directory: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  hedging:
    # If set to a non-zero value a second request will be issued at the provided
    # duration. Default is 0 (disabled)
    # CLI flag: -common.storage.hedge-requests-at
    [at: &amp;lt;duration&amp;gt; | default = 0s]

    # The maximum of hedge requests allowed.
    # CLI flag: -common.storage.hedge-requests-up-to
    [up_to: &amp;lt;int&amp;gt; | default = 2]

    # The maximum of hedge requests allowed per seconds.
    # CLI flag: -common.storage.hedge-max-per-second
    [max_per_second: &amp;lt;int&amp;gt; | default = 5]

  # The cos_storage_config block configures the connection to IBM Cloud Object
  # Storage (COS) backend.
  # The CLI flags prefix for this block configuration is: common.storage
  [cos: &amp;lt;cos_storage_config&amp;gt;]

  congestion_control:
    # Use storage congestion control (default: disabled).
    # CLI flag: -common.storage.congestion-control.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

    controller:
      # Congestion control strategy to use (default: none, options: &amp;#39;aimd&amp;#39;).
      # CLI flag: -common.storage.congestion-control.strategy
      [strategy: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      aimd:
        # AIMD starting throughput window size: how many requests can be sent
        # per second (default: 2000).
        # CLI flag: -common.storage.congestion-control.strategy.aimd.start
        [start: &amp;lt;int&amp;gt; | default = 2000]

        # AIMD maximum throughput window size: upper limit of requests sent per
        # second (default: 10000).
        # CLI flag: -common.storage.congestion-control.strategy.aimd.upper-bound
        [upper_bound: &amp;lt;int&amp;gt; | default = 10000]

        # AIMD backoff factor when upstream service is throttled to decrease
        # number of requests sent per second (default: 0.5).
        # CLI flag: -common.storage.congestion-control.strategy.aimd.backoff-factor
        [backoff_factor: &amp;lt;float&amp;gt; | default = 0.5]

    retry:
      # Congestion control retry strategy to use (default: none, options:
      # &amp;#39;limited&amp;#39;).
      # CLI flag: -common.storage.congestion-control.retry.strategy
      [strategy: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Maximum number of retries allowed.
      # CLI flag: -common.storage.congestion-control.retry.strategy.limited.limit
      [limit: &amp;lt;int&amp;gt; | default = 2]

    hedging:
      config:
        [at: &amp;lt;duration&amp;gt;]

        [up_to: &amp;lt;int&amp;gt;]

        [max_per_second: &amp;lt;int&amp;gt;]

      # Congestion control hedge strategy to use (default: none, options:
      # &amp;#39;limited&amp;#39;).
      # CLI flag: -common.storage.congestion-control.hedge.strategy
      [strategy: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The 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.
  # Currently this is opt-in and takes effect only when `-use-thanos-objstore`
  # is set to true.
  # The CLI flags prefix for this block configuration is:
  # common.storage.object-store
  [object_store: &amp;lt;thanos_object_store_config&amp;gt;]

[persist_tokens: &amp;lt;boolean&amp;gt;]

[replication_factor: &amp;lt;int&amp;gt;]

ring:
  kvstore:
    # Backend storage to use for the ring. Supported values are: consul, etcd,
    # inmemory, memberlist, multi.
    # CLI flag: -common.storage.ring.store
    [store: &amp;lt;string&amp;gt; | default = &amp;#34;consul&amp;#34;]

    # The prefix for the keys in the store. Should end with a /.
    # CLI flag: -common.storage.ring.prefix
    [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

    # Configuration for a Consul client. Only applies if the selected kvstore is
    # consul.
    # The CLI flags prefix for this block configuration is: common.storage.ring
    [consul: &amp;lt;consul&amp;gt;]

    # Configuration for an ETCD v3 client. Only applies if the selected kvstore
    # is etcd.
    # The CLI flags prefix for this block configuration is: common.storage.ring
    [etcd: &amp;lt;etcd&amp;gt;]

    multi:
      # Primary backend storage used by multi-client.
      # CLI flag: -common.storage.ring.multi.primary
      [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Secondary backend storage used by multi-client.
      # CLI flag: -common.storage.ring.multi.secondary
      [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Mirror writes to the secondary store.
      # CLI flag: -common.storage.ring.multi.mirror-enabled
      [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

      # Timeout for storing a value to the secondary store.
      # CLI flag: -common.storage.ring.multi.mirror-timeout
      [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

  # Period at which to heartbeat to the ring.
  # CLI flag: -common.storage.ring.heartbeat-period
  [heartbeat_period: &amp;lt;duration&amp;gt; | default = 15s]

  # The heartbeat timeout after which compactors are considered unhealthy within
  # the ring. 0 = never (timeout disabled).
  # CLI flag: -common.storage.ring.heartbeat-timeout
  [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

  # File path where tokens are stored. If empty, tokens are not stored at
  # shutdown and restored at startup.
  # CLI flag: -common.storage.ring.tokens-file-path
  [tokens_file_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # True to enable zone-awareness and replicate blocks across different
  # availability zones.
  # CLI flag: -common.storage.ring.zone-awareness-enabled
  [zone_awareness_enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Number of tokens to own in the ring.
  # CLI flag: -common.storage.ring.num-tokens
  [num_tokens: &amp;lt;int&amp;gt; | default = 128]

  # Factor for data replication.
  # CLI flag: -common.storage.ring.replication-factor
  [replication_factor: &amp;lt;int&amp;gt; | default = 3]

  # Instance ID to register in the ring.
  # CLI flag: -common.storage.ring.instance-id
  [instance_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;lt;hostname&amp;gt;&amp;#34;]

  # Name of network interface to read address from.
  # CLI flag: -common.storage.ring.instance-interface-names
  [instance_interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

  # Port to advertise in the ring (defaults to server.grpc-listen-port).
  # CLI flag: -common.storage.ring.instance-port
  [instance_port: &amp;lt;int&amp;gt; | default = 0]

  # IP address to advertise in the ring.
  # CLI flag: -common.storage.ring.instance-addr
  [instance_addr: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The availability zone where this instance is running. Required if
  # zone-awareness is enabled.
  # CLI flag: -common.storage.ring.instance-availability-zone
  [instance_availability_zone: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Enable using a IPv6 instance address.
  # CLI flag: -common.storage.ring.instance-enable-ipv6
  [instance_enable_ipv6: &amp;lt;boolean&amp;gt; | default = false]

[instance_interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

[instance_addr: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# the http address of the compactor in the form http://host:port
# CLI flag: -common.compactor-address
[compactor_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# the grpc address of the compactor in the form host:port
# CLI flag: -common.compactor-grpc-address
[compactor_grpc_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Experimental: path to use for temporary data, where scratch data is supported.
# CLI flag: -common.scratch-path
[scratch_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;compactor&#34;&gt;compactor&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;compactor&lt;/code&gt; block configures the compactor component, which compacts index shards for performance.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Directory where files can be downloaded for compaction.
# CLI flag: -compactor.working-directory
[working_directory: &amp;lt;string&amp;gt; | default = &amp;#34;/var/loki/compactor&amp;#34;]

# Interval at which to re-run the compaction operation.
# CLI flag: -compactor.compaction-interval
[compaction_interval: &amp;lt;duration&amp;gt; | default = 10m]

# Interval at which to apply/enforce retention. 0 means run at same interval as
# compaction. If non-zero, it should always be a multiple of compaction
# interval.
# CLI flag: -compactor.apply-retention-interval
[apply_retention_interval: &amp;lt;duration&amp;gt; | default = 0s]

# Activate custom (per-stream,per-tenant) retention.
# CLI flag: -compactor.retention-enabled
[retention_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Delay after which chunks will be fully deleted during retention.
# CLI flag: -compactor.retention-delete-delay
[retention_delete_delay: &amp;lt;duration&amp;gt; | default = 2h]

# The total amount of worker to use to delete chunks.
# CLI flag: -compactor.retention-delete-worker-count
[retention_delete_worker_count: &amp;lt;int&amp;gt; | default = 150]

# The maximum amount of time to spend running retention and deletion on any
# given table in the index.
# CLI flag: -compactor.retention-table-timeout
[retention_table_timeout: &amp;lt;duration&amp;gt; | default = 0s]

retention_backoff_config:
  # Minimum delay when backing off.
  # CLI flag: -compactor.retention-backoff-config.backoff-min-period
  [min_period: &amp;lt;duration&amp;gt; | default = 100ms]

  # Maximum delay when backing off.
  # CLI flag: -compactor.retention-backoff-config.backoff-max-period
  [max_period: &amp;lt;duration&amp;gt; | default = 10s]

  # Number of times to backoff and retry before failing.
  # CLI flag: -compactor.retention-backoff-config.backoff-retries
  [max_retries: &amp;lt;int&amp;gt; | default = 10]

# Store used for managing delete requests.
# CLI flag: -compactor.delete-request-store
[delete_request_store: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Path prefix for storing delete requests.
# CLI flag: -compactor.delete-request-store.key-prefix
[delete_request_store_key_prefix: &amp;lt;string&amp;gt; | default = &amp;#34;index/&amp;#34;]

# Type of DB to use for storing delete requests. Supported types: boltdb, sqlite
# CLI flag: -compactor.delete-request-store.db-type
[delete_request_store_db_type: &amp;lt;string&amp;gt; | default = &amp;#34;boltdb&amp;#34;]

# Type of DB to use as backup for storing delete requests. Backup DB should
# ideally be used while migrating from one DB type to another. Supported
# type(s): boltdb
# CLI flag: -compactor.delete-request-store.backup-db-type
[backup_delete_request_store_db_type: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# The max number of delete requests to run per compaction cycle.
# CLI flag: -compactor.delete-batch-size
[delete_batch_size: &amp;lt;int&amp;gt; | default = 70]

# Allow cancellation of delete request until duration after they are created.
# Data would be deleted only after delete requests have been older than this
# duration. Ideally this should be set to at least 24h.
# CLI flag: -compactor.delete-request-cancel-period
[delete_request_cancel_period: &amp;lt;duration&amp;gt; | default = 24h]

# Constrain the size of any single delete request with line filters. When a
# delete request &amp;gt; delete_max_interval is input, the request is sharded into
# smaller requests of no more than delete_max_interval
# CLI flag: -compactor.delete-max-interval
[delete_max_interval: &amp;lt;duration&amp;gt; | default = 24h]

# Maximum number of tables to compact in parallel. While increasing this value,
# please make sure compactor has enough disk space allocated to be able to store
# and compact as many tables.
# CLI flag: -compactor.max-compaction-parallelism
[max_compaction_parallelism: &amp;lt;int&amp;gt; | default = 1]

# Number of upload/remove operations to execute in parallel when finalizing a
# compaction. NOTE: This setting is per compaction operation, which can be
# executed in parallel. The upper bound on the number of concurrent uploads is
# upload_parallelism * max_compaction_parallelism.
# CLI flag: -compactor.upload-parallelism
[upload_parallelism: &amp;lt;int&amp;gt; | default = 10]

# The hash ring configuration used by compactors to elect a single instance for
# running compactions. The CLI flags prefix for this block config is:
# compactor.ring
compactor_ring:
  kvstore:
    # Backend storage to use for the ring. Supported values are: consul, etcd,
    # inmemory, memberlist, multi.
    # CLI flag: -compactor.ring.store
    [store: &amp;lt;string&amp;gt; | default = &amp;#34;consul&amp;#34;]

    # The prefix for the keys in the store. Should end with a /.
    # CLI flag: -compactor.ring.prefix
    [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

    # Configuration for a Consul client. Only applies if the selected kvstore is
    # consul.
    # The CLI flags prefix for this block configuration is: compactor.ring
    [consul: &amp;lt;consul&amp;gt;]

    # Configuration for an ETCD v3 client. Only applies if the selected kvstore
    # is etcd.
    # The CLI flags prefix for this block configuration is: compactor.ring
    [etcd: &amp;lt;etcd&amp;gt;]

    multi:
      # Primary backend storage used by multi-client.
      # CLI flag: -compactor.ring.multi.primary
      [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Secondary backend storage used by multi-client.
      # CLI flag: -compactor.ring.multi.secondary
      [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Mirror writes to the secondary store.
      # CLI flag: -compactor.ring.multi.mirror-enabled
      [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

      # Timeout for storing a value to the secondary store.
      # CLI flag: -compactor.ring.multi.mirror-timeout
      [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

  # Period at which to heartbeat to the ring.
  # CLI flag: -compactor.ring.heartbeat-period
  [heartbeat_period: &amp;lt;duration&amp;gt; | default = 15s]

  # The heartbeat timeout after which compactors are considered unhealthy within
  # the ring. 0 = never (timeout disabled).
  # CLI flag: -compactor.ring.heartbeat-timeout
  [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

  # File path where tokens are stored. If empty, tokens are not stored at
  # shutdown and restored at startup.
  # CLI flag: -compactor.ring.tokens-file-path
  [tokens_file_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # True to enable zone-awareness and replicate blocks across different
  # availability zones.
  # CLI flag: -compactor.ring.zone-awareness-enabled
  [zone_awareness_enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Instance ID to register in the ring.
  # CLI flag: -compactor.ring.instance-id
  [instance_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;lt;hostname&amp;gt;&amp;#34;]

  # Name of network interface to read address from.
  # CLI flag: -compactor.ring.instance-interface-names
  [instance_interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

  # Port to advertise in the ring (defaults to server.grpc-listen-port).
  # CLI flag: -compactor.ring.instance-port
  [instance_port: &amp;lt;int&amp;gt; | default = 0]

  # IP address to advertise in the ring.
  # CLI flag: -compactor.ring.instance-addr
  [instance_addr: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The availability zone where this instance is running. Required if
  # zone-awareness is enabled.
  # CLI flag: -compactor.ring.instance-availability-zone
  [instance_availability_zone: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Enable using a IPv6 instance address.
  # CLI flag: -compactor.ring.instance-enable-ipv6
  [instance_enable_ipv6: &amp;lt;boolean&amp;gt; | default = false]

# Number of tables that compactor will try to compact. Newer tables are chosen
# when this is less than the number of tables available.
# CLI flag: -compactor.tables-to-compact
[tables_to_compact: &amp;lt;int&amp;gt; | default = 0]

# Do not compact N latest tables. Together with -compactor.run-once and
# -compactor.tables-to-compact, this is useful when clearing compactor backlogs.
# CLI flag: -compactor.skip-latest-n-tables
[skip_latest_n_tables: &amp;lt;int&amp;gt; | default = 0]

# Experimental: Configuration to turn on and run horizontally scalable
# compactor. Supported modes - [disabled]: Keeps the horizontal scaling mode
# disabled. Locally runs all the functions of the compactor.[main]: Runs all
# functions of the compactor. Distributes work to workers where
# possible.[worker]: Runs the compactor in worker mode, only working on jobs
# built by the main compactor.
# CLI flag: -compactor.horizontal-scaling-mode
[horizontal_scaling_mode: &amp;lt;string&amp;gt; | default = &amp;#34;disabled&amp;#34;]

worker_config:
  # Number of sub-workers to run for concurrent processing of jobs.
  # CLI flag: -compactor.worker.num-sub-workers
  [num_sub_workers: &amp;lt;int&amp;gt; | default = 4]

jobs_config:
  deletion:
    # Object storage path prefix for storing deletion manifests.
    # CLI flag: -compactor.jobs.deletion.deletion-manifest-store-prefix
    [deletion_manifest_store_prefix: &amp;lt;string&amp;gt; | default = &amp;#34;__deletion_manifest__/&amp;#34;]

    # Maximum number of chunks to process concurrently in each worker.
    # CLI flag: -compactor.jobs.deletion.chunk-processing-concurrency
    [chunk_processing_concurrency: &amp;lt;int&amp;gt; | default = 3]

    # Maximum time to wait for a job before considering it failed and retrying.
    # CLI flag: -compactor.jobs.deletion.timeout
    [timeout: &amp;lt;duration&amp;gt; | default = 15m]

    # Maximum number of times to retry a failed or timed out job.
    # CLI flag: -compactor.jobs.deletion.max-retries
    [max_retries: &amp;lt;int&amp;gt; | default = 3]

# Object storage path prefix for storing deletion markers. The prefix must end
# with a forward slash(/). Leave empty to continue to store deletion markers on
# the local disk.
# CLI flag: -compactor.deletion-marker-object-store-prefix
[deletion_marker_object_store_prefix: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;consul&#34;&gt;consul&lt;/h3&gt;
&lt;p&gt;Configuration for a Consul client. Only applies if the selected kvstore is &lt;code&gt;consul&lt;/code&gt;. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;common.storage.ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;compactor.ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dataobj-consumer&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dataobj-consumer.partition-ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;distributor.ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;index-gateway.ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingest-limits&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingest-limits-frontend&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingester.partition-ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pattern-ingester&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;query-scheduler.ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ui.ring&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Hostname and port of Consul.
# CLI flag: -&amp;lt;prefix&amp;gt;.consul.hostname
[host: &amp;lt;string&amp;gt; | default = &amp;#34;localhost:8500&amp;#34;]

# ACL Token used to interact with Consul.
# CLI flag: -&amp;lt;prefix&amp;gt;.consul.acl-token
[acl_token: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# HTTP timeout when talking to Consul
# CLI flag: -&amp;lt;prefix&amp;gt;.consul.client-timeout
[http_client_timeout: &amp;lt;duration&amp;gt; | default = 20s]

# Enable consistent reads to Consul.
# CLI flag: -&amp;lt;prefix&amp;gt;.consul.consistent-reads
[consistent_reads: &amp;lt;boolean&amp;gt; | default = false]

# Rate limit when watching key or prefix in Consul, in requests per second. 0
# disables the rate limit.
# CLI flag: -&amp;lt;prefix&amp;gt;.consul.watch-rate-limit
[watch_rate_limit: &amp;lt;float&amp;gt; | default = 1]

# Burst size used in rate limit. Values less than 1 are treated as 1.
# CLI flag: -&amp;lt;prefix&amp;gt;.consul.watch-burst-size
[watch_burst_size: &amp;lt;int&amp;gt; | default = 1]

# Maximum duration to wait before retrying a Compare And Swap (CAS) operation.
# CLI flag: -&amp;lt;prefix&amp;gt;.consul.cas-retry-delay
[cas_retry_delay: &amp;lt;duration&amp;gt; | default = 1s]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;cos_storage_config&#34;&gt;cos_storage_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;cos_storage_config&lt;/code&gt; block configures the connection to IBM Cloud Object Storage (COS) backend. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;common.storage&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.storage&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Set this to `true` to force the request to use path-style addressing.
# CLI flag: -&amp;lt;prefix&amp;gt;.cos.force-path-style
[forcepathstyle: &amp;lt;boolean&amp;gt; | default = false]

# Comma separated list of bucket names to evenly distribute chunks over.
# CLI flag: -&amp;lt;prefix&amp;gt;.cos.buckets
[bucketnames: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# COS Endpoint to connect to.
# CLI flag: -&amp;lt;prefix&amp;gt;.cos.endpoint
[endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# COS region to use.
# CLI flag: -&amp;lt;prefix&amp;gt;.cos.region
[region: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# COS HMAC Access Key ID.
# CLI flag: -&amp;lt;prefix&amp;gt;.cos.access-key-id
[access_key_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# COS HMAC Secret Access Key.
# CLI flag: -&amp;lt;prefix&amp;gt;.cos.secret-access-key
[secret_access_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

http_config:
  # The maximum amount of time an idle connection will be held open.
  # CLI flag: -&amp;lt;prefix&amp;gt;.cos.http.idle-conn-timeout
  [idle_conn_timeout: &amp;lt;duration&amp;gt; | default = 1m30s]

  # If non-zero, specifies the amount of time to wait for a server&amp;#39;s response
  # headers after fully writing the request.
  # CLI flag: -&amp;lt;prefix&amp;gt;.cos.http.response-header-timeout
  [response_header_timeout: &amp;lt;duration&amp;gt; | default = 0s]

# Configures back off when cos get Object.
backoff_config:
  # Minimum backoff time when cos get Object.
  # CLI flag: -&amp;lt;prefix&amp;gt;.cos.min-backoff
  [min_period: &amp;lt;duration&amp;gt; | default = 100ms]

  # Maximum backoff time when cos get Object.
  # CLI flag: -&amp;lt;prefix&amp;gt;.cos.max-backoff
  [max_period: &amp;lt;duration&amp;gt; | default = 3s]

  # Maximum number of times to retry when cos get Object.
  # CLI flag: -&amp;lt;prefix&amp;gt;.cos.max-retries
  [max_retries: &amp;lt;int&amp;gt; | default = 5]

# IAM API key to access COS.
# CLI flag: -&amp;lt;prefix&amp;gt;.cos.api-key
[api_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# COS service instance id to use.
# CLI flag: -&amp;lt;prefix&amp;gt;.cos.service-instance-id
[service_instance_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# IAM Auth Endpoint for authentication.
# CLI flag: -&amp;lt;prefix&amp;gt;.cos.auth-endpoint
[auth_endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;https://iam.cloud.ibm.com/identity/token&amp;#34;]

# Compute resource token file path.
# CLI flag: -&amp;lt;prefix&amp;gt;.cos.cr-token-file-path
[cr_token_file_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Name of the trusted profile.
# CLI flag: -&amp;lt;prefix&amp;gt;.cos.trusted-profile-name
[trusted_profile_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# ID of the trusted profile.
# CLI flag: -&amp;lt;prefix&amp;gt;.cos.trusted-profile-id
[trusted_profile_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;distributor&#34;&gt;distributor&lt;/h3&gt;
&lt;p&gt;Configures the &lt;code&gt;distributor&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;ring:
  kvstore:
    # Backend storage to use for the ring. Supported values are: consul, etcd,
    # inmemory, memberlist, multi.
    # CLI flag: -distributor.ring.store
    [store: &amp;lt;string&amp;gt; | default = &amp;#34;consul&amp;#34;]

    # The prefix for the keys in the store. Should end with a /.
    # CLI flag: -distributor.ring.prefix
    [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

    # Configuration for a Consul client. Only applies if the selected kvstore is
    # consul.
    # The CLI flags prefix for this block configuration is: distributor.ring
    [consul: &amp;lt;consul&amp;gt;]

    # Configuration for an ETCD v3 client. Only applies if the selected kvstore
    # is etcd.
    # The CLI flags prefix for this block configuration is: distributor.ring
    [etcd: &amp;lt;etcd&amp;gt;]

    multi:
      # Primary backend storage used by multi-client.
      # CLI flag: -distributor.ring.multi.primary
      [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Secondary backend storage used by multi-client.
      # CLI flag: -distributor.ring.multi.secondary
      [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Mirror writes to the secondary store.
      # CLI flag: -distributor.ring.multi.mirror-enabled
      [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

      # Timeout for storing a value to the secondary store.
      # CLI flag: -distributor.ring.multi.mirror-timeout
      [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

  # Period at which to heartbeat to the ring.
  # CLI flag: -distributor.ring.heartbeat-period
  [heartbeat_period: &amp;lt;duration&amp;gt; | default = 5s]

  # The heartbeat timeout after which distributors are considered unhealthy
  # within the ring. 0 = never (timeout disabled).
  # CLI flag: -distributor.ring.heartbeat-timeout
  [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

  # Name of network interface to read address from.
  # CLI flag: -distributor.ring.instance-interface-names
  [instance_interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

# Number of workers to push batches to ingesters.
# CLI flag: -distributor.push-worker-count
[push_worker_count: &amp;lt;int&amp;gt; | default = 256]

# The maximum size of a received message.
# CLI flag: -distributor.max-recv-msg-size
[max_recv_msg_size: &amp;lt;int&amp;gt; | default = 104857600]

# The maximum size of a decompressed message. Defaults to 50x max-recv-msg-size.
# CLI flag: -distributor.max-decompressed-size
[max_decompressed_size: &amp;lt;int&amp;gt; | default = 5242880000]

rate_store:
  # The max number of concurrent requests to make to ingester stream apis
  # CLI flag: -distributor.rate-store.max-request-parallelism
  [max_request_parallelism: &amp;lt;int&amp;gt; | default = 200]

  # The interval on which distributors will update current stream rates from
  # ingesters
  # CLI flag: -distributor.rate-store.stream-rate-update-interval
  [stream_rate_update_interval: &amp;lt;duration&amp;gt; | default = 1s]

  # Timeout for communication between distributors and any given ingester when
  # updating rates
  # CLI flag: -distributor.rate-store.ingester-request-timeout
  [ingester_request_timeout: &amp;lt;duration&amp;gt; | default = 500ms]

  # If enabled, detailed logs and spans will be emitted.
  # CLI flag: -distributor.rate-store.debug
  [debug: &amp;lt;boolean&amp;gt; | default = false]

# Customize the logging of write failures.
write_failures_logging:
  # Log volume allowed (per second). Default: 1KB.
  # CLI flag: -distributor.write-failures-logging.rate
  [rate: &amp;lt;int&amp;gt; | default = 1KB]

  # Whether a insight=true key should be logged or not. Default: false.
  # CLI flag: -distributor.write-failures-logging.add-insights-label
  [add_insights_label: &amp;lt;boolean&amp;gt; | default = false]

otlp_config:
  # List of default otlp resource attributes to be picked as index labels
  # CLI flag: -distributor.otlp.default_resource_attributes_as_index_labels
  [default_resource_attributes_as_index_labels: &amp;lt;list of strings&amp;gt; | 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]]

# Default policy stream mappings that are merged with per-tenant mappings.
[default_policy_stream_mappings: &amp;lt;map of string to list of PriorityStreams&amp;gt;]

# Enable writes to Kafka during Push requests.
# CLI flag: -distributor.kafka-writes-enabled
[kafka_writes_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Enable writes to Ingesters during Push requests. Defaults to true.
# CLI flag: -distributor.ingester-writes-enabled
[ingester_writes_enabled: &amp;lt;boolean&amp;gt; | default = true]

# Enable checking limits against the ingest-limits service. Defaults to false.
# CLI flag: -distributor.ingest-limits-enabled
[ingest_limits_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Enable dry-run mode where limits are checked the ingest-limits service, but
# not enforced. Defaults to false.
# CLI flag: -distributor.ingest-limits-dry-run-enabled
[ingest_limits_dry_run_enabled: &amp;lt;boolean&amp;gt; | default = false]

dataobj_tee:
  # Enable data object tee.
  # CLI flag: -distributor.dataobj-tee.enabled
  [enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Topic for data object tee.
  # CLI flag: -distributor.dataobj-tee.topic
  [topic: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Maximum number of bytes to buffer.
  # CLI flag: -distributor.dataobj-tee.max-buffered-bytes
  [max_buffered_bytes: &amp;lt;int&amp;gt; | default = 104857600]

  # The per-tenant partition rate (bytes/sec).
  # CLI flag: -distributor.dataobj-tee.per-partition-rate-bytes
  [per_partition_rate_bytes: &amp;lt;int&amp;gt; | default = 1048576]

  # Enables optional debug metrics.
  # CLI flag: -distributor.dataobj-tee.debug-metrics-enabled
  [debug_metrics_enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Duration to accumulate rate updates before sending to limits frontend. Set
  # to 0 to disable batching.
  # CLI flag: -distributor.dataobj-tee.rate-batch-window
  [rate_batch_window: &amp;lt;duration&amp;gt; | default = 0s]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;etcd&#34;&gt;etcd&lt;/h3&gt;
&lt;p&gt;Configuration for an ETCD v3 client. Only applies if the selected kvstore is &lt;code&gt;etcd&lt;/code&gt;. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;common.storage.ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;compactor.ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dataobj-consumer&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dataobj-consumer.partition-ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;distributor.ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;index-gateway.ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingest-limits&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingest-limits-frontend&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingester.partition-ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pattern-ingester&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;query-scheduler.ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.ring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ui.ring&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# The etcd endpoints to connect to.
# CLI flag: -&amp;lt;prefix&amp;gt;.etcd.endpoints
[endpoints: &amp;lt;list of strings&amp;gt; | default = []]

# The dial timeout for the etcd connection.
# CLI flag: -&amp;lt;prefix&amp;gt;.etcd.dial-timeout
[dial_timeout: &amp;lt;duration&amp;gt; | default = 10s]

# The maximum number of retries to do for failed ops.
# CLI flag: -&amp;lt;prefix&amp;gt;.etcd.max-retries
[max_retries: &amp;lt;int&amp;gt; | default = 10]

# Enable TLS.
# CLI flag: -&amp;lt;prefix&amp;gt;.etcd.tls-enabled
[tls_enabled: &amp;lt;boolean&amp;gt; | default = false]

# The TLS configuration.
# The CLI flags prefix for this block configuration is: ui.ring.etcd
[&amp;lt;tls_config&amp;gt;]

# Etcd username.
# CLI flag: -&amp;lt;prefix&amp;gt;.etcd.username
[username: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Etcd password.
# CLI flag: -&amp;lt;prefix&amp;gt;.etcd.password
[password: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;frontend&#34;&gt;frontend&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;frontend&lt;/code&gt; block configures the Loki query-frontend.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Log queries that are slower than the specified duration. Set to 0 to disable.
# Set to &amp;lt; 0 to enable on all queries.
# CLI flag: -frontend.log-queries-longer-than
[log_queries_longer_than: &amp;lt;duration&amp;gt; | default = 0s]

# Comma-separated list of request header names to include in query logs. Applies
# to both query stats and slow queries logs.
# CLI flag: -frontend.log-query-request-headers
[log_query_request_headers: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Max body size for downstream prometheus.
# CLI flag: -frontend.max-body-size
[max_body_size: &amp;lt;int&amp;gt; | default = 10485760]

# True to enable query statistics tracking. When enabled, a message with some
# statistics is logged for every query.
# CLI flag: -frontend.query-stats-enabled
[query_stats_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Maximum number of outstanding requests per tenant per frontend; requests
# beyond this error with HTTP 429.
# CLI flag: -querier.max-outstanding-requests-per-tenant
[max_outstanding_per_tenant: &amp;lt;int&amp;gt; | default = 2048]

# In the event a tenant is repeatedly sending queries that lead the querier to
# crash or be killed due to an out-of-memory error, the crashed querier will be
# disconnected from the query frontend and a new querier will be immediately
# assigned to the tenant’s shard. This invalidates the assumption that shuffle
# sharding can be used to reduce the impact on tenants. This option mitigates
# the impact by configuring a delay between when a querier disconnects because
# of a crash and when the crashed querier is actually removed from the tenant&amp;#39;s
# shard.
# CLI flag: -query-frontend.querier-forget-delay
[querier_forget_delay: &amp;lt;duration&amp;gt; | default = 0s]

# DNS hostname used for finding query-schedulers.
# CLI flag: -frontend.scheduler-address
[scheduler_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# How often to resolve the scheduler-address, in order to look for new
# query-scheduler instances. Also used to determine how often to poll the
# scheduler-ring for addresses if the scheduler-ring is configured.
# CLI flag: -frontend.scheduler-dns-lookup-period
[scheduler_dns_lookup_period: &amp;lt;duration&amp;gt; | default = 10s]

# Number of concurrent workers forwarding queries to single query-scheduler.
# CLI flag: -frontend.scheduler-worker-concurrency
[scheduler_worker_concurrency: &amp;lt;int&amp;gt; | default = 5]

# The grpc_client block configures the gRPC client used to communicate between a
# client and server component in Loki.
# The CLI flags prefix for this block configuration is:
# frontend.grpc-client-config
[grpc_client_config: &amp;lt;grpc_client&amp;gt;]

# Time to wait for inflight requests to finish before forcefully shutting down.
# This needs to be aligned with the query timeout and the graceful termination
# period of the process orchestrator.
# CLI flag: -frontend.graceful-shutdown-timeout
[graceful_shutdown_timeout: &amp;lt;duration&amp;gt; | default = 5m]

# Name of network interface to read address from. This address is sent to
# query-scheduler and querier, which uses it to send the query response back to
# query-frontend.
# CLI flag: -frontend.instance-interface-names
[instance_interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

# Enable using a IPv6 instance address (default false).
# CLI flag: -frontend.instance-enable-ipv6
[instance_enable_ipv6: &amp;lt;boolean&amp;gt; | default = false]

# Defines the encoding for requests to and responses from the scheduler and
# querier. Can be &amp;#39;json&amp;#39; or &amp;#39;protobuf&amp;#39; (defaults to &amp;#39;json&amp;#39;).
# CLI flag: -frontend.encoding
[encoding: &amp;lt;string&amp;gt; | default = &amp;#34;json&amp;#34;]

# Compress HTTP responses.
# CLI flag: -querier.compress-http-responses
[compress_responses: &amp;lt;boolean&amp;gt; | default = true]

# URL of downstream Loki.
# CLI flag: -frontend.downstream-url
[downstream_url: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# URL of querier for tail proxy.
# CLI flag: -frontend.tail-proxy-url
[tail_proxy_url: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# The TLS configuration.
# The CLI flags prefix for this block configuration is: frontend.tail-tls-config
[tail_tls_config: &amp;lt;tls_config&amp;gt;]

# Support &amp;#39;application/vnd.apache.parquet&amp;#39; content type in HTTP responses.
[support_parquet_encoding: &amp;lt;boolean&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;frontend_worker&#34;&gt;frontend_worker&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;frontend_worker&lt;/code&gt; configures the worker - running within the Loki querier - picking up and executing queries enqueued by the query-frontend.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Address of query frontend service, in host:port format. If
# -querier.scheduler-address is set as well, querier will use scheduler instead.
# Only one of -querier.frontend-address or -querier.scheduler-address can be
# set. If neither is set, queries are only received via HTTP endpoint.
# CLI flag: -querier.frontend-address
[frontend_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Hostname (and port) of scheduler that querier will periodically resolve,
# connect to and receive queries from. Only one of -querier.frontend-address or
# -querier.scheduler-address can be set. If neither is set, queries are only
# received via HTTP endpoint.
# CLI flag: -querier.scheduler-address
[scheduler_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# How often to query DNS for query-frontend or query-scheduler address. Also
# used to determine how often to poll the scheduler-ring for addresses if the
# scheduler-ring is configured.
# CLI flag: -querier.dns-lookup-period
[dns_lookup_duration: &amp;lt;duration&amp;gt; | default = 3s]

# Querier ID, sent to frontend service to identify requests from the same
# querier. Defaults to hostname.
# CLI flag: -querier.id
[id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Configures the querier gRPC client used to communicate with the
# query-frontend. This can&amp;#39;t be used in conjunction with &amp;#39;grpc_client_config&amp;#39;.
# The CLI flags prefix for this block configuration is:
# querier.frontend-grpc-client
[query_frontend_grpc_client: &amp;lt;grpc_client&amp;gt;]

# Configures the querier gRPC client used to communicate with the query-frontend
# and with the query-scheduler. This can&amp;#39;t be used in conjunction with
# &amp;#39;query_frontend_grpc_client&amp;#39; or &amp;#39;query_scheduler_grpc_client&amp;#39;.
# The CLI flags prefix for this block configuration is: querier.frontend-client
[grpc_client_config: &amp;lt;grpc_client&amp;gt;]

# Configures the querier gRPC client used to communicate with the
# query-scheduler. This can&amp;#39;t be used in conjunction with &amp;#39;grpc_client_config&amp;#39;.
# The CLI flags prefix for this block configuration is:
# querier.scheduler-grpc-client
[query_scheduler_grpc_client: &amp;lt;grpc_client&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;gcs_storage_config&#34;&gt;gcs_storage_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;gcs_storage_config&lt;/code&gt; block configures the connection to Google Cloud Storage object storage backend. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;common.storage&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.storage&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Name of GCS bucket. Please refer to
# https://cloud.google.com/docs/authentication/production for more information
# about how to configure authentication.
# CLI flag: -&amp;lt;prefix&amp;gt;.gcs.bucketname
[bucket_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Custom GCS endpoint URL.
# CLI flag: -&amp;lt;prefix&amp;gt;.gcs.endpoint
[endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Service account key content in JSON format, refer to
# https://cloud.google.com/iam/docs/creating-managing-service-account-keys for
# creation.
# CLI flag: -&amp;lt;prefix&amp;gt;.gcs.service-account
[service_account: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# The size of the buffer that GCS client for each PUT request. 0 to disable
# buffering.
# CLI flag: -&amp;lt;prefix&amp;gt;.gcs.chunk-buffer-size
[chunk_buffer_size: &amp;lt;int&amp;gt; | default = 0]

# The duration after which the requests to GCS should be timed out.
# CLI flag: -&amp;lt;prefix&amp;gt;.gcs.request-timeout
[request_timeout: &amp;lt;duration&amp;gt; | default = 0s]

# Enable OpenCensus (OC) instrumentation for all requests.
# CLI flag: -&amp;lt;prefix&amp;gt;.gcs.enable-opencensus
[enable_opencensus: &amp;lt;boolean&amp;gt; | default = true]

# Enable HTTP2 connections.
# CLI flag: -&amp;lt;prefix&amp;gt;.gcs.enable-http2
[enable_http2: &amp;lt;boolean&amp;gt; | default = true]

# Enable automatic retries of failed idempotent requests.
# CLI flag: -&amp;lt;prefix&amp;gt;.gcs.enable-retries
[enable_retries: &amp;lt;boolean&amp;gt; | default = true]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;grpc_client&#34;&gt;grpc_client&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;grpc_client&lt;/code&gt; block configures the gRPC client used to communicate between a client and server component in Loki. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;bigtable&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bloom-build.builder.grpc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bloom-gateway-client.grpc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;boltdb.shipper.index-gateway-client.grpc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;compactor.grpc-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.grpc-client-config&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingest-limits-frontend-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingest-limits-frontend.limits-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingester.client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pattern-ingester.client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;querier.frontend-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;querier.frontend-grpc-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;querier.scheduler-grpc-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;query-scheduler.grpc-client-config&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tsdb.shipper.index-gateway-client.grpc&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# gRPC client max receive message size (bytes).
# CLI flag: -&amp;lt;prefix&amp;gt;.grpc-max-recv-msg-size
[max_recv_msg_size: &amp;lt;int&amp;gt; | default = 104857600]

# gRPC client max send message size (bytes).
# CLI flag: -&amp;lt;prefix&amp;gt;.grpc-max-send-msg-size
[max_send_msg_size: &amp;lt;int&amp;gt; | default = 104857600]

# Use compression when sending messages. Supported values are: &amp;#39;gzip&amp;#39;, &amp;#39;snappy&amp;#39;
# and &amp;#39;&amp;#39; (disable compression)
# CLI flag: -&amp;lt;prefix&amp;gt;.grpc-compression
[grpc_compression: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Rate limit for gRPC client; 0 means disabled.
# CLI flag: -&amp;lt;prefix&amp;gt;.grpc-client-rate-limit
[rate_limit: &amp;lt;float&amp;gt; | default = 0]

# Rate limit burst for gRPC client.
# CLI flag: -&amp;lt;prefix&amp;gt;.grpc-client-rate-limit-burst
[rate_limit_burst: &amp;lt;int&amp;gt; | default = 0]

# Enable backoff and retry when we hit rate limits.
# CLI flag: -&amp;lt;prefix&amp;gt;.backoff-on-ratelimits
[backoff_on_ratelimits: &amp;lt;boolean&amp;gt; | default = false]

backoff_config:
  # Minimum delay when backing off.
  # CLI flag: -&amp;lt;prefix&amp;gt;.backoff-min-period
  [min_period: &amp;lt;duration&amp;gt; | default = 100ms]

  # Maximum delay when backing off.
  # CLI flag: -&amp;lt;prefix&amp;gt;.backoff-max-period
  [max_period: &amp;lt;duration&amp;gt; | default = 10s]

  # Number of times to backoff and retry before failing.
  # CLI flag: -&amp;lt;prefix&amp;gt;.backoff-retries
  [max_retries: &amp;lt;int&amp;gt; | default = 10]

# Initial stream window size. Values less than the default are not supported and
# are ignored. Setting this to a value other than the default disables the BDP
# estimator.
# CLI flag: -&amp;lt;prefix&amp;gt;.initial-stream-window-size
[initial_stream_window_size: &amp;lt;int&amp;gt; | default = 63KiB1023B]

# Initial connection window size. Values less than the default are not supported
# and are ignored. Setting this to a value other than the default disables the
# BDP estimator.
# CLI flag: -&amp;lt;prefix&amp;gt;.initial-connection-window-size
[initial_connection_window_size: &amp;lt;int&amp;gt; | default = 63KiB1023B]

# Enable TLS in the gRPC client. This flag needs to be enabled when any other
# TLS flag is set. If set to false, insecure connection to gRPC server will be
# used.
# CLI flag: -&amp;lt;prefix&amp;gt;.tls-enabled
[tls_enabled: &amp;lt;boolean&amp;gt; | default = false]

# The TLS configuration.
# The CLI flags prefix for this block configuration is:
# tsdb.shipper.index-gateway-client.grpc
[&amp;lt;tls_config&amp;gt;]

# The maximum amount of time to establish a connection. A value of 0 means
# default gRPC client connect timeout and backoff.
# CLI flag: -&amp;lt;prefix&amp;gt;.connect-timeout
[connect_timeout: &amp;lt;duration&amp;gt; | default = 5s]

# Initial backoff delay after first connection failure. Only relevant if
# ConnectTimeout &amp;gt; 0.
# CLI flag: -&amp;lt;prefix&amp;gt;.connect-backoff-base-delay
[connect_backoff_base_delay: &amp;lt;duration&amp;gt; | default = 1s]

# Maximum backoff delay when establishing a connection. Only relevant if
# ConnectTimeout &amp;gt; 0.
# CLI flag: -&amp;lt;prefix&amp;gt;.connect-backoff-max-delay
[connect_backoff_max_delay: &amp;lt;duration&amp;gt; | default = 5s]

cluster_validation:
  # Primary cluster validation label.
  # CLI flag: -&amp;lt;prefix&amp;gt;.cluster-validation.label
  [label: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;index_gateway&#34;&gt;index_gateway&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;index_gateway&lt;/code&gt; block configures the Loki index gateway server, responsible for serving index queries without the need to constantly interact with the object store.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Defines in which mode the index gateway server will operate (default to
# &amp;#39;simple&amp;#39;). It supports two modes:
# - &amp;#39;simple&amp;#39;: an index gateway server instance is responsible for handling,
# storing and returning requests for all indices for all tenants.
# - &amp;#39;ring&amp;#39;: an index gateway server instance is responsible for a subset of
# tenants instead of all tenants.
# CLI flag: -index-gateway.mode
[mode: &amp;lt;string&amp;gt; | default = &amp;#34;simple&amp;#34;]

# Defines the ring to be used by the index gateway servers and clients in case
# the servers are configured to run in &amp;#39;ring&amp;#39; mode. In case this isn&amp;#39;t
# configured, this block supports inheriting configuration from the common ring
# section.
ring:
  kvstore:
    # Backend storage to use for the ring. Supported values are: consul, etcd,
    # inmemory, memberlist, multi.
    # CLI flag: -index-gateway.ring.store
    [store: &amp;lt;string&amp;gt; | default = &amp;#34;consul&amp;#34;]

    # The prefix for the keys in the store. Should end with a /.
    # CLI flag: -index-gateway.ring.prefix
    [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

    # Configuration for a Consul client. Only applies if the selected kvstore is
    # consul.
    # The CLI flags prefix for this block configuration is: index-gateway.ring
    [consul: &amp;lt;consul&amp;gt;]

    # Configuration for an ETCD v3 client. Only applies if the selected kvstore
    # is etcd.
    # The CLI flags prefix for this block configuration is: index-gateway.ring
    [etcd: &amp;lt;etcd&amp;gt;]

    multi:
      # Primary backend storage used by multi-client.
      # CLI flag: -index-gateway.ring.multi.primary
      [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Secondary backend storage used by multi-client.
      # CLI flag: -index-gateway.ring.multi.secondary
      [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Mirror writes to the secondary store.
      # CLI flag: -index-gateway.ring.multi.mirror-enabled
      [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

      # Timeout for storing a value to the secondary store.
      # CLI flag: -index-gateway.ring.multi.mirror-timeout
      [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

  # Period at which to heartbeat to the ring.
  # CLI flag: -index-gateway.ring.heartbeat-period
  [heartbeat_period: &amp;lt;duration&amp;gt; | default = 15s]

  # The heartbeat timeout after which compactors are considered unhealthy within
  # the ring. 0 = never (timeout disabled).
  # CLI flag: -index-gateway.ring.heartbeat-timeout
  [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

  # File path where tokens are stored. If empty, tokens are not stored at
  # shutdown and restored at startup.
  # CLI flag: -index-gateway.ring.tokens-file-path
  [tokens_file_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # True to enable zone-awareness and replicate blocks across different
  # availability zones.
  # CLI flag: -index-gateway.ring.zone-awareness-enabled
  [zone_awareness_enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Deprecated: How many index gateway instances are assigned to each tenant.
  # Use -index-gateway.shard-size instead. The shard size is also a per-tenant
  # setting.
  # CLI flag: -replication-factor
  [replication_factor: &amp;lt;int&amp;gt; | default = 3]

  # Instance ID to register in the ring.
  # CLI flag: -index-gateway.ring.instance-id
  [instance_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;lt;hostname&amp;gt;&amp;#34;]

  # Name of network interface to read address from.
  # CLI flag: -index-gateway.ring.instance-interface-names
  [instance_interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

  # Port to advertise in the ring (defaults to server.grpc-listen-port).
  # CLI flag: -index-gateway.ring.instance-port
  [instance_port: &amp;lt;int&amp;gt; | default = 0]

  # IP address to advertise in the ring.
  # CLI flag: -index-gateway.ring.instance-addr
  [instance_addr: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The availability zone where this instance is running. Required if
  # zone-awareness is enabled.
  # CLI flag: -index-gateway.ring.instance-availability-zone
  [instance_availability_zone: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Enable using a IPv6 instance address.
  # CLI flag: -index-gateway.ring.instance-enable-ipv6
  [instance_enable_ipv6: &amp;lt;boolean&amp;gt; | default = false]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;ingester&#34;&gt;ingester&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;ingester&lt;/code&gt; block configures the ingester and how the ingester will register itself to a key value store.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Configures how the lifecycle of the ingester will operate and where it will
# register for discovery.
lifecycler:
  ring:
    kvstore:
      # Backend storage to use for the ring. Supported values are: consul, etcd,
      # inmemory, memberlist, multi.
      # CLI flag: -ring.store
      [store: &amp;lt;string&amp;gt; | default = &amp;#34;consul&amp;#34;]

      # The prefix for the keys in the store. Should end with a /.
      # CLI flag: -ring.prefix
      [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

      # Configuration for a Consul client. Only applies if the selected kvstore
      # is consul.
      [consul: &amp;lt;consul&amp;gt;]

      # Configuration for an ETCD v3 client. Only applies if the selected
      # kvstore is etcd.
      [etcd: &amp;lt;etcd&amp;gt;]

      multi:
        # Primary backend storage used by multi-client.
        # CLI flag: -multi.primary
        [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        # Secondary backend storage used by multi-client.
        # CLI flag: -multi.secondary
        [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        # Mirror writes to the secondary store.
        # CLI flag: -multi.mirror-enabled
        [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

        # Timeout for storing a value to the secondary store.
        # CLI flag: -multi.mirror-timeout
        [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

    # The heartbeat timeout after which ingesters are skipped for reads/writes.
    # CLI flag: -ring.heartbeat-timeout
    [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

    # The number of ingesters to write to and read from.
    # CLI flag: -distributor.replication-factor
    [replication_factor: &amp;lt;int&amp;gt; | default = 3]

    # True to enable the zone-awareness and replicate ingested samples across
    # different availability zones.
    # CLI flag: -distributor.zone-awareness-enabled
    [zone_awareness_enabled: &amp;lt;boolean&amp;gt; | default = false]

    # Comma-separated list of zones to exclude from the ring. Instances in
    # excluded zones will be filtered out from the ring.
    # CLI flag: -distributor.excluded-zones
    [excluded_zones: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Number of tokens for each ingester.
  # CLI flag: -ingester.num-tokens
  [num_tokens: &amp;lt;int&amp;gt; | default = 128]

  # Period at which to heartbeat to consul.
  # CLI flag: -ingester.heartbeat-period
  [heartbeat_period: &amp;lt;duration&amp;gt; | default = 5s]

  # Heartbeat timeout after which instance is assumed to be unhealthy.
  # CLI flag: -ingester.heartbeat-timeout
  [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

  # Observe tokens after generating to resolve collisions. Useful when using
  # gossiping ring.
  # CLI flag: -ingester.observe-period
  [observe_period: &amp;lt;duration&amp;gt; | default = 0s]

  # Period to wait for a claim from another member; will join automatically
  # after this.
  # CLI flag: -ingester.join-after
  [join_after: &amp;lt;duration&amp;gt; | default = 0s]

  # Minimum duration to wait after the internal readiness checks have passed but
  # before succeeding the readiness endpoint. This is used to slowdown
  # deployment controllers (eg. Kubernetes) after an instance is ready and
  # before they proceed with a rolling update, to give the rest of the cluster
  # instances enough time to receive ring updates.
  # CLI flag: -ingester.min-ready-duration
  [min_ready_duration: &amp;lt;duration&amp;gt; | default = 15s]

  # Name of network interface to read address from.
  # CLI flag: -ingester.lifecycler.interface
  [interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

  # Enable IPv6 support. Required to make use of IP addresses from IPv6
  # interfaces.
  # CLI flag: -ingester.enable-inet6
  [enable_inet6: &amp;lt;boolean&amp;gt; | default = false]

  # Duration to sleep for before exiting, to ensure metrics are scraped.
  # CLI flag: -ingester.final-sleep
  [final_sleep: &amp;lt;duration&amp;gt; | default = 0s]

  # File path where tokens are stored. If empty, tokens are not stored at
  # shutdown and restored at startup.
  # CLI flag: -ingester.tokens-file-path
  [tokens_file_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The availability zone where this instance is running.
  # CLI flag: -ingester.availability-zone
  [availability_zone: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Unregister from the ring upon clean shutdown. It can be useful to disable
  # for rolling restarts with consistent naming in conjunction with
  # -distributor.extend-writes=false.
  # CLI flag: -ingester.unregister-on-shutdown
  [unregister_on_shutdown: &amp;lt;boolean&amp;gt; | default = true]

  # When enabled the readiness probe succeeds only after all instances are
  # ACTIVE and healthy in the ring, otherwise only the instance itself is
  # checked. This option should be disabled if in your cluster multiple
  # instances can be rolled out simultaneously, otherwise rolling updates may be
  # slowed down.
  # CLI flag: -ingester.readiness-check-ring-health
  [readiness_check_ring_health: &amp;lt;boolean&amp;gt; | default = true]

  # IP address to advertise in the ring.
  # CLI flag: -ingester.lifecycler.addr
  [address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # port to advertise in consul (defaults to server.grpc-listen-port).
  # CLI flag: -ingester.lifecycler.port
  [port: &amp;lt;int&amp;gt; | default = 0]

  # ID to register in the ring.
  # CLI flag: -ingester.lifecycler.ID
  [id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;lt;hostname&amp;gt;&amp;#34;]

# How many flushes can happen concurrently from each stream.
# CLI flag: -ingester.concurrent-flushes
[concurrent_flushes: &amp;lt;int&amp;gt; | default = 32]

# How often should the ingester see if there are any blocks to flush. The first
# flush check is delayed by a random time up to 0.8x the flush check period.
# Additionally, there is &amp;#43;/- 1% jitter added to the interval.
# CLI flag: -ingester.flush-check-period
[flush_check_period: &amp;lt;duration&amp;gt; | default = 30s]

flush_op_backoff:
  # Minimum backoff period when a flush fails. Each concurrent flush has its own
  # backoff, see `ingester.concurrent-flushes`.
  # CLI flag: -ingester.flush-op-backoff-min-period
  [min_period: &amp;lt;duration&amp;gt; | default = 10s]

  # Maximum backoff period when a flush fails. Each concurrent flush has its own
  # backoff, see `ingester.concurrent-flushes`.
  # CLI flag: -ingester.flush-op-backoff-max-period
  [max_period: &amp;lt;duration&amp;gt; | default = 1m]

  # Maximum retries for failed flushes.
  # CLI flag: -ingester.flush-op-backoff-retries
  [max_retries: &amp;lt;int&amp;gt; | default = 10]

# The timeout for an individual flush. Will be retried up to
# `flush-op-backoff-retries` times.
# CLI flag: -ingester.flush-op-timeout
[flush_op_timeout: &amp;lt;duration&amp;gt; | default = 10m]

# How long chunks should be retained in-memory after they&amp;#39;ve been flushed.
# CLI flag: -ingester.chunks-retain-period
[chunk_retain_period: &amp;lt;duration&amp;gt; | default = 0s]

# How long chunks should sit in-memory with no updates before being flushed if
# they don&amp;#39;t hit the max block size. This means that half-empty chunks will
# still be flushed after a certain period as long as they receive no further
# activity.
# CLI flag: -ingester.chunks-idle-period
[chunk_idle_period: &amp;lt;duration&amp;gt; | default = 30m]

# The targeted _uncompressed_ size in bytes of a chunk block When this threshold
# is exceeded the head block will be cut and compressed inside the chunk.
# CLI flag: -ingester.chunks-block-size
[chunk_block_size: &amp;lt;int&amp;gt; | default = 262144]

# A target _compressed_ size in bytes for chunks. This is a desired size not an
# exact size, chunks may be slightly bigger or significantly smaller if they get
# flushed for other reasons (e.g. chunk_idle_period). A value of 0 creates
# chunks with a fixed 10 blocks, a non zero value will create chunks with a
# variable number of blocks to meet the target size.
# CLI flag: -ingester.chunk-target-size
[chunk_target_size: &amp;lt;int&amp;gt; | default = 1572864]

# The algorithm to use for compressing chunk. (none, gzip, lz4-64k, snappy,
# lz4-256k, lz4-1M, lz4, flate, zstd)
# CLI flag: -ingester.chunk-encoding
[chunk_encoding: &amp;lt;string&amp;gt; | default = &amp;#34;gzip&amp;#34;]

# The maximum duration of a timeseries chunk in memory. If a timeseries runs for
# longer than this, the current chunk will be flushed to the store and a new
# chunk created.
# CLI flag: -ingester.max-chunk-age
[max_chunk_age: &amp;lt;duration&amp;gt; | default = 2h]

# Forget about ingesters having heartbeat timestamps older than
# `ring.kvstore.heartbeat_timeout`. This is equivalent to clicking on the
# `/ring` `forget` button in the UI: the ingester is removed from the ring. This
# is a useful setting when you are sure that an unhealthy node won&amp;#39;t return. An
# example is when not using stateful sets or the equivalent. Use
# `memberlist.rejoin_interval` &amp;gt; 0 to handle network partition cases when using
# a memberlist.
# CLI flag: -ingester.autoforget-unhealthy
[autoforget_unhealthy: &amp;lt;boolean&amp;gt; | default = false]

# Parameters used to synchronize ingesters to cut chunks at the same moment.
# Sync period is used to roll over incoming entry to a new chunk. If chunk&amp;#39;s
# utilization isn&amp;#39;t high enough (eg. less than 50% when sync_min_utilization is
# set to 0.5), then this chunk rollover doesn&amp;#39;t happen.
# CLI flag: -ingester.sync-period
[sync_period: &amp;lt;duration&amp;gt; | default = 1h]

# Minimum utilization of chunk when doing synchronization.
# CLI flag: -ingester.sync-min-utilization
[sync_min_utilization: &amp;lt;float&amp;gt; | default = 0.1]

# The maximum number of errors a stream will report to the user when a push
# fails. 0 to make unlimited.
# CLI flag: -ingester.max-ignored-stream-errors
[max_returned_stream_errors: &amp;lt;int&amp;gt; | default = 10]

# How far back should an ingester be allowed to query the store for data, for
# use only with boltdb-shipper/tsdb index and filesystem object store. -1 for
# infinite.
# CLI flag: -ingester.query-store-max-look-back-period
[query_store_max_look_back_period: &amp;lt;duration&amp;gt; | default = 0s]

# The ingester WAL (Write Ahead Log) records incoming logs and stores them on
# the local file systems in order to guarantee persistence of acknowledged data
# in the event of a process crash.
wal:
  # Enable writing of ingested data into WAL.
  # CLI flag: -ingester.wal-enabled
  [enabled: &amp;lt;boolean&amp;gt; | default = true]

  # Directory where the WAL data is stored and/or recovered from.
  # CLI flag: -ingester.wal-dir
  [dir: &amp;lt;string&amp;gt; | default = &amp;#34;wal&amp;#34;]

  # Interval at which checkpoints should be created.
  # CLI flag: -ingester.checkpoint-duration
  [checkpoint_duration: &amp;lt;duration&amp;gt; | default = 5m]

  # When WAL is enabled, should chunks be flushed to long-term storage on
  # shutdown.
  # CLI flag: -ingester.flush-on-shutdown
  [flush_on_shutdown: &amp;lt;boolean&amp;gt; | default = false]

  # Maximum memory size the WAL may use during replay. After hitting this, it
  # will flush data to storage before continuing. A unit suffix (KB, MB, GB) may
  # be applied.
  # CLI flag: -ingester.wal-replay-memory-ceiling
  [replay_memory_ceiling: &amp;lt;int&amp;gt; | default = 4GB]

  # Threshold for disk usage (0.0 to 1.0) at which the WAL will throttle
  # incoming writes. Set to 0 to disable throttling.
  # CLI flag: -ingester.wal-disk-full-threshold
  [disk_full_threshold: &amp;lt;float&amp;gt; | default = 0.9]

# Shard factor used in the ingesters for the in process reverse index. This MUST
# be evenly divisible by ALL schema shard factors or Loki will not start.
# CLI flag: -ingester.index-shards
[index_shards: &amp;lt;int&amp;gt; | default = 32]

# Maximum number of dropped streams to keep in memory during tailing.
# CLI flag: -ingester.tailer.max-dropped-streams
[max_dropped_streams: &amp;lt;int&amp;gt; | default = 10]

# Path where the shutdown marker file is stored. If not set and
# common.path_prefix is set then common.path_prefix will be used.
# CLI flag: -ingester.shutdown-marker-path
[shutdown_marker_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Interval at which the ingester ownedStreamService checks for changes in the
# ring to recalculate owned streams.
# CLI flag: -ingester.owned-streams-check-interval
[owned_streams_check_interval: &amp;lt;duration&amp;gt; | default = 30s]

# When enabled, the ingester skips stream count limit checks, delegating them
# entirely to the ingest-limits service (Thor). Requires ingest-limits service
# to be enabled.
# CLI flag: -ingester.delegate-stream-limits-enabled
[delegate_stream_limits_enabled: &amp;lt;boolean&amp;gt; | default = false]

kafka_ingestion:
  # Whether the kafka ingester is enabled.
  # CLI flag: -ingester.kafka-ingestion-enabled
  [enabled: &amp;lt;boolean&amp;gt; | default = false]

  partition_ring:
    # The key-value store used to share the hash ring across multiple instances.
    # This option needs be set on ingesters, distributors, queriers, and rulers
    # when running in microservices mode.
    kvstore:
      # Backend storage to use for the ring. Supported values are: consul, etcd,
      # inmemory, memberlist, multi.
      # CLI flag: -ingester.partition-ring.store
      [store: &amp;lt;string&amp;gt; | default = &amp;#34;memberlist&amp;#34;]

      # The prefix for the keys in the store. Should end with a /.
      # CLI flag: -ingester.partition-ring.prefix
      [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

      # Configuration for a Consul client. Only applies if the selected kvstore
      # is consul.
      # The CLI flags prefix for this block configuration is:
      # ingester.partition-ring
      [consul: &amp;lt;consul&amp;gt;]

      # Configuration for an ETCD v3 client. Only applies if the selected
      # kvstore is etcd.
      # The CLI flags prefix for this block configuration is:
      # ingester.partition-ring
      [etcd: &amp;lt;etcd&amp;gt;]

      multi:
        # Primary backend storage used by multi-client.
        # CLI flag: -ingester.partition-ring.multi.primary
        [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        # Secondary backend storage used by multi-client.
        # CLI flag: -ingester.partition-ring.multi.secondary
        [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

        # Mirror writes to the secondary store.
        # CLI flag: -ingester.partition-ring.multi.mirror-enabled
        [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

        # Timeout for storing a value to the secondary store.
        # CLI flag: -ingester.partition-ring.multi.mirror-timeout
        [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

    # Minimum number of owners to wait before a PENDING partition gets switched
    # to ACTIVE.
    # CLI flag: -ingester.partition-ring.min-partition-owners-count
    [min_partition_owners_count: &amp;lt;int&amp;gt; | default = 1]

    # How long the minimum number of owners are enforced before a PENDING
    # partition gets switched to ACTIVE.
    # CLI flag: -ingester.partition-ring.min-partition-owners-duration
    [min_partition_owners_duration: &amp;lt;duration&amp;gt; | default = 10s]

    # How long to wait before an INACTIVE partition is eligible for deletion.
    # The partition is deleted only if it has been in INACTIVE state for at
    # least the configured duration and it has no owners registered. A value of
    # 0 disables partitions deletion.
    # CLI flag: -ingester.partition-ring.delete-inactive-partition-after
    [delete_inactive_partition_after: &amp;lt;duration&amp;gt; | default = 13h]

    # Experimental: The size of the cache used for shuffle sharding. If zero or
    # negative, an unbounded cache is used. If positive, an LRU cache with the
    # specified size is used.
    # CLI flag: -ingester.partition-ring.shuffle-shard-cache-size
    [shuffle_shard_cache_size: &amp;lt;int&amp;gt; | default = 0]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;ingester_client&#34;&gt;ingester_client&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;ingester_client&lt;/code&gt; block configures how the distributor will connect to ingesters. Only appropriate when running all components, the distributor, or the querier.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Configures how connections are pooled.
pool_config:
  # How frequently to clean up clients for ingesters that have gone away.
  # CLI flag: -distributor.client-cleanup-period
  [client_cleanup_period: &amp;lt;duration&amp;gt; | default = 15s]

  # Run a health check on each ingester client during periodic cleanup.
  # CLI flag: -distributor.health-check-ingesters
  [health_check_ingesters: &amp;lt;boolean&amp;gt; | default = true]

  # How quickly a dead client will be removed after it has been detected to
  # disappear. Set this to a value to allow time for a secondary health check to
  # recover the missing client.
  # CLI flag: -ingester.client.healthcheck-timeout
  [remote_timeout: &amp;lt;duration&amp;gt; | default = 1s]

# The remote request timeout on the client side.
# CLI flag: -ingester.client.timeout
[remote_timeout: &amp;lt;duration&amp;gt; | default = 5s]

# Configures how the gRPC connection to ingesters work as a client.
# The CLI flags prefix for this block configuration is: ingester.client
[grpc_client_config: &amp;lt;grpc_client&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;limits_config&#34;&gt;limits_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;limits_config&lt;/code&gt; block configures global and per-tenant limits in Loki. The values here can be overridden in the &lt;code&gt;overrides&lt;/code&gt; section of the runtime_config file&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Whether the ingestion rate limit should be applied individually to each
# distributor instance (local), or evenly shared across the cluster (global).
# The ingestion rate strategy cannot be overridden on a per-tenant basis.
# - local: enforces the limit on a per distributor basis. The actual effective
# rate limit will be N times higher, where N is the number of distributor
# replicas.
# - global: enforces the limit globally, configuring a per-distributor local
# rate limiter as &amp;#39;ingestion_rate / N&amp;#39;, where N is the number of distributor
# replicas (it&amp;#39;s automatically adjusted if the number of replicas change). The
# global strategy requires the distributors to form their own ring, which is
# used to keep track of the current number of healthy distributor replicas.
# CLI flag: -distributor.ingestion-rate-limit-strategy
[ingestion_rate_strategy: &amp;lt;string&amp;gt; | default = &amp;#34;global&amp;#34;]

# Per-user ingestion rate limit in sample size per second. Sample size includes
# size of the logs line and the size of structured metadata labels. Units in MB.
# CLI flag: -distributor.ingestion-rate-limit-mb
[ingestion_rate_mb: &amp;lt;float&amp;gt; | default = 4]

# Per-user allowed ingestion burst size (in sample size). Units in MB. The burst
# size refers to the per-distributor local rate limiter even in the case of the
# &amp;#39;global&amp;#39; strategy, and should be set at least to the maximum logs size
# expected in a single push request.
# CLI flag: -distributor.ingestion-burst-size-mb
[ingestion_burst_size_mb: &amp;lt;float&amp;gt; | default = 6]

# Maximum length accepted for label names.
# CLI flag: -validation.max-length-label-name
[max_label_name_length: &amp;lt;int&amp;gt; | default = 1024]

# Maximum length accepted for label value. This setting also applies to the
# metric name.
# CLI flag: -validation.max-length-label-value
[max_label_value_length: &amp;lt;int&amp;gt; | default = 2048]

# Maximum number of label names per series.
# CLI flag: -validation.max-label-names-per-series
[max_label_names_per_series: &amp;lt;int&amp;gt; | default = 15]

# Whether or not old samples will be rejected.
# CLI flag: -validation.reject-old-samples
[reject_old_samples: &amp;lt;boolean&amp;gt; | default = true]

# Maximum accepted sample age before rejecting.
# CLI flag: -validation.reject-old-samples.max-age
[reject_old_samples_max_age: &amp;lt;duration&amp;gt; | default = 1w]

# Duration which table will be created/deleted before/after it&amp;#39;s needed; we
# won&amp;#39;t accept sample from before this time.
# CLI flag: -validation.create-grace-period
[creation_grace_period: &amp;lt;duration&amp;gt; | default = 10m]

# Maximum line size on ingestion path. Example: 256kb. Any log line exceeding
# this limit will be discarded unless `distributor.max-line-size-truncate` is
# set, in which case it is truncated rather than discarded completely. There is
# no limit when set to 0.
# CLI flag: -distributor.max-line-size
[max_line_size: &amp;lt;int&amp;gt; | default = 256KB]

# Whether to truncate lines that exceed max_line_size.
# CLI flag: -distributor.max-line-size-truncate
[max_line_size_truncate: &amp;lt;boolean&amp;gt; | default = false]

# Identifier that is added at the end of a truncated log line.
# CLI flag: -distributor.max-line-size-truncate-identifier
[max_line_size_truncate_identifier: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Alter the log line timestamp during ingestion when the timestamp is the same
# as the previous entry for the same stream. When enabled, if a log line in a
# push request has the same timestamp as the previous line for the same stream,
# one nanosecond is added to the log line. This will preserve the received order
# of log lines with the exact same timestamp when they are queried, by slightly
# altering their stored timestamp. NOTE: This is imperfect, because Loki accepts
# out of order writes, and another push request for the same stream could
# contain duplicate timestamps to existing entries and they will not be
# incremented.
# CLI flag: -validation.increment-duplicate-timestamps
[increment_duplicate_timestamp: &amp;lt;boolean&amp;gt; | default = false]

# Simulated latency to add to push requests. Used for testing. Set to 0s to
# disable.
# CLI flag: -limits.simulated-push-latency
[simulated_push_latency: &amp;lt;duration&amp;gt; | default = 0s]

# Enable experimental support for running multiple query variants over the same
# underlying data. For example, running both a rate() and count_over_time()
# query over the same range selector.
# CLI flag: -limits.enable-multi-variant-queries
[enable_multi_variant_queries: &amp;lt;boolean&amp;gt; | default = false]

# Experimental: Detect fields from stream labels, structured metadata, or
# json/logfmt formatted log line and put them into structured metadata of the
# log entry.
discover_generic_fields:
  [fields: &amp;lt;map of string to list of strings&amp;gt;]

# If no service_name label exists, Loki maps a single label from the configured
# list to service_name. If none of the configured labels exist in the stream,
# label is set to unknown_service. Empty list disables setting the label.
# CLI flag: -validation.discover-service-name
[discover_service_name: &amp;lt;list of strings&amp;gt; | default = [service app application app_name name app_kubernetes_io_name container container_name k8s_container_name component workload job k8s_job_name]]

# Discover and add log levels during ingestion, if not present already. Levels
# would be added to Structured Metadata with name
# level/LEVEL/Level/Severity/severity/SEVERITY/lvl/LVL/Lvl (case-sensitive) and
# one of the values from &amp;#39;trace&amp;#39;, &amp;#39;debug&amp;#39;, &amp;#39;info&amp;#39;, &amp;#39;warn&amp;#39;, &amp;#39;error&amp;#39;, &amp;#39;critical&amp;#39;,
# &amp;#39;fatal&amp;#39; (case insensitive).
# CLI flag: -validation.discover-log-levels
[discover_log_levels: &amp;lt;boolean&amp;gt; | default = true]

# Field name to use for log levels. If not set, log level would be detected
# based on pre-defined labels as mentioned above.
# CLI flag: -validation.log-level-fields
[log_level_fields: &amp;lt;list of strings&amp;gt; | default = [level LEVEL Level log.level severity SEVERITY Severity SeverityText lvl LVL Lvl severity_text Severity_Text SEVERITY_TEXT]]

# Maximum depth to search for log level fields in JSON logs. A value of 0 or
# less means unlimited depth. Default is 2 which searches the first 2 levels of
# the JSON object.
# CLI flag: -validation.log-level-from-json-max-depth
[log_level_from_json_max_depth: &amp;lt;int&amp;gt; | default = 2]

# When true an ingester takes into account only the streams that it owns
# according to the ring while applying the stream limit.
# CLI flag: -ingester.use-owned-stream-count
[use_owned_stream_count: &amp;lt;boolean&amp;gt; | default = false]

# Maximum number of active streams per user, per ingester. 0 to disable.
# CLI flag: -ingester.max-streams-per-user
[max_streams_per_user: &amp;lt;int&amp;gt; | default = 0]

# Maximum number of active streams per user, across the cluster. 0 to disable.
# When the global limit is enabled, each ingester is configured with a dynamic
# local limit based on the replication factor and the current number of healthy
# ingesters, and is kept updated whenever the number of ingesters change.
# CLI flag: -ingester.max-global-streams-per-user
[max_global_streams_per_user: &amp;lt;int&amp;gt; | default = 5000]

# Deprecated. When true, out-of-order writes are accepted.
# CLI flag: -ingester.unordered-writes
[unordered_writes: &amp;lt;boolean&amp;gt; | default = true]

# Maximum byte rate per second per stream, also expressible in human readable
# forms (1MB, 256KB, etc).
# CLI flag: -ingester.per-stream-rate-limit
[per_stream_rate_limit: &amp;lt;int&amp;gt; | default = 3MB]

# Maximum burst bytes per stream, also expressible in human readable forms (1MB,
# 256KB, etc). This is how far above the rate limit a stream can &amp;#39;burst&amp;#39; before
# the stream is limited.
# CLI flag: -ingester.per-stream-rate-limit-burst
[per_stream_rate_limit_burst: &amp;lt;int&amp;gt; | default = 15MB]

# Maximum number of chunks that can be fetched in a single query.
# CLI flag: -store.query-chunk-limit
[max_chunks_per_query: &amp;lt;int&amp;gt; | default = 2000000]

# Limit the maximum of unique series that is returned by a metric query. When
# the limit is reached an error is returned.
# CLI flag: -querier.max-query-series
[max_query_series: &amp;lt;int&amp;gt; | default = 500]

# Limit how far back in time series data and metadata can be queried, up until
# lookback duration ago. This limit is enforced in the query frontend, the
# querier and the ruler. If the requested time range is outside the allowed
# range, the request will not fail, but will be modified to only query data
# within the allowed time range. The default value of 0 does not set a limit.
# CLI flag: -querier.max-query-lookback
[max_query_lookback: &amp;lt;duration&amp;gt; | default = 0s]

# The limit to length of chunk store queries. 0 to disable.
# CLI flag: -store.max-query-length
[max_query_length: &amp;lt;duration&amp;gt; | default = 30d1h]

# Limit the length of the [range] inside a range query. Default is 0 or
# unlimited
# CLI flag: -querier.max-query-range
[max_query_range: &amp;lt;duration&amp;gt; | default = 0s]

# Maximum number of queries that will be scheduled in parallel by the frontend.
# CLI flag: -querier.max-query-parallelism
[max_query_parallelism: &amp;lt;int&amp;gt; | default = 32]

# Maximum number of queries will be scheduled in parallel by the frontend for
# TSDB schemas.
# CLI flag: -querier.tsdb-max-query-parallelism
[tsdb_max_query_parallelism: &amp;lt;int&amp;gt; | default = 128]

# Target maximum number of bytes assigned to a single sharded query. Also
# expressible in human readable forms (1GB, etc). Note: This is a _target_ and
# not an absolute limit. The actual limit can be higher, but the query planner
# will try to build shards up to this limit.
# CLI flag: -querier.tsdb-max-bytes-per-shard
[tsdb_max_bytes_per_shard: &amp;lt;int&amp;gt; | default = 600MB]

# sharding strategy to use in query planning. Suggested to use bounded once all
# nodes can recognize it.
# CLI flag: -limits.tsdb-sharding-strategy
[tsdb_sharding_strategy: &amp;lt;string&amp;gt; | default = &amp;#34;power_of_two&amp;#34;]

# Precompute chunks for TSDB queries. This can improve query performance at the
# cost of increased memory usage by computing chunks once during planning,
# reducing index calls.
# CLI flag: -querier.tsdb-precompute-chunks
[tsdb_precompute_chunks: &amp;lt;boolean&amp;gt; | default = false]

# Cardinality limit for index queries.
# CLI flag: -store.cardinality-limit
[cardinality_limit: &amp;lt;int&amp;gt; | default = 100000]

# Maximum number of stream matchers per query.
# CLI flag: -querier.max-streams-matcher-per-query
[max_streams_matchers_per_query: &amp;lt;int&amp;gt; | default = 1000]

# Maximum number of concurrent tail requests.
# CLI flag: -querier.max-concurrent-tail-requests
[max_concurrent_tail_requests: &amp;lt;int&amp;gt; | default = 10]

# Maximum number of log entries that will be returned for a query.
# CLI flag: -validation.max-entries-limit
[max_entries_limit_per_query: &amp;lt;int&amp;gt; | default = 5000]

# Most recent allowed cacheable result per-tenant, to prevent caching very
# recent results that might still be in flux.
# CLI flag: -frontend.max-cache-freshness
[max_cache_freshness_per_query: &amp;lt;duration&amp;gt; | default = 10m]

# Do not cache metadata request if the end time is within the
# frontend.max-metadata-cache-freshness window. Set this to 0 to apply no such
# limits. Defaults to 24h.
# CLI flag: -frontend.max-metadata-cache-freshness
[max_metadata_cache_freshness: &amp;lt;duration&amp;gt; | default = 1d]

# Do not cache requests with an end time that falls within Now minus this
# duration. 0 disables this feature (default).
# CLI flag: -frontend.max-stats-cache-freshness
[max_stats_cache_freshness: &amp;lt;duration&amp;gt; | default = 10m]

# Maximum number of queriers that can handle requests for a single tenant. If
# set to 0 or value higher than number of available queriers, *all* queriers
# will handle requests for the tenant. Each frontend (or query-scheduler, if
# used) will select the same set of queriers for the same tenant (given that all
# queriers are connected to all frontends / query-schedulers). This option only
# works with queriers connecting to the query-frontend / query-scheduler, not
# when using downstream URL.
# CLI flag: -frontend.max-queriers-per-tenant
[max_queriers_per_tenant: &amp;lt;int&amp;gt; | default = 0]

# How much of the available query capacity (&amp;#34;querier&amp;#34; components in distributed
# mode, &amp;#34;read&amp;#34; components in SSD mode) can be used by a single tenant. Allowed
# values are 0.0 to 1.0. For example, setting this to 0.5 would allow a tenant
# to use half of the available queriers for processing the query workload. If
# set to 0, query capacity is determined by frontend.max-queriers-per-tenant.
# When both frontend.max-queriers-per-tenant and frontend.max-query-capacity are
# configured, smaller value of the resulting querier replica count is
# considered: min(frontend.max-queriers-per-tenant, ceil(querier_replicas *
# frontend.max-query-capacity)). *All* queriers will handle requests for the
# tenant if neither limits are applied. This option only works with queriers
# connecting to the query-frontend / query-scheduler, not when using downstream
# URL. Use this feature in a multi-tenant setup where you need to limit query
# capacity for certain tenants.
# CLI flag: -frontend.max-query-capacity
[max_query_capacity: &amp;lt;float&amp;gt; | default = 0]

# Number of days of index to be kept always downloaded for queries. Applies only
# to per user index in boltdb-shipper index store. 0 to disable.
# CLI flag: -store.query-ready-index-num-days
[query_ready_index_num_days: &amp;lt;int&amp;gt; | default = 0]

# Timeout when querying backends (ingesters or storage) during the execution of
# a query request. When a specific per-tenant timeout is used, the global
# timeout is ignored.
# CLI flag: -querier.query-timeout
[query_timeout: &amp;lt;duration&amp;gt; | default = 1m]

# Split queries by a time interval and execute in parallel. The value 0 disables
# splitting by time. This also determines how cache keys are chosen when result
# caching is enabled.
# CLI flag: -querier.split-queries-by-interval
[split_queries_by_interval: &amp;lt;duration&amp;gt; | default = 1h]

# Split metadata queries by a time interval and execute in parallel. The value 0
# disables splitting metadata queries by time. This also determines how cache
# keys are chosen when label/series result caching is enabled.
# CLI flag: -querier.split-metadata-queries-by-interval
[split_metadata_queries_by_interval: &amp;lt;duration&amp;gt; | default = 1d]

# Experimental. Split interval to use for the portion of metadata request that
# falls within `recent_metadata_query_window`. Rest of the request which is
# outside the window still uses `split_metadata_queries_by_interval`. If set to
# 0, the entire request defaults to using a split interval of
# `split_metadata_queries_by_interval.`.
# CLI flag: -experimental.querier.split-recent-metadata-queries-by-interval
[split_recent_metadata_queries_by_interval: &amp;lt;duration&amp;gt; | default = 1h]

# Experimental. Metadata query window inside which
# `split_recent_metadata_queries_by_interval` gets applied, portion of the
# metadata request that falls in this window is split using
# `split_recent_metadata_queries_by_interval`. The value 0 disables using a
# different split interval for recent metadata queries.
# 
# This is added to improve cacheability of recent metadata queries. Query split
# interval also determines the interval used in cache key. The default split
# interval of 24h is useful for caching long queries, each cache key holding 1
# day&amp;#39;s results. But metadata queries are often shorter than 24h, to cache them
# effectively we need a smaller split interval. `recent_metadata_query_window`
# along with `split_recent_metadata_queries_by_interval` help configure a
# shorter split interval for recent metadata queries.
# CLI flag: -experimental.querier.recent-metadata-query-window
[recent_metadata_query_window: &amp;lt;duration&amp;gt; | default = 0s]

# Split instant metric queries by a time interval and execute in parallel. The
# value 0 disables splitting instant metric queries by time. This also
# determines how cache keys are chosen when instant metric query result caching
# is enabled.
# CLI flag: -querier.split-instant-metric-queries-by-interval
[split_instant_metric_queries_by_interval: &amp;lt;duration&amp;gt; | default = 1h]

# Time bucket interval used for cache key generation in the Thor (V2) query
# engine. Queries starting within the same bucket share the same cache key.
# CLI flag: -querier.engine-results-cache-time-bucket-interval
[engine_results_cache_time_bucket_interval: &amp;lt;duration&amp;gt; | default = 1d]

# Interval to use for time-based splitting when a request is within the
# `query_ingesters_within` window; defaults to `split-queries-by-interval` by
# setting to 0.
# CLI flag: -querier.split-ingester-queries-by-interval
[split_ingester_queries_by_interval: &amp;lt;duration&amp;gt; | default = 0s]

# Limit queries that can be sharded. Queries within the time range of now and
# now minus this sharding lookback are not sharded. The default value of 0s
# disables the lookback, causing sharding of all queries at all times.
# CLI flag: -frontend.min-sharding-lookback
[min_sharding_lookback: &amp;lt;duration&amp;gt; | default = 0s]

# Max number of bytes a query can fetch. Enforced in log and metric queries only
# when TSDB is used. This limit is not enforced on log queries without filters.
# The default value of 0 disables this limit.
# CLI flag: -frontend.max-query-bytes-read
[max_query_bytes_read: &amp;lt;int&amp;gt; | default = 0B]

# Max number of bytes a query can fetch after splitting and sharding. Enforced
# in log and metric queries only when TSDB is used. This limit is not enforced
# on log queries without filters. The default value of 0 disables this limit.
# CLI flag: -frontend.max-querier-bytes-read
[max_querier_bytes_read: &amp;lt;int&amp;gt; | default = 150GB]

# Enable log-volume endpoints.
# CLI flag: -limits.volume-enabled
[volume_enabled: &amp;lt;boolean&amp;gt; | default = true]

# The maximum number of aggregated series in a log-volume response
# CLI flag: -limits.volume-max-series
[volume_max_series: &amp;lt;int&amp;gt; | default = 1000]

# Maximum number of rules per rule group per-tenant. 0 to disable.
# CLI flag: -ruler.max-rules-per-rule-group
[ruler_max_rules_per_rule_group: &amp;lt;int&amp;gt; | default = 0]

# Maximum number of rule groups per-tenant. 0 to disable.
# CLI flag: -ruler.max-rule-groups-per-tenant
[ruler_max_rule_groups_per_tenant: &amp;lt;int&amp;gt; | default = 0]

# The default tenant&amp;#39;s shard size when shuffle-sharding is enabled in the ruler.
# When this setting is specified in the per-tenant overrides, a value of 0
# disables shuffle sharding for the tenant.
# CLI flag: -ruler.tenant-shard-size
[ruler_tenant_shard_size: &amp;lt;int&amp;gt; | default = 0]

# Enable WAL replay on ruler startup. Disabling this can reduce memory usage on
# startup at the cost of not recovering in-memory WAL metrics on restart.
# CLI flag: -ruler.enable-wal-replay
[ruler_enable_wal_replay: &amp;lt;boolean&amp;gt; | default = true]

# Disable recording rules remote-write.
[ruler_remote_write_disabled: &amp;lt;boolean&amp;gt;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. The URL of the endpoint
# to send samples to.
[ruler_remote_write_url: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. Timeout for requests to
# the remote write endpoint.
[ruler_remote_write_timeout: &amp;lt;duration&amp;gt;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. Custom HTTP headers to be
# sent along with each remote write request. Be aware that headers that are set
# by Loki itself can&amp;#39;t be overwritten.
[ruler_remote_write_headers: &amp;lt;headers&amp;gt;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. List of remote write
# relabel configurations.
[ruler_remote_write_relabel_configs: &amp;lt;relabel_config...&amp;gt;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. Number of samples to
# buffer per shard before we block reading of more samples from the WAL. It is
# recommended to have enough capacity in each shard to buffer several requests
# to keep throughput up while processing occasional slow remote requests.
[ruler_remote_write_queue_capacity: &amp;lt;int&amp;gt;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. Minimum number of shards,
# i.e. amount of concurrency.
[ruler_remote_write_queue_min_shards: &amp;lt;int&amp;gt;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. Maximum number of shards,
# i.e. amount of concurrency.
[ruler_remote_write_queue_max_shards: &amp;lt;int&amp;gt;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. Maximum number of samples
# per send.
[ruler_remote_write_queue_max_samples_per_send: &amp;lt;int&amp;gt;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. Maximum time a sample
# will wait in buffer.
[ruler_remote_write_queue_batch_send_deadline: &amp;lt;duration&amp;gt;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. Initial retry delay. Gets
# doubled for every retry.
[ruler_remote_write_queue_min_backoff: &amp;lt;duration&amp;gt;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. Maximum retry delay.
[ruler_remote_write_queue_max_backoff: &amp;lt;duration&amp;gt;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. Retry upon receiving a
# 429 status code from the remote-write storage. This is experimental and might
# change in the future.
[ruler_remote_write_queue_retry_on_ratelimit: &amp;lt;boolean&amp;gt;]

# Deprecated: Use &amp;#39;ruler_remote_write_config&amp;#39; instead. Configures AWS&amp;#39;s
# Signature Verification 4 signing process to sign every remote write request.
ruler_remote_write_sigv4_config:
  [region: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  [access_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  [secret_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  [profile: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  [role_arn: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Configures global and per-tenant limits for remote write clients. A map with
# remote client id as key.
[ruler_remote_write_config: &amp;lt;map of string to RemoteWriteConfig&amp;gt;]

# Timeout for a remote rule evaluation. Defaults to the value of
# &amp;#39;querier.query-timeout&amp;#39;.
[ruler_remote_evaluation_timeout: &amp;lt;duration&amp;gt;]

# Maximum size (in bytes) of the allowable response size from a remote rule
# evaluation. Set to 0 to allow any response size (default).
[ruler_remote_evaluation_max_response_size: &amp;lt;int&amp;gt;]

# Deletion mode. Can be one of &amp;#39;disabled&amp;#39;, &amp;#39;filter-only&amp;#39;, or
# &amp;#39;filter-and-delete&amp;#39;. When set to &amp;#39;filter-only&amp;#39; or &amp;#39;filter-and-delete&amp;#39;, and if
# retention_enabled is true, then the log entry deletion API endpoints are
# available.
# CLI flag: -compactor.deletion-mode
[deletion_mode: &amp;lt;string&amp;gt; | default = &amp;#34;filter-and-delete&amp;#34;]

# Retention period to apply to stored data, only applies if retention_enabled is
# true in the compactor config. As of version 2.8.0, a zero value of 0 or 0s
# disables retention. In previous releases, Loki did not properly honor a zero
# value to disable retention and a really large value should be used instead.
# CLI flag: -store.retention
[retention_period: &amp;lt;duration&amp;gt; | default = 0s]

# Per-stream retention to apply, if the retention is enabled on the compactor
# side.
# Example:
#  retention_stream:
#  - selector: &amp;#39;{namespace=&amp;#34;dev&amp;#34;}&amp;#39;
#  priority: 1
#  period: 24h
# - selector: &amp;#39;{container=&amp;#34;nginx&amp;#34;}&amp;#39;
#  priority: 1
#  period: 744h
# Selector is a Prometheus labels matchers that will apply the &amp;#39;period&amp;#39;
# retention only if the stream is matching. In case multiple streams are
# matching, the highest priority will be picked. If no rule is matched the
# &amp;#39;retention_period&amp;#39; is used.
[retention_stream: &amp;lt;list of StreamRetentions&amp;gt;]

# Feature renamed to &amp;#39;runtime configuration&amp;#39;, flag deprecated in favor of
# -runtime-config.file (runtime_config.file in YAML).
# CLI flag: -limits.per-user-override-config
[per_tenant_override_config: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Feature renamed to &amp;#39;runtime configuration&amp;#39;; flag deprecated in favor of
# -runtime-config.reload-period (runtime_config.period in YAML).
# CLI flag: -limits.per-user-override-period
[per_tenant_override_period: &amp;lt;duration&amp;gt; | default = 10s]

# Deprecated: Use deletion_mode per tenant configuration instead.
[allow_deletes: &amp;lt;boolean&amp;gt;]

# Define streams sharding behavior.
shard_streams:
  # Automatically shard streams to keep them under the per-stream rate limit.
  # Sharding is dictated by the desired rate.
  # CLI flag: -shard-streams.enabled
  [enabled: &amp;lt;boolean&amp;gt; | default = true]

  # Automatically shard streams by adding a __time_shard__ label, with values
  # calculated from the log timestamps divided by MaxChunkAge/2. This allows the
  # out-of-order ingestion of very old logs. If both flags are enabled,
  # time-based sharding will happen before rate-based sharding.
  # CLI flag: -shard-streams.time-sharding-enabled
  [time_sharding_enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Logs with timestamps that are newer than this value will not be
  # time-sharded.
  # CLI flag: -shard-streams.time-sharding-ignore-recent
  [time_sharding_ignore_recent: &amp;lt;duration&amp;gt; | default = 40m]

  # Whether to log sharding streams behavior or not. Not recommended for
  # production environments.
  # CLI flag: -shard-streams.logging-enabled
  [logging_enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Threshold used to cut a new shard. Default (1536KB) means if a rate is above
  # 1536KB/s, it will be sharded into two streams.
  # CLI flag: -shard-streams.desired-rate
  [desired_rate: &amp;lt;int&amp;gt; | default = 1536KB]

[blocked_queries: &amp;lt;blocked_query...&amp;gt;]

# Define a list of required selector labels.
[required_labels: &amp;lt;list of strings&amp;gt;]

# Minimum number of label matchers a query should contain.
[minimum_labels_number: &amp;lt;int&amp;gt;]

# The shard size defines how many index gateways should be used by a tenant for
# querying. If the global shard factor is 0, the global shard factor is set to
# the deprecated -replication-factor for backwards compatibility reasons.
# CLI flag: -index-gateway.shard-size
[index_gateway_shard_size: &amp;lt;int&amp;gt; | default = 0]

# Experimental. Defines a fraction (between 0.0 and 1.0) of the total index
# gateways available for a each tenant. A value of 0.0 has the same effect as
# 1.0, meaning all available index gateways. This setting only applies to simple
# mode.
# CLI flag: -index-gateway.max-capacity
[index_gateway_max_capacity: &amp;lt;float&amp;gt; | default = 1]

# Experimental. Whether to use the bloom gateway component in the read path to
# filter chunks.
# CLI flag: -bloom-gateway.enable-filtering
[bloom_gateway_enable_filtering: &amp;lt;boolean&amp;gt; | default = false]

# Experimental. Maximum number of builders to use when building blooms. 0 allows
# unlimited builders.
# CLI flag: -bloom-build.max-builders
[bloom_build_max_builders: &amp;lt;int&amp;gt; | default = 0]

# Experimental. Maximum number of retries for a failed task. If a task fails
# more than this number of times, it is considered failed and will not be
# retried. A value of 0 disables this limit.
# CLI flag: -bloom-build.task-max-retries
[bloom_build_task_max_retries: &amp;lt;int&amp;gt; | default = 3]

# Experimental. Timeout for a builder to finish a task. If a builder does not
# respond within this time, it is considered failed and the task will be
# requeued. 0 disables the timeout.
# CLI flag: -bloom-build.builder-response-timeout
[bloom_build_builder_response_timeout: &amp;lt;duration&amp;gt; | default = 0s]

# Experimental. Whether to create blooms for the tenant.
# CLI flag: -bloom-build.enable
[bloom_creation_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Experimental. Bloom planning strategy to use in bloom creation. Can be one of:
# &amp;#39;split_keyspace_by_factor&amp;#39;, &amp;#39;split_by_series_chunks_size&amp;#39;
# CLI flag: -bloom-build.planning-strategy
[bloom_planning_strategy: &amp;lt;string&amp;gt; | default = &amp;#34;split_keyspace_by_factor&amp;#34;]

# Experimental. Only if `bloom-build.planning-strategy` is &amp;#39;split&amp;#39;. Number of
# splits to create for the series keyspace when building blooms. The series
# keyspace is split into this many parts to parallelize bloom creation.
# CLI flag: -bloom-build.split-keyspace-by
[bloom_split_series_keyspace_by: &amp;lt;int&amp;gt; | default = 256]

# Experimental. Target chunk size in bytes for bloom tasks. Default is 20GB.
# CLI flag: -bloom-build.split-target-series-chunk-size
[bloom_task_target_series_chunk_size: &amp;lt;int&amp;gt; | default = 20GB]

# Experimental. Compression algorithm for bloom block pages.
# CLI flag: -bloom-build.block-encoding
[bloom_block_encoding: &amp;lt;string&amp;gt; | default = &amp;#34;none&amp;#34;]

# Experimental. Prefetch blocks on bloom gateways as soon as they are built.
# CLI flag: -bloom-build.prefetch-blocks
[bloom_prefetch_blocks: &amp;lt;boolean&amp;gt; | default = false]

# Experimental. The maximum bloom block size. A value of 0 sets an unlimited
# size. Default is 200MB. The actual block size might exceed this limit since
# blooms will be added to blocks until the block exceeds the maximum block size.
# CLI flag: -bloom-build.max-block-size
[bloom_max_block_size: &amp;lt;int&amp;gt; | default = 200MB]

# Experimental. The maximum bloom size per log stream. A log stream whose
# generated bloom filter exceeds this size will be discarded. A value of 0 sets
# an unlimited size. Default is 128MB.
# CLI flag: -bloom-build.max-bloom-size
[bloom_max_bloom_size: &amp;lt;int&amp;gt; | default = 128MB]

# Allow user to send structured metadata in push payload.
# CLI flag: -validation.allow-structured-metadata
[allow_structured_metadata: &amp;lt;boolean&amp;gt; | default = true]

# Maximum size accepted for structured metadata per log line.
# CLI flag: -limits.max-structured-metadata-size
[max_structured_metadata_size: &amp;lt;int&amp;gt; | default = 64KB]

# Maximum number of structured metadata entries per log line.
# CLI flag: -limits.max-structured-metadata-entries-count
[max_structured_metadata_entries_count: &amp;lt;int&amp;gt; | default = 128]

# OTLP log ingestion configurations
otlp_config:
  # Configuration for resource attributes to store them as index labels or
  # Structured Metadata or drop them altogether
  resource_attributes:
    # Configure whether to ignore the default list of resource attributes set in
    # &amp;#39;distributor.otlp.default_resource_attributes_as_index_labels&amp;#39; to be
    # stored as index labels and only use the given resource attributes config
    [ignore_defaults: &amp;lt;boolean&amp;gt; | default = false]

    [attributes_config: &amp;lt;list of attributes_configs&amp;gt;]

  # Configuration for scope attributes to store them as Structured Metadata or
  # drop them altogether
  [scope_attributes: &amp;lt;list of attributes_configs&amp;gt;]

  # Configuration for log attributes to store them as index labels or Structured
  # Metadata or drop them altogether
  [log_attributes: &amp;lt;list of attributes_configs&amp;gt;]

  # When true, the severity_text field from log records will be stored as an
  # index label. It is recommended not to use this option unless absolutely
  # necessary
  [severity_text_as_label: &amp;lt;boolean&amp;gt; | default = false]

# Block ingestion for policy until the configured date. The policy &amp;#39;*&amp;#39; is the
# global policy, which is applied to all streams not matching a policy and can
# be overridden by other policies. The time should be in RFC3339 format. The
# policy is based on the policy_stream_mapping configuration.
[block_ingestion_policy_until: &amp;lt;map of string to Time&amp;gt;]

# Block ingestion until the configured date. The time should be in RFC3339
# format.
# CLI flag: -limits.block-ingestion-until
[block_ingestion_until: &amp;lt;time&amp;gt; | default = 0]

# HTTP status code to return when ingestion is blocked. If 200, the ingestion
# will be blocked without returning an error to the client. By Default, a custom
# status code (260) is returned to the client along with an error message.
# CLI flag: -limits.block-ingestion-status-code
[block_ingestion_status_code: &amp;lt;int&amp;gt; | default = 260]

# List of labels that must be present in the stream. If any of the labels are
# missing, the stream will be discarded. This flag configures it globally for
# all tenants. Experimental.
# CLI flag: -validation.enforced-labels
[enforced_labels: &amp;lt;list of strings&amp;gt; | default = []]

# Map of policies to enforced labels. The policy &amp;#39;*&amp;#39; is the global policy, which
# is applied to all streams and can be extended by other policies. Example:
#  policy_enforced_labels: 
#   policy1: 
#     - label1 
#     - label2 
#   policy2: 
#     - label3 
#     - label4
#   &amp;#39;*&amp;#39;:
#     - label5
[policy_enforced_labels: &amp;lt;map of string to list of strings&amp;gt;]

# Map of policies to stream selectors with a priority. Experimental.  Example:
#  policy_stream_mapping: 
#   finance: 
#     - selector: &amp;#39;{namespace=&amp;#34;prod&amp;#34;, container=&amp;#34;billing&amp;#34;}&amp;#39; 
#       priority: 2 
#   ops: 
#     - selector: &amp;#39;{namespace=&amp;#34;prod&amp;#34;, container=&amp;#34;ops&amp;#34;}&amp;#39; 
#       priority: 1 
#   staging: 
#     - selector: &amp;#39;{namespace=&amp;#34;staging&amp;#34;}&amp;#39; 
#       priority: 1
[policy_stream_mapping: &amp;lt;map of string to list of PriorityStreams&amp;gt;]

# The number of partitions a tenant&amp;#39;s data should be sharded to when using kafka
# ingestion. Tenants are sharded across partitions using shuffle-sharding. 0
# disables shuffle sharding and tenant is sharded across all partitions.
# CLI flag: -limits.ingestion-partition-tenant-shard-size
[ingestion_partitions_tenant_shard_size: &amp;lt;int&amp;gt; | default = 0]

# List of LogQL vector and range aggregations that should be sharded.
[shard_aggregations: &amp;lt;list of strings&amp;gt;]

# Default list of JSON fields to tokenize for pattern detection. It is recommend
# to append to or delete from the defaults rather than replacing them.
# CLI flag: -limits.pattern-ingester-tokenizable-json-fields
[pattern_ingester_tokenizable_json_fields_default: &amp;lt;string&amp;gt; | default = &amp;#34;log,message,msg,msg_,_msg,content&amp;#34;]

# List of additional JSON fields to tokenize for pattern detection.
# CLI flag: -limits.pattern-ingester-tokenizable-json-fields-append
[pattern_ingester_tokenizable_json_fields_append: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# List of JSON fields to excluded from the defaults to tokenize for pattern
# detection.
# CLI flag: -limits.pattern-ingester-tokenizable-json-fields-delete
[pattern_ingester_tokenizable_json_fields_delete: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Enable metric aggregation. When enabled, pushed streams will be sampled for
# bytes and line counts. These metrics will be written back into Loki as a
# special __aggregated_metric__ stream.
# CLI flag: -limits.aggregation-enabled
[metric_aggregation_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Enable persistence of patterns detected at ingest. When enabled, patterns for
# pushed streams will be written back into Loki as a special __pattern__ stream.
# CLI flag: -limits.pattern-persistence-enabled
[pattern_persistence_enabled: &amp;lt;boolean&amp;gt; | default = false]

# The time granularity for persisting patterns. Controls how many data points
# are written when patterns are flushed. Set to 0 to use the default from the
# pattern ingester configuration.
# CLI flag: -limits.pattern-persistence-granularity
[pattern_persistence_granularity: &amp;lt;duration&amp;gt; | default = 0s]

# Minimum pattern rate (samples per second) required for a pattern to be
# persisted. Patterns with lower rates will be filtered out during persistence.
# CLI flag: -limits.pattern-rate-threshold
[pattern_rate_threshold: &amp;lt;float&amp;gt; | default = 1]

# S3 server-side encryption type. Required to enable server-side encryption
# overrides for a specific tenant. If not set, the default S3 client settings
# are used.
[s3_sse_type: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# S3 server-side encryption KMS Key ID. Ignored if the SSE type override is not
# set.
[s3_sse_kms_key_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# S3 server-side encryption KMS encryption context. If unset and the key ID
# override is set, the encryption context will not be provided to S3. Ignored if
# the SSE type override is not set.
[s3_sse_kms_encryption_context: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Experimental: Controls the amount of scan tasks that can be running in
# parallel in the new query engine. The default of 0 means unlimited parallelism
# and all tasks will be scheduled at once.
# CLI flag: -limits.max-scan-task-parallelism
[max_scan_task_parallelism: &amp;lt;int&amp;gt; | default = 0]

# Experimental: Toggles verbose debug logging of tasks in the new query engine.
# CLI flag: -limits.debug-engine-tasks
[debug_engine_tasks: &amp;lt;boolean&amp;gt; | default = false]

# Experimental: Toggles verbose debug logging of data streams in the new query
# engine.
# CLI flag: -limits.debug-engine-streams
[debug_engine_streams: &amp;lt;boolean&amp;gt; | default = false]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;local_storage_config&#34;&gt;local_storage_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;local_storage_config&lt;/code&gt; block configures the usage of local file system as object storage backend.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Directory to store chunks in.
# CLI flag: -local.chunk-directory
[directory: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;memberlist&#34;&gt;memberlist&lt;/h3&gt;
&lt;p&gt;Configuration for &lt;code&gt;memberlist&lt;/code&gt; client. Only applies if the selected kvstore is memberlist.&lt;/p&gt;
&lt;p&gt;When 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&amp;rsquo;s configuration section.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Name of the node in memberlist cluster. Defaults to hostname.
# CLI flag: -memberlist.nodename
[node_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Add random suffix to the node name.
# CLI flag: -memberlist.randomize-node-name
[randomize_node_name: &amp;lt;boolean&amp;gt; | default = true]

# The timeout for establishing a connection with a remote node, and for
# read/write operations.
# CLI flag: -memberlist.stream-timeout
[stream_timeout: &amp;lt;duration&amp;gt; | default = 2s]

# Multiplication factor used when sending out messages (factor * log(N&amp;#43;1)).
# CLI flag: -memberlist.retransmit-factor
[retransmit_factor: &amp;lt;int&amp;gt; | default = 4]

# How often to use pull/push sync.
# CLI flag: -memberlist.pullpush-interval
[pull_push_interval: &amp;lt;duration&amp;gt; | default = 30s]

# How often to gossip.
# CLI flag: -memberlist.gossip-interval
[gossip_interval: &amp;lt;duration&amp;gt; | default = 200ms]

# How many nodes to gossip to.
# CLI flag: -memberlist.gossip-nodes
[gossip_nodes: &amp;lt;int&amp;gt; | default = 3]

# How long to keep gossiping to dead nodes, to give them chance to refute their
# death.
# CLI flag: -memberlist.gossip-to-dead-nodes-time
[gossip_to_dead_nodes_time: &amp;lt;duration&amp;gt; | default = 30s]

# How soon can dead node&amp;#39;s name be reclaimed with new address. 0 to disable.
# CLI flag: -memberlist.dead-node-reclaim-time
[dead_node_reclaim_time: &amp;lt;duration&amp;gt; | default = 0s]

# Enable message compression. This can be used to reduce bandwidth usage at the
# cost of slightly more CPU utilization.
# CLI flag: -memberlist.compression-enabled
[compression_enabled: &amp;lt;boolean&amp;gt; | default = true]

# How frequently to notify watchers when a key changes. Can reduce CPU activity
# in large memberlist deployments. 0 to notify without delay.
# CLI flag: -memberlist.notify-interval
[notify_interval: &amp;lt;duration&amp;gt; | default = 0s]

# Gossip address to advertise to other members in the cluster. Used for NAT
# traversal.
# CLI flag: -memberlist.advertise-addr
[advertise_addr: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Gossip port to advertise to other members in the cluster. Used for NAT
# traversal.
# CLI flag: -memberlist.advertise-port
[advertise_port: &amp;lt;int&amp;gt; | default = 7946]

# The cluster label is an optional string to include in outbound packets and
# gossip streams. Other members in the memberlist cluster will discard any
# message whose label doesn&amp;#39;t match the configured one, unless the
# &amp;#39;cluster-label-verification-disabled&amp;#39; configuration option is set to true.
# CLI flag: -memberlist.cluster-label
[cluster_label: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# When true, memberlist doesn&amp;#39;t verify that inbound packets and gossip streams
# have the cluster label matching the configured one. This verification should
# be disabled while rolling out the change to the configured cluster label in a
# live memberlist cluster.
# CLI flag: -memberlist.cluster-label-verification-disabled
[cluster_label_verification_disabled: &amp;lt;boolean&amp;gt; | default = false]

# Other cluster members to join. Can be specified multiple times or as a
# comma-separated list. It can be an IP, hostname or an entry specified in the
# DNS Service Discovery format.
# CLI flag: -memberlist.join
[join_members: &amp;lt;list of strings&amp;gt;]

# Min backoff duration to join other cluster members.
# CLI flag: -memberlist.min-join-backoff
[min_join_backoff: &amp;lt;duration&amp;gt; | default = 1s]

# Max backoff duration to join other cluster members.
# CLI flag: -memberlist.max-join-backoff
[max_join_backoff: &amp;lt;duration&amp;gt; | default = 1m]

# Max number of retries to join other cluster members.
# CLI flag: -memberlist.max-join-retries
[max_join_retries: &amp;lt;int&amp;gt; | default = 10]

# Abort if this node fails the fast memberlist cluster joining procedure at
# startup. When enabled, it&amp;#39;s guaranteed that other services, depending on
# memberlist, have an updated view over the cluster state when they&amp;#39;re started.
# CLI flag: -memberlist.abort-if-fast-join-fails
[abort_if_cluster_fast_join_fails: &amp;lt;boolean&amp;gt; | default = false]

# Minimum number of seed nodes that must be successfully joined during fast-join
# for it to succeed. Only applies when -memberlist.abort-if-fast-join-fails is
# enabled.
# CLI flag: -memberlist.abort-if-fast-join-fails-min-nodes
[abort_if_cluster_fast_join_fails_min_nodes: &amp;lt;int&amp;gt; | default = 1]

# Abort if this node fails to join memberlist cluster at startup. When enabled,
# it&amp;#39;s not guaranteed that other services are started only after the cluster
# state has been successfully updated; use &amp;#39;abort-if-fast-join-fails&amp;#39; instead.
# CLI flag: -memberlist.abort-if-join-fails
[abort_if_cluster_join_fails: &amp;lt;boolean&amp;gt; | default = false]

# If not 0, how often to rejoin the cluster. Occasional rejoin can help to fix
# the cluster split issue, and is harmless otherwise. For example when using
# only few components as a seed nodes (via -memberlist.join), then it&amp;#39;s
# recommended to use rejoin. If -memberlist.join points to dynamic service that
# resolves to all gossiping nodes (eg. Kubernetes headless service), then rejoin
# is not needed.
# CLI flag: -memberlist.rejoin-interval
[rejoin_interval: &amp;lt;duration&amp;gt; | default = 0s]

# Seed nodes to use for periodic rejoin. Takes precedence over -memberlist.join
# for rejoining. If not specified, -memberlist.join is used. Can be specified
# multiple times or as a comma-separated list. Supports IP, hostname, or DNS
# Service Discovery format.
# CLI flag: -memberlist.rejoin-seed-nodes
[rejoin_seed_nodes: &amp;lt;list of strings&amp;gt;]

# How long to keep LEFT ingesters in the ring.
# CLI flag: -memberlist.left-ingesters-timeout
[left_ingesters_timeout: &amp;lt;duration&amp;gt; | default = 5m]

# How long to keep obsolete entries in the KV store.
# CLI flag: -memberlist.obsolete-entries-timeout
[obsolete_entries_timeout: &amp;lt;duration&amp;gt; | default = 30s]

# Timeout for leaving memberlist cluster.
# CLI flag: -memberlist.leave-timeout
[leave_timeout: &amp;lt;duration&amp;gt; | default = 20s]

# Timeout for broadcasting all remaining locally-generated updates to other
# nodes when shutting down. Only used if there are nodes left in the memberlist
# cluster, and only applies to locally-generated updates, not to broadcast
# messages that are result of incoming gossip updates. 0 = no timeout, wait
# until all locally-generated updates are sent.
# CLI flag: -memberlist.broadcast-timeout-for-local-updates-on-shutdown
[broadcast_timeout_for_local_updates_on_shutdown: &amp;lt;duration&amp;gt; | default = 10s]

# How much space to use for keeping received and sent messages in memory for
# troubleshooting (two buffers). 0 to disable.
# CLI flag: -memberlist.message-history-buffer-bytes
[message_history_buffer_bytes: &amp;lt;int&amp;gt; | default = 0]

# Size of the buffered channel for the WatchPrefix function.
# CLI flag: -memberlist.watch-prefix-buffer-size
[watch_prefix_buffer_size: &amp;lt;int&amp;gt; | default = 128]

# IP address to listen on for gossip messages. Multiple addresses may be
# specified. Defaults to 0.0.0.0
# CLI flag: -memberlist.bind-addr
[bind_addr: &amp;lt;list of strings&amp;gt; | default = []]

# Port to listen on for gossip messages.
# CLI flag: -memberlist.bind-port
[bind_port: &amp;lt;int&amp;gt; | default = 7946]

# Timeout used when connecting to other nodes to send packet.
# CLI flag: -memberlist.packet-dial-timeout
[packet_dial_timeout: &amp;lt;duration&amp;gt; | default = 2s]

# Timeout for writing &amp;#39;packet&amp;#39; data.
# CLI flag: -memberlist.packet-write-timeout
[packet_write_timeout: &amp;lt;duration&amp;gt; | default = 5s]

# Maximum number of concurrent writes to other nodes.
# CLI flag: -memberlist.max-concurrent-writes
[max_concurrent_writes: &amp;lt;int&amp;gt; | default = 3]

# Timeout for acquiring one of the concurrent write slots. After this time, the
# message will be dropped.
# CLI flag: -memberlist.acquire-writer-timeout
[acquire_writer_timeout: &amp;lt;duration&amp;gt; | default = 250ms]

# Enable TLS on the memberlist transport layer.
# CLI flag: -memberlist.tls-enabled
[tls_enabled: &amp;lt;boolean&amp;gt; | default = false]

# The TLS configuration.
# The CLI flags prefix for this block configuration is: memberlist
[&amp;lt;tls_config&amp;gt;]

zone_aware_routing:
  # Enable zone-aware routing for memberlist gossip.
  # CLI flag: -memberlist.zone-aware-routing.enabled
  [enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Availability zone where this node is running.
  # CLI flag: -memberlist.zone-aware-routing.instance-availability-zone
  [instance_availability_zone: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Role of this node in the cluster. Valid values: member, bridge.
  # CLI flag: -memberlist.zone-aware-routing.role
  [role: &amp;lt;string&amp;gt; | default = &amp;#34;member&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;named_stores_config&#34;&gt;named_stores_config&lt;/h3&gt;
&lt;p&gt;Configures additional object stores for a given storage provider.
Supported stores: aws, azure, bos, filesystem, gcs, swift.
Example:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;    storage_config:
      named_stores:
        aws:
          store-1:
            endpoint: s3://foo-bucket
            region: us-west1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Named store from this example can be used by setting object_store to store-1 in period_config.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;[aws: &amp;lt;map of string to aws_storage_config&amp;gt;]

[azure: &amp;lt;map of string to azure_storage_config&amp;gt;]

[bos: &amp;lt;map of string to bos_storage_config&amp;gt;]

[filesystem: &amp;lt;map of string to local_storage_config&amp;gt;]

[gcs: &amp;lt;map of string to gcs_storage_config&amp;gt;]

[alibabacloud: &amp;lt;map of string to alibabacloud_storage_config&amp;gt;]

[swift: &amp;lt;map of string to swift_storage_config&amp;gt;]

[cos: &amp;lt;map of string to cos_storage_config&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;operational_config&#34;&gt;operational_config&lt;/h3&gt;
&lt;p&gt;These are values which allow you to control aspects of Loki&amp;rsquo;s operation, most commonly used for controlling types of higher verbosity logging, the values here can be overridden in the &lt;code&gt;configs&lt;/code&gt; section of the &lt;code&gt;runtime_config&lt;/code&gt; file.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Log every new stream created by a push request (very verbose, recommend to
# enable via runtime config only).
# CLI flag: -operation-config.log-stream-creation
[log_stream_creation: &amp;lt;boolean&amp;gt; | default = false]

# Log every push request (very verbose, recommend to enable via runtime config
# only).
# CLI flag: -operation-config.log-push-request
[log_push_request: &amp;lt;boolean&amp;gt; | default = false]

# Log a commutative hash of the labels for all streams in a push request. In
# some cases this can potentially be used as an identifier of the agent sending
# the stream. Calculating hashes is epensive so only enable as needed.
# CLI flag: -operation-config.log-hash-of-labels
[log_hash_of_labels: &amp;lt;boolean&amp;gt; | default = false]

# Log every stream in a push request (very verbose, recommend to enable via
# runtime config only).
# CLI flag: -operation-config.log-push-request-streams
[log_push_request_streams: &amp;lt;boolean&amp;gt; | default = false]

# Only show streams that match a provided IP address, LogPushRequestStreams must
# be enabled. Can be used multiple times to filter by multiple IPs.
# CLI flag: -operation-config.filter-push-request-streams-ips
[filter_push_request_streams_ips: &amp;lt;list of strings&amp;gt; | default = []]

# Log service name discovery (very verbose, recommend to enable via runtime
# config only).
# CLI flag: -operation-config.log-service-name-discovery
[log_service_name_discovery: &amp;lt;boolean&amp;gt; | default = false]

# Log metrics for duplicate lines received.
# CLI flag: -operation-config.log-duplicate-metrics
[log_duplicate_metrics: &amp;lt;boolean&amp;gt; | default = false]

# Log stream info for duplicate lines received
# CLI flag: -operation-config.log-duplicate-stream-info
[log_duplicate_stream_info: &amp;lt;boolean&amp;gt; | default = false]

# Log push errors with a rate limited logger, will show client push errors
# without overly spamming logs.
# CLI flag: -operation-config.limited-log-push-errors
[limited_log_push_errors: &amp;lt;boolean&amp;gt; | default = true]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;period_config&#34;&gt;period_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;period_config&lt;/code&gt; block configures what index schemas should be used for from specific time periods.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# The date of the first day that index buckets should be created. Use a date in
# the past if this is your only period_config, otherwise use a date when you
# want the schema to switch over. In YYYY-MM-DD format, for example: 2018-04-15.
[from: &amp;lt;daytime&amp;gt;]

# store and object_store below affect which &amp;lt;storage_config&amp;gt; key is used. Which
# index to use. Either tsdb or boltdb-shipper. Following stores are deprecated:
# aws, aws-dynamo, gcp, gcp-columnkey, bigtable, bigtable-hashed, cassandra,
# grpc.
[store: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Which store to use for the chunks. Either aws (alias s3), azure, gcs,
# alibabacloud, bos, cos, swift, filesystem, or a named_store (refer to
# named_stores_config). Following stores are deprecated: aws-dynamo, gcp,
# gcp-columnkey, bigtable, bigtable-hashed, cassandra, grpc.
[object_store: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# The schema version to use, current recommended schema is v13.
[schema: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Configures how the index is updated and stored.
index:
  # Path prefix for index tables. Prefix always needs to end with a path
  # delimiter &amp;#39;/&amp;#39;, except when the prefix is empty.
  [path_prefix: &amp;lt;string&amp;gt; | default = &amp;#34;index/&amp;#34;]

  # Table prefix for all period tables.
  [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Table period.
  [period: &amp;lt;duration&amp;gt;]

  # A map to be added to all managed tables.
  [tags: &amp;lt;map of string to string&amp;gt;]

# Configured how the chunks are updated and stored.
chunks:
  # Table prefix for all period tables.
  [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Table period.
  [period: &amp;lt;duration&amp;gt;]

  # A map to be added to all managed tables.
  [tags: &amp;lt;map of string to string&amp;gt;]

# How many shards will be created. Only used if schema is v10 or greater.
[row_shards: &amp;lt;int&amp;gt; | default = 16]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;profiling&#34;&gt;profiling&lt;/h3&gt;
&lt;p&gt;Configuration for &lt;code&gt;profiling&lt;/code&gt; options.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Sets the value for runtime.SetBlockProfilingRate
# CLI flag: -profiling.block-profile-rate
[block_profile_rate: &amp;lt;int&amp;gt; | default = 0]

# Sets the value for runtime.SetCPUProfileRate
# CLI flag: -profiling.cpu-profile-rate
[cpu_profile_rate: &amp;lt;int&amp;gt; | default = 0]

# Sets the value for runtime.SetMutexProfileFraction
# CLI flag: -profiling.mutex-profile-fraction
[mutex_profile_fraction: &amp;lt;int&amp;gt; | default = 0]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;querier&#34;&gt;querier&lt;/h3&gt;
&lt;p&gt;Configures the &lt;code&gt;querier&lt;/code&gt;. Only appropriate when running all modules or just the querier.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Maximum duration for which the live tailing requests are served.
# CLI flag: -querier.tail-max-duration
[tail_max_duration: &amp;lt;duration&amp;gt; | default = 1h]

# Time to wait before sending more than the minimum successful query requests.
# CLI flag: -querier.extra-query-delay
[extra_query_delay: &amp;lt;duration&amp;gt; | default = 0s]

# Maximum lookback beyond which queries are not sent to ingester. 0 means all
# queries are sent to ingester.
# CLI flag: -querier.query-ingesters-within
[query_ingesters_within: &amp;lt;duration&amp;gt; | default = 3h]

engine:
  # The maximum amount of time to look back for log lines. Used only for instant
  # log queries.
  # CLI flag: -querier.engine.max-lookback-period
  [max_look_back_period: &amp;lt;duration&amp;gt; | default = 30s]

  # The maximum number of labels the heap of a topk query using a count min
  # sketch can track.
  # CLI flag: -querier.engine.max-count-min-sketch-heap-size
  [max_count_min_sketch_heap_size: &amp;lt;int&amp;gt; | default = 10000]

# The maximum number of queries that can be simultaneously processed by the
# querier.
# CLI flag: -querier.max-concurrent
[max_concurrent: &amp;lt;int&amp;gt; | default = 4]

# Only query the store, and not attempt any ingesters. This is useful for
# running a standalone querier pool operating only against stored data.
# CLI flag: -querier.query-store-only
[query_store_only: &amp;lt;boolean&amp;gt; | default = false]

# When true, queriers only query the ingesters, and not stored data. This is
# useful when the object store is unavailable.
# CLI flag: -querier.query-ingester-only
[query_ingester_only: &amp;lt;boolean&amp;gt; | default = false]

# When true, allow queries to span multiple tenants.
# CLI flag: -querier.multi-tenant-queries-enabled
[multi_tenant_queries_enabled: &amp;lt;boolean&amp;gt; | default = false]

# When true, querier limits sent via a header are enforced.
# CLI flag: -querier.per-request-limits-enabled
[per_request_limits_enabled: &amp;lt;boolean&amp;gt; | default = false]

# When true, querier directs ingester queries to the partition-ingesters instead
# of the normal ingesters.
# CLI flag: -querier.query-partition-ingesters
[query_partition_ingesters: &amp;lt;boolean&amp;gt; | default = false]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;query_range&#34;&gt;query_range&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;query_range&lt;/code&gt; block configures the query splitting and caching in the Loki query-frontend.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Mutate incoming queries to align their start and end with their step.
# CLI flag: -querier.align-querier-with-step
[align_queries_with_step: &amp;lt;boolean&amp;gt; | default = false]

results_cache:
  # The cache_config block configures the cache backend for a specific Loki
  # component.
  # The CLI flags prefix for this block configuration is: frontend
  [cache: &amp;lt;cache_config&amp;gt;]

  # Use compression in cache. The default is an empty value &amp;#39;&amp;#39;, which disables
  # compression. Supported values are: &amp;#39;snappy&amp;#39; and &amp;#39;&amp;#39;.
  # CLI flag: -frontend.compression
  [compression: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Cache query results.
# CLI flag: -querier.cache-results
[cache_results: &amp;lt;boolean&amp;gt; | default = false]

# Maximum number of retries for a single request; beyond this, the downstream
# error is returned.
# CLI flag: -querier.max-retries-per-request
[max_retries: &amp;lt;int&amp;gt; | default = 5]

# Perform query parallelisations based on storage sharding configuration and
# query ASTs. This feature is supported only by the chunks storage engine.
# CLI flag: -querier.parallelise-shardable-queries
[parallelise_shardable_queries: &amp;lt;boolean&amp;gt; | default = true]

# A comma-separated list of LogQL vector and range aggregations that should be
# sharded. Possible values &amp;#39;quantile_over_time&amp;#39;, &amp;#39;last_over_time&amp;#39;,
# &amp;#39;first_over_time&amp;#39;.
# CLI flag: -querier.shard-aggregations
[shard_aggregations: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Cache index stats query results.
# CLI flag: -querier.cache-index-stats-results
[cache_index_stats_results: &amp;lt;boolean&amp;gt; | default = true]

# If a cache config is not specified and cache_index_stats_results is true, the
# config for the results cache is used.
index_stats_results_cache:
  # The cache_config block configures the cache backend for a specific Loki
  # component.
  # The CLI flags prefix for this block configuration is:
  # frontend.index-stats-results-cache
  [cache: &amp;lt;cache_config&amp;gt;]

  # Use compression in cache. The default is an empty value &amp;#39;&amp;#39;, which disables
  # compression. Supported values are: &amp;#39;snappy&amp;#39; and &amp;#39;&amp;#39;.
  # CLI flag: -frontend.index-stats-results-cache.compression
  [compression: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Cache volume query results.
# CLI flag: -querier.cache-volume-results
[cache_volume_results: &amp;lt;boolean&amp;gt; | default = true]

# If a cache config is not specified and cache_volume_results is true, the
# config for the results cache is used.
volume_results_cache:
  # The cache_config block configures the cache backend for a specific Loki
  # component.
  # The CLI flags prefix for this block configuration is:
  # frontend.volume-results-cache
  [cache: &amp;lt;cache_config&amp;gt;]

  # Use compression in cache. The default is an empty value &amp;#39;&amp;#39;, which disables
  # compression. Supported values are: &amp;#39;snappy&amp;#39; and &amp;#39;&amp;#39;.
  # CLI flag: -frontend.volume-results-cache.compression
  [compression: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Cache instant metric query results.
# CLI flag: -querier.cache-instant-metric-results
[cache_instant_metric_results: &amp;lt;boolean&amp;gt; | default = false]

# If a cache config is not specified and cache_instant_metric_results is true,
# the config for the results cache is used.
instant_metric_results_cache:
  # The cache_config block configures the cache backend for a specific Loki
  # component.
  # The CLI flags prefix for this block configuration is:
  # frontend.instant-metric-results-cache
  [cache: &amp;lt;cache_config&amp;gt;]

  # Use compression in cache. The default is an empty value &amp;#39;&amp;#39;, which disables
  # compression. Supported values are: &amp;#39;snappy&amp;#39; and &amp;#39;&amp;#39;.
  # CLI flag: -frontend.instant-metric-results-cache.compression
  [compression: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Whether to align the splits of instant metric query with splitByInterval and
# query&amp;#39;s exec time. Useful when instant_metric_cache is enabled
# CLI flag: -querier.instant-metric-query-split-align
[instant_metric_query_split_align: &amp;lt;boolean&amp;gt; | default = false]

# Cache series query results.
# CLI flag: -querier.cache-series-results
[cache_series_results: &amp;lt;boolean&amp;gt; | default = true]

# If series_results_cache is not configured and cache_series_results is true,
# the config for the results cache is used.
series_results_cache:
  # The cache_config block configures the cache backend for a specific Loki
  # component.
  # The CLI flags prefix for this block configuration is:
  # frontend.series-results-cache
  [cache: &amp;lt;cache_config&amp;gt;]

  # Use compression in cache. The default is an empty value &amp;#39;&amp;#39;, which disables
  # compression. Supported values are: &amp;#39;snappy&amp;#39; and &amp;#39;&amp;#39;.
  # CLI flag: -frontend.series-results-cache.compression
  [compression: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Cache label query results.
# CLI flag: -querier.cache-label-results
[cache_label_results: &amp;lt;boolean&amp;gt; | default = true]

# If label_results_cache is not configured and cache_label_results is true, the
# config for the results cache is used.
label_results_cache:
  # The cache_config block configures the cache backend for a specific Loki
  # component.
  # The CLI flags prefix for this block configuration is:
  # frontend.label-results-cache
  [cache: &amp;lt;cache_config&amp;gt;]

  # Use compression in cache. The default is an empty value &amp;#39;&amp;#39;, which disables
  # compression. Supported values are: &amp;#39;snappy&amp;#39; and &amp;#39;&amp;#39;.
  # CLI flag: -frontend.label-results-cache.compression
  [compression: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;query_scheduler&#34;&gt;query_scheduler&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;query_scheduler&lt;/code&gt; block configures the Loki query scheduler. When configured it separates the tenant query queues from the query-frontend.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Maximum number of outstanding requests per tenant per query-scheduler.
# In-flight requests above this limit will fail with HTTP response status code
# 429.
# CLI flag: -query-scheduler.max-outstanding-requests-per-tenant
[max_outstanding_requests_per_tenant: &amp;lt;int&amp;gt; | default = 32000]

# Maximum number of levels of nesting of hierarchical queues. 0 means that
# hierarchical queues are disabled.
# CLI flag: -query-scheduler.max-queue-hierarchy-levels
[max_queue_hierarchy_levels: &amp;lt;int&amp;gt; | default = 3]

# If a querier disconnects without sending notification about graceful shutdown,
# the query-scheduler will keep the querier in the tenant&amp;#39;s shard until the
# forget delay has passed. This feature is useful to reduce the blast radius
# when shuffle-sharding is enabled.
# CLI flag: -query-scheduler.querier-forget-delay
[querier_forget_delay: &amp;lt;duration&amp;gt; | default = 0s]

# This configures the gRPC client used to report errors back to the
# query-frontend.
# The CLI flags prefix for this block configuration is:
# query-scheduler.grpc-client-config
[grpc_client_config: &amp;lt;grpc_client&amp;gt;]

# Set to true to have the query schedulers create and place themselves in a
# ring. If no frontend_address or scheduler_address are present anywhere else in
# the configuration, Loki will toggle this value to true.
# CLI flag: -query-scheduler.use-scheduler-ring
[use_scheduler_ring: &amp;lt;boolean&amp;gt; | default = false]

# The hash ring configuration. This option is required only if
# use_scheduler_ring is true.
scheduler_ring:
  kvstore:
    # Backend storage to use for the ring. Supported values are: consul, etcd,
    # inmemory, memberlist, multi.
    # CLI flag: -query-scheduler.ring.store
    [store: &amp;lt;string&amp;gt; | default = &amp;#34;consul&amp;#34;]

    # The prefix for the keys in the store. Should end with a /.
    # CLI flag: -query-scheduler.ring.prefix
    [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;collectors/&amp;#34;]

    # Configuration for a Consul client. Only applies if the selected kvstore is
    # consul.
    # The CLI flags prefix for this block configuration is: query-scheduler.ring
    [consul: &amp;lt;consul&amp;gt;]

    # Configuration for an ETCD v3 client. Only applies if the selected kvstore
    # is etcd.
    # The CLI flags prefix for this block configuration is: query-scheduler.ring
    [etcd: &amp;lt;etcd&amp;gt;]

    multi:
      # Primary backend storage used by multi-client.
      # CLI flag: -query-scheduler.ring.multi.primary
      [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Secondary backend storage used by multi-client.
      # CLI flag: -query-scheduler.ring.multi.secondary
      [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Mirror writes to the secondary store.
      # CLI flag: -query-scheduler.ring.multi.mirror-enabled
      [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

      # Timeout for storing a value to the secondary store.
      # CLI flag: -query-scheduler.ring.multi.mirror-timeout
      [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

  # Period at which to heartbeat to the ring.
  # CLI flag: -query-scheduler.ring.heartbeat-period
  [heartbeat_period: &amp;lt;duration&amp;gt; | default = 15s]

  # The heartbeat timeout after which compactors are considered unhealthy within
  # the ring. 0 = never (timeout disabled).
  # CLI flag: -query-scheduler.ring.heartbeat-timeout
  [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

  # File path where tokens are stored. If empty, tokens are not stored at
  # shutdown and restored at startup.
  # CLI flag: -query-scheduler.ring.tokens-file-path
  [tokens_file_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # True to enable zone-awareness and replicate blocks across different
  # availability zones.
  # CLI flag: -query-scheduler.ring.zone-awareness-enabled
  [zone_awareness_enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Instance ID to register in the ring.
  # CLI flag: -query-scheduler.ring.instance-id
  [instance_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;lt;hostname&amp;gt;&amp;#34;]

  # Name of network interface to read address from.
  # CLI flag: -query-scheduler.ring.instance-interface-names
  [instance_interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

  # Port to advertise in the ring (defaults to server.grpc-listen-port).
  # CLI flag: -query-scheduler.ring.instance-port
  [instance_port: &amp;lt;int&amp;gt; | default = 0]

  # IP address to advertise in the ring.
  # CLI flag: -query-scheduler.ring.instance-addr
  [instance_addr: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The availability zone where this instance is running. Required if
  # zone-awareness is enabled.
  # CLI flag: -query-scheduler.ring.instance-availability-zone
  [instance_availability_zone: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Enable using a IPv6 instance address.
  # CLI flag: -query-scheduler.ring.instance-enable-ipv6
  [instance_enable_ipv6: &amp;lt;boolean&amp;gt; | default = false]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;ruler&#34;&gt;ruler&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;ruler&lt;/code&gt; block configures the Loki ruler.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Base URL of the Grafana instance.
# CLI flag: -ruler.external.url
[external_url: &amp;lt;url&amp;gt;]

# Datasource UID for the dashboard.
# CLI flag: -ruler.datasource-uid
[datasource_uid: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Labels to add to all alerts.
external_labels:

# The grpc_client block configures the gRPC client used to communicate between a
# client and server component in Loki.
# The CLI flags prefix for this block configuration is: ruler.client
[ruler_client: &amp;lt;grpc_client&amp;gt;]

# How frequently to evaluate rules.
# CLI flag: -ruler.evaluation-interval
[evaluation_interval: &amp;lt;duration&amp;gt; | default = 1m]

# How frequently to poll for rule changes.
# CLI flag: -ruler.poll-interval
[poll_interval: &amp;lt;duration&amp;gt; | default = 1m]

# Deprecated: Use -ruler-storage. CLI flags and their respective YAML config
# options instead.
storage:
  # Method to use for backend rule storage (configdb, azure, gcs, s3, swift,
  # local, bos, cos)
  # CLI flag: -ruler.storage.type
  [type: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Configures backend rule storage for Azure.
  # The CLI flags prefix for this block configuration is: ruler.storage
  [azure: &amp;lt;azure_storage_config&amp;gt;]

  # Configures backend rule storage for AlibabaCloud Object Storage (OSS).
  # The CLI flags prefix for this block configuration is: ruler.storage
  [alibabacloud: &amp;lt;alibabacloud_storage_config&amp;gt;]

  # Configures backend rule storage for GCS.
  # The CLI flags prefix for this block configuration is: ruler.storage
  [gcs: &amp;lt;gcs_storage_config&amp;gt;]

  # Configures backend rule storage for S3.
  # The CLI flags prefix for this block configuration is: ruler.storage
  [s3: &amp;lt;s3_storage_config&amp;gt;]

  # Configures backend rule storage for Baidu Object Storage (BOS).
  # The CLI flags prefix for this block configuration is: ruler.storage
  [bos: &amp;lt;bos_storage_config&amp;gt;]

  # Configures backend rule storage for Swift.
  # The CLI flags prefix for this block configuration is: ruler.storage
  [swift: &amp;lt;swift_storage_config&amp;gt;]

  # Configures backend rule storage for IBM Cloud Object Storage (COS).
  # The CLI flags prefix for this block configuration is: ruler.storage
  [cos: &amp;lt;cos_storage_config&amp;gt;]

  # Configures backend rule storage for a local file system directory.
  local:
    # Directory to scan for rules
    # CLI flag: -ruler.storage.local.directory
    [directory: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# File path to store temporary rule files.
# CLI flag: -ruler.rule-path
[rule_path: &amp;lt;string&amp;gt; | default = &amp;#34;/rules&amp;#34;]

# Comma-separated list of Alertmanager URLs to send notifications to. Each
# Alertmanager URL is treated as a separate group in the configuration. Multiple
# Alertmanagers in HA per group can be supported by using DNS resolution via
# &amp;#39;-ruler.alertmanager-discovery&amp;#39;.
# CLI flag: -ruler.alertmanager-url
[alertmanager_url: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Use DNS SRV records to discover Alertmanager hosts.
# CLI flag: -ruler.alertmanager-discovery
[enable_alertmanager_discovery: &amp;lt;boolean&amp;gt; | default = false]

# How long to wait between refreshing DNS resolutions of Alertmanager hosts.
# CLI flag: -ruler.alertmanager-refresh-interval
[alertmanager_refresh_interval: &amp;lt;duration&amp;gt; | default = 1m]

# Use Alertmanager APIv2. APIv1 was deprecated in Alertmanager 0.16.0 and is
# removed as of 0.27.0.
# CLI flag: -ruler.alertmanager-use-v2
[enable_alertmanager_v2: &amp;lt;boolean&amp;gt; | default = true]

# List of alert relabel configs.
[alert_relabel_configs: &amp;lt;relabel_config...&amp;gt;]

# Capacity of the queue for notifications to be sent to the Alertmanager.
# CLI flag: -ruler.notification-queue-capacity
[notification_queue_capacity: &amp;lt;int&amp;gt; | default = 10000]

# HTTP timeout duration when sending notifications to the Alertmanager.
# CLI flag: -ruler.notification-timeout
[notification_timeout: &amp;lt;duration&amp;gt; | default = 10s]

alertmanager_client:
  # The TLS configuration.
  # The CLI flags prefix for this block configuration is:
  # ruler.alertmanager-client
  [&amp;lt;tls_config&amp;gt;]

  # HTTP Basic authentication username. It overrides the username set in the URL
  # (if any).
  # CLI flag: -ruler.alertmanager-client.basic-auth-username
  [basic_auth_username: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # HTTP Basic authentication password. It overrides the password set in the URL
  # (if any).
  # CLI flag: -ruler.alertmanager-client.basic-auth-password
  [basic_auth_password: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # HTTP Header authorization type (default: Bearer).
  # CLI flag: -ruler.alertmanager-client.type
  [type: &amp;lt;string&amp;gt; | default = &amp;#34;Bearer&amp;#34;]

  # HTTP Header authorization credentials.
  # CLI flag: -ruler.alertmanager-client.credentials
  [credentials: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # HTTP Header authorization credentials file.
  # CLI flag: -ruler.alertmanager-client.credentials-file
  [credentials_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Max time to tolerate outage for restoring &amp;#34;for&amp;#34; state of alert.
# CLI flag: -ruler.for-outage-tolerance
[for_outage_tolerance: &amp;lt;duration&amp;gt; | default = 1h]

# Minimum duration between alert and restored &amp;#34;for&amp;#34; state. This is maintained
# only for alerts with configured &amp;#34;for&amp;#34; time greater than the grace period.
# CLI flag: -ruler.for-grace-period
[for_grace_period: &amp;lt;duration&amp;gt; | default = 10m]

# Minimum amount of time to wait before resending an alert to Alertmanager.
# CLI flag: -ruler.resend-delay
[resend_delay: &amp;lt;duration&amp;gt; | default = 1m]

# Distribute rule evaluation using ring backend.
# CLI flag: -ruler.enable-sharding
[enable_sharding: &amp;lt;boolean&amp;gt; | default = false]

# The sharding strategy to use. Supported values are: default, shuffle-sharding.
# CLI flag: -ruler.sharding-strategy
[sharding_strategy: &amp;lt;string&amp;gt; | default = &amp;#34;default&amp;#34;]

# The sharding algorithm to use for deciding how rules &amp;amp; groups are sharded.
# Supported values are: by-group, by-rule.
# CLI flag: -ruler.sharding-algo
[sharding_algo: &amp;lt;string&amp;gt; | default = &amp;#34;by-group&amp;#34;]

# Time to spend searching for a pending ruler when shutting down.
# CLI flag: -ruler.search-pending-for
[search_pending_for: &amp;lt;duration&amp;gt; | default = 5m]

# Ring used by Loki ruler. The CLI flags prefix for this block configuration is
# &amp;#39;ruler.ring&amp;#39;.
ring:
  kvstore:
    # Backend storage to use for the ring. Supported values are: consul, etcd,
    # inmemory, memberlist, multi.
    # CLI flag: -ruler.ring.store
    [store: &amp;lt;string&amp;gt; | default = &amp;#34;consul&amp;#34;]

    # The prefix for the keys in the store. Should end with a /.
    # CLI flag: -ruler.ring.prefix
    [prefix: &amp;lt;string&amp;gt; | default = &amp;#34;rulers/&amp;#34;]

    # Configuration for a Consul client. Only applies if the selected kvstore is
    # consul.
    # The CLI flags prefix for this block configuration is: ruler.ring
    [consul: &amp;lt;consul&amp;gt;]

    # Configuration for an ETCD v3 client. Only applies if the selected kvstore
    # is etcd.
    # The CLI flags prefix for this block configuration is: ruler.ring
    [etcd: &amp;lt;etcd&amp;gt;]

    multi:
      # Primary backend storage used by multi-client.
      # CLI flag: -ruler.ring.multi.primary
      [primary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Secondary backend storage used by multi-client.
      # CLI flag: -ruler.ring.multi.secondary
      [secondary: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

      # Mirror writes to the secondary store.
      # CLI flag: -ruler.ring.multi.mirror-enabled
      [mirror_enabled: &amp;lt;boolean&amp;gt; | default = false]

      # Timeout for storing a value to the secondary store.
      # CLI flag: -ruler.ring.multi.mirror-timeout
      [mirror_timeout: &amp;lt;duration&amp;gt; | default = 2s]

  # Interval between heartbeats sent to the ring.
  # CLI flag: -ruler.ring.heartbeat-period
  [heartbeat_period: &amp;lt;duration&amp;gt; | default = 5s]

  # The heartbeat timeout after which ruler ring members are considered
  # unhealthy within the ring. 0 = never (timeout disabled).
  # CLI flag: -ruler.ring.heartbeat-timeout
  [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = 1m]

  # Name of network interface to read addresses from.
  # CLI flag: -ruler.ring.instance-interface-names
  [instance_interface_names: &amp;lt;list of strings&amp;gt; | default = [&amp;lt;private network interfaces&amp;gt;]]

  # The number of tokens the lifecycler will generate and put into the ring if
  # it joined without transferring tokens from another lifecycler.
  # CLI flag: -ruler.ring.num-tokens
  [num_tokens: &amp;lt;int&amp;gt; | default = 128]

# Period with which to attempt to flush rule groups.
# CLI flag: -ruler.flush-period
[flush_period: &amp;lt;duration&amp;gt; | default = 1m]

# Enable the ruler API.
# CLI flag: -ruler.enable-api
[enable_api: &amp;lt;boolean&amp;gt; | default = true]

# Comma separated list of tenants whose rules this ruler can evaluate. If
# specified, only these tenants will be handled by ruler, otherwise this ruler
# can process rules from all tenants. Subject to sharding.
# CLI flag: -ruler.enabled-tenants
[enabled_tenants: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Comma separated list of tenants whose rules this ruler cannot evaluate. If
# specified, a ruler that would normally pick the specified tenant(s) for
# processing will ignore them instead. Subject to sharding.
# CLI flag: -ruler.disabled-tenants
[disabled_tenants: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Report the wall time for ruler queries to complete as a per user metric and as
# an info level log message.
# CLI flag: -ruler.query-stats-enabled
[query_stats_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Disable the rule_group label on exported metrics.
# CLI flag: -ruler.disable-rule-group-label
[disable_rule_group_label: &amp;lt;boolean&amp;gt; | default = false]

wal:
  # The directory in which to write tenant WAL files. Each tenant will have its
  # own directory one level below this directory.
  # CLI flag: -ruler.wal.dir
  [dir: &amp;lt;string&amp;gt; | default = &amp;#34;ruler-wal&amp;#34;]

  # Frequency with which to run the WAL truncation process.
  # CLI flag: -ruler.wal.truncate-frequency
  [truncate_frequency: &amp;lt;duration&amp;gt; | default = 1h]

  # Minimum age that samples must exist in the WAL before being truncated.
  # CLI flag: -ruler.wal.min-age
  [min_age: &amp;lt;duration&amp;gt; | default = 5m]

  # Maximum age that samples must exist in the WAL before being truncated.
  # CLI flag: -ruler.wal.max-age
  [max_age: &amp;lt;duration&amp;gt; | default = 4h]

wal_cleaner:
  # The minimum age of a WAL to consider for cleaning.
  # CLI flag: -ruler.wal-cleaner.min-age
  [min_age: &amp;lt;duration&amp;gt; | default = 12h]

  # How often to run the WAL cleaner. 0 = disabled.
  # CLI flag: -ruler.wal-cleaner.period
  [period: &amp;lt;duration&amp;gt; | default = 0s]

# Remote-write configuration to send rule samples to a Prometheus remote-write
# endpoint.
remote_write:
  # Deprecated: Use &amp;#39;clients&amp;#39; instead. Configure remote write client.
  [client: &amp;lt;RemoteWriteConfig&amp;gt;]

  # Configure remote write clients. A map with remote client id as key. For
  # details, see
  # https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write
  # Specifying a header with key &amp;#39;X-Scope-OrgID&amp;#39; under the &amp;#39;headers&amp;#39; section of
  # RemoteWriteConfig is not permitted. If specified, it will be dropped during
  # config parsing.
  [clients: &amp;lt;map of string to RemoteWriteConfig&amp;gt;]

  # Enable remote-write functionality.
  # CLI flag: -ruler.remote-write.enabled
  [enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Minimum period to wait between refreshing remote-write reconfigurations.
  # This should be greater than or equivalent to
  # -limits.per-user-override-period.
  # CLI flag: -ruler.remote-write.config-refresh-period
  [config_refresh_period: &amp;lt;duration&amp;gt; | default = 10s]

  # Add an X-Scope-OrgID header in remote write requests with the tenant ID of a
  # Loki tenant that the recording rules are part of.
  # CLI flag: -ruler.remote-write.add-org-id-header
  [add_org_id_header: &amp;lt;boolean&amp;gt; | default = true]

# Configuration for rule evaluation.
evaluation:
  # The evaluation mode for the ruler. Can be either &amp;#39;local&amp;#39; or &amp;#39;remote&amp;#39;. If set
  # to &amp;#39;local&amp;#39;, the ruler will evaluate rules locally. If set to &amp;#39;remote&amp;#39;, the
  # ruler will evaluate rules remotely. If unset, the ruler will evaluate rules
  # locally.
  # CLI flag: -ruler.evaluation.mode
  [mode: &amp;lt;string&amp;gt; | default = &amp;#34;local&amp;#34;]

  # Upper bound of random duration to wait before rule evaluation to avoid
  # contention during concurrent execution of rules. Jitter is calculated
  # consistently for a given rule. Set 0 to disable (default).
  # CLI flag: -ruler.evaluation.max-jitter
  [max_jitter: &amp;lt;duration&amp;gt; | default = 0s]

  query_frontend:
    # GRPC listen address of the query-frontend(s). Must be a DNS address
    # (prefixed with dns:///) to enable client side load balancing.
    # CLI flag: -ruler.evaluation.query-frontend.address
    [address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Set to true if query-frontend connection requires TLS.
    # CLI flag: -ruler.evaluation.query-frontend.tls-enabled
    [tls_enabled: &amp;lt;boolean&amp;gt; | default = false]

    # The TLS configuration.
    # The CLI flags prefix for this block configuration is:
    # ruler.evaluation.query-frontend
    [&amp;lt;tls_config&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;runtime_config&#34;&gt;runtime_config&lt;/h3&gt;
&lt;p&gt;Configuration for &amp;lsquo;runtime config&amp;rsquo; module, responsible for reloading runtime configuration file.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# How often to check runtime config files.
# CLI flag: -runtime-config.reload-period
[period: &amp;lt;duration&amp;gt; | default = 10s]

# Comma separated list of yaml files with the configuration that can be updated
# at runtime. Runtime config files will be merged from left to right.
# CLI flag: -runtime-config.file
[file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;s3_storage_config&#34;&gt;s3_storage_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;s3_storage_config&lt;/code&gt; block configures the connection to Amazon S3 object storage backend. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;common.storage&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.storage&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# S3 endpoint URL with escaped Key and Secret encoded. If only region is
# specified as a host, proper endpoint will be deduced. Use
# inmemory:///&amp;lt;bucket-name&amp;gt; to use a mock in-memory implementation.
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.url
[s3: &amp;lt;url&amp;gt;]

# Set this to `true` to force the request to use path-style addressing.
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.force-path-style
[s3forcepathstyle: &amp;lt;boolean&amp;gt; | default = false]

# Comma separated list of bucket names to evenly distribute chunks over.
# Overrides any buckets specified in s3.url flag
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.buckets
[bucketnames: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# S3 Endpoint to connect to.
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.endpoint
[endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# AWS region to use.
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.region
[region: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# AWS Access Key ID
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.access-key-id
[access_key_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# AWS Secret Access Key
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.secret-access-key
[secret_access_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# AWS Session Token
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.session-token
[session_token: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Disable https on s3 connection.
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.insecure
[insecure: &amp;lt;boolean&amp;gt; | default = false]

# Delimiter used to replace the default delimiter &amp;#39;:&amp;#39; in chunk IDs when storing
# chunks. This is mainly intended when you run a MinIO instance on a Windows
# machine. You should not change this value inflight.
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.chunk-delimiter
[chunk_delimiter: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

http_config:
  # Timeout specifies a time limit for requests made by s3 Client.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.http.timeout
  [timeout: &amp;lt;duration&amp;gt; | default = 0s]

  # The maximum amount of time an idle connection will be held open.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.http.idle-conn-timeout
  [idle_conn_timeout: &amp;lt;duration&amp;gt; | default = 1m30s]

  # If non-zero, specifies the amount of time to wait for a server&amp;#39;s response
  # headers after fully writing the request.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.http.response-header-timeout
  [response_header_timeout: &amp;lt;duration&amp;gt; | default = 0s]

  # Set to true to skip verifying the certificate chain and hostname.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.http.insecure-skip-verify
  [insecure_skip_verify: &amp;lt;boolean&amp;gt; | default = false]

  # Path to the trusted CA file that signed the SSL certificate of the S3
  # endpoint.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.http.ca-file
  [ca_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# The signature version to use for authenticating against S3. Supported values
# are: v4.
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.signature-version
[signature_version: &amp;lt;string&amp;gt; | default = &amp;#34;v4&amp;#34;]

# The S3 storage class which objects will use. Supported values are: GLACIER,
# DEEP_ARCHIVE, GLACIER_IR, INTELLIGENT_TIERING, ONEZONE_IA, OUTPOSTS,
# REDUCED_REDUNDANCY, STANDARD, STANDARD_IA.
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.storage-class
[storage_class: &amp;lt;string&amp;gt; | default = &amp;#34;STANDARD&amp;#34;]

sse:
  # Enable AWS Server Side Encryption. Supported values: SSE-KMS, SSE-S3.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.sse.type
  [type: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # KMS Key ID used to encrypt objects in S3
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.sse.kms-key-id
  [kms_key_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # KMS Encryption Context used for object encryption. It expects JSON formatted
  # string.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.sse.kms-encryption-context
  [kms_encryption_context: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Configures back off when S3 get Object.
backoff_config:
  # Minimum backoff time when s3 get Object
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.min-backoff
  [min_period: &amp;lt;duration&amp;gt; | default = 100ms]

  # Maximum backoff time when s3 get Object
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.max-backoff
  [max_period: &amp;lt;duration&amp;gt; | default = 3s]

  # Maximum number of times to retry for s3 GetObject or ObjectExists
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.max-retries
  [max_retries: &amp;lt;int&amp;gt; | default = 5]

# Disable forcing S3 dualstack endpoint usage.
# CLI flag: -&amp;lt;prefix&amp;gt;.s3.disable-dualstack
[disable_dualstack: &amp;lt;boolean&amp;gt; | default = false]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;schema_config&#34;&gt;schema_config&lt;/h3&gt;
&lt;p&gt;Configures the chunk index schema and where it is stored.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;[configs: &amp;lt;list of period_configs&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;server&#34;&gt;server&lt;/h3&gt;
&lt;p&gt;Configures the &lt;code&gt;server&lt;/code&gt; of the launched module(s).&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# HTTP server listen network, default tcp
# CLI flag: -server.http-listen-network
[http_listen_network: &amp;lt;string&amp;gt; | default = &amp;#34;tcp&amp;#34;]

# HTTP server listen address.
# CLI flag: -server.http-listen-address
[http_listen_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# HTTP server listen port.
# CLI flag: -server.http-listen-port
[http_listen_port: &amp;lt;int&amp;gt; | default = 3100]

# Maximum number of simultaneous http connections, &amp;lt;=0 to disable
# CLI flag: -server.http-conn-limit
[http_listen_conn_limit: &amp;lt;int&amp;gt; | default = 0]

# gRPC server listen network
# CLI flag: -server.grpc-listen-network
[grpc_listen_network: &amp;lt;string&amp;gt; | default = &amp;#34;tcp&amp;#34;]

# gRPC server listen address.
# CLI flag: -server.grpc-listen-address
[grpc_listen_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# gRPC server listen port.
# CLI flag: -server.grpc-listen-port
[grpc_listen_port: &amp;lt;int&amp;gt; | default = 9095]

# Maximum number of simultaneous grpc connections, &amp;lt;=0 to disable
# CLI flag: -server.grpc-conn-limit
[grpc_listen_conn_limit: &amp;lt;int&amp;gt; | default = 0]

# If true, the max streams by connection gauge will be collected.
# CLI flag: -server.grpc-collect-max-streams-by-conn
[grpc_collect_max_streams_by_conn: &amp;lt;boolean&amp;gt; | default = true]

# Enables PROXY protocol.
# CLI flag: -server.proxy-protocol-enabled
[proxy_protocol_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Comma-separated list of cipher suites to use. If blank, the default Go cipher
# suites is used.
# CLI flag: -server.tls-cipher-suites
[tls_cipher_suites: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Minimum TLS version to use. Allowed values: VersionTLS10, VersionTLS11,
# VersionTLS12, VersionTLS13. If blank, the Go TLS minimum version is used.
# CLI flag: -server.tls-min-version
[tls_min_version: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

http_tls_config:
  # Server TLS certificate. This configuration parameter is YAML only.
  [cert: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Server TLS key. This configuration parameter is YAML only.
  [key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Root certificate authority used to verify client certificates. This
  # configuration parameter is YAML only.
  [client_ca: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # HTTP server cert path.
  # CLI flag: -server.http-tls-cert-path
  [cert_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # HTTP server key path.
  # CLI flag: -server.http-tls-key-path
  [key_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # HTTP TLS Client Auth type.
  # CLI flag: -server.http-tls-client-auth
  [client_auth_type: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # HTTP TLS Client CA path.
  # CLI flag: -server.http-tls-ca-path
  [client_ca_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

grpc_tls_config:
  # Server TLS certificate. This configuration parameter is YAML only.
  [cert: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Server TLS key. This configuration parameter is YAML only.
  [key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Root certificate authority used to verify client certificates. This
  # configuration parameter is YAML only.
  [client_ca: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # GRPC TLS server cert path.
  # CLI flag: -server.grpc-tls-cert-path
  [cert_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # GRPC TLS server key path.
  # CLI flag: -server.grpc-tls-key-path
  [key_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # GRPC TLS Client Auth type.
  # CLI flag: -server.grpc-tls-client-auth
  [client_auth_type: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # GRPC TLS Client CA path.
  # CLI flag: -server.grpc-tls-ca-path
  [client_ca_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Register the intrumentation handlers (/metrics etc).
# CLI flag: -server.register-instrumentation
[register_instrumentation: &amp;lt;boolean&amp;gt; | default = true]

# If set to true, gRPC statuses will be reported in instrumentation labels with
# their string representations. Otherwise, they will be reported as &amp;#34;error&amp;#34;.
# CLI flag: -server.report-grpc-codes-in-instrumentation-label-enabled
[report_grpc_codes_in_instrumentation_label_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Timeout for graceful shutdowns
# CLI flag: -server.graceful-shutdown-timeout
[graceful_shutdown_timeout: &amp;lt;duration&amp;gt; | default = 30s]

# Read timeout for entire HTTP request, including headers and body.
# CLI flag: -server.http-read-timeout
[http_server_read_timeout: &amp;lt;duration&amp;gt; | default = 30s]

# Read timeout for HTTP request headers. If set to 0, value of
# -server.http-read-timeout is used.
# CLI flag: -server.http-read-header-timeout
[http_server_read_header_timeout: &amp;lt;duration&amp;gt; | default = 0s]

# Write timeout for HTTP server
# CLI flag: -server.http-write-timeout
[http_server_write_timeout: &amp;lt;duration&amp;gt; | default = 30s]

# Idle timeout for HTTP server
# CLI flag: -server.http-idle-timeout
[http_server_idle_timeout: &amp;lt;duration&amp;gt; | default = 2m]

# Log closed connections that did not receive any response, most likely because
# client didn&amp;#39;t send any request within timeout.
# CLI flag: -server.http-log-closed-connections-without-response-enabled
[http_log_closed_connections_without_response_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Limit on the size of a gRPC message this server can receive (bytes).
# CLI flag: -server.grpc-max-recv-msg-size-bytes
[grpc_server_max_recv_msg_size: &amp;lt;int&amp;gt; | default = 4194304]

# Limit on the size of a gRPC message this server can send (bytes).
# CLI flag: -server.grpc-max-send-msg-size-bytes
[grpc_server_max_send_msg_size: &amp;lt;int&amp;gt; | default = 4194304]

# Limit on the number of concurrent streams for gRPC calls per client connection
# (0 = unlimited)
# CLI flag: -server.grpc-max-concurrent-streams
[grpc_server_max_concurrent_streams: &amp;lt;int&amp;gt; | default = 100]

# The duration after which an idle connection should be closed. Default:
# infinity
# CLI flag: -server.grpc.keepalive.max-connection-idle
[grpc_server_max_connection_idle: &amp;lt;duration&amp;gt; | default = 2562047h47m16.854775807s]

# The duration for the maximum amount of time a connection may exist before it
# will be closed. Default: infinity
# CLI flag: -server.grpc.keepalive.max-connection-age
[grpc_server_max_connection_age: &amp;lt;duration&amp;gt; | default = 2562047h47m16.854775807s]

# An additive period after max-connection-age after which the connection will be
# forcibly closed. Default: infinity
# CLI flag: -server.grpc.keepalive.max-connection-age-grace
[grpc_server_max_connection_age_grace: &amp;lt;duration&amp;gt; | default = 2562047h47m16.854775807s]

# Duration after which a keepalive probe is sent in case of no activity over the
# connection., Default: 2h
# CLI flag: -server.grpc.keepalive.time
[grpc_server_keepalive_time: &amp;lt;duration&amp;gt; | default = 2h]

# After having pinged for keepalive check, the duration after which an idle
# connection should be closed, Default: 20s
# CLI flag: -server.grpc.keepalive.timeout
[grpc_server_keepalive_timeout: &amp;lt;duration&amp;gt; | default = 20s]

# Minimum amount of time a client should wait before sending a keepalive ping.
# If client sends keepalive ping more often, server will send GOAWAY and close
# the connection.
# CLI flag: -server.grpc.keepalive.min-time-between-pings
[grpc_server_min_time_between_pings: &amp;lt;duration&amp;gt; | default = 10s]

# If true, server allows keepalive pings even when there are no active
# streams(RPCs). If false, and client sends ping when there are no active
# streams, server will send GOAWAY and close the connection.
# CLI flag: -server.grpc.keepalive.ping-without-stream-allowed
[grpc_server_ping_without_stream_allowed: &amp;lt;boolean&amp;gt; | default = true]

# If non-zero, configures the amount of GRPC server workers used to serve the
# requests.
# CLI flag: -server.grpc.num-workers
[grpc_server_num_workers: &amp;lt;int&amp;gt; | default = 0]

# If true, the request_message_bytes, response_message_bytes, and
# inflight_requests metrics will be tracked. Enabling this option prevents the
# use of memory pools for parsing gRPC request bodies and may lead to more
# memory allocations.
# CLI flag: -server.grpc.stats-tracking-enabled
[grpc_server_stats_tracking_enabled: &amp;lt;boolean&amp;gt; | default = true]

# Deprecated option, has no effect and will be removed in a future version.
# CLI flag: -server.grpc.recv-buffer-pools-enabled
[grpc_server_recv_buffer_pools_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Output log messages in the given format. Valid formats: [logfmt, json]
# CLI flag: -log.format
[log_format: &amp;lt;string&amp;gt; | default = &amp;#34;logfmt&amp;#34;]

# Only log messages with the given severity or above. Valid levels: [debug,
# info, warn, error]
# CLI flag: -log.level
[log_level: &amp;lt;string&amp;gt; | default = &amp;#34;info&amp;#34;]

# Optionally log the source IPs.
# CLI flag: -server.log-source-ips-enabled
[log_source_ips_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Log all source IPs instead of only the originating one. Only used if
# server.log-source-ips-enabled is true
# CLI flag: -server.log-source-ips-full
[log_source_ips_full: &amp;lt;boolean&amp;gt; | default = false]

# Header field storing the source IPs. Only used if
# server.log-source-ips-enabled is true. If not set the default Forwarded,
# X-Real-IP and X-Forwarded-For headers are used
# CLI flag: -server.log-source-ips-header
[log_source_ips_header: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Regex for matching the source IPs. Only used if server.log-source-ips-enabled
# is true. If not set the default Forwarded, X-Real-IP and X-Forwarded-For
# headers are used
# CLI flag: -server.log-source-ips-regex
[log_source_ips_regex: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Optionally log request headers.
# CLI flag: -server.log-request-headers
[log_request_headers: &amp;lt;boolean&amp;gt; | default = false]

# Optionally log requests at info level instead of debug level. Applies to
# request headers as well if server.log-request-headers is enabled.
# CLI flag: -server.log-request-at-info-level-enabled
[log_request_at_info_level_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Comma separated list of headers to exclude from loggin. Only used if
# server.log-request-headers is true.
# CLI flag: -server.log-request-headers-exclude-list
[log_request_exclude_headers_list: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Optionally add request headers to tracing spans.
# CLI flag: -server.trace-request-headers
[trace_request_headers: &amp;lt;boolean&amp;gt; | default = false]

# Comma separated list of headers to exclude from tracing spans. Only used if
# server.trace-request-headers is true. The following headers are always
# excluded: Authorization, Cookie, X-Access-Token, X-Csrf-Token, X-Grafana-Id.
# CLI flag: -server.trace-request-headers-exclude-list
[trace_request_exclude_headers_list: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Base path to serve all API routes from (e.g. /v1/)
# CLI flag: -server.path-prefix
[http_path_prefix: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

cluster_validation:
  # Primary cluster validation label.
  # CLI flag: -server.cluster-validation.label
  [label: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Comma-separated list of additional cluster validation labels that the server
  # will accept from incoming requests.
  # CLI flag: -server.cluster-validation.additional-labels
  [additional_labels: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  grpc:
    # When enabled, cluster label validation is executed: configured cluster
    # validation label is compared with the cluster validation label received
    # through the requests.
    # CLI flag: -server.cluster-validation.grpc.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

    # When enabled, soft cluster label validation is executed. Can be enabled
    # only together with server.cluster-validation.grpc.enabled
    # CLI flag: -server.cluster-validation.grpc.soft-validation
    [soft_validation: &amp;lt;boolean&amp;gt; | default = false]

  http:
    # When enabled, cluster label validation is executed: configured cluster
    # validation label is compared with the cluster validation label received
    # through the requests.
    # CLI flag: -server.cluster-validation.http.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

    # When enabled, soft cluster label validation is executed. Can be enabled
    # only together with server.cluster-validation.http.enabled
    # CLI flag: -server.cluster-validation.http.soft-validation
    [soft_validation: &amp;lt;boolean&amp;gt; | default = false]

    # Comma-separated list of url paths that are excluded from the cluster
    # validation check.
    # CLI flag: -server.cluster-validation.http.excluded-paths
    [excluded_paths: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Comma-separated list of user agents that are excluded from the cluster
    # validation check.
    # CLI flag: -server.cluster-validation.http.excluded-user-agents
    [excluded_user_agents: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Creates new traces for each call rather than continuing the existing trace. A
# span link is used to allow navigation to the parent trace. Only works when
# using Open-Telemetry tracing.
# CLI flag: -server.create-new-traces
[create_new_traces: &amp;lt;boolean&amp;gt; | default = false]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;storage_config&#34;&gt;storage_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;storage_config&lt;/code&gt; 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.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# The alibabacloud_storage_config block configures the connection to Alibaba
# Cloud Storage object storage backend.
[alibabacloud: &amp;lt;alibabacloud_storage_config&amp;gt;]

# The aws_storage_config block configures the connection to dynamoDB and S3
# object storage. Either one of them or both can be configured.
[aws: &amp;lt;aws_storage_config&amp;gt;]

# The azure_storage_config block configures the connection to Azure object
# storage backend.
[azure: &amp;lt;azure_storage_config&amp;gt;]

# The bos_storage_config block configures the connection to Baidu Object Storage
# (BOS) object storage backend.
[bos: &amp;lt;bos_storage_config&amp;gt;]

# Deprecated: Configures storing indexes in Bigtable. Required fields only
# required when bigtable is defined in config.
bigtable:
  # Bigtable project ID.
  # CLI flag: -bigtable.project
  [project: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Bigtable instance ID. Please refer to
  # https://cloud.google.com/docs/authentication/production for more information
  # about how to configure authentication.
  # CLI flag: -bigtable.instance
  [instance: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The grpc_client block configures the gRPC client used to communicate between
  # a client and server component in Loki.
  # The CLI flags prefix for this block configuration is: bigtable
  [grpc_client_config: &amp;lt;grpc_client&amp;gt;]

  # If enabled, once a tables info is fetched, it is cached.
  # CLI flag: -bigtable.table-cache.enabled
  [table_cache_enabled: &amp;lt;boolean&amp;gt; | default = true]

  # Duration to cache tables before checking again.
  # CLI flag: -bigtable.table-cache.expiration
  [table_cache_expiration: &amp;lt;duration&amp;gt; | default = 30m]

# Configures storing chunks in GCS. Required fields only required when gcs is
# defined in config.
[gcs: &amp;lt;gcs_storage_config&amp;gt;]

# Deprecated: Configures storing chunks and/or the index in Cassandra.
cassandra:
  # Comma-separated hostnames or IPs of Cassandra instances.
  # CLI flag: -cassandra.addresses
  [addresses: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Port that Cassandra is running on
  # CLI flag: -cassandra.port
  [port: &amp;lt;int&amp;gt; | default = 9042]

  # Keyspace to use in Cassandra.
  # CLI flag: -cassandra.keyspace
  [keyspace: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Consistency level for Cassandra.
  # CLI flag: -cassandra.consistency
  [consistency: &amp;lt;string&amp;gt; | default = &amp;#34;QUORUM&amp;#34;]

  # Replication factor to use in Cassandra.
  # CLI flag: -cassandra.replication-factor
  [replication_factor: &amp;lt;int&amp;gt; | default = 3]

  # Instruct the cassandra driver to not attempt to get host info from the
  # system.peers table.
  # CLI flag: -cassandra.disable-initial-host-lookup
  [disable_initial_host_lookup: &amp;lt;boolean&amp;gt; | default = false]

  # Use SSL when connecting to cassandra instances.
  # CLI flag: -cassandra.ssl
  [SSL: &amp;lt;boolean&amp;gt; | default = false]

  # Require SSL certificate validation.
  # CLI flag: -cassandra.host-verification
  [host_verification: &amp;lt;boolean&amp;gt; | default = true]

  # Policy for selecting Cassandra host. Supported values are: round-robin,
  # token-aware.
  # CLI flag: -cassandra.host-selection-policy
  [host_selection_policy: &amp;lt;string&amp;gt; | default = &amp;#34;round-robin&amp;#34;]

  # Path to certificate file to verify the peer.
  # CLI flag: -cassandra.ca-path
  [CA_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Path to certificate file used by TLS.
  # CLI flag: -cassandra.tls-cert-path
  [tls_cert_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Path to private key file used by TLS.
  # CLI flag: -cassandra.tls-key-path
  [tls_key_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Enable password authentication when connecting to cassandra.
  # CLI flag: -cassandra.auth
  [auth: &amp;lt;boolean&amp;gt; | default = false]

  # Username to use when connecting to cassandra.
  # CLI flag: -cassandra.username
  [username: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Password to use when connecting to cassandra.
  # CLI flag: -cassandra.password
  [password: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # File containing password to use when connecting to cassandra.
  # CLI flag: -cassandra.password-file
  [password_file: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # If set, when authenticating with cassandra a custom authenticator will be
  # expected during the handshake. This flag can be set multiple times.
  # CLI flag: -cassandra.custom-authenticator
  [custom_authenticators: &amp;lt;list of strings&amp;gt; | default = []]

  # Timeout when connecting to cassandra.
  # CLI flag: -cassandra.timeout
  [timeout: &amp;lt;duration&amp;gt; | default = 2s]

  # Initial connection timeout, used during initial dial to server.
  # CLI flag: -cassandra.connect-timeout
  [connect_timeout: &amp;lt;duration&amp;gt; | default = 5s]

  # Interval to retry connecting to cassandra nodes marked as DOWN.
  # CLI flag: -cassandra.reconnent-interval
  [reconnect_interval: &amp;lt;duration&amp;gt; | default = 1s]

  # Number of retries to perform on a request. Set to 0 to disable retries.
  # CLI flag: -cassandra.max-retries
  [max_retries: &amp;lt;int&amp;gt; | default = 0]

  # Maximum time to wait before retrying a failed request.
  # CLI flag: -cassandra.retry-max-backoff
  [retry_max_backoff: &amp;lt;duration&amp;gt; | default = 10s]

  # Minimum time to wait before retrying a failed request.
  # CLI flag: -cassandra.retry-min-backoff
  [retry_min_backoff: &amp;lt;duration&amp;gt; | default = 100ms]

  # Limit number of concurrent queries to Cassandra. Set to 0 to disable the
  # limit.
  # CLI flag: -cassandra.query-concurrency
  [query_concurrency: &amp;lt;int&amp;gt; | default = 0]

  # Number of TCP connections per host.
  # CLI flag: -cassandra.num-connections
  [num_connections: &amp;lt;int&amp;gt; | default = 2]

  # Convict hosts of being down on failure.
  # CLI flag: -cassandra.convict-hosts-on-failure
  [convict_hosts_on_failure: &amp;lt;boolean&amp;gt; | default = true]

  # Table options used to create index or chunk tables. This value is used as
  # plain text in the table `WITH` like this, &amp;#34;CREATE TABLE
  # &amp;lt;generated_by_cortex&amp;gt; (...) WITH &amp;lt;cassandra.table-options&amp;gt;&amp;#34;. For details,
  # see https://cortexmetrics.io/docs/production/cassandra. By default it will
  # use the default table options of your Cassandra cluster.
  # CLI flag: -cassandra.table-options
  [table_options: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Deprecated: Configures storing index in BoltDB. Required fields only required
# when boltdb is present in the configuration.
boltdb:
  # Location of BoltDB index files.
  # CLI flag: -boltdb.dir
  [directory: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Configures storing the chunks on the local file system. Required fields only
# required when filesystem is present in the configuration.
[filesystem: &amp;lt;local_storage_config&amp;gt;]

# The swift_storage_config block configures the connection to OpenStack Object
# Storage (Swift) object storage backend.
[swift: &amp;lt;swift_storage_config&amp;gt;]

# Deprecated:
grpc_store:
  # Hostname or IP of the gRPC store instance.
  # CLI flag: -grpc-store.server-address
  [server_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

hedging:
  # If set to a non-zero value a second request will be issued at the provided
  # duration. Default is 0 (disabled)
  # CLI flag: -store.hedge-requests-at
  [at: &amp;lt;duration&amp;gt; | default = 0s]

  # The maximum of hedge requests allowed.
  # CLI flag: -store.hedge-requests-up-to
  [up_to: &amp;lt;int&amp;gt; | default = 2]

  # The maximum of hedge requests allowed per seconds.
  # CLI flag: -store.hedge-max-per-second
  [max_per_second: &amp;lt;int&amp;gt; | default = 5]

# Configures additional object stores for a given storage provider.
# Supported stores: aws, azure, bos, filesystem, gcs, swift.
# Example:
# ```yaml
#     storage_config:
#       named_stores:
#         aws:
#           store-1:
#             endpoint: s3://foo-bucket
#             region: us-west1
# ```
# Named store from this example can be used by setting object_store to store-1
# in period_config.
[named_stores: &amp;lt;named_stores_config&amp;gt;]

# The cos_storage_config block configures the connection to IBM Cloud Object
# Storage (COS) backend.
[cos: &amp;lt;cos_storage_config&amp;gt;]

# Cache validity for active index entries. Should be no higher than
# -ingester.max-chunk-idle.
# CLI flag: -store.index-cache-validity
[index_cache_validity: &amp;lt;duration&amp;gt; | default = 5m]

congestion_control:
  # Use storage congestion control (default: disabled).
  # CLI flag: -store.congestion-control.enabled
  [enabled: &amp;lt;boolean&amp;gt; | default = false]

  controller:
    # Congestion control strategy to use (default: none, options: &amp;#39;aimd&amp;#39;).
    # CLI flag: -store.congestion-control.strategy
    [strategy: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    aimd:
      # AIMD starting throughput window size: how many requests can be sent per
      # second (default: 2000).
      # CLI flag: -store.congestion-control.strategy.aimd.start
      [start: &amp;lt;int&amp;gt; | default = 2000]

      # AIMD maximum throughput window size: upper limit of requests sent per
      # second (default: 10000).
      # CLI flag: -store.congestion-control.strategy.aimd.upper-bound
      [upper_bound: &amp;lt;int&amp;gt; | default = 10000]

      # AIMD backoff factor when upstream service is throttled to decrease
      # number of requests sent per second (default: 0.5).
      # CLI flag: -store.congestion-control.strategy.aimd.backoff-factor
      [backoff_factor: &amp;lt;float&amp;gt; | default = 0.5]

  retry:
    # Congestion control retry strategy to use (default: none, options:
    # &amp;#39;limited&amp;#39;).
    # CLI flag: -store.congestion-control.retry.strategy
    [strategy: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Maximum number of retries allowed.
    # CLI flag: -store.congestion-control.retry.strategy.limited.limit
    [limit: &amp;lt;int&amp;gt; | default = 2]

  hedging:
    config:
      [at: &amp;lt;duration&amp;gt;]

      [up_to: &amp;lt;int&amp;gt;]

      [max_per_second: &amp;lt;int&amp;gt;]

    # Congestion control hedge strategy to use (default: none, options:
    # &amp;#39;limited&amp;#39;).
    # CLI flag: -store.congestion-control.hedge.strategy
    [strategy: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Experimental. Sets a constant prefix for all keys inserted into object
# storage. Example: loki/
# CLI flag: -store.object-prefix
[object_prefix: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# The cache_config block configures the cache backend for a specific Loki
# component.
# The CLI flags prefix for this block configuration is: store.index-cache-read
[index_queries_cache_config: &amp;lt;cache_config&amp;gt;]

# Disable broad index queries which results in reduced cache usage and faster
# query performance at the expense of somewhat higher QPS on the index store.
# CLI flag: -store.disable-broad-index-queries
[disable_broad_index_queries: &amp;lt;boolean&amp;gt; | default = false]

# Maximum number of parallel chunk reads.
# CLI flag: -store.max-parallel-get-chunk
[max_parallel_get_chunk: &amp;lt;int&amp;gt; | default = 150]

# Enables the use of thanos-io/objstore clients for connecting to object
# storage. When set to true, the configuration inside
# `storage_config.object_store` or `common.storage.object_store` block takes
# effect.
# CLI flag: -use-thanos-objstore
[use_thanos_objstore: &amp;lt;boolean&amp;gt; | default = false]

object_store:
  # The 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.
  # Currently this is opt-in and takes effect only when `-use-thanos-objstore`
  # is set to true.
  # The CLI flags prefix for this block configuration is: object-store
  [&amp;lt;thanos_object_store_config&amp;gt;]

  named_stores:
    [azure: &amp;lt;map of string to NamedAzureStorageConfig&amp;gt;]

    [filesystem: &amp;lt;map of string to NamedFilesystemStorageConfig&amp;gt;]

    [gcs: &amp;lt;map of string to NamedGCSStorageConfig&amp;gt;]

    [s3: &amp;lt;map of string to NamedS3StorageConfig&amp;gt;]

    [swift: &amp;lt;map of string to NamedSwiftStorageConfig&amp;gt;]

# The maximum number of chunks to fetch per batch.
# CLI flag: -store.max-chunk-batch-size
[max_chunk_batch_size: &amp;lt;int&amp;gt; | default = 50]

# Configures storing index in an Object Store
# (GCS/S3/Azure/Swift/COS/Filesystem) in the form of boltdb files. Required
# fields only required when boltdb-shipper is defined in config.
boltdb_shipper:
  # Directory where ingesters would write index files which would then be
  # uploaded by shipper to configured storage
  # CLI flag: -boltdb.shipper.active-index-directory
  [active_index_directory: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Cache location for restoring index files from storage for queries
  # CLI flag: -boltdb.shipper.cache-location
  [cache_location: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # TTL for index files restored in cache for queries
  # CLI flag: -boltdb.shipper.cache-ttl
  [cache_ttl: &amp;lt;duration&amp;gt; | default = 24h]

  # Resync downloaded files with the storage
  # CLI flag: -boltdb.shipper.resync-interval
  [resync_interval: &amp;lt;duration&amp;gt; | default = 5m]

  # Number of days of common index to be kept downloaded for queries. For per
  # tenant index query readiness, use limits overrides config.
  # CLI flag: -boltdb.shipper.query-ready-num-days
  [query_ready_num_days: &amp;lt;int&amp;gt; | default = 0]

  index_gateway_client:
    # The grpc_client block configures the gRPC client used to communicate
    # between a client and server component in Loki.
    # The CLI flags prefix for this block configuration is:
    # boltdb.shipper.index-gateway-client.grpc
    [grpc_client_config: &amp;lt;grpc_client&amp;gt;]

    # Hostname or IP of the Index Gateway gRPC server running in simple mode.
    # Can also be prefixed with dns&amp;#43;, dnssrv&amp;#43;, or dnssrvnoa&amp;#43; to resolve a DNS A
    # record with multiple IP&amp;#39;s, a DNS SRV record with a followup A record
    # lookup, or a DNS SRV record without a followup A record lookup,
    # respectively.
    # CLI flag: -boltdb.shipper.index-gateway-client.server-address
    [server_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Whether requests sent to the gateway should be logged or not.
    # CLI flag: -boltdb.shipper.index-gateway-client.log-gateway-requests
    [log_gateway_requests: &amp;lt;boolean&amp;gt; | default = false]

    # Experimental: Defines buckets for time-based sharding. Time based sharding
    # only takes affect when index gateways run in simple mode. To enable client
    # side time-based sharding of queries across index gateway instances set at
    # least one bucket in the format of a string representation of a
    # time.Duration, e.g. [&amp;#39;168h&amp;#39;, &amp;#39;336h&amp;#39;, &amp;#39;504h&amp;#39;]
    # CLI flag: -boltdb.shipper.index-gateway-client.time-based-sharding-buckets
    [time_based_sharding_buckets: &amp;lt;list of strings&amp;gt; | default = []]

  [ingestername: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  [mode: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  [ingesterdbretainperiod: &amp;lt;duration&amp;gt;]

  # Build per tenant index files
  # CLI flag: -boltdb.shipper.build-per-tenant-index
  [build_per_tenant_index: &amp;lt;boolean&amp;gt; | default = false]

# Configures storing index in an Object Store
# (GCS/S3/Azure/Swift/COS/Filesystem) in a prometheus TSDB-like format. Required
# fields only required when TSDB is defined in config.
tsdb_shipper:
  # Directory where ingesters would write index files which would then be
  # uploaded by shipper to configured storage
  # CLI flag: -tsdb.shipper.active-index-directory
  [active_index_directory: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Cache location for restoring index files from storage for queries
  # CLI flag: -tsdb.shipper.cache-location
  [cache_location: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # TTL for index files restored in cache for queries
  # CLI flag: -tsdb.shipper.cache-ttl
  [cache_ttl: &amp;lt;duration&amp;gt; | default = 24h]

  # Resync downloaded files with the storage
  # CLI flag: -tsdb.shipper.resync-interval
  [resync_interval: &amp;lt;duration&amp;gt; | default = 5m]

  # Number of days of common index to be kept downloaded for queries. For per
  # tenant index query readiness, use limits overrides config.
  # CLI flag: -tsdb.shipper.query-ready-num-days
  [query_ready_num_days: &amp;lt;int&amp;gt; | default = 0]

  index_gateway_client:
    # The grpc_client block configures the gRPC client used to communicate
    # between a client and server component in Loki.
    # The CLI flags prefix for this block configuration is:
    # tsdb.shipper.index-gateway-client.grpc
    [grpc_client_config: &amp;lt;grpc_client&amp;gt;]

    # Hostname or IP of the Index Gateway gRPC server running in simple mode.
    # Can also be prefixed with dns&amp;#43;, dnssrv&amp;#43;, or dnssrvnoa&amp;#43; to resolve a DNS A
    # record with multiple IP&amp;#39;s, a DNS SRV record with a followup A record
    # lookup, or a DNS SRV record without a followup A record lookup,
    # respectively.
    # CLI flag: -tsdb.shipper.index-gateway-client.server-address
    [server_address: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Whether requests sent to the gateway should be logged or not.
    # CLI flag: -tsdb.shipper.index-gateway-client.log-gateway-requests
    [log_gateway_requests: &amp;lt;boolean&amp;gt; | default = false]

    # Experimental: Defines buckets for time-based sharding. Time based sharding
    # only takes affect when index gateways run in simple mode. To enable client
    # side time-based sharding of queries across index gateway instances set at
    # least one bucket in the format of a string representation of a
    # time.Duration, e.g. [&amp;#39;168h&amp;#39;, &amp;#39;336h&amp;#39;, &amp;#39;504h&amp;#39;]
    # CLI flag: -tsdb.shipper.index-gateway-client.time-based-sharding-buckets
    [time_based_sharding_buckets: &amp;lt;list of strings&amp;gt; | default = []]

  [ingestername: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  [mode: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  [ingesterdbretainperiod: &amp;lt;duration&amp;gt;]

# Experimental: Configures the bloom shipper component, which contains the store
# abstraction to fetch bloom filters from and put them to object storage.
bloom_shipper:
  # Working directory to store downloaded bloom blocks. Supports multiple
  # directories, separated by comma.
  # CLI flag: -bloom.shipper.working-directory
  [working_directory: &amp;lt;string&amp;gt; | default = &amp;#34;/data/blooms&amp;#34;]

  # Maximum size of bloom pages that should be queried. Larger pages than this
  # limit are skipped when querying blooms to limit memory usage.
  # CLI flag: -bloom.max-query-page-size
  [max_query_page_size: &amp;lt;int&amp;gt; | default = 64MiB]

  # The amount of maximum concurrent bloom blocks downloads. Usually set to 2x
  # number of CPU cores.
  # CLI flag: -bloom.download-parallelism
  [download_parallelism: &amp;lt;int&amp;gt; | default = 8]

  blocks_cache:
    # Cache for bloom blocks. Soft limit of the cache in bytes. Exceeding this
    # limit will trigger evictions of least recently used items in the
    # background.
    # CLI flag: -bloom.blocks-cache.soft-limit
    [soft_limit: &amp;lt;int&amp;gt; | default = 32GiB]

    # Cache for bloom blocks. Hard limit of the cache in bytes. Exceeding this
    # limit will block execution until soft limit is deceeded.
    # CLI flag: -bloom.blocks-cache.hard-limit
    [hard_limit: &amp;lt;int&amp;gt; | default = 64GiB]

    # Cache for bloom blocks. The time to live for items in the cache before
    # they get purged.
    # CLI flag: -bloom.blocks-cache.ttl
    [ttl: &amp;lt;duration&amp;gt; | default = 24h]

  # The cache_config block configures the cache backend for a specific Loki
  # component.
  # The CLI flags prefix for this block configuration is: bloom.metas-cache
  [metas_cache: &amp;lt;cache_config&amp;gt;]

  metas_lru_cache:
    # In-memory LRU cache for bloom metas. Whether embedded cache is enabled.
    # CLI flag: -bloom.metas-lru-cache.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

    # In-memory LRU cache for bloom metas. Maximum memory size of the cache in
    # MB.
    # CLI flag: -bloom.metas-lru-cache.max-size-mb
    [max_size_mb: &amp;lt;int&amp;gt; | default = 100]

    # In-memory LRU cache for bloom metas. Maximum number of entries in the
    # cache.
    # CLI flag: -bloom.metas-lru-cache.max-size-items
    [max_size_items: &amp;lt;int&amp;gt; | default = 0]

    # In-memory LRU cache for bloom metas. The time to live for items in the
    # cache before they get purged.
    # CLI flag: -bloom.metas-lru-cache.ttl
    [ttl: &amp;lt;duration&amp;gt; | default = 1h]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;swift_storage_config&#34;&gt;swift_storage_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;swift_storage_config&lt;/code&gt; block configures the connection to OpenStack Object Storage (Swift) object storage backend. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;common.storage&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.storage&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# OpenStack Swift authentication API version. 0 to autodetect.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.auth-version
[auth_version: &amp;lt;int&amp;gt; | default = 0]

# OpenStack Swift authentication URL
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.auth-url
[auth_url: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Set this to true to use the internal OpenStack Swift endpoint URL
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.internal
[internal: &amp;lt;boolean&amp;gt; | default = false]

# OpenStack Swift username.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.username
[username: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# OpenStack Swift user&amp;#39;s domain name.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.user-domain-name
[user_domain_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# OpenStack Swift user&amp;#39;s domain ID.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.user-domain-id
[user_domain_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# OpenStack Swift user ID.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.user-id
[user_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# OpenStack Swift API key.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.password
[password: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# OpenStack Swift user&amp;#39;s domain ID.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.domain-id
[domain_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# OpenStack Swift user&amp;#39;s domain name.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.domain-name
[domain_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# OpenStack Swift project ID (v2,v3 auth only).
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.project-id
[project_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# OpenStack Swift project name (v2,v3 auth only).
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.project-name
[project_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# ID of the OpenStack Swift project&amp;#39;s domain (v3 auth only), only needed if it
# differs the from user domain.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.project-domain-id
[project_domain_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Name of the OpenStack Swift project&amp;#39;s domain (v3 auth only), only needed if it
# differs from the user domain.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.project-domain-name
[project_domain_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# OpenStack Swift Region to use (v2,v3 auth only).
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.region-name
[region_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Name of the OpenStack Swift container to put chunks in.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.container-name
[container_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Max retries on requests error.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.max-retries
[max_retries: &amp;lt;int&amp;gt; | default = 3]

# Time after which a connection attempt is aborted.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.connect-timeout
[connect_timeout: &amp;lt;duration&amp;gt; | default = 10s]

# Time after which an idle request is aborted. The timeout watchdog is reset
# each time some data is received, so the timeout triggers after X time no data
# is received on a request.
# CLI flag: -&amp;lt;prefix&amp;gt;.swift.request-timeout
[request_timeout: &amp;lt;duration&amp;gt; | default = 5s]

http:
  # Path to the CA certificates to validate server certificate against. If not
  # set, the host&amp;#39;s root CA certificates are used.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.http.tls-ca-path
  [tls_ca_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;table_manager&#34;&gt;table_manager&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;table_manager&lt;/code&gt; block configures the table manager for retention.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# If true, disable all changes to DB capacity
# CLI flag: -table-manager.throughput-updates-disabled
[throughput_updates_disabled: &amp;lt;boolean&amp;gt; | default = false]

# If true, enables retention deletes of DB tables
# CLI flag: -table-manager.retention-deletes-enabled
[retention_deletes_enabled: &amp;lt;boolean&amp;gt; | default = false]

# Tables older than this retention period are deleted. Must be either 0
# (disabled) or a multiple of 24h. When enabled, be aware this setting is
# destructive to data!
# CLI flag: -table-manager.retention-period
[retention_period: &amp;lt;duration&amp;gt; | default = 0s]

# How frequently to poll backend to learn our capacity.
# CLI flag: -table-manager.poll-interval
[poll_interval: &amp;lt;duration&amp;gt; | default = 2m]

# Periodic tables grace period (duration which table will be created/deleted
# before/after it&amp;#39;s needed).
# CLI flag: -table-manager.periodic-table.grace-period
[creation_grace_period: &amp;lt;duration&amp;gt; | default = 10m]

index_tables_provisioning:
  # Enables on demand throughput provisioning for the storage provider (if
  # supported). Applies only to tables which are not autoscaled. Supported by
  # DynamoDB
  # CLI flag: -table-manager.index-table.enable-ondemand-throughput-mode
  [enable_ondemand_throughput_mode: &amp;lt;boolean&amp;gt; | default = false]

  # Table default write throughput. Supported by DynamoDB
  # CLI flag: -table-manager.index-table.write-throughput
  [provisioned_write_throughput: &amp;lt;int&amp;gt; | default = 1000]

  # Table default read throughput. Supported by DynamoDB
  # CLI flag: -table-manager.index-table.read-throughput
  [provisioned_read_throughput: &amp;lt;int&amp;gt; | default = 300]

  write_scale:
    # Should we enable autoscale for the table.
    # CLI flag: -table-manager.index-table.write-throughput.scale.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

    # AWS AutoScaling role ARN
    # CLI flag: -table-manager.index-table.write-throughput.scale.role-arn
    [role_arn: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # DynamoDB minimum provision capacity.
    # CLI flag: -table-manager.index-table.write-throughput.scale.min-capacity
    [min_capacity: &amp;lt;int&amp;gt; | default = 3000]

    # DynamoDB maximum provision capacity.
    # CLI flag: -table-manager.index-table.write-throughput.scale.max-capacity
    [max_capacity: &amp;lt;int&amp;gt; | default = 6000]

    # DynamoDB minimum seconds between each autoscale up.
    # CLI flag: -table-manager.index-table.write-throughput.scale.out-cooldown
    [out_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB minimum seconds between each autoscale down.
    # CLI flag: -table-manager.index-table.write-throughput.scale.in-cooldown
    [in_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB target ratio of consumed capacity to provisioned capacity.
    # CLI flag: -table-manager.index-table.write-throughput.scale.target-value
    [target: &amp;lt;float&amp;gt; | default = 80]

  read_scale:
    # Should we enable autoscale for the table.
    # CLI flag: -table-manager.index-table.read-throughput.scale.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

    # AWS AutoScaling role ARN
    # CLI flag: -table-manager.index-table.read-throughput.scale.role-arn
    [role_arn: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # DynamoDB minimum provision capacity.
    # CLI flag: -table-manager.index-table.read-throughput.scale.min-capacity
    [min_capacity: &amp;lt;int&amp;gt; | default = 3000]

    # DynamoDB maximum provision capacity.
    # CLI flag: -table-manager.index-table.read-throughput.scale.max-capacity
    [max_capacity: &amp;lt;int&amp;gt; | default = 6000]

    # DynamoDB minimum seconds between each autoscale up.
    # CLI flag: -table-manager.index-table.read-throughput.scale.out-cooldown
    [out_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB minimum seconds between each autoscale down.
    # CLI flag: -table-manager.index-table.read-throughput.scale.in-cooldown
    [in_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB target ratio of consumed capacity to provisioned capacity.
    # CLI flag: -table-manager.index-table.read-throughput.scale.target-value
    [target: &amp;lt;float&amp;gt; | default = 80]

  # Enables on demand throughput provisioning for the storage provider (if
  # supported). Applies only to tables which are not autoscaled. Supported by
  # DynamoDB
  # CLI flag: -table-manager.index-table.inactive-enable-ondemand-throughput-mode
  [enable_inactive_throughput_on_demand_mode: &amp;lt;boolean&amp;gt; | default = false]

  # Table write throughput for inactive tables. Supported by DynamoDB
  # CLI flag: -table-manager.index-table.inactive-write-throughput
  [inactive_write_throughput: &amp;lt;int&amp;gt; | default = 1]

  # Table read throughput for inactive tables. Supported by DynamoDB
  # CLI flag: -table-manager.index-table.inactive-read-throughput
  [inactive_read_throughput: &amp;lt;int&amp;gt; | default = 300]

  inactive_write_scale:
    # Should we enable autoscale for the table.
    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

    # AWS AutoScaling role ARN
    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.role-arn
    [role_arn: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # DynamoDB minimum provision capacity.
    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.min-capacity
    [min_capacity: &amp;lt;int&amp;gt; | default = 3000]

    # DynamoDB maximum provision capacity.
    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.max-capacity
    [max_capacity: &amp;lt;int&amp;gt; | default = 6000]

    # DynamoDB minimum seconds between each autoscale up.
    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.out-cooldown
    [out_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB minimum seconds between each autoscale down.
    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.in-cooldown
    [in_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB target ratio of consumed capacity to provisioned capacity.
    # CLI flag: -table-manager.index-table.inactive-write-throughput.scale.target-value
    [target: &amp;lt;float&amp;gt; | default = 80]

  inactive_read_scale:
    # Should we enable autoscale for the table.
    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

    # AWS AutoScaling role ARN
    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.role-arn
    [role_arn: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # DynamoDB minimum provision capacity.
    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.min-capacity
    [min_capacity: &amp;lt;int&amp;gt; | default = 3000]

    # DynamoDB maximum provision capacity.
    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.max-capacity
    [max_capacity: &amp;lt;int&amp;gt; | default = 6000]

    # DynamoDB minimum seconds between each autoscale up.
    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.out-cooldown
    [out_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB minimum seconds between each autoscale down.
    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.in-cooldown
    [in_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB target ratio of consumed capacity to provisioned capacity.
    # CLI flag: -table-manager.index-table.inactive-read-throughput.scale.target-value
    [target: &amp;lt;float&amp;gt; | default = 80]

  # Number of last inactive tables to enable write autoscale.
  # CLI flag: -table-manager.index-table.inactive-write-throughput.scale-last-n
  [inactive_write_scale_lastn: &amp;lt;int&amp;gt; | default = 4]

  # Number of last inactive tables to enable read autoscale.
  # CLI flag: -table-manager.index-table.inactive-read-throughput.scale-last-n
  [inactive_read_scale_lastn: &amp;lt;int&amp;gt; | default = 4]

chunk_tables_provisioning:
  # Enables on demand throughput provisioning for the storage provider (if
  # supported). Applies only to tables which are not autoscaled. Supported by
  # DynamoDB
  # CLI flag: -table-manager.chunk-table.enable-ondemand-throughput-mode
  [enable_ondemand_throughput_mode: &amp;lt;boolean&amp;gt; | default = false]

  # Table default write throughput. Supported by DynamoDB
  # CLI flag: -table-manager.chunk-table.write-throughput
  [provisioned_write_throughput: &amp;lt;int&amp;gt; | default = 1000]

  # Table default read throughput. Supported by DynamoDB
  # CLI flag: -table-manager.chunk-table.read-throughput
  [provisioned_read_throughput: &amp;lt;int&amp;gt; | default = 300]

  write_scale:
    # Should we enable autoscale for the table.
    # CLI flag: -table-manager.chunk-table.write-throughput.scale.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

    # AWS AutoScaling role ARN
    # CLI flag: -table-manager.chunk-table.write-throughput.scale.role-arn
    [role_arn: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # DynamoDB minimum provision capacity.
    # CLI flag: -table-manager.chunk-table.write-throughput.scale.min-capacity
    [min_capacity: &amp;lt;int&amp;gt; | default = 3000]

    # DynamoDB maximum provision capacity.
    # CLI flag: -table-manager.chunk-table.write-throughput.scale.max-capacity
    [max_capacity: &amp;lt;int&amp;gt; | default = 6000]

    # DynamoDB minimum seconds between each autoscale up.
    # CLI flag: -table-manager.chunk-table.write-throughput.scale.out-cooldown
    [out_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB minimum seconds between each autoscale down.
    # CLI flag: -table-manager.chunk-table.write-throughput.scale.in-cooldown
    [in_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB target ratio of consumed capacity to provisioned capacity.
    # CLI flag: -table-manager.chunk-table.write-throughput.scale.target-value
    [target: &amp;lt;float&amp;gt; | default = 80]

  read_scale:
    # Should we enable autoscale for the table.
    # CLI flag: -table-manager.chunk-table.read-throughput.scale.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

    # AWS AutoScaling role ARN
    # CLI flag: -table-manager.chunk-table.read-throughput.scale.role-arn
    [role_arn: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # DynamoDB minimum provision capacity.
    # CLI flag: -table-manager.chunk-table.read-throughput.scale.min-capacity
    [min_capacity: &amp;lt;int&amp;gt; | default = 3000]

    # DynamoDB maximum provision capacity.
    # CLI flag: -table-manager.chunk-table.read-throughput.scale.max-capacity
    [max_capacity: &amp;lt;int&amp;gt; | default = 6000]

    # DynamoDB minimum seconds between each autoscale up.
    # CLI flag: -table-manager.chunk-table.read-throughput.scale.out-cooldown
    [out_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB minimum seconds between each autoscale down.
    # CLI flag: -table-manager.chunk-table.read-throughput.scale.in-cooldown
    [in_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB target ratio of consumed capacity to provisioned capacity.
    # CLI flag: -table-manager.chunk-table.read-throughput.scale.target-value
    [target: &amp;lt;float&amp;gt; | default = 80]

  # Enables on demand throughput provisioning for the storage provider (if
  # supported). Applies only to tables which are not autoscaled. Supported by
  # DynamoDB
  # CLI flag: -table-manager.chunk-table.inactive-enable-ondemand-throughput-mode
  [enable_inactive_throughput_on_demand_mode: &amp;lt;boolean&amp;gt; | default = false]

  # Table write throughput for inactive tables. Supported by DynamoDB
  # CLI flag: -table-manager.chunk-table.inactive-write-throughput
  [inactive_write_throughput: &amp;lt;int&amp;gt; | default = 1]

  # Table read throughput for inactive tables. Supported by DynamoDB
  # CLI flag: -table-manager.chunk-table.inactive-read-throughput
  [inactive_read_throughput: &amp;lt;int&amp;gt; | default = 300]

  inactive_write_scale:
    # Should we enable autoscale for the table.
    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

    # AWS AutoScaling role ARN
    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.role-arn
    [role_arn: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # DynamoDB minimum provision capacity.
    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.min-capacity
    [min_capacity: &amp;lt;int&amp;gt; | default = 3000]

    # DynamoDB maximum provision capacity.
    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.max-capacity
    [max_capacity: &amp;lt;int&amp;gt; | default = 6000]

    # DynamoDB minimum seconds between each autoscale up.
    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.out-cooldown
    [out_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB minimum seconds between each autoscale down.
    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.in-cooldown
    [in_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB target ratio of consumed capacity to provisioned capacity.
    # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.target-value
    [target: &amp;lt;float&amp;gt; | default = 80]

  inactive_read_scale:
    # Should we enable autoscale for the table.
    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

    # AWS AutoScaling role ARN
    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.role-arn
    [role_arn: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # DynamoDB minimum provision capacity.
    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.min-capacity
    [min_capacity: &amp;lt;int&amp;gt; | default = 3000]

    # DynamoDB maximum provision capacity.
    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.max-capacity
    [max_capacity: &amp;lt;int&amp;gt; | default = 6000]

    # DynamoDB minimum seconds between each autoscale up.
    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.out-cooldown
    [out_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB minimum seconds between each autoscale down.
    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.in-cooldown
    [in_cooldown: &amp;lt;int&amp;gt; | default = 1800]

    # DynamoDB target ratio of consumed capacity to provisioned capacity.
    # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.target-value
    [target: &amp;lt;float&amp;gt; | default = 80]

  # Number of last inactive tables to enable write autoscale.
  # CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale-last-n
  [inactive_write_scale_lastn: &amp;lt;int&amp;gt; | default = 4]

  # Number of last inactive tables to enable read autoscale.
  # CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale-last-n
  [inactive_read_scale_lastn: &amp;lt;int&amp;gt; | default = 4]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;thanos_object_store_config&#34;&gt;thanos_object_store_config&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;thanos_object_store_config&lt;/code&gt; 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.
Currently this is opt-in and takes effect only when &lt;code&gt;-use-thanos-objstore&lt;/code&gt; is set to true. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;common.storage.object-store&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;object-store&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler-storage&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ui.goldfish.results&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;s3:
  # The S3 bucket endpoint. It could be an AWS S3 endpoint listed at
  # https://docs.aws.amazon.com/general/latest/gr/s3.html or the address of an
  # S3-compatible service in hostname:port format.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.endpoint
  [endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # S3 region. If unset, the client will issue a S3 GetBucketLocation API call
  # to autodetect it.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.region
  [region: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # S3 bucket name
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.bucket-name
  [bucket_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # S3 secret access key
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.secret-access-key
  [secret_access_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # S3 access key ID
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.access-key-id
  [access_key_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # S3 session token
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.session-token
  [session_token: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # If enabled, use http:// for the S3 endpoint instead of https://. This could
  # be useful in local dev/test environments while using an S3-compatible
  # backend storage, like Minio.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.insecure
  [insecure: &amp;lt;boolean&amp;gt; | default = false]

  # Use a specific version of the S3 list object API. Supported values are v1 or
  # v2. Default is unset.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.list-objects-version
  [list_objects_version: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Bucket lookup style type, used to access bucket in S3-compatible service.
  # Default is auto. Supported values are: auto, path, virtual-hosted.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.bucket-lookup-type
  [bucket_lookup_type: &amp;lt;int&amp;gt; | default = auto]

  # When enabled, direct all AWS S3 requests to the dual-stack IPv4/IPv6
  # endpoint for the configured region.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.dualstack-enabled
  [dualstack_enabled: &amp;lt;boolean&amp;gt; | default = true]

  # The S3 storage class to use, not set by default. Details can be found at
  # https://aws.amazon.com/s3/storage-classes/. Supported values are: STANDARD,
  # REDUCED_REDUNDANCY, GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING,
  # DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR, SNOW, EXPRESS_ONEZONE, FSX_OPENZFS,
  # FSX_ONTAP
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.storage-class
  [storage_class: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # If enabled, it will use the default authentication methods of the AWS SDK
  # for go based on known environment variables and known AWS config files.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.native-aws-auth-enabled
  [native_aws_auth_enabled: &amp;lt;boolean&amp;gt; | default = false]

  # The minimum file size in bytes used for multipart uploads. If 0, the value
  # is optimally computed for each object.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.part-size
  [part_size: &amp;lt;int&amp;gt; | default = 0]

  # If enabled, a Content-MD5 header is sent with S3 Put Object requests.
  # Consumes more resources to compute the MD5, but may improve compatibility
  # with object storage services that do not support checksums.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.send-content-md5
  [send_content_md5: &amp;lt;boolean&amp;gt; | default = false]

  # Accessing S3 resources using temporary, secure credentials provided by AWS
  # Security Token Service.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.sts-endpoint
  [sts_endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The maximum number of retries for S3 requests that are retryable. Default is
  # 10, set this to 1 to disable retries.
  # CLI flag: -&amp;lt;prefix&amp;gt;.s3.max-retries
  [max_retries: &amp;lt;int&amp;gt; | default = 10]

  sse:
    # Enable AWS Server Side Encryption. Supported values: SSE-KMS, SSE-S3.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.sse.type
    [type: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # KMS Key ID used to encrypt objects in S3
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.sse.kms-key-id
    [kms_key_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # KMS Encryption Context used for object encryption. It expects JSON
    # formatted string.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.sse.kms-encryption-context
    [kms_encryption_context: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  http:
    # The time an idle connection will remain idle before closing.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.http.idle-conn-timeout
    [idle_conn_timeout: &amp;lt;duration&amp;gt; | default = 1m30s]

    # The amount of time the client will wait for a servers response headers.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.http.response-header-timeout
    [response_header_timeout: &amp;lt;duration&amp;gt; | default = 2m]

    # If the client connects via HTTPS and this option is enabled, the client
    # will accept any certificate and hostname.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.http.insecure-skip-verify
    [insecure_skip_verify: &amp;lt;boolean&amp;gt; | default = false]

    # Maximum time to wait for a TLS handshake. 0 means no limit.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.tls-handshake-timeout
    [tls_handshake_timeout: &amp;lt;duration&amp;gt; | default = 10s]

    # The time to wait for a server&amp;#39;s first response headers after fully writing
    # the request headers if the request has an Expect header. 0 to send the
    # request body immediately.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.expect-continue-timeout
    [expect_continue_timeout: &amp;lt;duration&amp;gt; | default = 1s]

    # Maximum number of idle (keep-alive) connections across all hosts. 0 means
    # no limit.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.max-idle-connections
    [max_idle_connections: &amp;lt;int&amp;gt; | default = 100]

    # Maximum number of idle (keep-alive) connections to keep per-host. If 0, a
    # built-in default value is used.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.max-idle-connections-per-host
    [max_idle_connections_per_host: &amp;lt;int&amp;gt; | default = 100]

    # Maximum number of connections per host. 0 means no limit.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.max-connections-per-host
    [max_connections_per_host: &amp;lt;int&amp;gt; | default = 0]

    # Path to the CA certificates to validate server certificate against. If not
    # set, the host&amp;#39;s root CA certificates are used.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.http.tls-ca-path
    [tls_ca_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Path to the client certificate, which will be used for authenticating with
    # the server. Also requires the key path to be configured.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.http.tls-cert-path
    [tls_cert_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Path to the key for the client certificate. Also requires the client
    # certificate to be configured.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.http.tls-key-path
    [tls_key_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Override the expected name on the server certificate.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.http.tls-server-name
    [tls_server_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  trace:
    # When enabled, low-level S3 HTTP operation information is logged at the
    # debug level.
    # CLI flag: -&amp;lt;prefix&amp;gt;.s3.trace.enabled
    [enabled: &amp;lt;boolean&amp;gt; | default = false]

gcs:
  # GCS bucket name
  # CLI flag: -&amp;lt;prefix&amp;gt;.gcs.bucket-name
  [bucket_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # JSON either from a Google Developers Console client_credentials.json file,
  # or a Google Developers service account key. Needs to be valid JSON, not a
  # filesystem path. If empty, fallback to Google default logic:
  # 1. A JSON file whose path is specified by the GOOGLE_APPLICATION_CREDENTIALS
  # environment variable. For workload identity federation, refer to
  # https://cloud.google.com/iam/docs/how-to#using-workload-identity-federation
  # on how to generate the JSON configuration file for on-prem/non-Google cloud
  # platforms.
  # 2. A JSON file in a location known to the gcloud command-line tool:
  # $HOME/.config/gcloud/application_default_credentials.json.
  # 3. On Google Compute Engine it fetches credentials from the metadata server.
  # CLI flag: -&amp;lt;prefix&amp;gt;.gcs.service-account
  [service_account: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # The maximum size of the buffer that GCS client for a single PUT request. 0
  # to disable buffering.
  # CLI flag: -&amp;lt;prefix&amp;gt;.gcs.chunk-buffer-size
  [chunk_buffer_size: &amp;lt;int&amp;gt; | default = 0]

  # The maximum number of retries for idempotent operations. Overrides the
  # default gcs storage client behavior if this value is greater than 0. Set
  # this to 1 to disable retries.
  # CLI flag: -&amp;lt;prefix&amp;gt;.gcs.max-retries
  [max_retries: &amp;lt;int&amp;gt; | default = 10]

azure:
  # Azure storage account name
  # CLI flag: -&amp;lt;prefix&amp;gt;.azure.account-name
  [account_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Azure storage account key. If unset, Azure managed identities will be used
  # for authentication instead.
  # CLI flag: -&amp;lt;prefix&amp;gt;.azure.account-key
  [account_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # If `connection-string` is set, the value of `endpoint-suffix` will not be
  # used. Use this method over `account-key` if you need to authenticate via a
  # SAS token. Or if you use the Azurite emulator.
  # CLI flag: -&amp;lt;prefix&amp;gt;.azure.connection-string
  [connection_string: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Azure storage container name
  # CLI flag: -&amp;lt;prefix&amp;gt;.azure.container-name
  [container_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Azure storage endpoint suffix without schema. The account name will be
  # prefixed to this value to create the FQDN. If set to empty string, default
  # endpoint suffix is used.
  # CLI flag: -&amp;lt;prefix&amp;gt;.azure.endpoint-suffix
  [endpoint_suffix: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Number of retries for recoverable errors
  # CLI flag: -&amp;lt;prefix&amp;gt;.azure.max-retries
  [max_retries: &amp;lt;int&amp;gt; | default = 20]

  # User assigned managed identity. If empty, then System assigned identity is
  # used.
  # CLI flag: -&amp;lt;prefix&amp;gt;.azure.user-assigned-id
  [user_assigned_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Delimiter used to replace &amp;#39;:&amp;#39; in chunk IDs when storing chunks
  # CLI flag: -&amp;lt;prefix&amp;gt;.azure.chunk-delimiter
  [chunk_delimiter: &amp;lt;string&amp;gt; | default = &amp;#34;-&amp;#34;]

swift:
  # OpenStack Swift application credential id
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.application-credential-id
  [application_credential_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift application credential name
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.application-credential-name
  [application_credential_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift application credential secret
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.application-credential-secret
  [application_credential_secret: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift authentication API version. 0 to autodetect.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.auth-version
  [auth_version: &amp;lt;int&amp;gt; | default = 0]

  # OpenStack Swift authentication URL
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.auth-url
  [auth_url: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift username.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.username
  [username: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift user&amp;#39;s domain name.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.user-domain-name
  [user_domain_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift user&amp;#39;s domain ID.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.user-domain-id
  [user_domain_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift user ID.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.user-id
  [user_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift API key.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.password
  [password: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift user&amp;#39;s domain ID.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.domain-id
  [domain_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift user&amp;#39;s domain name.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.domain-name
  [domain_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift project ID (v2,v3 auth only).
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.project-id
  [project_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift project name (v2,v3 auth only).
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.project-name
  [project_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # ID of the OpenStack Swift project&amp;#39;s domain (v3 auth only), only needed if it
  # differs the from user domain.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.project-domain-id
  [project_domain_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Name of the OpenStack Swift project&amp;#39;s domain (v3 auth only), only needed if
  # it differs from the user domain.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.project-domain-name
  [project_domain_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # OpenStack Swift Region to use (v2,v3 auth only).
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.region-name
  [region_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Name of the OpenStack Swift container to put chunks in.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.container-name
  [container_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Max retries on requests error.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.max-retries
  [max_retries: &amp;lt;int&amp;gt; | default = 3]

  # Time after which a connection attempt is aborted.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.connect-timeout
  [connect_timeout: &amp;lt;duration&amp;gt; | default = 10s]

  # Time after which an idle request is aborted. The timeout watchdog is reset
  # each time some data is received, so the timeout triggers after X time no
  # data is received on a request.
  # CLI flag: -&amp;lt;prefix&amp;gt;.swift.request-timeout
  [request_timeout: &amp;lt;duration&amp;gt; | default = 5s]

  http:
    # The time an idle connection will remain idle before closing.
    # CLI flag: -&amp;lt;prefix&amp;gt;.swift.http.idle-conn-timeout
    [idle_conn_timeout: &amp;lt;duration&amp;gt; | default = 1m30s]

    # The amount of time the client will wait for a servers response headers.
    # CLI flag: -&amp;lt;prefix&amp;gt;.swift.http.response-header-timeout
    [response_header_timeout: &amp;lt;duration&amp;gt; | default = 2m]

    # If the client connects via HTTPS and this option is enabled, the client
    # will accept any certificate and hostname.
    # CLI flag: -&amp;lt;prefix&amp;gt;.swift.http.insecure-skip-verify
    [insecure_skip_verify: &amp;lt;boolean&amp;gt; | default = false]

    # Maximum time to wait for a TLS handshake. 0 means no limit.
    # CLI flag: -&amp;lt;prefix&amp;gt;.swift.tls-handshake-timeout
    [tls_handshake_timeout: &amp;lt;duration&amp;gt; | default = 10s]

    # The time to wait for a server&amp;#39;s first response headers after fully writing
    # the request headers if the request has an Expect header. 0 to send the
    # request body immediately.
    # CLI flag: -&amp;lt;prefix&amp;gt;.swift.expect-continue-timeout
    [expect_continue_timeout: &amp;lt;duration&amp;gt; | default = 1s]

    # Maximum number of idle (keep-alive) connections across all hosts. 0 means
    # no limit.
    # CLI flag: -&amp;lt;prefix&amp;gt;.swift.max-idle-connections
    [max_idle_connections: &amp;lt;int&amp;gt; | default = 100]

    # Maximum number of idle (keep-alive) connections to keep per-host. If 0, a
    # built-in default value is used.
    # CLI flag: -&amp;lt;prefix&amp;gt;.swift.max-idle-connections-per-host
    [max_idle_connections_per_host: &amp;lt;int&amp;gt; | default = 100]

    # Maximum number of connections per host. 0 means no limit.
    # CLI flag: -&amp;lt;prefix&amp;gt;.swift.max-connections-per-host
    [max_connections_per_host: &amp;lt;int&amp;gt; | default = 0]

    # Path to the CA certificates to validate server certificate against. If not
    # set, the host&amp;#39;s root CA certificates are used.
    # CLI flag: -&amp;lt;prefix&amp;gt;.swift.http.tls-ca-path
    [tls_ca_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Path to the client certificate, which will be used for authenticating with
    # the server. Also requires the key path to be configured.
    # CLI flag: -&amp;lt;prefix&amp;gt;.swift.http.tls-cert-path
    [tls_cert_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Path to the key for the client certificate. Also requires the client
    # certificate to be configured.
    # CLI flag: -&amp;lt;prefix&amp;gt;.swift.http.tls-key-path
    [tls_key_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

    # Override the expected name on the server certificate.
    # CLI flag: -&amp;lt;prefix&amp;gt;.swift.http.tls-server-name
    [tls_server_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

filesystem:
  # Local filesystem storage directory.
  # CLI flag: -&amp;lt;prefix&amp;gt;.filesystem.dir
  [dir: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

alibaba:
  # Endpoint to connect to.
  # CLI flag: -&amp;lt;prefix&amp;gt;.oss.endpoint
  [endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Name of OSS bucket.
  # CLI flag: -&amp;lt;prefix&amp;gt;.oss.bucketname
  [bucket: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # alibabacloud Access Key ID
  # CLI flag: -&amp;lt;prefix&amp;gt;.oss.access-key-id
  [access_key_id: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # alibabacloud Secret Access Key
  # CLI flag: -&amp;lt;prefix&amp;gt;.oss.access-key-secret
  [access_key_secret: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

bos:
  # Name of BOS bucket.
  # CLI flag: -&amp;lt;prefix&amp;gt;.bos.bucket
  [bucket: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # BOS endpoint to connect to.
  # CLI flag: -&amp;lt;prefix&amp;gt;.bos.endpoint
  [endpoint: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Baidu Cloud Engine (BCE) Access Key ID.
  # CLI flag: -&amp;lt;prefix&amp;gt;.bos.access-key
  [access_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

  # Baidu Cloud Engine (BCE) Secret Access Key.
  # CLI flag: -&amp;lt;prefix&amp;gt;.bos.secret-key
  [secret_key: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Prefix for all objects stored in the backend storage. For simplicity, it may
# only contain digits, English alphabet letters and dashes.
# CLI flag: -&amp;lt;prefix&amp;gt;.storage-prefix
[storage_prefix: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;tls_config&#34;&gt;tls_config&lt;/h3&gt;
&lt;p&gt;The TLS configuration. The supported CLI flags &lt;code&gt;&amp;lt;prefix&amp;gt;&lt;/code&gt; used to reference this configuration block are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;bigtable&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bloom-build.builder.grpc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bloom-gateway-client.grpc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bloom.metas-cache.memcached&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;boltdb.shipper.index-gateway-client.grpc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;common.storage.ring.etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;compactor.grpc-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;compactor.ring.etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dataobj-consumer.etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dataobj-consumer.partition-ring.etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;distributor.ring.etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.grpc-client-config&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.index-stats-results-cache.memcached&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.instant-metric-results-cache.memcached&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.label-results-cache.memcached&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.memcached&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.series-results-cache.memcached&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.tail-tls-config&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontend.volume-results-cache.memcached&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;index-gateway.ring.etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingest-limits-frontend-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingest-limits-frontend.etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingest-limits-frontend.limits-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingest-limits.etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingester.client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ingester.partition-ring.etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;memberlist&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pattern-ingester.client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pattern-ingester.etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;querier.frontend-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;querier.frontend-grpc-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;querier.scheduler-grpc-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;query-engine.results-cache.memcached&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;query-scheduler.grpc-client-config&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;query-scheduler.ring.etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;reporting.tls-config&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.alertmanager-client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.client&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.evaluation.query-frontend&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ruler.ring.etcd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;store.chunks-cache-l2.memcached&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;store.chunks-cache.memcached&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;store.index-cache-read.memcached&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;store.index-cache-write.memcached&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tsdb.shipper.index-gateway-client.grpc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ui.ring.etcd&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Path to the client certificate, which will be used for authenticating with the
# server. Also requires the key path to be configured.
# CLI flag: -&amp;lt;prefix&amp;gt;.tls-cert-path
[tls_cert_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Path to the key for the client certificate. Also requires the client
# certificate to be configured.
# CLI flag: -&amp;lt;prefix&amp;gt;.tls-key-path
[tls_key_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Path to the CA certificates to validate server certificate against. If not
# set, the host&amp;#39;s root CA certificates are used.
# CLI flag: -&amp;lt;prefix&amp;gt;.tls-ca-path
[tls_ca_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Override the expected name on the server certificate.
# CLI flag: -&amp;lt;prefix&amp;gt;.tls-server-name
[tls_server_name: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Skip validating server certificate.
# CLI flag: -&amp;lt;prefix&amp;gt;.tls-insecure-skip-verify
[tls_insecure_skip_verify: &amp;lt;boolean&amp;gt; | default = false]

# Override the default cipher suite list (separated by commas). Allowed values:
# 
# Secure Ciphers:
# - TLS_AES_128_GCM_SHA256
# - TLS_AES_256_GCM_SHA384
# - TLS_CHACHA20_POLY1305_SHA256
# - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
# - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
# - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
# - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
# - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
# - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
# - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
# - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
# - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
# - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
# 
# Insecure Ciphers:
# - TLS_RSA_WITH_RC4_128_SHA
# - TLS_RSA_WITH_3DES_EDE_CBC_SHA
# - TLS_RSA_WITH_AES_128_CBC_SHA
# - TLS_RSA_WITH_AES_256_CBC_SHA
# - TLS_RSA_WITH_AES_128_CBC_SHA256
# - TLS_RSA_WITH_AES_128_GCM_SHA256
# - TLS_RSA_WITH_AES_256_GCM_SHA384
# - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
# - TLS_ECDHE_RSA_WITH_RC4_128_SHA
# - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
# - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
# - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
# CLI flag: -&amp;lt;prefix&amp;gt;.tls-cipher-suites
[tls_cipher_suites: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Override the default minimum TLS version. Allowed values: VersionTLS10,
# VersionTLS11, VersionTLS12, VersionTLS13
# CLI flag: -&amp;lt;prefix&amp;gt;.tls-min-version
[tls_min_version: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;tracing&#34;&gt;tracing&lt;/h3&gt;
&lt;p&gt;Configuration for &lt;code&gt;tracing&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Set to false to disable tracing.
# CLI flag: -tracing.enabled
[enabled: &amp;lt;boolean&amp;gt; | default = true]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;!-- vale Grafana.Spelling = YES --&gt;
&lt;h2 id=&#34;runtime-configuration-file&#34;&gt;Runtime Configuration file&lt;/h2&gt;
&lt;p&gt;Loki has a concept of &amp;ldquo;runtime config&amp;rdquo; 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 &lt;code&gt;-runtime-config.file=&amp;lt;filename&amp;gt;&lt;/code&gt; flag and reload period (which defaults to 10 seconds) can be changed by &lt;code&gt;-runtime-config.reload-period=&amp;lt;duration&amp;gt;&lt;/code&gt; flag. Previously this mechanism was only used by limits overrides, and flags were called &lt;code&gt;-limits.per-user-override-config=&amp;lt;filename&amp;gt;&lt;/code&gt; and &lt;code&gt;-limits.per-user-override-period=10s&lt;/code&gt; respectively. These are still used, if &lt;code&gt;-runtime-config.file=&amp;lt;filename&amp;gt;&lt;/code&gt; is not specified.&lt;/p&gt;
&lt;p&gt;At the moment, two components use runtime configuration: limits and multi KV store.&lt;/p&gt;
&lt;p&gt;Options for runtime configuration reload can also be configured via YAML:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Configuration file to periodically check and reload.
[file: &amp;lt;string&amp;gt;: default = empty]

# How often to check the file.
[period: &amp;lt;duration&amp;gt;: default 10s]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Example runtime configuration file:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;overrides:
  tenant1:
    ingestion_rate_mb: 10
    max_streams_per_user: 100000
    max_chunks_per_query: 100000
  tenant2:
    max_streams_per_user: 1000000
    max_chunks_per_query: 1000000

multi_kv_config:
    mirror-enabled: false
    primary: consul&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;accept-out-of-order-writes&#34;&gt;Accept out-of-order writes&lt;/h2&gt;
&lt;p&gt;Since the beginning of Loki, log entries had to be written to Loki in order
by time.
This limitation has been lifted.
Out-of-order writes are enabled globally by default, but can be disabled/enabled
on a cluster or per-tenant basis.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;To disable out-of-order writes for all tenants,
place in the &lt;code&gt;limits_config&lt;/code&gt; section:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;limits_config:
    unordered_writes: false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To disable out-of-order writes for specific tenants,
configure a runtime configuration file:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;runtime_config:
  file: overrides.yaml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In the &lt;code&gt;overrides.yaml&lt;/code&gt; file, add &lt;code&gt;unordered_writes&lt;/code&gt; for each tenant
permitted to have out-of-order writes:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;overrides:
  &amp;#34;tenantA&amp;#34;:
    unordered_writes: false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;How far into the past accepted out-of-order log entries may be
is configurable with &lt;code&gt;max_chunk_age&lt;/code&gt;.
&lt;code&gt;max_chunk_age&lt;/code&gt; defaults to 2 hour.
Loki calculates the earliest time that out-of-order entries may have
and be accepted with&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;time_of_most_recent_line - (max_chunk_age/2)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This means the allowed out-of-order window is half of the configured max_chunk_age.&lt;/p&gt;
&lt;p&gt;Log entries with timestamps that are after this earliest time are accepted.
Log entries further back in time return an out-of-order error.&lt;/p&gt;
&lt;p&gt;For example, if &lt;code&gt;max_chunk_age&lt;/code&gt; is 2 hours
and the stream &lt;code&gt;{foo=&amp;quot;bar&amp;quot;}&lt;/code&gt; has one entry at &lt;code&gt;8:00&lt;/code&gt;,
the earliest accepted timestamp will be calculated as: 8:00 - (2h / 2) = &lt;code&gt;7:00&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Loki will accept data for that stream as far back in time as &lt;code&gt;7:00&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If another log line is written at &lt;code&gt;10:00&lt;/code&gt;,
the earliest accepted timestamp becomes: 10:00 - (2h / 2) = &lt;code&gt;9:00&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Loki will accept data for that stream as far back in time as &lt;code&gt;9:00&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;

        
]]></content><description>&lt;h1 id="grafana-loki-configuration-parameters">Grafana Loki configuration parameters&lt;/h1>
&lt;p>Grafana Loki is configured in a YAML file (usually referred to as &lt;code>loki.yaml&lt;/code> )
which contains information on the Loki server and its individual components,
depending on which mode Loki is launched in.&lt;/p></description></item><item><title>Loki HTTP API</title><link>https://grafana.com/docs/loki/v3.7.x/reference/loki-http-api/</link><pubDate>Thu, 09 Apr 2026 02:28:18 +0000</pubDate><guid>https://grafana.com/docs/loki/v3.7.x/reference/loki-http-api/</guid><content><![CDATA[&lt;h1 id=&#34;loki-http-api&#34;&gt;Loki HTTP API&lt;/h1&gt;
&lt;p&gt;Loki exposes an HTTP API for pushing, querying, and tailing log data, as well
as for viewing and managing cluster information.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Note that authorization is not part of the Loki API.
Authorization needs to be done separately, for example, using an open-source load-balancer such as NGINX.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;endpoints&#34;&gt;Endpoints&lt;/h2&gt;
&lt;h3 id=&#34;ingest-endpoints&#34;&gt;Ingest endpoints&lt;/h3&gt;
&lt;p&gt;These endpoints are exposed by the &lt;code&gt;distributor&lt;/code&gt;, &lt;code&gt;write&lt;/code&gt;, and &lt;code&gt;all&lt;/code&gt; components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#ingest-logs&#34;&gt;&lt;code&gt;POST /loki/api/v1/push&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#ingest-logs-using-otlp&#34;&gt;&lt;code&gt;POST /otlp/v1/logs&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A &lt;a href=&#34;../../send-data/&#34;&gt;list of clients&lt;/a&gt; can be found in the clients documentation.&lt;/p&gt;
&lt;h3 id=&#34;query-endpoints&#34;&gt;Query endpoints&lt;/h3&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Requests sent to the query endpoints must use valid LogQL syntax. For more information, see the &lt;a href=&#34;../../query/&#34;&gt;LogQL&lt;/a&gt; section of the documentation.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;



&lt;div class=&#34;admonition admonition-tip&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Tip&lt;/p&gt;&lt;p&gt;For Python examples of these endpoints, see &lt;a href=&#34;../python-client-examples/&#34;&gt;Query Loki with Python&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;These HTTP endpoints are exposed by the &lt;code&gt;querier&lt;/code&gt;, &lt;code&gt;query-frontend&lt;/code&gt;, &lt;code&gt;read&lt;/code&gt;, and &lt;code&gt;all&lt;/code&gt; components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#query-logs-at-a-single-point-in-time&#34;&gt;&lt;code&gt;GET /loki/api/v1/query&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#query-logs-within-a-range-of-time&#34;&gt;&lt;code&gt;GET /loki/api/v1/query_range&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#query-labels&#34;&gt;&lt;code&gt;GET /loki/api/v1/labels&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#query-label-values&#34;&gt;&lt;code&gt;GET /loki/api/v1/label/&amp;lt;name&amp;gt;/values&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#query-streams&#34;&gt;&lt;code&gt;GET /loki/api/v1/series&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#query-log-statistics&#34;&gt;&lt;code&gt;GET /loki/api/v1/index/stats&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#query-log-volume&#34;&gt;&lt;code&gt;GET /loki/api/v1/index/volume&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#query-log-volume&#34;&gt;&lt;code&gt;GET /loki/api/v1/index/volume_range&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#patterns-detection&#34;&gt;&lt;code&gt;GET /loki/api/v1/patterns&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#stream-logs&#34;&gt;&lt;code&gt;GET /loki/api/v1/tail&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;status-endpoints&#34;&gt;Status endpoints&lt;/h3&gt;
&lt;p&gt;These HTTP endpoints are exposed by all components and return the status of the component:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#readiness-probe&#34;&gt;&lt;code&gt;GET /ready&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#change-log-level&#34;&gt;&lt;code&gt;GET /log_level&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#prometheus-metrics&#34;&gt;&lt;code&gt;GET /metrics&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#show-current-configuration&#34;&gt;&lt;code&gt;GET /config&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#list-running-services&#34;&gt;&lt;code&gt;GET /services&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#show-build-information&#34;&gt;&lt;code&gt;GET /loki/api/v1/status/buildinfo&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;ring-endpoints&#34;&gt;Ring endpoints&lt;/h3&gt;
&lt;p&gt;These HTTP endpoints are exposed by their respective component that is part of the ring URL prefix:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#distributor-ring-status&#34;&gt;&lt;code&gt;GET /distributor/ring&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#index-gateway-ring-status&#34;&gt;&lt;code&gt;GET /indexgateway/ring&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#ruler-ring-status&#34;&gt;&lt;code&gt;GET /ruler/ring&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#compactor-ring-status&#34;&gt;&lt;code&gt;GET /compactor/ring&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;flushshutdown-endpoints&#34;&gt;Flush/shutdown endpoints&lt;/h3&gt;
&lt;p&gt;These HTTP endpoints are exposed by the &lt;code&gt;ingester&lt;/code&gt;, &lt;code&gt;write&lt;/code&gt;, and &lt;code&gt;all&lt;/code&gt; components for flushing chunks and/or shutting down.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#flush-in-memory-chunks-to-backing-store&#34;&gt;&lt;code&gt;POST /flush&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#prepare-ingester-shutdown&#34;&gt;&lt;code&gt;POST /ingester/prepare_shutdown&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#flush-in-memory-chunks-and-shut-down&#34;&gt;&lt;code&gt;POST /ingester/shutdown&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;rule-endpoints&#34;&gt;Rule endpoints&lt;/h3&gt;
&lt;p&gt;These HTTP endpoints are exposed by the &lt;code&gt;ruler&lt;/code&gt; component:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#list-rule-groups&#34;&gt;&lt;code&gt;GET /loki/api/v1/rules&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#get-rule-groups-by-namespace&#34;&gt;&lt;code&gt;GET /loki/api/v1/rules/{namespace}&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#get-rule-group&#34;&gt;&lt;code&gt;GET /loki/api/v1/rules/{namespace}/{groupName}&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#set-rule-group&#34;&gt;&lt;code&gt;POST /loki/api/v1/rules/{namespace}&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#delete-rule-group&#34;&gt;&lt;code&gt;DELETE /loki/api/v1/rules/{namespace}/{groupName}&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#delete-namespace&#34;&gt;&lt;code&gt;DELETE /loki/api/v1/rules/{namespace}&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#list-rule-groups&#34;&gt;&lt;code&gt;GET /api/prom/rules&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#get-rule-groups-by-namespace&#34;&gt;&lt;code&gt;GET /api/prom/rules/{namespace}&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#get-rule-group&#34;&gt;&lt;code&gt;GET /api/prom/rules/{namespace}/{groupName}&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#set-rule-group&#34;&gt;&lt;code&gt;POST /api/prom/rules/{namespace}&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#delete-rule-group&#34;&gt;&lt;code&gt;DELETE /api/prom/rules/{namespace}/{groupName}&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#delete-namespace&#34;&gt;&lt;code&gt;DELETE /api/prom/rules/{namespace}&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#list-rules&#34;&gt;&lt;code&gt;GET /prometheus/api/v1/rules&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#list-alerts&#34;&gt;&lt;code&gt;GET /prometheus/api/v1/alerts&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;API endpoints starting with &lt;code&gt;/api/prom&lt;/code&gt; are &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/api/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus API-compatible&lt;/a&gt; and the result formats can be used interchangeably.&lt;/p&gt;
&lt;h3 id=&#34;log-deletion-endpoints&#34;&gt;Log deletion endpoints&lt;/h3&gt;
&lt;p&gt;These endpoints are exposed by the &lt;code&gt;compactor&lt;/code&gt;, &lt;code&gt;backend&lt;/code&gt;, and &lt;code&gt;all&lt;/code&gt; components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#request-log-deletion&#34;&gt;&lt;code&gt;POST /loki/api/v1/delete&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#list-log-deletion-requests&#34;&gt;&lt;code&gt;GET /loki/api/v1/delete&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#request-cancellation-of-a-delete-request&#34;&gt;&lt;code&gt;DELETE /loki/api/v1/delete&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;other-endpoints&#34;&gt;Other endpoints&lt;/h3&gt;
&lt;p&gt;These HTTP endpoints are exposed by all individual components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#format-a-logql-query&#34;&gt;&lt;code&gt;GET /loki/api/v1/format_query&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;deprecated-endpoints&#34;&gt;Deprecated endpoints&lt;/h3&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The following endpoints are deprecated.While they still exist and work, they should not be used for new deployments.
Existing deployments should upgrade to use the supported endpoints.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Deprecated&lt;/th&gt;
              &lt;th&gt;Replacement&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;POST /api/prom/push&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;#ingest-logs&#34;&gt;&lt;code&gt;POST /loki/api/v1/push&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;GET /api/prom/tail&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;#stream-logs&#34;&gt;&lt;code&gt;GET /loki/api/v1/tail&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;GET /api/prom/query&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;#query-logs-at-a-single-point-in-time&#34;&gt;&lt;code&gt;GET /loki/api/v1/query&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;GET /api/prom/label&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;#query-labels&#34;&gt;&lt;code&gt;GET /loki/api/v1/labels&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;GET /api/prom/label/&amp;lt;name&amp;gt;/values&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;#query-label-values&#34;&gt;&lt;code&gt;GET /loki/api/v1/label/&amp;lt;name&amp;gt;/values&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;GET /api/prom/series&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href=&#34;#query-streams&#34;&gt;&lt;code&gt;GET /loki/api/v1/series&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;format&#34;&gt;Format&lt;/h2&gt;
&lt;h3 id=&#34;matrix-vector-and-stream&#34;&gt;Matrix, vector, and stream&lt;/h3&gt;
&lt;p&gt;Some Loki API endpoints return a result of a matrix, a vector, or a stream:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Matrix&lt;/strong&gt;: a table of values where each row represents a different label set
and the columns are each sample values for that row over the queried time.
Matrix types are only returned when running a query that computes some value.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Instant Vector&lt;/strong&gt;: denoted in the type as just &lt;code&gt;vector&lt;/code&gt;, an Instant Vector
represents the latest value of a calculation for a given labelset. Instant
Vectors are only returned when doing a query against a single point in
time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Stream&lt;/strong&gt;: a Stream is a set of all values (logs) for a given label set over the
queried time range. Streams are the only type that will result in log lines
being returned.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;timestamps&#34;&gt;Timestamps&lt;/h3&gt;
&lt;p&gt;The API accepts several formats for timestamps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All epoch values will be interpreted as a Unix timestamp in nanoseconds.&lt;/li&gt;
&lt;li&gt;A floating point number is a Unix timestamp with fractions of a second.&lt;/li&gt;
&lt;li&gt;A string in &lt;code&gt;RFC3339&lt;/code&gt; and &lt;code&gt;RFC3339Nano&lt;/code&gt; format, as supported by Go&amp;rsquo;s &lt;a href=&#34;https://pkg.go.dev/time&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;time&lt;/a&gt; package.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;When using &lt;code&gt;/api/v1/push&lt;/code&gt;, you must send the timestamp as a string and not a number, otherwise the endpoint will return a 400 error.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;statistics&#34;&gt;Statistics&lt;/h3&gt;
&lt;p&gt;Query endpoints such as &lt;code&gt;/loki/api/v1/query&lt;/code&gt; and &lt;code&gt;/loki/api/v1/query_range&lt;/code&gt; return a set of statistics about the query execution. Those statistics allow users to understand the amount of data processed and at which speed.&lt;/p&gt;
&lt;p&gt;The example below show all possible statistics returned with their respective description.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;success&amp;#34;,
  &amp;#34;data&amp;#34;: {
    &amp;#34;resultType&amp;#34;: &amp;#34;streams&amp;#34;,
    &amp;#34;result&amp;#34;: [],
    &amp;#34;stats&amp;#34;: {
      &amp;#34;ingester&amp;#34;: {
        &amp;#34;compressedBytes&amp;#34;: 0, // Total bytes of compressed chunks (blocks) processed by ingesters
        &amp;#34;decompressedBytes&amp;#34;: 0, // Total bytes decompressed and processed by ingesters
        &amp;#34;decompressedLines&amp;#34;: 0, // Total lines decompressed and processed by ingesters
        &amp;#34;headChunkBytes&amp;#34;: 0, // Total bytes read from ingesters head chunks
        &amp;#34;headChunkLines&amp;#34;: 0, // Total lines read from ingesters head chunks
        &amp;#34;totalBatches&amp;#34;: 0, // Total batches sent by ingesters
        &amp;#34;totalChunksMatched&amp;#34;: 0, // Total chunks matched by ingesters
        &amp;#34;totalDuplicates&amp;#34;: 0, // Total of duplicates found by ingesters
        &amp;#34;totalLinesSent&amp;#34;: 0, // Total lines sent by ingesters
        &amp;#34;totalReached&amp;#34;: 0 // Amount of ingesters reached.
      },
      &amp;#34;store&amp;#34;: {
        &amp;#34;compressedBytes&amp;#34;: 0, // Total bytes of compressed chunks (blocks) processed by the store
        &amp;#34;decompressedBytes&amp;#34;: 0, // Total bytes decompressed and processed by the store
        &amp;#34;decompressedLines&amp;#34;: 0, // Total lines decompressed and processed by the store
        &amp;#34;chunksDownloadTime&amp;#34;: 0, // Total time spent downloading chunks in seconds (float)
        &amp;#34;totalChunksRef&amp;#34;: 0, // Total chunks found in the index for the current query
        &amp;#34;totalChunksDownloaded&amp;#34;: 0, // Total of chunks downloaded
        &amp;#34;totalDuplicates&amp;#34;: 0 // Total of duplicates removed from replication
      },
      &amp;#34;summary&amp;#34;: {
        &amp;#34;bytesProcessedPerSecond&amp;#34;: 0, // Total of bytes processed per second
        &amp;#34;execTime&amp;#34;: 0, // Total execution time in seconds (float)
        &amp;#34;linesProcessedPerSecond&amp;#34;: 0, // Total lines processed per second
        &amp;#34;queueTime&amp;#34;: 0, // Total queue time in seconds (float)
        &amp;#34;totalBytesProcessed&amp;#34;: 0, // Total amount of bytes processed overall for this request
        &amp;#34;totalLinesProcessed&amp;#34;: 0 // Total amount of lines processed overall for this request
      }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;ingest-logs&#34;&gt;Ingest logs&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;POST /loki/api/v1/push&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/loki/api/v1/push&lt;/code&gt; is the endpoint used to send log entries to Loki. The default
behavior is for the POST body to be a &lt;a href=&#34;https://github.com/google/snappy&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Snappy&lt;/a&gt;-compressed &lt;a href=&#34;https://github.com/protocolbuffers/protobuf&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Protocol Buffer&lt;/a&gt; message:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/grafana/loki/blob/main/pkg/logproto/logproto.proto&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Protocol Buffer definition&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/grafana/loki/blob/main/clients/pkg/promtail/client/client.go&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Go client library&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These POST requests require the &lt;code&gt;Content-Type&lt;/code&gt; HTTP header to be &lt;code&gt;application/x-protobuf&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Alternatively, if the &lt;code&gt;Content-Type&lt;/code&gt; header is set to &lt;code&gt;application/json&lt;/code&gt;, a JSON post body can be sent in the following format:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;streams&amp;#34;: [
    {
      &amp;#34;stream&amp;#34;: {
        &amp;#34;label&amp;#34;: &amp;#34;value&amp;#34;
      },
      &amp;#34;values&amp;#34;: [
          [ &amp;#34;&amp;lt;unix epoch in nanoseconds&amp;gt;&amp;#34;, &amp;#34;&amp;lt;log line&amp;gt;&amp;#34; ],
          [ &amp;#34;&amp;lt;unix epoch in nanoseconds&amp;gt;&amp;#34;, &amp;#34;&amp;lt;log line&amp;gt;&amp;#34; ]
      ]
    }
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can set &lt;code&gt;Content-Encoding: gzip&lt;/code&gt; request header and post gzipped JSON.&lt;/p&gt;
&lt;p&gt;You can optionally attach &lt;a href=&#34;../../get-started/labels/structured-metadata/&#34;&gt;structured metadata&lt;/a&gt; to each log line by adding a JSON object to the end of the log line array.
The JSON object must be a valid JSON object with string keys and string values. The JSON object should not contain any nested object.
The JSON object must be set immediately after the log line. Here is an example of a log entry with some structured metadata attached:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;&amp;#34;values&amp;#34;: [
    [ &amp;#34;&amp;lt;unix epoch in nanoseconds&amp;gt;&amp;#34;, &amp;#34;&amp;lt;log line&amp;gt;&amp;#34;, {&amp;#34;trace_id&amp;#34;: &amp;#34;0242ac120002&amp;#34;, &amp;#34;user_id&amp;#34;: &amp;#34;superUser123&amp;#34;}]
]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In microservices mode, &lt;code&gt;/loki/api/v1/push&lt;/code&gt; is exposed by the distributor.&lt;/p&gt;
&lt;p&gt;If 
    &lt;a href=&#34;/docs/loki/v3.7.x/configuration/#limits_config&#34;&gt;&lt;code&gt;block_ingestion_until&lt;/code&gt;&lt;/a&gt; is configured and push requests are blocked, the endpoint will return the status code configured in &lt;code&gt;block_ingestion_status_code&lt;/code&gt; (&lt;code&gt;260&lt;/code&gt; by default)
along with an error message. If the configured status code is &lt;code&gt;200&lt;/code&gt;, no error message will be returned.&lt;/p&gt;
&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;
&lt;p&gt;The following cURL command pushes a stream with the label &amp;ldquo;foo=bar2&amp;rdquo; and a single log line &amp;ldquo;fizzbuzz&amp;rdquo; using JSON encoding:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -H &amp;#34;Content-Type: application/json&amp;#34; \
  -s -X POST &amp;#34;http://localhost:3100/loki/api/v1/push&amp;#34; \
  --data-raw &amp;#39;{&amp;#34;streams&amp;#34;: [{ &amp;#34;stream&amp;#34;: { &amp;#34;foo&amp;#34;: &amp;#34;bar2&amp;#34; }, &amp;#34;values&amp;#34;: [ [ &amp;#34;1570818238000000000&amp;#34;, &amp;#34;fizzbuzz&amp;#34; ] ] }]}&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;ingest-logs-using-otlp&#34;&gt;Ingest logs using OTLP&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;POST /otlp/v1/logs&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/otlp/v1/logs&lt;/code&gt; lets the OpenTelemetry Collector send logs to Loki using &lt;code&gt;otlphttp&lt;/code&gt; protocol.&lt;/p&gt;
&lt;p&gt;For information on how to configure Loki, refer to the 
    &lt;a href=&#34;/docs/loki/v3.7.x/send-data/otel/&#34;&gt;OTel Collector topic&lt;/a&gt;.&lt;/p&gt;
&lt;!-- vale Google.Will = NO --&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;When configuring the OpenTelemetry Collector, you must use &lt;code&gt;endpoint: http://&amp;lt;LOKI_ADDR&amp;gt;/otlp&lt;/code&gt;, as the collector automatically completes the endpoint.  Entering the full endpoint will generate an error.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;!-- vale Google.Will = YES --&gt;
&lt;h2 id=&#34;query-logs-at-a-single-point-in-time&#34;&gt;Query logs at a single point in time&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/query&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/loki/api/v1/query&lt;/code&gt; allows for doing queries against a single point in time.
This type of query is often referred to as an instant query. Instant queries are only used for metric type LogQL queries
and will return a 400 (Bad Request) in case a log type query is provided.
The endpoint accepts the following query parameters in the URL:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;: The &lt;a href=&#34;../../query/&#34;&gt;LogQL&lt;/a&gt; query to perform. Requests that do not use valid LogQL syntax will return errors.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;limit&lt;/code&gt;: The max number of entries to return. It defaults to &lt;code&gt;100&lt;/code&gt;. Only applies to query types which produce a stream (log lines) response.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;time&lt;/code&gt;: The evaluation time for the query as a nanosecond Unix epoch or another &lt;a href=&#34;#timestamps&#34;&gt;supported format&lt;/a&gt;. Defaults to now.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;direction&lt;/code&gt;: Determines the sort order of logs. Supported values are &lt;code&gt;forward&lt;/code&gt; or &lt;code&gt;backward&lt;/code&gt;. Defaults to &lt;code&gt;backward&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In microservices mode, &lt;code&gt;/loki/api/v1/query&lt;/code&gt; is exposed by the querier and the query frontend.&lt;/p&gt;
&lt;p&gt;Response format:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;success&amp;#34;,
  &amp;#34;data&amp;#34;: {
    &amp;#34;resultType&amp;#34;: &amp;#34;vector&amp;#34; | &amp;#34;streams&amp;#34;,
    &amp;#34;result&amp;#34;: [&amp;lt;vector value&amp;gt;] | [&amp;lt;stream value&amp;gt;],
    &amp;#34;stats&amp;#34; : [&amp;lt;statistics&amp;gt;]
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;where &lt;code&gt;&amp;lt;vector value&amp;gt;&lt;/code&gt; is:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;metric&amp;#34;: {
    &amp;lt;label key-value pairs&amp;gt;
  },
  &amp;#34;value&amp;#34;: [
    &amp;lt;number: second unix epoch&amp;gt;,
    &amp;lt;string: value&amp;gt;
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;and &lt;code&gt;&amp;lt;stream value&amp;gt;&lt;/code&gt; is:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;stream&amp;#34;: {
    &amp;lt;label key-value pairs&amp;gt;
  },
  &amp;#34;values&amp;#34;: [
    [
      &amp;lt;string: nanosecond unix epoch&amp;gt;,
      &amp;lt;string: log line&amp;gt;
    ],
    ...
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The items in the &lt;code&gt;values&lt;/code&gt; array are sorted by timestamp.
The most recent item is first when using &lt;code&gt;direction=backward&lt;/code&gt;.
The oldest item is first when using &lt;code&gt;direction=forward&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Parquet can be request as a response format by setting the &lt;code&gt;Accept&lt;/code&gt; header to &lt;code&gt;application/vnd.apache.parquet&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The schema is the following for streams:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;column_name&lt;/th&gt;
              &lt;th&gt;column_type&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;timestamp&lt;/td&gt;
              &lt;td&gt;TIMESTAMP WITH TIME ZONE&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;labels&lt;/td&gt;
              &lt;td&gt;MAP(VARCHAR, VARCHAR)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;line&lt;/td&gt;
              &lt;td&gt;VARCHAR&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;and for metrics:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;column_name&lt;/th&gt;
              &lt;th&gt;column_type&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;timestamp&lt;/td&gt;
              &lt;td&gt;TIMESTAMP WITH TIME ZONE&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;labels&lt;/td&gt;
              &lt;td&gt;MAP(VARCHAR, VARCHAR)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;value&lt;/td&gt;
              &lt;td&gt;DOUBLE&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;See &lt;a href=&#34;#statistics&#34;&gt;statistics&lt;/a&gt; for information about the statistics returned by Loki.&lt;/p&gt;
&lt;h3 id=&#34;examples-1&#34;&gt;Examples&lt;/h3&gt;
&lt;p&gt;This example cURL command&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -G -s  &amp;#34;http://localhost:3100/loki/api/v1/query&amp;#34; \
  --data-urlencode &amp;#39;query=sum(rate({job=&amp;#34;varlogs&amp;#34;}[10m])) by (level)&amp;#39; | jq&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;gave this response:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;success&amp;#34;,
  &amp;#34;data&amp;#34;: {
    &amp;#34;resultType&amp;#34;: &amp;#34;vector&amp;#34;,
    &amp;#34;result&amp;#34;: [
      {
        &amp;#34;metric&amp;#34;: {},
        &amp;#34;value&amp;#34;: [
          1588889221,
          &amp;#34;1267.1266666666666&amp;#34;
        ]
      },
      {
        &amp;#34;metric&amp;#34;: {
          &amp;#34;level&amp;#34;: &amp;#34;warn&amp;#34;
        },
        &amp;#34;value&amp;#34;: [
          1588889221,
          &amp;#34;37.77166666666667&amp;#34;
        ]
      },
      {
        &amp;#34;metric&amp;#34;: {
          &amp;#34;level&amp;#34;: &amp;#34;info&amp;#34;
        },
        &amp;#34;value&amp;#34;: [
          1588889221,
          &amp;#34;37.69&amp;#34;
        ]
      }
    ],
    &amp;#34;stats&amp;#34;: {
      ...
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If your cluster has
&lt;a href=&#34;../../operations/multi-tenancy/&#34;&gt;Grafana Loki Multi-Tenancy&lt;/a&gt; enabled,
set the &lt;code&gt;X-Scope-OrgID&lt;/code&gt; header to identify the tenant you want to query.
Here is the same example query for the single tenant called &lt;code&gt;Tenant1&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -H &amp;#39;X-Scope-OrgID:Tenant1&amp;#39; \
  -G -s &amp;#34;http://localhost:3100/loki/api/v1/query&amp;#34; \
  --data-urlencode &amp;#39;query=sum(rate({job=&amp;#34;varlogs&amp;#34;}[10m])) by (level)&amp;#39; | jq&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To query against the three tenants &lt;code&gt;Tenant1&lt;/code&gt;, &lt;code&gt;Tenant2&lt;/code&gt;, and &lt;code&gt;Tenant3&lt;/code&gt;,
specify the tenant names separated by the pipe (&lt;code&gt;|&lt;/code&gt;) character:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -H &amp;#39;X-Scope-OrgID:Tenant1|Tenant2|Tenant3&amp;#39; \
  -G -s &amp;#34;http://localhost:3100/loki/api/v1/query&amp;#34; \
  --data-urlencode &amp;#39;query=sum(rate({job=&amp;#34;varlogs&amp;#34;}[10m])) by (level)&amp;#39; | jq&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The same example query for Grafana Enterprise Logs
uses Basic Authentication and specifies the tenant names as a &lt;code&gt;user&lt;/code&gt;.
The tenant names are separated by the pipe (&lt;code&gt;|&lt;/code&gt;) character.
The password in this example is an access policy token that has been
defined in the &lt;code&gt;API_TOKEN&lt;/code&gt; environment variable:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -u &amp;#34;Tenant1|Tenant2|Tenant3:$API_TOKEN&amp;#34; \
  -G -s &amp;#34;http://localhost:3100/loki/api/v1/query&amp;#34; \
  --data-urlencode &amp;#39;query=sum(rate({job=&amp;#34;varlogs&amp;#34;}[10m])) by (level)&amp;#39; | jq&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To query against your hosted log tenant in Grafana Cloud, use the &lt;strong&gt;User&lt;/strong&gt; and &lt;strong&gt;URL&lt;/strong&gt; values provided in the Loki logging service details of your Grafana Cloud stack. You can find this information in the &lt;a href=&#34;/docs/grafana-cloud/account-management/cloud-portal/#your-grafana-cloud-stack&#34;&gt;Cloud Portal&lt;/a&gt;. Use an access policy token in your queries for authentication. The password in this example is an access policy token that has been defined in the &lt;code&gt;API_TOKEN&lt;/code&gt; environment variable:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -u &amp;#34;User:$API_TOKEN&amp;#34; \
  -G -s &amp;#34;&amp;lt;URL_PROVIDED_IN_LOKI_DATA_SOURCE_SETTINGS&amp;gt;/loki/api/v1/query&amp;#34; \
  --data-urlencode &amp;#39;query=sum(rate({job=&amp;#34;varlogs&amp;#34;}[10m])) by (level)&amp;#39; | jq&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-logs-within-a-range-of-time&#34;&gt;Query logs within a range of time&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/query_range&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/loki/api/v1/query_range&lt;/code&gt; is used to do a query over a range of time.
This type of query is often referred to as a range query. Range queries are used for both log and metric type LogQL queries.
It accepts the following query parameters in the URL:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;: The &lt;a href=&#34;../../query/&#34;&gt;LogQL&lt;/a&gt; query to perform.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;limit&lt;/code&gt;: The max number of entries to return. It defaults to &lt;code&gt;100&lt;/code&gt;. Only applies to query types which produce a stream (log lines) response.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;start&lt;/code&gt;: The start time for the query as a nanosecond Unix epoch or another &lt;a href=&#34;#timestamps&#34;&gt;supported format&lt;/a&gt;. Defaults to one hour ago. Loki returns results with timestamp greater or equal to this value.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end&lt;/code&gt;: The end time for the query as a nanosecond Unix epoch or another &lt;a href=&#34;#timestamps&#34;&gt;supported format&lt;/a&gt;. Defaults to now. Loki returns results with timestamp lower than this value.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;since&lt;/code&gt;: A &lt;code&gt;duration&lt;/code&gt; used to calculate &lt;code&gt;start&lt;/code&gt; relative to &lt;code&gt;end&lt;/code&gt;. If &lt;code&gt;end&lt;/code&gt; is in the future, &lt;code&gt;start&lt;/code&gt; is calculated as this duration before now. Any value specified for &lt;code&gt;start&lt;/code&gt; supersedes this parameter.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;step&lt;/code&gt;: Query resolution step width in &lt;code&gt;duration&lt;/code&gt; format or float number of seconds. &lt;code&gt;duration&lt;/code&gt; refers to Prometheus duration strings of the form &lt;code&gt;[0-9]&#43;[smhdwy]&lt;/code&gt;. For example, 5m refers to a duration of 5 minutes. Defaults to a dynamic value based on &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt;. Only applies to query types which produce a matrix response.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;interval&lt;/code&gt;: Only return entries at (or greater than) the specified interval, can be a &lt;code&gt;duration&lt;/code&gt; format or float number of seconds. Only applies to queries which produce a stream response. Not to be confused with &lt;code&gt;step&lt;/code&gt;, see the explanation under &lt;a href=&#34;#step-versus-interval&#34;&gt;Step versus interval&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;direction&lt;/code&gt;: Determines the sort order of logs. Supported values are &lt;code&gt;forward&lt;/code&gt; or &lt;code&gt;backward&lt;/code&gt;. Defaults to &lt;code&gt;backward.&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In microservices mode, &lt;code&gt;/loki/api/v1/query_range&lt;/code&gt; is exposed by the querier and the query frontend.&lt;/p&gt;
&lt;h3 id=&#34;step-versus-interval&#34;&gt;Step versus interval&lt;/h3&gt;
&lt;p&gt;Use the &lt;code&gt;step&lt;/code&gt; parameter when making metric queries to Loki, or queries which return a matrix response. It is evaluated in exactly the same way Prometheus evaluates &lt;code&gt;step&lt;/code&gt;. First the query will be evaluated at &lt;code&gt;start&lt;/code&gt; and then evaluated again at &lt;code&gt;start &#43; step&lt;/code&gt; and again at &lt;code&gt;start &#43; step &#43; step&lt;/code&gt; until &lt;code&gt;end&lt;/code&gt; is reached. The result will be a matrix of the query result evaluated at each step.&lt;/p&gt;
&lt;p&gt;Use the &lt;code&gt;interval&lt;/code&gt; parameter when making log queries to Loki, or queries which return a stream response. It is evaluated by returning a log entry at &lt;code&gt;start&lt;/code&gt;, then the next entry will be returned an entry with timestampe &amp;gt;= &lt;code&gt;start &#43; interval&lt;/code&gt;, and again at &lt;code&gt;start &#43; interval &#43; interval&lt;/code&gt; and so on until &lt;code&gt;end&lt;/code&gt; is reached. It does not fill missing entries.&lt;/p&gt;
&lt;p&gt;Response format:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;success&amp;#34;,
  &amp;#34;data&amp;#34;: {
    &amp;#34;resultType&amp;#34;: &amp;#34;matrix&amp;#34; | &amp;#34;streams&amp;#34;,
    &amp;#34;result&amp;#34;: [&amp;lt;matrix value&amp;gt;] | [&amp;lt;stream value&amp;gt;]
    &amp;#34;stats&amp;#34; : [&amp;lt;statistics&amp;gt;]
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;where &lt;code&gt;&amp;lt;matrix value&amp;gt;&lt;/code&gt; is:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;metric&amp;#34;: {
    &amp;lt;label key-value pairs&amp;gt;
  },
  &amp;#34;values&amp;#34;: [
    [
      &amp;lt;number: second unix epoch&amp;gt;,
      &amp;lt;string: value&amp;gt;
    ],
    ...
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The items in the &lt;code&gt;values&lt;/code&gt; array are sorted by timestamp, and the oldest item is first.&lt;/p&gt;
&lt;p&gt;And &lt;code&gt;&amp;lt;stream value&amp;gt;&lt;/code&gt; is:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;stream&amp;#34;: {
    &amp;lt;label key-value pairs&amp;gt;
  },
  &amp;#34;values&amp;#34;: [
    [
      &amp;lt;string: nanosecond unix epoch&amp;gt;,
      &amp;lt;string: log line&amp;gt;
    ],
    ...
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The items in the &lt;code&gt;values&lt;/code&gt; array are sorted by timestamp.
The most recent item is first when using &lt;code&gt;direction=backward&lt;/code&gt;.
The oldest item is first when using &lt;code&gt;direction=forward&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Parquet can be request as a response format by setting the &lt;code&gt;Accept&lt;/code&gt; header to &lt;code&gt;application/vnd.apache.parquet&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The schema is the following for streams:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;column_name&lt;/th&gt;
              &lt;th&gt;column_type&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;timestamp&lt;/td&gt;
              &lt;td&gt;TIMESTAMP WITH TIME ZONE&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;labels&lt;/td&gt;
              &lt;td&gt;MAP(VARCHAR, VARCHAR)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;line&lt;/td&gt;
              &lt;td&gt;VARCHAR&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;and for metrics:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;column_name&lt;/th&gt;
              &lt;th&gt;column_type&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;timestamp&lt;/td&gt;
              &lt;td&gt;TIMESTAMP WITH TIME ZONE&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;labels&lt;/td&gt;
              &lt;td&gt;MAP(VARCHAR, VARCHAR)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;value&lt;/td&gt;
              &lt;td&gt;DOUBLE&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;See &lt;a href=&#34;#statistics&#34;&gt;statistics&lt;/a&gt; for information about the statistics returned by Loki.&lt;/p&gt;
&lt;h3 id=&#34;examples-2&#34;&gt;Examples&lt;/h3&gt;
&lt;p&gt;This example cURL command&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -G -s  &amp;#34;http://localhost:3100/loki/api/v1/query_range&amp;#34; \
  --data-urlencode &amp;#39;query=sum(rate({job=&amp;#34;varlogs&amp;#34;}[10m])) by (level)&amp;#39; \
  --data-urlencode &amp;#39;step=300&amp;#39; | jq&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;gave this response:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;success&amp;#34;,
  &amp;#34;data&amp;#34;: {
    &amp;#34;resultType&amp;#34;: &amp;#34;matrix&amp;#34;,
    &amp;#34;result&amp;#34;: [
      {
       &amp;#34;metric&amp;#34;: {
          &amp;#34;level&amp;#34;: &amp;#34;info&amp;#34;
        },
        &amp;#34;values&amp;#34;: [
          [
            1588889221,
            &amp;#34;137.95&amp;#34;
          ],
          [
            1588889221,
            &amp;#34;467.115&amp;#34;
          ],
          [
            1588889221,
            &amp;#34;658.8516666666667&amp;#34;
          ]
        ]
      },
      {
        &amp;#34;metric&amp;#34;: {
          &amp;#34;level&amp;#34;: &amp;#34;warn&amp;#34;
        },
        &amp;#34;values&amp;#34;: [
          [
            1588889221,
            &amp;#34;137.27833333333334&amp;#34;
          ],
          [
            1588889221,
            &amp;#34;467.69&amp;#34;
          ],
          [
            1588889221,
            &amp;#34;660.6933333333334&amp;#34;
          ]
        ]
      }
    ],
    &amp;#34;stats&amp;#34;: {
      ...
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This example cURL command&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -G -s &amp;#34;http://localhost:3100/loki/api/v1/query_range&amp;#34; \
  --data-urlencode &amp;#39;query={job=&amp;#34;varlogs&amp;#34;}&amp;#39; | jq&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;gave this response:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;success&amp;#34;,
  &amp;#34;data&amp;#34;: {
    &amp;#34;resultType&amp;#34;: &amp;#34;streams&amp;#34;,
    &amp;#34;result&amp;#34;: [
      {
        &amp;#34;stream&amp;#34;: {
          &amp;#34;filename&amp;#34;: &amp;#34;/var/log/myproject.log&amp;#34;,
          &amp;#34;job&amp;#34;: &amp;#34;varlogs&amp;#34;,
          &amp;#34;level&amp;#34;: &amp;#34;info&amp;#34;
        },
        &amp;#34;values&amp;#34;: [
          [
            &amp;#34;1569266497240578000&amp;#34;,
            &amp;#34;foo&amp;#34;
          ],
          [
            &amp;#34;1569266492548155000&amp;#34;,
            &amp;#34;bar&amp;#34;
          ]
        ]
      }
    ],
    &amp;#34;stats&amp;#34;: {
      ...
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-labels&#34;&gt;Query labels&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/labels&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/loki/api/v1/labels&lt;/code&gt; retrieves the list of known labels within a given time span.
Loki may use a larger time span than the one specified.
It accepts the following query parameters in the URL:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;start&lt;/code&gt;: The start time for the query as a nanosecond Unix epoch. Defaults to 6 hours ago.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end&lt;/code&gt;: The end time for the query as a nanosecond Unix epoch. Defaults to now.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;since&lt;/code&gt;: A &lt;code&gt;duration&lt;/code&gt; used to calculate &lt;code&gt;start&lt;/code&gt; relative to &lt;code&gt;end&lt;/code&gt;. If &lt;code&gt;end&lt;/code&gt; is in the future, &lt;code&gt;start&lt;/code&gt; is calculated as this duration before now. Any value specified for &lt;code&gt;start&lt;/code&gt; supersedes this parameter.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;: Log stream selector that selects the streams to match and return label names. Example: &lt;code&gt;{app=&amp;quot;myapp&amp;quot;, environment=&amp;quot;dev&amp;quot;}&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In microservices mode, &lt;code&gt;/loki/api/v1/labels&lt;/code&gt; is exposed by the querier.&lt;/p&gt;
&lt;p&gt;Response format:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;success&amp;#34;,
  &amp;#34;data&amp;#34;: [
    &amp;lt;label string&amp;gt;,
    ...
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;examples-3&#34;&gt;Examples&lt;/h3&gt;
&lt;p&gt;This example cURL command&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -G -s  &amp;#34;http://localhost:3100/loki/api/v1/labels&amp;#34; | jq&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;gave this response:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;success&amp;#34;,
  &amp;#34;data&amp;#34;: [
    &amp;#34;foo&amp;#34;,
    &amp;#34;bar&amp;#34;,
    &amp;#34;baz&amp;#34;
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-label-values&#34;&gt;Query label values&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/label/&amp;lt;name&amp;gt;/values&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/loki/api/v1/label/&amp;lt;name&amp;gt;/values&lt;/code&gt; retrieves the list of known values for a given
label within a given time span. Loki may use a larger time span than the one specified.
It accepts the following query parameters in the URL:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;start&lt;/code&gt;: The start time for the query as a nanosecond Unix epoch. Defaults to 6 hours ago.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end&lt;/code&gt;: The end time for the query as a nanosecond Unix epoch. Defaults to now.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;since&lt;/code&gt;: A &lt;code&gt;duration&lt;/code&gt; used to calculate &lt;code&gt;start&lt;/code&gt; relative to &lt;code&gt;end&lt;/code&gt;. If &lt;code&gt;end&lt;/code&gt; is in the future, &lt;code&gt;start&lt;/code&gt; is calculated as this duration before now. Any value specified for &lt;code&gt;start&lt;/code&gt; supersedes this parameter.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;: Log stream selector that selects the streams to match and return label values for &lt;code&gt;&amp;lt;name&amp;gt;&lt;/code&gt;. Example: &lt;code&gt;{app=&amp;quot;myapp&amp;quot;, environment=&amp;quot;dev&amp;quot;}&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In microservices mode, &lt;code&gt;/loki/api/v1/label/&amp;lt;name&amp;gt;/values&lt;/code&gt; is exposed by the querier.&lt;/p&gt;
&lt;p&gt;Response format:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;success&amp;#34;,
  &amp;#34;data&amp;#34;: [
    &amp;lt;label value&amp;gt;,
    ...
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;examples-4&#34;&gt;Examples&lt;/h3&gt;
&lt;p&gt;This example cURL command&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -G -s  &amp;#34;http://localhost:3100/loki/api/v1/label/foo/values&amp;#34; | jq&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;gave this response:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;success&amp;#34;,
  &amp;#34;data&amp;#34;: [
    &amp;#34;cat&amp;#34;,
    &amp;#34;dog&amp;#34;,
    &amp;#34;axolotl&amp;#34;
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-streams&#34;&gt;Query streams&lt;/h2&gt;
&lt;p&gt;The Series API is available under the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;GET /loki/api/v1/series&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POST /loki/api/v1/series&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This endpoint returns the list of streams (unique set of labels) that match a certain given selector.&lt;/p&gt;
&lt;p&gt;URL query parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;match[]=&amp;lt;selector&amp;gt;&lt;/code&gt;: Repeated log stream selector argument that selects the streams to return. At least one &lt;code&gt;match[]&lt;/code&gt; argument must be provided.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;start=&amp;lt;nanosecond Unix epoch&amp;gt;&lt;/code&gt;: Start timestamp.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end=&amp;lt;nanosecond Unix epoch&amp;gt;&lt;/code&gt;: End timestamp.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;since&lt;/code&gt;: A &lt;code&gt;duration&lt;/code&gt; used to calculate &lt;code&gt;start&lt;/code&gt; relative to &lt;code&gt;end&lt;/code&gt;. If &lt;code&gt;end&lt;/code&gt; is in the future, &lt;code&gt;start&lt;/code&gt; is calculated as this duration before now. Any value specified for &lt;code&gt;start&lt;/code&gt; supersedes this parameter.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can URL-encode these parameters directly in the request body by using the POST method and &lt;code&gt;Content-Type: application/x-www-form-urlencoded&lt;/code&gt; header. This is useful when specifying a large or dynamic number of stream selectors that may breach server-side URL character limits.&lt;/p&gt;
&lt;p&gt;In microservices mode, these endpoints are exposed by the querier.&lt;/p&gt;
&lt;h3 id=&#34;examples-5&#34;&gt;Examples&lt;/h3&gt;
&lt;p&gt;This example cURL command&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -s &amp;#34;http://localhost:3100/loki/api/v1/series&amp;#34; \
  --data-urlencode &amp;#39;match[]={container_name=~&amp;#34;prometheus.*&amp;#34;, component=&amp;#34;server&amp;#34;}&amp;#39; \
  --data-urlencode &amp;#39;match[]={app=&amp;#34;loki&amp;#34;}&amp;#39; | jq &amp;#39;.&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;gave this response:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;success&amp;#34;,
  &amp;#34;data&amp;#34;: [
    {
      &amp;#34;container_name&amp;#34;: &amp;#34;loki&amp;#34;,
      &amp;#34;app&amp;#34;: &amp;#34;loki&amp;#34;,
      &amp;#34;stream&amp;#34;: &amp;#34;stderr&amp;#34;,
      &amp;#34;filename&amp;#34;: &amp;#34;/var/log/pods/default_loki-stack-0_50835643-1df0-11ea-ba79-025000000001/loki/0.log&amp;#34;,
      &amp;#34;name&amp;#34;: &amp;#34;loki&amp;#34;,
      &amp;#34;job&amp;#34;: &amp;#34;default/loki&amp;#34;,
      &amp;#34;controller_revision_hash&amp;#34;: &amp;#34;loki-stack-757479754d&amp;#34;,
      &amp;#34;statefulset_kubernetes_io_pod_name&amp;#34;: &amp;#34;loki-stack-0&amp;#34;,
      &amp;#34;release&amp;#34;: &amp;#34;loki-stack&amp;#34;,
      &amp;#34;namespace&amp;#34;: &amp;#34;default&amp;#34;,
      &amp;#34;instance&amp;#34;: &amp;#34;loki-stack-0&amp;#34;
    },
    {
      &amp;#34;chart&amp;#34;: &amp;#34;prometheus-9.3.3&amp;#34;,
      &amp;#34;container_name&amp;#34;: &amp;#34;prometheus-server-configmap-reload&amp;#34;,
      &amp;#34;filename&amp;#34;: &amp;#34;/var/log/pods/default_loki-stack-prometheus-server-696cc9ddff-87lmq_507b1db4-1df0-11ea-ba79-025000000001/prometheus-server-configmap-reload/0.log&amp;#34;,
      &amp;#34;instance&amp;#34;: &amp;#34;loki-stack-prometheus-server-696cc9ddff-87lmq&amp;#34;,
      &amp;#34;pod_template_hash&amp;#34;: &amp;#34;696cc9ddff&amp;#34;,
      &amp;#34;app&amp;#34;: &amp;#34;prometheus&amp;#34;,
      &amp;#34;component&amp;#34;: &amp;#34;server&amp;#34;,
      &amp;#34;heritage&amp;#34;: &amp;#34;Tiller&amp;#34;,
      &amp;#34;job&amp;#34;: &amp;#34;default/prometheus&amp;#34;,
      &amp;#34;namespace&amp;#34;: &amp;#34;default&amp;#34;,
      &amp;#34;release&amp;#34;: &amp;#34;loki-stack&amp;#34;,
      &amp;#34;stream&amp;#34;: &amp;#34;stderr&amp;#34;
    },
    {
      &amp;#34;app&amp;#34;: &amp;#34;prometheus&amp;#34;,
      &amp;#34;component&amp;#34;: &amp;#34;server&amp;#34;,
      &amp;#34;filename&amp;#34;: &amp;#34;/var/log/pods/default_loki-stack-prometheus-server-696cc9ddff-87lmq_507b1db4-1df0-11ea-ba79-025000000001/prometheus-server/0.log&amp;#34;,
      &amp;#34;release&amp;#34;: &amp;#34;loki-stack&amp;#34;,
      &amp;#34;namespace&amp;#34;: &amp;#34;default&amp;#34;,
      &amp;#34;pod_template_hash&amp;#34;: &amp;#34;696cc9ddff&amp;#34;,
      &amp;#34;stream&amp;#34;: &amp;#34;stderr&amp;#34;,
      &amp;#34;chart&amp;#34;: &amp;#34;prometheus-9.3.3&amp;#34;,
      &amp;#34;container_name&amp;#34;: &amp;#34;prometheus-server&amp;#34;,
      &amp;#34;heritage&amp;#34;: &amp;#34;Tiller&amp;#34;,
      &amp;#34;instance&amp;#34;: &amp;#34;loki-stack-prometheus-server-696cc9ddff-87lmq&amp;#34;,
      &amp;#34;job&amp;#34;: &amp;#34;default/prometheus&amp;#34;
    }
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-log-statistics&#34;&gt;Query log statistics&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/index/stats&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;/loki/api/v1/index/stats&lt;/code&gt; endpoint can be used to query the index for the number of &lt;code&gt;streams&lt;/code&gt;, &lt;code&gt;chunks&lt;/code&gt;, &lt;code&gt;entries&lt;/code&gt;, and &lt;code&gt;bytes&lt;/code&gt; that a query resolves to.&lt;/p&gt;
&lt;p&gt;URL query parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;: The &lt;a href=&#34;../../query/&#34;&gt;LogQL&lt;/a&gt; matchers to check (that is, &lt;code&gt;{job=&amp;quot;foo&amp;quot;, env!=&amp;quot;dev&amp;quot;}&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;start=&amp;lt;nanosecond Unix epoch&amp;gt;&lt;/code&gt;: Start timestamp.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end=&amp;lt;nanosecond Unix epoch&amp;gt;&lt;/code&gt;: End timestamp.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can URL-encode these parameters directly in the request body by using the POST method and &lt;code&gt;Content-Type: application/x-www-form-urlencoded&lt;/code&gt; header. This is useful when specifying a large or dynamic number of stream selectors that may breach server-side URL character limits.&lt;/p&gt;
&lt;p&gt;Response:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;streams&amp;#34;: 100,
  &amp;#34;chunks&amp;#34;: 1000,
  &amp;#34;entries&amp;#34;: 5000,
  &amp;#34;bytes&amp;#34;: 100000
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It is an approximation with the following caveats:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It does not include data from the ingesters.&lt;/li&gt;
&lt;li&gt;It is a probabilistic technique.&lt;/li&gt;
&lt;li&gt;Streams/chunks which span multiple period configurations may be counted twice.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These make it generally more helpful for larger queries.
It can be used for better understanding the throughput requirements and data topology for a list of matchers over a period of time.&lt;/p&gt;
&lt;h2 id=&#34;query-log-volume&#34;&gt;Query log volume&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/index/volume
GET /loki/api/v1/index/volume_range&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;You must configure &lt;code&gt;volume_enabled: true&lt;/code&gt; to enable this feature.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;/loki/api/v1/index/volume&lt;/code&gt; and &lt;code&gt;/loki/api/v1/index/volume_range&lt;/code&gt; endpoints can be used to query the index for volume information about label and label-value combinations. This is helpful in exploring the logs Loki has ingested to find high or low volume streams. The &lt;code&gt;volume&lt;/code&gt; endpoint returns results for a single point in time, the time the query was processed. Each datapoint represents an aggregation of the matching label or series over the requested time period, returned in a Prometheus style vector response. The &lt;code&gt;volume_range&lt;/code&gt; endoint returns a series of datapoints over a range of time, in Prometheus style matrix response, for each matching set of labels or series. The number of timestamps returned when querying &lt;code&gt;volume_range&lt;/code&gt; will be determined by the provided &lt;code&gt;step&lt;/code&gt; parameter and the requested time range.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;query&lt;/code&gt; should be a valid LogQL stream selector, for example &lt;code&gt;{job=&amp;quot;foo&amp;quot;, env=~&amp;quot;.&#43;&amp;quot;}&lt;/code&gt;. By default, these endpoints will aggregate into series consisting of all matches for labels included in the query. For example, assuming you have the streams &lt;code&gt;{job=&amp;quot;foo&amp;quot;, env=&amp;quot;prod&amp;quot;, team=&amp;quot;alpha&amp;quot;}&lt;/code&gt;, &lt;code&gt;{job=&amp;quot;bar&amp;quot;, env=&amp;quot;prod&amp;quot;, team=&amp;quot;beta&amp;quot;}&lt;/code&gt;, &lt;code&gt;{job=&amp;quot;foo&amp;quot;, env=&amp;quot;dev&amp;quot;, team=&amp;quot;alpha&amp;quot;}&lt;/code&gt;, and &lt;code&gt;{job=&amp;quot;bar&amp;quot;, env=&amp;quot;dev&amp;quot;, team=&amp;quot;beta&amp;quot;}&lt;/code&gt; in your system. The query &lt;code&gt;{job=&amp;quot;foo&amp;quot;, env=~&amp;quot;.&#43;&amp;quot;}&lt;/code&gt; would return the two metric series &lt;code&gt;{job=&amp;quot;foo&amp;quot;, env=&amp;quot;dev&amp;quot;}&lt;/code&gt; and &lt;code&gt;{job=&amp;quot;foo&amp;quot;, env=&amp;quot;prod&amp;quot;}&lt;/code&gt;, each with datapoints representing the accumulate values of chunks for the streams matching that selector, which in this case would be the streams &lt;code&gt;{job=&amp;quot;foo&amp;quot;, env=&amp;quot;dev&amp;quot;, team=&amp;quot;alpha&amp;quot;}&lt;/code&gt; and &lt;code&gt;{job=&amp;quot;foo&amp;quot;, env=&amp;quot;prod&amp;quot;, team=&amp;quot;alpha&amp;quot;}&lt;/code&gt;, respectively.&lt;/p&gt;
&lt;p&gt;There are two parameters which can affect the aggregation strategy. First, a comma-separated list of &lt;code&gt;targetLabels&lt;/code&gt; can be provided, allowing volumes to be aggregated by the speficied &lt;code&gt;targetLabels&lt;/code&gt; only. This is useful for negations. For example, if you said &lt;code&gt;{team=&amp;quot;alpha&amp;quot;, env!=&amp;quot;dev&amp;quot;}&lt;/code&gt;, the default behavior would include &lt;code&gt;env&lt;/code&gt; in the aggregation set. However, maybe you&amp;rsquo;re looking for all non-dev jobs for team alpha, and you don&amp;rsquo;t care which env those are in (other than caring that they&amp;rsquo;re not dev jobs). To achieve this, you could specify &lt;code&gt;targetLabels=team,job&lt;/code&gt;, resulting in a single metric series (in this case) of &lt;code&gt;{team=&amp;quot;alpha&amp;quot;, job=&amp;quot;foo}&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The other way to change aggregations is with the &lt;code&gt;aggregateBy&lt;/code&gt; parameter. The default value for this is &lt;code&gt;series&lt;/code&gt;, which aggregates into combinations of matching key-value pairs. Alternately this can be specified as &lt;code&gt;labels&lt;/code&gt;, which will aggregate into labels only. In this case, the response will have a metric series with a label name matching each label, and a label value of &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;. This is useful for exploring logs at a high level. For example, if you wanted to know what percentage of your logs had a &lt;code&gt;team&lt;/code&gt; label, you could query your logs with &lt;code&gt;aggregateBy=labels&lt;/code&gt; and a query with either an exact or regex match on &lt;code&gt;team&lt;/code&gt;, or by including &lt;code&gt;team&lt;/code&gt; in the list of &lt;code&gt;targetLabels&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;URL query parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;: The &lt;a href=&#34;../../query/&#34;&gt;LogQL&lt;/a&gt; matchers to check (that is, &lt;code&gt;{job=&amp;quot;foo&amp;quot;, env=~&amp;quot;.&#43;&amp;quot;}&lt;/code&gt;). This parameter is required.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;start=&amp;lt;nanosecond Unix epoch&amp;gt;&lt;/code&gt;: Start timestamp. This parameter is required.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end=&amp;lt;nanosecond Unix epoch&amp;gt;&lt;/code&gt;: End timestamp. This parameter is required.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;limit&lt;/code&gt;: How many metric series to return. The parameter is optional, the default is &lt;code&gt;100&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;step&lt;/code&gt;: Query resolution step width in &lt;code&gt;duration&lt;/code&gt; format or float number of seconds. &lt;code&gt;duration&lt;/code&gt; refers to Prometheus duration strings of the form &lt;code&gt;[0-9]&#43;[smhdwy]&lt;/code&gt;. For example, 5m refers to a duration of 5 minutes. Defaults to a dynamic value based on &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt;. Only applies when querying the &lt;code&gt;volume_range&lt;/code&gt; endpoint, which will always return a Prometheus style matrix response. This parameter is optional, and only applicable for &lt;code&gt;query_range&lt;/code&gt;. The default step configured for range queries will be used when not provided.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;targetLabels&lt;/code&gt;: A comma separated list of labels to aggregate into. This parameter is optional. When not provided, volumes will be aggregated into the matching labels or label-value pairs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;aggregateBy&lt;/code&gt;: Whether to aggregate into labels or label-value pairs. This parameter is optional, the default is label-value pairs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can URL-encode these parameters directly in the request body by using the POST method and &lt;code&gt;Content-Type: application/x-www-form-urlencoded&lt;/code&gt; header. This is useful when specifying a large or dynamic number of stream selectors that may breach server-side URL character limits.&lt;/p&gt;
&lt;h2 id=&#34;patterns-detection&#34;&gt;Patterns detection&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/patterns&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;You must configure&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;pattern_ingester:
  enabled: true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;to enable this feature.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;/loki/api/v1/patterns&lt;/code&gt; endpoint can be used to query loki for patterns detected in the logs. This helps understand the structure of the logs Loki has ingested.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;query&lt;/code&gt; should be a valid LogQL stream selector, for example &lt;code&gt;{job=&amp;quot;foo&amp;quot;, env=~&amp;quot;.&#43;&amp;quot;}&lt;/code&gt;. The result is aggregated by the &lt;code&gt;pattern&lt;/code&gt; from all matching streams.&lt;/p&gt;
&lt;p&gt;For each pattern detected, the response includes the pattern itself and the number of samples for each pattern at each timestamp.&lt;/p&gt;
&lt;p&gt;For example, if you have the following logs:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;log&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-log&#34;&gt;ts=2024-03-30T23:03:40 caller=grpc_logging.go:66 level=info method=/cortex.Ingester/Push duration=200ms msg=gRPC
ts=2024-03-30T23:03:41 caller=grpc_logging.go:66 level=info method=/cortex.Ingester/Push duration=500ms msg=gRPC&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The pattern detected might be:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;log&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-log&#34;&gt;ts=&amp;lt;_&amp;gt; caller=grpc_logging.go:66 level=info method=/cortex.Ingester/Push duration=&amp;lt;_&amp;gt; msg=gRPC&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;URL query parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;: The &lt;a href=&#34;../../query/&#34;&gt;LogQL&lt;/a&gt; matchers to check (that is, &lt;code&gt;{job=&amp;quot;foo&amp;quot;, env=~&amp;quot;.&#43;&amp;quot;}&lt;/code&gt;). This parameter is required.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;start=&amp;lt;nanosecond Unix epoch&amp;gt;&lt;/code&gt;: Start timestamp. This parameter is required.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end=&amp;lt;nanosecond Unix epoch&amp;gt;&lt;/code&gt;: End timestamp. This parameter is required.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;step=&amp;lt;duration string or float number of seconds&amp;gt;&lt;/code&gt;: Step between samples for occurrences of this pattern. This parameter is optional.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;examples-6&#34;&gt;Examples&lt;/h3&gt;
&lt;p&gt;This example cURL command&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -s &amp;#34;http://localhost:3100/loki/api/v1/patterns&amp;#34; \
  --data-urlencode &amp;#39;query={app=&amp;#34;loki&amp;#34;}&amp;#39; | jq&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;gave this response:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;success&amp;#34;,
  &amp;#34;data&amp;#34;: [
    {
      &amp;#34;pattern&amp;#34;: &amp;#34;&amp;lt;_&amp;gt; caller=grpc_logging.go:66 &amp;lt;_&amp;gt; level=error method=/cortex.Ingester/Push &amp;lt;_&amp;gt; msg=gRPC err=\&amp;#34;connection refused to object store\&amp;#34;&amp;#34;,
      &amp;#34;samples&amp;#34;: [
        [
          1711839260,
          1
        ],
        [
          1711839270,
          2
        ],
        [
          1711839280,
          1
        ]
      ]
    },
    {
      &amp;#34;pattern&amp;#34;: &amp;#34;&amp;lt;_&amp;gt; caller=grpc_logging.go:66 &amp;lt;_&amp;gt; level=info method=/cortex.Ingester/Push &amp;lt;_&amp;gt; msg=gRPC&amp;#34;,
      &amp;#34;samples&amp;#34;: [
        [
          1711839260,
          105
        ],
        [
          1711839270,
          222
        ],
        [
          1711839280,
          196
        ]
      ]
    }
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The result is a list of patterns detected in the logs, with the number of samples for each pattern at each timestamp.
The pattern format is the same as the &lt;a href=&#34;../../query/&#34;&gt;LogQL&lt;/a&gt; pattern filter and parser and can be used in queries for filtering matching logs.
Each sample is a tuple of timestamp (second) and count.&lt;/p&gt;
&lt;h2 id=&#34;detected-fields&#34;&gt;Detected fields&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/detected_fields
POST /loki/api/v1/detected_fields&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;/loki/api/v1/detected_fields&lt;/code&gt; endpoint returns fields that Loki has detected in log lines matching the given stream selector, along with the inferred type, estimated cardinality, and the parser that was used to extract the field.
This endpoint is useful for discovering the structure of your logs without running a full log query.&lt;/p&gt;
&lt;p&gt;URL query parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;: The &lt;a href=&#34;../../query/&#34;&gt;LogQL&lt;/a&gt; stream selector to match. Example: &lt;code&gt;{app=&amp;quot;myapp&amp;quot;, environment=&amp;quot;dev&amp;quot;}&lt;/code&gt;. This parameter is required.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;start=&amp;lt;nanosecond Unix epoch&amp;gt;&lt;/code&gt;: Start timestamp. This parameter is optional. If omitted, it defaults to &lt;code&gt;end - since&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end=&amp;lt;nanosecond Unix epoch&amp;gt;&lt;/code&gt;: End timestamp. This parameter is optional. If omitted, it defaults to the current server time.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;since=&amp;lt;duration&amp;gt;&lt;/code&gt;: Relative time range (for example, &lt;code&gt;1h&lt;/code&gt;, &lt;code&gt;5m&lt;/code&gt;). This parameter is optional and is used when &lt;code&gt;start&lt;/code&gt; is omitted to compute &lt;code&gt;start = end - since&lt;/code&gt;. If both &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;since&lt;/code&gt; are omitted, &lt;code&gt;since&lt;/code&gt; defaults to &lt;code&gt;1h&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;step=&amp;lt;duration string or float number of seconds&amp;gt;&lt;/code&gt;: Step between sample windows. This parameter is optional.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;line_limit=&amp;lt;integer&amp;gt;&lt;/code&gt;: Maximum number of log lines to scan per shard. Defaults to 100. This parameter is optional.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;limit=&amp;lt;integer&amp;gt;&lt;/code&gt;: Maximum number of fields to return. Defaults to 1000. The query parameter &lt;code&gt;field_limit&lt;/code&gt; is also accepted as an alias for backwards compatibility. This parameter is optional.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can URL-encode these parameters directly in the request body by using the POST method and &lt;code&gt;Content-Type: application/x-www-form-urlencoded&lt;/code&gt; header.&lt;/p&gt;
&lt;p&gt;Response format:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;{
  &amp;#34;fields&amp;#34;: [
    {
      &amp;#34;label&amp;#34;: &amp;lt;string&amp;gt;,
      &amp;#34;type&amp;#34;: &amp;lt;string|int|float|boolean|duration|bytes&amp;gt;,
      &amp;#34;cardinality&amp;#34;: &amp;lt;integer&amp;gt;,
      &amp;#34;parsers&amp;#34;: [&amp;lt;string&amp;gt;],
      &amp;#34;jsonPath&amp;#34;: &amp;lt;string, optional&amp;gt;,
      &amp;#34;sketch&amp;#34;: &amp;lt;object, optional&amp;gt;
    }
  ],
  &amp;#34;limit&amp;#34;: &amp;lt;integer&amp;gt;
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;examples-7&#34;&gt;Examples&lt;/h3&gt;
&lt;p&gt;This example cURL command&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -H &amp;#39;X-Scope-OrgID: &amp;lt;TENANT_ID&amp;gt;&amp;#39; -G -s &amp;#34;http://localhost:3100/loki/api/v1/detected_fields&amp;#34; \
  --data-urlencode &amp;#39;query={app=&amp;#34;myapp&amp;#34;}&amp;#39; \
  --data-urlencode &amp;#39;start=1609459200000000000&amp;#39; \
  --data-urlencode &amp;#39;end=1609462800000000000&amp;#39; | jq&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;gave this response:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;fields&amp;#34;: [
    {
      &amp;#34;label&amp;#34;: &amp;#34;level&amp;#34;,
      &amp;#34;type&amp;#34;: &amp;#34;string&amp;#34;,
      &amp;#34;cardinality&amp;#34;: 3,
      &amp;#34;parsers&amp;#34;: [&amp;#34;logfmt&amp;#34;]
    },
    {
      &amp;#34;label&amp;#34;: &amp;#34;duration&amp;#34;,
      &amp;#34;type&amp;#34;: &amp;#34;duration&amp;#34;,
      &amp;#34;cardinality&amp;#34;: 152,
      &amp;#34;parsers&amp;#34;: [&amp;#34;logfmt&amp;#34;]
    },
    {
      &amp;#34;label&amp;#34;: &amp;#34;status&amp;#34;,
      &amp;#34;type&amp;#34;: &amp;#34;int&amp;#34;,
      &amp;#34;cardinality&amp;#34;: 5,
      &amp;#34;parsers&amp;#34;: [&amp;#34;logfmt&amp;#34;]
    }
  ],
  &amp;#34;limit&amp;#34;: 1000
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;detected-field-values&#34;&gt;Detected field values&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/detected_field/{name}/values
POST /loki/api/v1/detected_field/{name}/values&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;/loki/api/v1/detected_field/{name}/values&lt;/code&gt; endpoint returns the values observed for a specific detected field matching the given stream selector.
&lt;code&gt;{name}&lt;/code&gt; is the name of the field to retrieve values for.&lt;/p&gt;
&lt;p&gt;URL query parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;: The &lt;a href=&#34;../../query/&#34;&gt;LogQL&lt;/a&gt; stream selector to match. Example: &lt;code&gt;{app=&amp;quot;myapp&amp;quot;, environment=&amp;quot;dev&amp;quot;}&lt;/code&gt;. This parameter is required.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;start=&amp;lt;nanosecond Unix epoch&amp;gt;&lt;/code&gt;: Start timestamp. This parameter is optional. If omitted, it defaults to &lt;code&gt;end - since&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end=&amp;lt;nanosecond Unix epoch&amp;gt;&lt;/code&gt;: End timestamp. This parameter is optional. If omitted, it defaults to the current server time.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;since=&amp;lt;duration&amp;gt;&lt;/code&gt;: Relative time range (for example, &lt;code&gt;1h&lt;/code&gt;, &lt;code&gt;5m&lt;/code&gt;). This parameter is optional and is used when &lt;code&gt;start&lt;/code&gt; is omitted to compute &lt;code&gt;start = end - since&lt;/code&gt;. If both &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;since&lt;/code&gt; are omitted, &lt;code&gt;since&lt;/code&gt; defaults to &lt;code&gt;1h&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;step=&amp;lt;duration string or float number of seconds&amp;gt;&lt;/code&gt;: Step between sample windows. This parameter is optional.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;line_limit=&amp;lt;integer&amp;gt;&lt;/code&gt;: Maximum number of log lines to scan per shard. Defaults to 100. This parameter is optional.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;limit=&amp;lt;integer&amp;gt;&lt;/code&gt;: Maximum number of values to return. Defaults to 1000. The query parameter &lt;code&gt;field_limit&lt;/code&gt; is also accepted as an alias. This parameter is optional.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can URL-encode these parameters directly in the request body by using the POST method and &lt;code&gt;Content-Type: application/x-www-form-urlencoded&lt;/code&gt; header.&lt;/p&gt;
&lt;p&gt;Response format:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;{
  &amp;#34;values&amp;#34;: [
    &amp;lt;string&amp;gt;,
    ...
  ],
  &amp;#34;limit&amp;#34;: &amp;lt;integer&amp;gt;
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;examples-8&#34;&gt;Examples&lt;/h3&gt;
&lt;p&gt;This example cURL command&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -H &amp;#39;X-Scope-OrgID: &amp;lt;TENANT_ID&amp;gt;&amp;#39; -G -s &amp;#34;http://localhost:3100/loki/api/v1/detected_field/level/values&amp;#34; \
  --data-urlencode &amp;#39;query={app=&amp;#34;myapp&amp;#34;}&amp;#39; \
  --data-urlencode &amp;#39;start=1609459200000000000&amp;#39; \
  --data-urlencode &amp;#39;end=1609462800000000000&amp;#39; | jq&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;gave this response:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;values&amp;#34;: [
    &amp;#34;debug&amp;#34;,
    &amp;#34;info&amp;#34;,
    &amp;#34;warn&amp;#34;,
    &amp;#34;error&amp;#34;
  ],
  &amp;#34;limit&amp;#34;: 1000
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;stream-logs&#34;&gt;Stream logs&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/tail&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/loki/api/v1/tail&lt;/code&gt; is a WebSocket endpoint that streams log messages based on a query to the client.
It accepts the following query parameters in the URL:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;: The &lt;a href=&#34;../../query/&#34;&gt;LogQL&lt;/a&gt; query to perform.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;delay_for&lt;/code&gt;: The number of seconds to delay retrieving logs to let slow
loggers catch up. Defaults to 0 and cannot be larger than 5.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;limit&lt;/code&gt;: The max number of entries to return. It defaults to &lt;code&gt;100&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;start&lt;/code&gt;: The start time for the query as a nanosecond Unix epoch. Defaults to one hour ago.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In microservices mode, &lt;code&gt;/loki/api/v1/tail&lt;/code&gt; is exposed by the querier.&lt;/p&gt;
&lt;p&gt;Response format (streamed):&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;streams&amp;#34;: [
    {
      &amp;#34;stream&amp;#34;: {
        &amp;lt;label key-value pairs&amp;gt;
      },
      &amp;#34;values&amp;#34;: [
        [
          &amp;lt;string: nanosecond unix epoch&amp;gt;,
          &amp;lt;string: log line&amp;gt;
        ]
      ]
    }
  ],
  &amp;#34;dropped_entries&amp;#34;: [
    {
      &amp;#34;labels&amp;#34;: {
        &amp;lt;label key-value pairs&amp;gt;
      },
      &amp;#34;timestamp&amp;#34;: &amp;#34;&amp;lt;nanosecond unix epoch&amp;gt;&amp;#34;
    }
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;readiness-probe&#34;&gt;Readiness probe&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /ready&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/ready&lt;/code&gt; returns HTTP 200 when the Loki instance is ready to accept traffic. If
running Loki on Kubernetes, &lt;code&gt;/ready&lt;/code&gt; can be used as a readiness probe.&lt;/p&gt;
&lt;p&gt;In microservices mode, the &lt;code&gt;/ready&lt;/code&gt; endpoint is exposed by all components.&lt;/p&gt;
&lt;h2 id=&#34;change-log-level&#34;&gt;Change log level&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /log_level
POST /log_level&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/log_level&lt;/code&gt; a &lt;code&gt;GET&lt;/code&gt; returns the current log level and a &lt;code&gt;POST&lt;/code&gt; lets you change the log level of a Loki process &lt;strong&gt;at runtime&lt;/strong&gt;.
This can be useful for accessing debugging information during an incident. Caution should be used when running at the &lt;code&gt;debug&lt;/code&gt; log level, as this produces a large volume of data.&lt;/p&gt;
&lt;p&gt;The endpoint accepts the following query parameters in the URL:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;log_level&lt;/code&gt;: A valid log level that can be passed as a URL param (&lt;code&gt;?log_level=&amp;lt;level&amp;gt;&lt;/code&gt;) or as a form value in case of &lt;code&gt;POST&lt;/code&gt;. Valid levels: [debug, info, warn, error]&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In microservices mode, the &lt;code&gt;/log_level&lt;/code&gt; endpoint is exposed by all components.&lt;/p&gt;
&lt;h2 id=&#34;prometheus-metrics&#34;&gt;Prometheus metrics&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /metrics&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/metrics&lt;/code&gt; returns exposed Prometheus metrics. See
&lt;a href=&#34;../../operations/meta-monitoring/&#34;&gt;Observing Loki&lt;/a&gt;
for a list of exported metrics.&lt;/p&gt;
&lt;p&gt;In microservices mode, the &lt;code&gt;/metrics&lt;/code&gt; endpoint is exposed by all components.&lt;/p&gt;
&lt;h2 id=&#34;show-current-configuration&#34;&gt;Show current configuration&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /config&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/config&lt;/code&gt; exposes the current configuration. The optional &lt;code&gt;mode&lt;/code&gt; query parameter can be used to
modify the output. If it has the value &lt;code&gt;diffs&lt;/code&gt; only the differences between the default configuration
and the current are returned. A value of &lt;code&gt;defaults&lt;/code&gt; returns the default configuration.&lt;/p&gt;
&lt;p&gt;In microservices mode, the &lt;code&gt;/config&lt;/code&gt; endpoint is exposed by all components.&lt;/p&gt;
&lt;h2 id=&#34;list-running-services&#34;&gt;List running services&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /services&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/services&lt;/code&gt; returns a list of all running services and their current states.&lt;/p&gt;
&lt;p&gt;Services can have the following states:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;New&lt;/strong&gt;: Service is new, not running yet (initial state)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Starting&lt;/strong&gt;: Service is starting; if starting succeeds, service enters &lt;strong&gt;Running&lt;/strong&gt; state&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Running&lt;/strong&gt;: Service is fully running now; when service stops running, it enters &lt;strong&gt;Stopping&lt;/strong&gt; state&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stopping&lt;/strong&gt;: Service is shutting down&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Terminated&lt;/strong&gt;: Service has stopped successfully (terminal state)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Failed&lt;/strong&gt;: Service has failed in &lt;strong&gt;Starting&lt;/strong&gt;, &lt;strong&gt;Running&lt;/strong&gt; or &lt;strong&gt;Stopping&lt;/strong&gt; state (terminal state)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;show-build-information&#34;&gt;Show build information&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/status/buildinfo&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/loki/api/v1/status/buildinfo&lt;/code&gt; exposes the build information in a JSON object. The fields are &lt;code&gt;version&lt;/code&gt;, &lt;code&gt;revision&lt;/code&gt;, &lt;code&gt;branch&lt;/code&gt;, &lt;code&gt;buildDate&lt;/code&gt;, &lt;code&gt;buildUser&lt;/code&gt;, and &lt;code&gt;goVersion&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;flush-in-memory-chunks-to-backing-store&#34;&gt;Flush in-memory chunks to backing store&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;POST /flush&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/flush&lt;/code&gt; triggers a flush of all in-memory chunks held by the ingesters to the
backing store. Mainly used for local testing.&lt;/p&gt;
&lt;p&gt;In microservices mode, the &lt;code&gt;/flush&lt;/code&gt; endpoint is exposed by the ingester.&lt;/p&gt;
&lt;h2 id=&#34;prepare-ingester-shutdown&#34;&gt;Prepare ingester shutdown&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET, POST, DELETE /ingester/prepare_shutdown&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This endpoint is used to tell the ingester to release all resources on receiving the next &lt;code&gt;SIGTERM&lt;/code&gt; or &lt;code&gt;SIGINT&lt;/code&gt; signal.&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;POST&lt;/code&gt; request to the &lt;code&gt;/ingester/prepare_shutdown&lt;/code&gt; endpoint configures the ingester for a full shutdown and returns immediately.
Only when the ingester process is stopped with &lt;code&gt;SIGINT&lt;/code&gt; or &lt;code&gt;SIGTERM&lt;/code&gt;, it will unregister from the ring, and in-memory data will be flushed to long-term storage.
This endpoint supersedes any YAML configurations and isn&amp;rsquo;t necessary if the ingester is already configured to unregister from the ring or to flush on shutdown.&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;GET&lt;/code&gt; request to the &lt;code&gt;/ingester/prepare_shutdown&lt;/code&gt; endpoint returns the status of this configuration, either &lt;code&gt;set&lt;/code&gt; or &lt;code&gt;unset&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;DELETE&lt;/code&gt; request to the &lt;code&gt;/ingester/prepare_shutdown&lt;/code&gt; endpoint reverts the configuration of the ingester to its previous state
(with respect to unregistering on shutdown and flushing of in-memory data to long-term storage).&lt;/p&gt;
&lt;p&gt;This API endpoint is usually used by Kubernetes-specific scale down automations such as the
&lt;a href=&#34;https://github.com/grafana/rollout-operator&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;rollout-operator&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;flush-in-memory-chunks-and-shut-down&#34;&gt;Flush in-memory chunks and shut down&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET, POST /ingester/shutdown&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;/ingester/shutdown&lt;/code&gt; triggers a shutdown of the ingester and notably will &lt;em&gt;always&lt;/em&gt; flush any in memory chunks it holds.
This is helpful for scaling down WAL-enabled ingesters where we want to ensure old WAL directories are not orphaned,
but instead flushed to our chunk backend.&lt;/p&gt;
&lt;p&gt;It accepts three URL query parameters &lt;code&gt;flush&lt;/code&gt;, &lt;code&gt;delete_ring_tokens&lt;/code&gt;, and &lt;code&gt;terminate&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;URL query parameters:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;flush=&amp;lt;bool&amp;gt;&lt;/code&gt;:
Flag to control whether to flush any in-memory chunks the ingester holds. Defaults to &lt;code&gt;true&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;delete_ring_tokens=&amp;lt;bool&amp;gt;&lt;/code&gt;:
Flag to control whether to delete the file that contains the ingester ring tokens of the instance if the &lt;code&gt;-ingester.token-file-path&lt;/code&gt; is specified. Defaults to &lt;code&gt;false&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;terminate=&amp;lt;bool&amp;gt;&lt;/code&gt;:
Flag to control whether to terminate the Loki process after service shutdown. Defaults to &lt;code&gt;true&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This handler, in contrast to the deprecated &lt;code&gt;/ingester/flush_shutdown&lt;/code&gt; handler, terminates the Loki process by default.
This behaviour can be changed by setting the &lt;code&gt;terminate&lt;/code&gt; query parameter to &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In microservices mode, the &lt;code&gt;/ingester/shutdown&lt;/code&gt; endpoint is exposed by the ingester.&lt;/p&gt;
&lt;h2 id=&#34;distributor-ring-status&#34;&gt;Distributor ring status&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /distributor/ring&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Displays a web page with the distributor hash ring status, including the state, health, and last heartbeat time of each distributor.&lt;/p&gt;
&lt;h2 id=&#34;index-gateway-ring-status&#34;&gt;Index gateway ring status&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /indexgateway/ring&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Displays a web page with the index gateway hash ring status, including the state, health, and last heartbeat time of each index gateway.&lt;/p&gt;
&lt;h2 id=&#34;ruler&#34;&gt;Ruler&lt;/h2&gt;
&lt;p&gt;The ruler API endpoints require to configure a backend object storage to store the recording rules and alerts. The ruler API uses the concept of a &amp;ldquo;namespace&amp;rdquo; when creating rule groups. This is a stand-in for the name of the rule file in Prometheus. Rule groups must be named uniquely within a namespace.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;You must configure &lt;code&gt;enable_api: true&lt;/code&gt; to enable this feature.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;ruler-ring-status&#34;&gt;Ruler ring status&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /ruler/ring&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Displays a web page with the ruler hash ring status, including the state, health, and last heartbeat time of each ruler.&lt;/p&gt;
&lt;h3 id=&#34;list-rule-groups&#34;&gt;List rule groups&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/rules&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;List all rules configured for the authenticated tenant. This endpoint returns a YAML dictionary with all the rule groups for each namespace and &lt;code&gt;200&lt;/code&gt; status code on success.&lt;/p&gt;
&lt;h4 id=&#34;example-response&#34;&gt;Example response&lt;/h4&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;---
&amp;lt;namespace1&amp;gt;:
- name: &amp;lt;string&amp;gt;
  interval: &amp;lt;duration;optional&amp;gt;
  rules:
  - alert: &amp;lt;string&amp;gt;
    expr: &amp;lt;string&amp;gt;
    for: &amp;lt;duration&amp;gt;
    annotations:
      &amp;lt;annotation_name&amp;gt;: &amp;lt;string&amp;gt;
    labels:
      &amp;lt;label_name&amp;gt;: &amp;lt;string&amp;gt;
- name: &amp;lt;string&amp;gt;
  interval: &amp;lt;duration;optional&amp;gt;
  rules:
  - alert: &amp;lt;string&amp;gt;
    expr: &amp;lt;string&amp;gt;
    for: &amp;lt;duration&amp;gt;
    annotations:
      &amp;lt;annotation_name&amp;gt;: &amp;lt;string&amp;gt;
    labels:
      &amp;lt;label_name&amp;gt;: &amp;lt;string&amp;gt;
&amp;lt;namespace2&amp;gt;:
- name: &amp;lt;string&amp;gt;
  interval: &amp;lt;duration;optional&amp;gt;
  rules:
  - alert: &amp;lt;string&amp;gt;
    expr: &amp;lt;string&amp;gt;
    for: &amp;lt;duration&amp;gt;
    annotations:
      &amp;lt;annotation_name&amp;gt;: &amp;lt;string&amp;gt;
    labels:
      &amp;lt;label_name&amp;gt;: &amp;lt;string&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;get-rule-groups-by-namespace&#34;&gt;Get rule groups by namespace&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/rules/{namespace}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Returns the rule groups defined for a given namespace.&lt;/p&gt;
&lt;h4 id=&#34;example-response-1&#34;&gt;Example response&lt;/h4&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;name: &amp;lt;string&amp;gt;
interval: &amp;lt;duration;optional&amp;gt;
rules:
  - alert: &amp;lt;string&amp;gt;
    expr: &amp;lt;string&amp;gt;
    for: &amp;lt;duration&amp;gt;
    annotations:
      &amp;lt;annotation_name&amp;gt;: &amp;lt;string&amp;gt;
    labels:
      &amp;lt;label_name&amp;gt;: &amp;lt;string&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;get-rule-group&#34;&gt;Get rule group&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/rules/{namespace}/{groupName}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Returns the rule group matching the request namespace and group name.&lt;/p&gt;
&lt;h3 id=&#34;set-rule-group&#34;&gt;Set rule group&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;POST /loki/api/v1/rules/{namespace}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Creates or updates a rule group. This endpoint expects a request with &lt;code&gt;Content-Type: application/yaml&lt;/code&gt; header and the rules &lt;strong&gt;YAML&lt;/strong&gt; definition in the request body, and returns &lt;code&gt;202&lt;/code&gt; on success.&lt;/p&gt;
&lt;h4 id=&#34;example-request&#34;&gt;Example request&lt;/h4&gt;
&lt;p&gt;Request headers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Content-Type: application/yaml&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Request body:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;name: &amp;lt;string&amp;gt;
interval: &amp;lt;duration;optional&amp;gt;
rules:
  - alert: &amp;lt;string&amp;gt;
    expr: &amp;lt;string&amp;gt;
    for: &amp;lt;duration&amp;gt;
    annotations:
      &amp;lt;annotation_name&amp;gt;: &amp;lt;string&amp;gt;
    labels:
      &amp;lt;label_name&amp;gt;: &amp;lt;string&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;delete-rule-group&#34;&gt;Delete rule group&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;DELETE /loki/api/v1/rules/{namespace}/{groupName}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Deletes a rule group by namespace and group name. This endpoints returns &lt;code&gt;202&lt;/code&gt; on success.&lt;/p&gt;
&lt;h3 id=&#34;delete-namespace&#34;&gt;Delete namespace&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;DELETE /loki/api/v1/rules/{namespace}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Deletes all the rule groups in a namespace (including the namespace itself). This endpoint returns &lt;code&gt;202&lt;/code&gt; on success.&lt;/p&gt;
&lt;h3 id=&#34;list-rules&#34;&gt;List rules&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /prometheus/api/v1/rules?type={alert|record}&amp;amp;file={}&amp;amp;rule_group={}&amp;amp;rule_name={}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Prometheus-compatible rules endpoint to list alerting and recording rules that are currently loaded.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;type&lt;/code&gt; parameter is optional. If set, only the specified type of rule is returned.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;file&lt;/code&gt;, &lt;code&gt;rule_group&lt;/code&gt; and &lt;code&gt;rule_name&lt;/code&gt; parameters are optional, and can accept multiple values. If set, the response content is filtered accordingly.&lt;/p&gt;
&lt;p&gt;For more information, refer to the &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/api/#rules&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus rules&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h3 id=&#34;list-alerts&#34;&gt;List alerts&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /prometheus/api/v1/alerts&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Prometheus-compatible rules endpoint to list all active alerts.&lt;/p&gt;
&lt;p&gt;For more information, refer to the Prometheus &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/api/#alerts&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;alerts&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h2 id=&#34;compactor&#34;&gt;Compactor&lt;/h2&gt;
&lt;h3 id=&#34;compactor-ring-status&#34;&gt;Compactor ring status&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /compactor/ring&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Displays a web page with the compactor hash ring status, including the state, health, and last heartbeat time of each compactor.&lt;/p&gt;
&lt;h3 id=&#34;request-log-deletion&#34;&gt;Request log deletion&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;POST /loki/api/v1/delete
PUT /loki/api/v1/delete&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Create a new delete request for the authenticated tenant.
The &lt;a href=&#34;../../operations/storage/logs-deletion/&#34;&gt;log entry deletion&lt;/a&gt; documentation has configuration details.&lt;/p&gt;
&lt;p&gt;Log entry deletion is supported &lt;em&gt;only&lt;/em&gt; when TSDB or BoltDB Shipper is configured for the index store.&lt;/p&gt;
&lt;p&gt;Query parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;query=&amp;lt;series_selector&amp;gt;&lt;/code&gt;: query argument that identifies the streams from which to delete with optional line filters.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;start=&amp;lt;rfc3339 | unix_seconds_timestamp&amp;gt;&lt;/code&gt;: A timestamp that identifies the start of the time window within which entries will be deleted. This parameter is required.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end=&amp;lt;rfc3339 | unix_seconds_timestamp&amp;gt;&lt;/code&gt;: A timestamp that identifies the end of the time window within which entries will be deleted. If not specified, defaults to the current time.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;max_interval=&amp;lt;duration&amp;gt;&lt;/code&gt;: The maximum time period the delete request can span. If the request is larger than this value, it is split into several requests of &amp;lt;= &lt;code&gt;max_interval&lt;/code&gt;. Valid time units are &lt;code&gt;s&lt;/code&gt;, &lt;code&gt;m&lt;/code&gt;, and &lt;code&gt;h&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A 204 response indicates success.&lt;/p&gt;
&lt;p&gt;The query parameter can also include filter operations. For example &lt;code&gt;query={foo=&amp;quot;bar&amp;quot;} |= &amp;quot;other&amp;quot;&lt;/code&gt; will filter out lines that contain the string &amp;ldquo;other&amp;rdquo; for the streams matching the stream selector &lt;code&gt;{foo=&amp;quot;bar&amp;quot;}&lt;/code&gt;.&lt;/p&gt;
&lt;h4 id=&#34;examples-9&#34;&gt;Examples&lt;/h4&gt;
&lt;p&gt;URL encode the &lt;code&gt;query&lt;/code&gt; parameter. This sample form of a cURL command URL encodes &lt;code&gt;query={foo=&amp;quot;bar&amp;quot;}&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -g -X POST \
  &amp;#39;http://127.0.0.1:3100/loki/api/v1/delete?query={foo=&amp;#34;bar&amp;#34;}&amp;amp;start=1591616227&amp;amp;end=1591619692&amp;#39; \
  -H &amp;#39;X-Scope-OrgID: 1&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The same example deletion request for Grafana Enterprise Logs uses Basic Authentication and specifies the tenant name as a user; &lt;code&gt;Tenant1&lt;/code&gt; is the tenant name in this example. The password in this example is an access policy token that has been defined in the API_TOKEN environment variable. The token must be for an access policy with &lt;code&gt;logs:delete&lt;/code&gt; scope for the tenant specified in the user field:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -u &amp;#34;Tenant1:$API_TOKEN&amp;#34; \
  -g -X POST \
  &amp;#39;http://127.0.0.1:3100/loki/api/v1/delete?query={foo=&amp;#34;bar&amp;#34;}&amp;amp;start=1591616227&amp;amp;end=1591619692&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;list-log-deletion-requests&#34;&gt;List log deletion requests&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/delete&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;List the existing delete requests for the authenticated tenant.
The &lt;a href=&#34;../../operations/storage/logs-deletion/&#34;&gt;log entry deletion&lt;/a&gt; documentation has configuration details.&lt;/p&gt;
&lt;p&gt;Log entry deletion is supported &lt;em&gt;only&lt;/em&gt; when TSDB or BoltDB Shipper is configured for the index store.&lt;/p&gt;
&lt;p&gt;List the existing delete requests using the following API:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/delete&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This endpoint returns both processed and unprocessed deletion requests. It does not list canceled requests, as those requests will have been removed from storage.&lt;/p&gt;
&lt;p&gt;Query parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;start=&amp;lt;rfc3339 | unix_seconds_timestamp&amp;gt;&lt;/code&gt;: Optional. A timestamp that identifies the start of the time range. Only deletion requests that overlap with this time range will be returned. Must be provided together with &lt;code&gt;end&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end=&amp;lt;rfc3339 | unix_seconds_timestamp&amp;gt;&lt;/code&gt;: Optional. A timestamp that identifies the end of the time range. Only deletion requests that overlap with this time range will be returned. Must be provided together with &lt;code&gt;start&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;examples-10&#34;&gt;Examples&lt;/h4&gt;
&lt;p&gt;Example cURL command:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -X GET \
  &amp;lt;COMPACTOR_ADDR&amp;gt;/loki/api/v1/delete \
  -H &amp;#39;X-Scope-OrgID: &amp;lt;ORG_ID&amp;gt;&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The same example deletion request for Grafana Enterprise Logs uses Basic Authentication and specifies the tenant name as a user; &lt;code&gt;Tenant1&lt;/code&gt; is the tenant name in this example. The password in this example is an access policy token that has been defined in the API_TOKEN environment variable. The token must be for an access policy with &lt;code&gt;logs:delete&lt;/code&gt; scope for the tenant specified in the user field.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -u &amp;#34;Tenant1:$API_TOKEN&amp;#34; \
  -X GET \
  &amp;lt;COMPACTOR_ADDR&amp;gt;/loki/api/v1/delete&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;request-cancellation-of-a-delete-request&#34;&gt;Request cancellation of a delete request&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;DELETE /loki/api/v1/delete&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Remove a delete request for the authenticated tenant.
The &lt;a href=&#34;../../operations/storage/logs-deletion/&#34;&gt;log entry deletion&lt;/a&gt; documentation has configuration details.&lt;/p&gt;
&lt;p&gt;Loki allows cancellation of delete requests until the requests are picked up for processing. It is controlled by the &lt;code&gt;delete_request_cancel_period&lt;/code&gt; YAML configuration or the equivalent command line option when invoking Loki. To cancel a delete request that has been picked up for processing or is partially complete, pass the &lt;code&gt;force=true&lt;/code&gt; query parameter to the API.&lt;/p&gt;
&lt;p&gt;Log entry deletion is supported &lt;em&gt;only&lt;/em&gt; when TSDB or BoltDB Shipper is configured for the index store.&lt;/p&gt;
&lt;p&gt;Cancel a delete request using this compactor endpoint:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;DELETE /loki/api/v1/delete&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Query parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;request_id=&amp;lt;request_id&amp;gt;&lt;/code&gt;: Identifies the delete request to cancel; IDs are found using the &lt;code&gt;delete&lt;/code&gt; endpoint.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;force=&amp;lt;boolean&amp;gt;&lt;/code&gt;: When the &lt;code&gt;force&lt;/code&gt; query parameter is true, partially completed delete requests will be canceled.


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;some data from the request may still be deleted and the deleted request will be listed as &amp;lsquo;processed&amp;rsquo;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A 204 response indicates success.&lt;/p&gt;
&lt;h4 id=&#34;examples-11&#34;&gt;Examples&lt;/h4&gt;
&lt;p&gt;Example cURL command:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -X DELETE \
  &amp;#39;&amp;lt;COMPACTOR_ADDR&amp;gt;/loki/api/v1/delete?request_id=&amp;lt;REQUEST_ID&amp;gt;&amp;#39; \
  -H &amp;#39;X-Scope-OrgID: &amp;lt;TENANT_ID&amp;gt;&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The same example deletion cancellation request for Grafana Enterprise Logs uses Basic Authentication and specifies the tenant name as a user; &lt;code&gt;Tenant1&lt;/code&gt; is the tenant name in this example. The password in this example is an access policy token that has been defined in the API_TOKEN environment variable. The token must be for an access policy with &lt;code&gt;logs:delete&lt;/code&gt; scope for the tenant specified in the user field.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;curl -u &amp;#34;Tenant1:$API_TOKEN&amp;#34; \
  -X DELETE \
  &amp;#39;&amp;lt;COMPACTOR_ADDR&amp;gt;/loki/api/v1/delete?request_id=&amp;lt;REQUEST_ID&amp;gt;&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;format-a-logql-query&#34;&gt;Format a LogQL query&lt;/h2&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GET /loki/api/v1/format_query
POST /loki/api/v1/format_query&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The endpoint accepts the following query parameters in the URL:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;query&lt;/code&gt;: A LogQL query string. Can be passed as URL param (&lt;code&gt;?query=&amp;lt;query&amp;gt;&lt;/code&gt;) in case of both &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt;. Or as form value in case of &lt;code&gt;POST&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;code&gt;/loki/api/v1/format_query&lt;/code&gt; endpoint lets you format LogQL queries. It returns an error if the passed LogQL is invalid. It is exposed by all Loki components and helps to improve readability and the debugging experience of LogQL queries.&lt;/p&gt;
&lt;p&gt;The following example formats the expression LogQL &lt;code&gt;{foo=   &amp;quot;bar&amp;quot;}&lt;/code&gt; into&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
   &amp;#34;status&amp;#34; : &amp;#34;success&amp;#34;,
   &amp;#34;data&amp;#34; : &amp;#34;{foo=\&amp;#34;bar\&amp;#34;}&amp;#34;
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="loki-http-api">Loki HTTP API&lt;/h1>
&lt;p>Loki exposes an HTTP API for pushing, querying, and tailing log data, as well
as for viewing and managing cluster information.&lt;/p>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p></description></item><item><title>Query Loki with Python</title><link>https://grafana.com/docs/loki/v3.7.x/reference/python-client-examples/</link><pubDate>Thu, 09 Apr 2026 02:28:18 +0000</pubDate><guid>https://grafana.com/docs/loki/v3.7.x/reference/python-client-examples/</guid><content><![CDATA[&lt;h1 id=&#34;query-loki-with-python&#34;&gt;Query Loki with Python&lt;/h1&gt;
&lt;p&gt;This page provides Python examples for the most common Loki HTTP API operations: querying logs, pushing log entries, and listing labels. For the full API reference including all parameters and response formats, see the &lt;a href=&#34;../loki-http-api/&#34;&gt;Loki HTTP API&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;Install the &lt;a href=&#34;https://requests.readthedocs.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;requests&lt;/a&gt; library:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;pip install requests&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you need an async-capable client, &lt;a href=&#34;https://www.python-httpx.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;httpx&lt;/a&gt; provides a nearly identical API:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;pip install httpx&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;authentication&#34;&gt;Authentication&lt;/h2&gt;
&lt;p&gt;The examples on this page connect to a local Loki instance without authentication. To use these examples with a multi-tenant or Grafana Cloud deployment, add the appropriate authentication as shown below.&lt;/p&gt;
&lt;h3 id=&#34;multi-tenant-mode&#34;&gt;Multi-tenant mode&lt;/h3&gt;
&lt;p&gt;If your cluster has &lt;a href=&#34;../../operations/multi-tenancy/&#34;&gt;multi-tenancy&lt;/a&gt; enabled, pass the tenant ID in the &lt;code&gt;X-Scope-OrgID&lt;/code&gt; header:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt;headers = {&amp;#34;X-Scope-OrgID&amp;#34;: &amp;#34;my-tenant&amp;#34;}
resp = requests.get(url, params=params, headers=headers)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To query across multiple tenants, separate tenant names with the pipe (&lt;code&gt;|&lt;/code&gt;) character:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt;headers = {&amp;#34;X-Scope-OrgID&amp;#34;: &amp;#34;tenant1|tenant2|tenant3&amp;#34;}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;grafana-cloud&#34;&gt;Grafana Cloud&lt;/h3&gt;
&lt;p&gt;For Grafana Cloud, use basic authentication with your Grafana Cloud user and an API token:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt;resp = requests.get(url, params=params, auth=(&amp;#34;&amp;lt;user&amp;gt;&amp;#34;, &amp;#34;&amp;lt;API_TOKEN&amp;gt;&amp;#34;))&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can find the &lt;strong&gt;User&lt;/strong&gt; and &lt;strong&gt;URL&lt;/strong&gt; values in the Loki logging service details of your &lt;a href=&#34;/docs/grafana-cloud/account-management/cloud-portal/#your-grafana-cloud-stack&#34;&gt;Grafana Cloud stack&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;self-signed-certificates&#34;&gt;Self-signed certificates&lt;/h3&gt;
&lt;p&gt;If your Loki instance uses a self-signed TLS certificate, you can disable certificate verification:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt;resp = requests.get(url, params=params, verify=False)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For production use, pass the path to your CA bundle instead:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt;resp = requests.get(url, params=params, verify=&amp;#34;/path/to/ca-bundle.crt&amp;#34;)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-logs-within-a-range-of-time&#34;&gt;Query logs within a range of time&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;../loki-http-api/#query-logs-within-a-range-of-time&#34;&gt;&lt;code&gt;GET /loki/api/v1/query_range&lt;/code&gt;&lt;/a&gt; queries logs over a time range. This is the most common query operation.&lt;/p&gt;
&lt;h3 id=&#34;using-requests&#34;&gt;Using requests&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt;import requests
from datetime import datetime, timedelta


def query_range(
    url: str,
    query: str,
    start: datetime,
    end: datetime,
    limit: int = 1000,
) -&amp;gt; list:
    &amp;#34;&amp;#34;&amp;#34;Query Loki for log entries within a time range.&amp;#34;&amp;#34;&amp;#34;
    resp = requests.get(
        f&amp;#34;{url}/loki/api/v1/query_range&amp;#34;,
        params={
            &amp;#34;query&amp;#34;: query,
            &amp;#34;start&amp;#34;: str(int(start.timestamp() * 1e9)),  # nanoseconds
            &amp;#34;end&amp;#34;: str(int(end.timestamp() * 1e9)),
            &amp;#34;limit&amp;#34;: limit,
            &amp;#34;direction&amp;#34;: &amp;#34;backward&amp;#34;,
        },
    )
    resp.raise_for_status()
    return resp.json()[&amp;#34;data&amp;#34;][&amp;#34;result&amp;#34;]


results = query_range(
    url=&amp;#34;http://localhost:3100&amp;#34;,
    query=&amp;#39;{job=&amp;#34;varlogs&amp;#34;} |= &amp;#34;error&amp;#34;&amp;#39;,
    start=datetime.now() - timedelta(hours=1),
    end=datetime.now(),
)

for stream in results:
    print(f&amp;#34;Labels: {stream[&amp;#39;stream&amp;#39;]}&amp;#34;)
    for ts, line in stream[&amp;#34;values&amp;#34;]:
        print(f&amp;#34;  {datetime.fromtimestamp(int(ts) / 1e9)}: {line}&amp;#34;)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;using-httpx&#34;&gt;Using httpx&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt;import httpx
from datetime import datetime, timedelta


def query_range(
    url: str,
    query: str,
    start: datetime,
    end: datetime,
    limit: int = 1000,
) -&amp;gt; list:
    &amp;#34;&amp;#34;&amp;#34;Query Loki for log entries within a time range.&amp;#34;&amp;#34;&amp;#34;
    resp = httpx.get(
        f&amp;#34;{url}/loki/api/v1/query_range&amp;#34;,
        params={
            &amp;#34;query&amp;#34;: query,
            &amp;#34;start&amp;#34;: str(int(start.timestamp() * 1e9)),  # nanoseconds
            &amp;#34;end&amp;#34;: str(int(end.timestamp() * 1e9)),
            &amp;#34;limit&amp;#34;: limit,
            &amp;#34;direction&amp;#34;: &amp;#34;backward&amp;#34;,
        },
    )
    resp.raise_for_status()
    return resp.json()[&amp;#34;data&amp;#34;][&amp;#34;result&amp;#34;]


results = query_range(
    url=&amp;#34;http://localhost:3100&amp;#34;,
    query=&amp;#39;{job=&amp;#34;varlogs&amp;#34;} |= &amp;#34;error&amp;#34;&amp;#39;,
    start=datetime.now() - timedelta(hours=1),
    end=datetime.now(),
)

for stream in results:
    print(f&amp;#34;Labels: {stream[&amp;#39;stream&amp;#39;]}&amp;#34;)
    for ts, line in stream[&amp;#34;values&amp;#34;]:
        print(f&amp;#34;  {datetime.fromtimestamp(int(ts) / 1e9)}: {line}&amp;#34;)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-logs-at-a-single-point-in-time&#34;&gt;Query logs at a single point in time&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;../loki-http-api/#query-logs-at-a-single-point-in-time&#34;&gt;&lt;code&gt;GET /loki/api/v1/query&lt;/code&gt;&lt;/a&gt; evaluates a query at a single point in time. Use this for instant metric queries such as aggregations with &lt;code&gt;rate()&lt;/code&gt;, &lt;code&gt;count_over_time()&lt;/code&gt;, or &lt;code&gt;bytes_over_time()&lt;/code&gt;. Log stream selectors (queries that return log lines) are not supported as instant queries; use &lt;code&gt;query_range&lt;/code&gt; instead.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt;import requests
from datetime import datetime


def query_instant(url: str, query: str) -&amp;gt; list:
    &amp;#34;&amp;#34;&amp;#34;Run an instant metric query against Loki.&amp;#34;&amp;#34;&amp;#34;
    resp = requests.get(
        f&amp;#34;{url}/loki/api/v1/query&amp;#34;,
        params={
            &amp;#34;query&amp;#34;: query,
            &amp;#34;time&amp;#34;: str(int(datetime.now().timestamp() * 1e9)),
        },
    )
    resp.raise_for_status()
    return resp.json()[&amp;#34;data&amp;#34;][&amp;#34;result&amp;#34;]


results = query_instant(
    url=&amp;#34;http://localhost:3100&amp;#34;,
    query=&amp;#39;sum(rate({job=&amp;#34;varlogs&amp;#34;}[10m])) by (level)&amp;#39;,
)

for entry in results:
    print(f&amp;#34;{entry[&amp;#39;metric&amp;#39;]}: {entry[&amp;#39;value&amp;#39;][1]}&amp;#34;)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;push-logs&#34;&gt;Push logs&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;../loki-http-api/#ingest-logs&#34;&gt;&lt;code&gt;POST /loki/api/v1/push&lt;/code&gt;&lt;/a&gt; sends log entries to Loki using the JSON format.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt;import json
import time
import requests


def push_logs(
    url: str,
    labels: dict[str, str],
    entries: list[tuple[str, str]],
) -&amp;gt; None:
    &amp;#34;&amp;#34;&amp;#34;Push log entries to Loki.

    Args:
        url: Loki base URL.
        labels: Stream labels, for example {&amp;#34;job&amp;#34;: &amp;#34;myapp&amp;#34;, &amp;#34;env&amp;#34;: &amp;#34;dev&amp;#34;}.
        entries: List of (timestamp_ns, log_line) tuples. Use
                 str(int(time.time() * 1e9)) to get a nanosecond timestamp.
    &amp;#34;&amp;#34;&amp;#34;
    payload = {
        &amp;#34;streams&amp;#34;: [
            {
                &amp;#34;stream&amp;#34;: labels,
                &amp;#34;values&amp;#34;: [list(e) for e in entries],
            }
        ]
    }
    resp = requests.post(
        f&amp;#34;{url}/loki/api/v1/push&amp;#34;,
        headers={&amp;#34;Content-Type&amp;#34;: &amp;#34;application/json&amp;#34;},
        data=json.dumps(payload),
    )
    resp.raise_for_status()


now_ns = str(int(time.time() * 1e9))
push_logs(
    url=&amp;#34;http://localhost:3100&amp;#34;,
    labels={&amp;#34;job&amp;#34;: &amp;#34;myapp&amp;#34;, &amp;#34;env&amp;#34;: &amp;#34;dev&amp;#34;},
    entries=[
        (now_ns, &amp;#34;application started&amp;#34;),
        (now_ns, &amp;#34;listening on port 8080&amp;#34;),
    ],
)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-labels-and-label-values&#34;&gt;Query labels and label values&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;../loki-http-api/#query-labels&#34;&gt;&lt;code&gt;GET /loki/api/v1/labels&lt;/code&gt;&lt;/a&gt; returns the list of known label names. &lt;a href=&#34;../loki-http-api/#query-label-values&#34;&gt;&lt;code&gt;GET /loki/api/v1/label/&amp;lt;name&amp;gt;/values&lt;/code&gt;&lt;/a&gt; returns the values for a specific label.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt;import requests


def get_labels(url: str) -&amp;gt; list[str]:
    &amp;#34;&amp;#34;&amp;#34;List all known label names.&amp;#34;&amp;#34;&amp;#34;
    resp = requests.get(f&amp;#34;{url}/loki/api/v1/labels&amp;#34;)
    resp.raise_for_status()
    return resp.json()[&amp;#34;data&amp;#34;]


def get_label_values(url: str, label: str) -&amp;gt; list[str]:
    &amp;#34;&amp;#34;&amp;#34;List values for a specific label.&amp;#34;&amp;#34;&amp;#34;
    resp = requests.get(f&amp;#34;{url}/loki/api/v1/label/{label}/values&amp;#34;)
    resp.raise_for_status()
    return resp.json()[&amp;#34;data&amp;#34;]


labels = get_labels(&amp;#34;http://localhost:3100&amp;#34;)
print(f&amp;#34;Labels: {labels}&amp;#34;)

for label in labels:
    values = get_label_values(&amp;#34;http://localhost:3100&amp;#34;, label)
    print(f&amp;#34;  {label}: {values}&amp;#34;)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;handling-errors&#34;&gt;Handling errors&lt;/h2&gt;
&lt;p&gt;Loki returns standard HTTP status codes. Common errors include:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Status&lt;/th&gt;
              &lt;th&gt;Meaning&lt;/th&gt;
              &lt;th&gt;Typical cause&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;400&lt;/td&gt;
              &lt;td&gt;Bad Request&lt;/td&gt;
              &lt;td&gt;Invalid LogQL syntax&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;429&lt;/td&gt;
              &lt;td&gt;Too Many Requests&lt;/td&gt;
              &lt;td&gt;Rate limit exceeded&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;5xx&lt;/td&gt;
              &lt;td&gt;Server Error&lt;/td&gt;
              &lt;td&gt;Loki is unavailable or overloaded&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Use &lt;code&gt;raise_for_status()&lt;/code&gt; to catch errors, and inspect the response body for details:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Python&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-python&#34;&gt;import time
import requests


def query_with_retry(
    url: str,
    query: str,
    max_retries: int = 3,
    backoff: float = 1.0,
) -&amp;gt; dict:
    &amp;#34;&amp;#34;&amp;#34;Query Loki with simple retry logic for rate limits.&amp;#34;&amp;#34;&amp;#34;
    for attempt in range(max_retries):
        resp = requests.get(
            f&amp;#34;{url}/loki/api/v1/query&amp;#34;,
            params={&amp;#34;query&amp;#34;: query},
        )
        if resp.status_code == 429:
            wait = backoff * (2 ** attempt)
            print(f&amp;#34;Rate limited, retrying in {wait}s...&amp;#34;)
            time.sleep(wait)
            continue
        resp.raise_for_status()
        return resp.json()
    raise Exception(f&amp;#34;Query failed after {max_retries} retries&amp;#34;)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;common-problems&#34;&gt;Common problems&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Timestamps are in nanoseconds.&lt;/strong&gt; Loki expects Unix timestamps in nanoseconds, not seconds or milliseconds. Multiply &lt;code&gt;time.time()&lt;/code&gt; by &lt;code&gt;1e9&lt;/code&gt; and convert to a string.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;At least one label matcher is required.&lt;/strong&gt; You cannot query without a stream selector. &lt;code&gt;{job=&amp;quot;myapp&amp;quot;}&lt;/code&gt; works; an empty selector does not.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The &lt;code&gt;direction&lt;/code&gt; parameter changes result ordering.&lt;/strong&gt; Use &lt;code&gt;backward&lt;/code&gt; (the default) to get the most recent entries first, or &lt;code&gt;forward&lt;/code&gt; to get the oldest entries first.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The instant query endpoint only supports metric queries.&lt;/strong&gt; Log stream selectors like &lt;code&gt;{job=&amp;quot;myapp&amp;quot;}&lt;/code&gt; return a 400 error on &lt;code&gt;/query&lt;/code&gt;. Use &lt;code&gt;/query_range&lt;/code&gt; for log queries, and &lt;code&gt;/query&lt;/code&gt; for aggregations like &lt;code&gt;rate()&lt;/code&gt; or &lt;code&gt;count_over_time()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use the &lt;code&gt;limit&lt;/code&gt; parameter to control result size.&lt;/strong&gt; The default is 100 entries. For large time ranges, set a higher limit or paginate by adjusting the &lt;code&gt;start&lt;/code&gt; parameter based on the last received timestamp.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="query-loki-with-python">Query Loki with Python&lt;/h1>
&lt;p>This page provides Python examples for the most common Loki HTTP API operations: querying logs, pushing log entries, and listing labels. For the full API reference including all parameters and response formats, see the &lt;a href="../loki-http-api/">Loki HTTP API&lt;/a> documentation.&lt;/p></description></item></channel></rss>