<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Configure static mode on Grafana Labs</title><link>https://grafana.com/docs/agent/v0.43/static/configuration/</link><description>Recent content in Configure static mode on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/agent/v0.43/static/configuration/index.xml" rel="self" type="application/rss+xml"/><item><title>Create a configuration file</title><link>https://grafana.com/docs/agent/v0.43/static/configuration/create-config-file/</link><pubDate>Wed, 11 Sep 2024 17:43:35 +0000</pubDate><guid>https://grafana.com/docs/agent/v0.43/static/configuration/create-config-file/</guid><content><![CDATA[&lt;h1 id=&#34;create-a-configuration-file&#34;&gt;Create a configuration file&lt;/h1&gt;
&lt;p&gt;The Grafana Agent supports configuring multiple independent &amp;ldquo;subsystems.&amp;rdquo; Each
subsystem helps you collect data for a specific type of telemetry.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;Metrics&lt;/strong&gt; subsystem allows you collect metrics to send to Prometheus.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Logs&lt;/strong&gt; subsystem allows you to collect logs to send to Grafana Loki.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Traces&lt;/strong&gt; subsystem allows you to collect spans to send to Grafana Tempo.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Integrations&lt;/strong&gt; subsystem allows you to collect metrics for common
applications, such as MySQL.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Integrations are recommended for first-time users of observability platforms,
especially newcomers to Prometheus. Users with more experience with Prometheus
or users that already have an existing Prometheus config file can configure
the Prometheus subsystem manually.&lt;/p&gt;
&lt;h2 id=&#34;integrations&#34;&gt;Integrations&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Integrations&lt;/em&gt; are individual features that collect metrics for you. For
example, the &lt;code&gt;agent&lt;/code&gt; integration collects metrics from that running instance of
the Grafana Agent. The &lt;code&gt;node_exporter&lt;/code&gt; integration will collect metrics from the
Linux machine that the Grafana Agent is running on.&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;metrics:
  wal_directory: /tmp/wal
  global:
    remote_write:
      - url: http://localhost:9009/api/prom/push

integrations:
  agent:
    enabled: true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In this example, we first must configure the &lt;code&gt;wal_directory&lt;/code&gt; which is used to
store metrics in a Write-Ahead Log (WAL). The WAL is required and ensures that samples
will be redelivered in case of failure (e.g., network issues, machine reboot). We
also configure &lt;code&gt;remote_write&lt;/code&gt;, which is where all metrics should be sent by
default.&lt;/p&gt;
&lt;p&gt;Then, the individual &lt;code&gt;integrations&lt;/code&gt; are configured. In this example, just the
&lt;code&gt;agent&lt;/code&gt; integration is enabled. Finally, &lt;code&gt;prometheus_remote_write&lt;/code&gt; is configured
with a location to send metrics. You will have to replace this URL with the
appropriate URL for your &lt;code&gt;remote_write&lt;/code&gt; system (such as a Grafana Cloud Hosted
Prometheus instance).&lt;/p&gt;
&lt;p&gt;When the Agent is run with this file, it will collect metrics from itself and
send those metrics to the default &lt;code&gt;remote_write&lt;/code&gt; endpoint. All metrics from
integrations will have an &lt;code&gt;instance&lt;/code&gt; label matching the hostname of the machine
the Grafana Agent is running on. This label helps to uniquely identify the
source of metrics if you are running multiple Grafana Agents across multiple
machines.&lt;/p&gt;
&lt;p&gt;Full configuration options can be found in the 
    &lt;a href=&#34;/docs/agent/v0.43/static/configuration/&#34;&gt;configuration reference&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;prometheus-configmigrating-from-prometheus&#34;&gt;Prometheus config/migrating from Prometheus&lt;/h2&gt;
&lt;p&gt;The Prometheus subsystem config is useful for those migrating from Prometheus
and those who want to scrape metrics from something that currently does not have
an associated integration.&lt;/p&gt;
&lt;p&gt;To migrate from an existing Prometheus config, use this Agent config as a
template and copy and paste subsections from your existing Prometheus config
into it:&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;metrics:
  global:
  # PASTE PROMETHEUS global SECTION HERE
  configs:
    - name: agent
      scrape_configs:
        # PASTE scrape_configs SECTION HERE
      remote_write:
        # PASTE remote_write SECTION HERE&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For example, this configuration file configures the Grafana Agent to
scrape itself without using the integration:&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;server:
  log_level: info

metrics:
  global:
    scrape_interval: 1m
  configs:
    - name: agent
      scrape_configs:
        - job_name: agent
          static_configs:
            - targets: [&amp;#39;127.0.0.1:12345&amp;#39;]
      remote_write:
        - url: http://localhost:9009/api/prom/push&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Like with integrations, full configuration options can be found in the

    &lt;a href=&#34;/docs/agent/v0.43/static/configuration/&#34;&gt;configuration&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;loki-configmigrating-from-promtail&#34;&gt;Loki Config/Migrating from Promtail&lt;/h2&gt;
&lt;p&gt;The Loki Config allows for collecting logs to send to a Loki API. Users that are
familiar with Promtail will notice that the Loki config for the Agent matches
their existing Promtail config with the following exceptions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The deprecated field &lt;code&gt;client&lt;/code&gt; is not present&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;server&lt;/code&gt; field is not present&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To migrate from an existing Promtail config, make sure you are using &lt;code&gt;clients&lt;/code&gt;
instead of &lt;code&gt;client&lt;/code&gt; and remove the &lt;code&gt;server&lt;/code&gt; block if present. Then paste your
Promtail config into the Agent config file inside of a &lt;code&gt;logs&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;logs:
  configs:
  - name: default
    # PASTE YOUR PROMTAIL CONFIG INSIDE OF HERE&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;full-config-example&#34;&gt;Full config example&lt;/h3&gt;
&lt;p&gt;Here is an example full config file, using integrations, Prometheus, Loki, and
Tempo:&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;server:
  log_level: info

metrics:
  global:
    scrape_interval: 1m
    remote_write:
      - url: http://localhost:9009/api/prom/push
  configs:
    - name: default
      scrape_configs:
        - job_name: agent
          static_configs:
            - targets: [&amp;#39;127.0.0.1:12345&amp;#39;]

logs:
  configs:
  - name: default
    positions:
      filename: /tmp/positions.yaml
    scrape_configs:
      - job_name: varlogs
        static_configs:
          - targets: [localhost]
            labels:
              job: varlogs
              __path__: /var/log/*log
    clients:
      - url: http://localhost:3100/loki/api/v1/push

traces:
  configs:
  - name: default
    receivers:
      jaeger:
        protocols:
          grpc: # listens on the default jaeger grpc port: 14250
    remote_write:
      - endpoint: localhost:55680
        insecure: true  # only add this if TLS is not required
    batch:
      timeout: 5s
      send_batch_size: 100

integrations:
  node_exporter:
    enabled: true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="create-a-configuration-file">Create a configuration file&lt;/h1>
&lt;p>The Grafana Agent supports configuring multiple independent &amp;ldquo;subsystems.&amp;rdquo; Each
subsystem helps you collect data for a specific type of telemetry.&lt;/p>
&lt;ul>
&lt;li>The &lt;strong>Metrics&lt;/strong> subsystem allows you collect metrics to send to Prometheus.&lt;/li>
&lt;li>The &lt;strong>Logs&lt;/strong> subsystem allows you to collect logs to send to Grafana Loki.&lt;/li>
&lt;li>The &lt;strong>Traces&lt;/strong> subsystem allows you to collect spans to send to Grafana Tempo.&lt;/li>
&lt;li>The &lt;strong>Integrations&lt;/strong> subsystem allows you to collect metrics for common
applications, such as MySQL.&lt;/li>
&lt;/ul>
&lt;p>Integrations are recommended for first-time users of observability platforms,
especially newcomers to Prometheus. Users with more experience with Prometheus
or users that already have an existing Prometheus config file can configure
the Prometheus subsystem manually.&lt;/p></description></item><item><title>Command-line flags</title><link>https://grafana.com/docs/agent/v0.43/static/configuration/flags/</link><pubDate>Wed, 11 Sep 2024 17:43:35 +0000</pubDate><guid>https://grafana.com/docs/agent/v0.43/static/configuration/flags/</guid><content><![CDATA[&lt;h1 id=&#34;command-line-flags&#34;&gt;Command-line flags&lt;/h1&gt;
&lt;p&gt;Command-line flags are used to configure settings of Grafana Agent which cannot
be updated at runtime.&lt;/p&gt;
&lt;p&gt;All flags may be prefixed with either one hyphen or two (i.e., both
&lt;code&gt;-config.file&lt;/code&gt; and &lt;code&gt;--config.file&lt;/code&gt; are valid).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: There may be flags returned by &lt;code&gt;-help&lt;/code&gt; which are not listed here; this
document only lists flags that do not have an equivalent in the YAML file.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;basic&#34;&gt;Basic&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-version&lt;/code&gt;: Print out version information&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-help&lt;/code&gt;: Print out help&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;experimental-feature-flags&#34;&gt;Experimental feature flags&lt;/h2&gt;
&lt;p&gt;Grafana Agent has some experimental features that require being enabled through
an &lt;code&gt;-enable-features&lt;/code&gt; flag. This flag takes a comma-delimited list of feature
names to enable.&lt;/p&gt;
&lt;p&gt;Valid feature names are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;remote-configs&lt;/code&gt;: Enable 
    &lt;a href=&#34;/docs/agent/v0.43/static/configuration/#remote-configuration-experimental&#34;&gt;retrieving&lt;/a&gt; config files over HTTP/HTTPS&lt;/li&gt;
&lt;li&gt;&lt;code&gt;integrations-next&lt;/code&gt;: Enable 
    &lt;a href=&#34;/docs/agent/v0.43/static/configuration/integrations/integrations-next/&#34;&gt;revamp&lt;/a&gt; of the integrations subsystem&lt;/li&gt;
&lt;li&gt;&lt;code&gt;extra-scrape-metrics&lt;/code&gt;: When enabled, additional time series  are exposed for each metrics instance scrape. See &lt;a href=&#34;https://prometheus.io/docs/prometheus/2.45/feature_flags/#extra-scrape-metrics&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Extra scrape metrics&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;agent-management&lt;/code&gt;: Enable support for 
    &lt;a href=&#34;/docs/agent/v0.43/static/configuration/agent-management/&#34;&gt;agent management&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;report-information-usage&#34;&gt;Report information usage&lt;/h2&gt;
&lt;p&gt;By default, Grafana Agent sends anonymous, but uniquely-identifiable usage information
from your running Grafana Agent instance to Grafana Labs.
These statistics are sent to &lt;code&gt;stats.grafana.org&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Statistics help us better understand how Grafana Agent is used.
This helps us prioritize features and documentation.&lt;/p&gt;
&lt;p&gt;The usage information includes the following details:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A randomly generated and an anonymous unique ID (UUID).&lt;/li&gt;
&lt;li&gt;Timestamp of when the UID was first generated.&lt;/li&gt;
&lt;li&gt;Timestamp of when the report was created (by default, every 4h).&lt;/li&gt;
&lt;li&gt;Version of running Grafana Agent.&lt;/li&gt;
&lt;li&gt;Operating system Grafana Agent is running on.&lt;/li&gt;
&lt;li&gt;System architecture Grafana Agent is running on.&lt;/li&gt;
&lt;li&gt;List of enabled feature flags.&lt;/li&gt;
&lt;li&gt;List of enabled integrations.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This list may change over time. All newly reported data will also be documented in the CHANGELOG.&lt;/p&gt;
&lt;p&gt;If you would like to disable the reporting, Grafana Agent provides the flag &lt;code&gt;-disable-reporting&lt;/code&gt;
to stop the reporting.&lt;/p&gt;
&lt;h2 id=&#34;support-bundles&#34;&gt;Support bundles&lt;/h2&gt;
&lt;p&gt;Grafana Agent allows the exporting of &amp;lsquo;support bundles&amp;rsquo; on the &lt;code&gt;/-/support&lt;/code&gt;
endpoint. Support bundles are zip files containing commonly-used information
that provide a baseline for debugging issues with the Agent.&lt;/p&gt;
&lt;p&gt;Support bundles contain all information in plain text, so that they can be
inspected before sharing to verify that no sensitive information has leaked.&lt;/p&gt;
&lt;p&gt;Support bundles contain the following data:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;agent-config.yaml&lt;/code&gt; contains the current agent configuration (when the &lt;code&gt;-config.enable-read-api&lt;/code&gt; flag is passed).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;agent-logs.txt&lt;/code&gt; contains the agent logs during the bundle generation.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;agent-metadata.yaml&lt;/code&gt; contains the agent&amp;rsquo;s build version, operating system, architecture, uptime, plus a string payload defining which extra agent features have been enabled via command-line flags.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;agent-metrics-instances.json&lt;/code&gt; and &lt;code&gt;agent-metrics-targets.json&lt;/code&gt; contain the active metric subsystem instances, and the discovered scraped targets for each one.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;agent-logs-instances.json&lt;/code&gt; and &lt;code&gt;agent-logs-targets.json&lt;/code&gt; contains the active logs subsystem instances and the discovered log targets for each one.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;agent-metrics.txt&lt;/code&gt; contains a snapshot of the agent&amp;rsquo;s internal metrics.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;pprof/&lt;/code&gt; directory contains Go runtime profiling data (CPU, heap, goroutine, mutex, block profiles) as exported by the pprof package.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To disable the endpoint that exports these support bundles, you can pass in the
&lt;code&gt;-disable-support-bundle&lt;/code&gt; command-line flag.&lt;/p&gt;
&lt;h2 id=&#34;configuration-file&#34;&gt;Configuration file&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-config.file&lt;/code&gt;: Path to the configuration file to load. May be an HTTP(s) URL when the &lt;code&gt;remote-configs&lt;/code&gt; feature is enabled.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-config.file.type&lt;/code&gt;: Type of file which &lt;code&gt;-config.file&lt;/code&gt; refers to (default &lt;code&gt;yaml&lt;/code&gt;). Valid values are &lt;code&gt;yaml&lt;/code&gt; and &lt;code&gt;dynamic&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-config.expand-env&lt;/code&gt;: Expand environment variables in the loaded configuration file&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-config.enable-read-api&lt;/code&gt;: Enables the &lt;code&gt;/-/config&lt;/code&gt; and &lt;code&gt;/agent/api/v1/configs/{name}&lt;/code&gt; API endpoints to print YAML configuration&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;remote-configuration&#34;&gt;Remote Configuration&lt;/h3&gt;
&lt;p&gt;These flags require the &lt;code&gt;remote-configs&lt;/code&gt; feature to be enabled:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;-config.url.basic-auth-user&lt;/code&gt;: Basic Authentication username to use when fetching the remote configuration file
&lt;code&gt;-config.url.basic-auth-password-file&lt;/code&gt;: File containing a Basic Authentication password to use when fetching the remote configuration file&lt;/p&gt;
&lt;h2 id=&#34;server&#34;&gt;Server&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-server.register-instrumentation&lt;/code&gt;: Expose the &lt;code&gt;/metrics&lt;/code&gt; and &lt;code&gt;/debug/pprof/&lt;/code&gt; instrumentation handlers over HTTP (default true)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.graceful-shutdown-timeout&lt;/code&gt;: Timeout for a graceful server shutdown&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.log.source-ips.enabled&lt;/code&gt;: Whether to log IP addresses of incoming requests&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.log.source-ips.header&lt;/code&gt;: Header field to extract incoming IP requests from (defaults to Forwarded, X-Real-IP, X-Forwarded-For)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.log.source-ips.regex&lt;/code&gt;: Regex to extract the IP out of the read header, using the first capture group as the IP address&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.http.network&lt;/code&gt;: HTTP server listen network (default &lt;code&gt;tcp&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.http.address&lt;/code&gt;: HTTP server listen:port (default &lt;code&gt;127.0.0.1:12345&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.http.enable-tls&lt;/code&gt;: Enable TLS for the HTTP server&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.http.conn-limit&lt;/code&gt;: Maximum number of simultaneous HTTP connections&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.http.idle-timeout&lt;/code&gt;: HTTP server idle timeout&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.http.read-timeout&lt;/code&gt;: HTTP server read timeout&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.http.write-timeout&lt;/code&gt;: HTTP server write timeout&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.http.in-memory-addr&lt;/code&gt;: Internal address used for the agent to make
in-memory HTTP connections to itself. (default &lt;code&gt;agent.internal:12345&lt;/code&gt;) The
port number specified here is virtual and does not open a real network port.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.network&lt;/code&gt; gRPC server listen network (default &lt;code&gt;grpc&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.address&lt;/code&gt;: gRPC server listen host:port (default &lt;code&gt;127.0.0.1:12346&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.enable-tls&lt;/code&gt;: Enable TLS for the gRPC server&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.conn-limit&lt;/code&gt;: Maximum number of simultaneous gRPC connections&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.keepalive.max-connection-age&lt;/code&gt; Maximum age for any gRPC connection for a graceful shutdown&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.keepalive.max-connection-age-grace&lt;/code&gt; Grace period to forcibly close connections after a graceful shutdown starts&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.keepalive.max-connection-idle&lt;/code&gt; Time to wait before closing idle gRPC connections&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.keepalive.min-time-between-pings&lt;/code&gt; Maximum frequency that clients may send pings at&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.keepalive.ping-without-stream-allowed&lt;/code&gt; Allow clients to send pings without having a gRPC stream&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.keepalive.time&lt;/code&gt; Frequency to send keepalive pings from the server&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.keepalive.timeout&lt;/code&gt; How long to wait for a keepalive pong before closing the connection&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.max-concurrent-streams&lt;/code&gt; Maximum number of concurrent gRPC streams (0 = unlimited)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.max-recv-msg-size-bytes&lt;/code&gt; Maximum size in bytes for received gRPC messages&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.max-send-msg-size-bytes&lt;/code&gt; Maximum size in bytes for send gRPC messages&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-server.grpc.in-memory-addr&lt;/code&gt;: Internal address used for the agent to make
in-memory gRPC connections to itself. (default &lt;code&gt;agent.internal:12346&lt;/code&gt;). The
port number specified here is virtual and does not open a real network port.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;tls-support&#34;&gt;TLS Support&lt;/h3&gt;
&lt;p&gt;TLS support can be enabled with &lt;code&gt;-server.http.tls-enabled&lt;/code&gt; and
&lt;code&gt;-server.grpc.tls-enabled&lt;/code&gt; for the HTTP and gRPC servers respectively.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;server.http_tls_config&lt;/code&gt; and &lt;code&gt;integrations.http_tls_config&lt;/code&gt; must be set in the
YAML configuration when the &lt;code&gt;-server.http.tls-enabled&lt;/code&gt; flag is used.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;server.grpc_tls_config&lt;/code&gt; must be set in the YAML configuration when the
&lt;code&gt;-server.grpc.tls-enabled&lt;/code&gt; flag is used.&lt;/p&gt;
&lt;h2 id=&#34;metrics&#34;&gt;Metrics&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-metrics.wal-directory&lt;/code&gt;: Directory to store the metrics Write-Ahead Log in&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="command-line-flags">Command-line flags&lt;/h1>
&lt;p>Command-line flags are used to configure settings of Grafana Agent which cannot
be updated at runtime.&lt;/p>
&lt;p>All flags may be prefixed with either one hyphen or two (i.e., both
&lt;code>-config.file&lt;/code> and &lt;code>--config.file&lt;/code> are valid).&lt;/p></description></item><item><title>server_config</title><link>https://grafana.com/docs/agent/v0.43/static/configuration/server-config/</link><pubDate>Wed, 11 Sep 2024 17:43:35 +0000</pubDate><guid>https://grafana.com/docs/agent/v0.43/static/configuration/server-config/</guid><content><![CDATA[&lt;h1 id=&#34;server_config&#34;&gt;server_config&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;server_config&lt;/code&gt; block configures the Agent&amp;rsquo;s behavior as an HTTP server,
gRPC server, and the log level for the whole process.&lt;/p&gt;
&lt;p&gt;The Agent exposes an HTTP server for scraping its own metrics and gRPC for the
scraping service mode.&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 only messages with the given severity or above. Supported values [debug,
# info, warn, error]. This level affects logging for all Agent-level logs, not
# just the HTTP and gRPC server.
#
# Note that some integrations use their own loggers which ignore this
# setting.
[log_level: &amp;lt;string&amp;gt; | default = &amp;#34;info&amp;#34;]

# Log messages with the given format. Supported values [logfmt, json].
# This affects logging for all Agent-levle logs, not just the HTTP and gRPC
# server.
#
# Note that some integrations use their own loggers which ignore this
# setting.
[log_format: &amp;lt;string&amp;gt; | default = &amp;#34;logfmt&amp;#34;]

# TLS configuration for the HTTP server. Required when the
# -server.http.tls-enabled flag is provided, ignored otherwise.
[http_tls_config: &amp;lt;server_tls_config&amp;gt;]

# TLS configuration for the gRPC server. Required when the
# -server.grpc.tls-enabled flag is provided, ignored otherwise.
[grpc_tls_config: &amp;lt;server_tls_config&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;server_tls_config&#34;&gt;server_tls_config&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;server_tls_config&lt;/code&gt; configures TLS.&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;# File path to the server certificate
[cert_file: &amp;lt;string&amp;gt;]

# File path to the server key
[key_file: &amp;lt;string&amp;gt;]

# Tells the server what is acceptable from the client, this drives the options in client_tls_config
[client_auth_type: &amp;lt;string&amp;gt;]

# File path to the signing CA certificate, needed if CA is not trusted
[client_ca_file: &amp;lt;string&amp;gt;]

# Windows certificate filter allows selecting client CA and server certificate from the Windows Certificate store
[windows_certificate_filter: &amp;lt;windows_certificate_filter_config&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;windows_certificate_filter_config&#34;&gt;windows_certificate_filter_config&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;windows_certificate_filter_config&lt;/code&gt; configures the use of the Windows Certificate store. Setting cert_file, key_file, and client_ca_file are invalid settings when using the windows_certificate_filter.&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;# Client configuration, optional. If nothing specific will use the default client ca root
[client: &amp;lt;windows_client_config&amp;gt;]

# Name of the store to look for the Client Certificate ex My, CA
server: &amp;lt;windows_server_config&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;windows_client_config&#34;&gt;windows_client_config&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;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;# Array of issuer common names to check against
issuer_common_names:
  [- &amp;lt;string&amp;gt; ... ]

# Regular expression to match Subject name
[subject_regex: &amp;lt;string&amp;gt;]

# Client Template ID to match in ASN1 format ex &amp;#34;1.2.3&amp;#34;
[template_id: &amp;lt;string&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;windows_server_config&#34;&gt;windows_server_config&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;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 system store to look for the Server Certificate ex LocalMachine, CurrentUser
system_store: &amp;lt;string&amp;gt;

# Name of the store to look for the Server Certificate ex My, CA
store: &amp;lt;string&amp;gt;

# Array of issuer common names to check against
issuer_common_names:
[- &amp;lt;string&amp;gt; ... ]


# Server Template ID to match in ASN1 format ex &amp;#34;1.2.3&amp;#34;
[template_id: &amp;lt;string&amp;gt;]

# How often to refresh the server certificate ex 5m, 1h
[refresh_interval: &amp;lt;duration&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="server_config">server_config&lt;/h1>
&lt;p>The &lt;code>server_config&lt;/code> block configures the Agent&amp;rsquo;s behavior as an HTTP server,
gRPC server, and the log level for the whole process.&lt;/p>
&lt;p>The Agent exposes an HTTP server for scraping its own metrics and gRPC for the
scraping service mode.&lt;/p></description></item><item><title>metrics_config</title><link>https://grafana.com/docs/agent/v0.43/static/configuration/metrics-config/</link><pubDate>Wed, 11 Sep 2024 17:43:35 +0000</pubDate><guid>https://grafana.com/docs/agent/v0.43/static/configuration/metrics-config/</guid><content><![CDATA[&lt;h1 id=&#34;metrics_config&#34;&gt;metrics_config&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;metrics_config&lt;/code&gt; block is used to define a collection of metrics
instances. Each instance defines a collection of Prometheus-compatible
scrape_configs and remote_write rules. Most users will only need to
define one instance.&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 the optional scraping service to cluster agents.
[scraping_service: &amp;lt;scraping_service_config&amp;gt;]

# Configures the gRPC client used for agents to connect to other
# clustered agents.
[scraping_service_client: &amp;lt;scraping_service_client_config&amp;gt;]

# Configure values for all Prometheus instances.
[global: &amp;lt;global_config&amp;gt;]

# Configure the directory used by instances to store their WAL.
#
# The Grafana Agent assumes that all folders within wal_directory are managed by
# the agent itself. This means if you are using a PVC, you must point
# wal_directory to a subdirectory of the PVC mount.
[wal_directory: &amp;lt;string&amp;gt; | default = &amp;#34;data-agent/&amp;#34;]

# Configures how long ago an abandoned (not associated with an instance) WAL
# may be written to before being eligible to be deleted
[wal_cleanup_age: &amp;lt;duration&amp;gt; | default = &amp;#34;12h&amp;#34;]

# Configures how often checks for abandoned WALs to be deleted are performed.
# A value of 0 disables periodic cleanup of abandoned WALs
[wal_cleanup_period: &amp;lt;duration&amp;gt; | default = &amp;#34;30m&amp;#34;]

# Allows to disable HTTP Keep-Alives when scraping; the Agent will only use
# outgoing each connection for a single request.
[http_disable_keepalives: &amp;lt;boolean&amp;gt; | default = false]

# Allows to configure the maximum amount of time an idle Keep-Alive connection
# can remain idle before closing itself. Zero means no limit.
# The setting is ignored when `http_disable_keepalives` is enabled.
[http_idle_conn_timeout: &amp;lt;duration&amp;gt; | default = &amp;#34;5m&amp;#34;]

# The list of Prometheus instances to launch with the agent.
configs:
  [- &amp;lt;metrics_instance_config&amp;gt;]

# If an instance crashes abnormally, how long should we wait before trying
# to restart it. 0s disables the backoff period and restarts the agent
# immediately.
[instance_restart_backoff: &amp;lt;duration&amp;gt; | default = &amp;#34;5s&amp;#34;]

# How to spawn instances based on instance configs. Supported values: shared,
# distinct.
[instance_mode: &amp;lt;string&amp;gt; | default = &amp;#34;shared&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;scraping_service_config&#34;&gt;scraping_service_config&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;scraping_service&lt;/code&gt; block configures the 
    &lt;a href=&#34;/docs/agent/v0.43/static/configuration/scraping-service/&#34;&gt;scraping service&lt;/a&gt;, an operational
mode where configurations are stored centrally in a KV store and a cluster of
agents distributes discovery and scrape load between nodes.&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 to enable scraping service mode. When enabled, local configs
# cannot be used.
[enabled: &amp;lt;boolean&amp;gt; | default = false]

# Note these next 3 configuration options are confusing. Due to backwards compatibility the naming
# is less than ideal.

# How often should the agent manually refresh the configuration. Useful for if KV change
# events are not sent by an agent.
[reshard_interval: &amp;lt;duration&amp;gt; | default = &amp;#34;1m&amp;#34;]

# The timeout for configuration refreshes. This can occur on cluster events or
# on the reshard interval. A timeout of 0 indicates no timeout.
[reshard_timeout: &amp;lt;duration&amp;gt; | default = &amp;#34;30s&amp;#34;]

# The timeout for a cluster reshard events. A timeout of 0 indicates no timeout.
[cluster_reshard_event_timeout: &amp;lt;duration&amp;gt; | default = &amp;#34;30s&amp;#34;]

# Configuration for the KV store to store configurations.
kvstore: &amp;lt;kvstore_config&amp;gt;

# When set, allows configs pushed to the KV store to specify configuration
# fields that can read secrets from files.
#
# This is disabled by default. When enabled, a malicious user can craft an
# instance config that reads arbitrary files on the machine the Agent runs
# on and sends its contents to a specically crafted remote_write endpoint.
#
# If enabled, ensure that no untrusted users have access to the Agent API.
[dangerous_allow_reading_files: &amp;lt;boolean&amp;gt;]

# Configuration for how agents will cluster together.
lifecycler: &amp;lt;lifecycler_config&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;kvstore_config&#34;&gt;kvstore_config&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;kvstore_config&lt;/code&gt; block configures the KV store used as storage for
configurations in the scraping service mode.&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;# Which underlying KV store to use. Can be either consul or etcd
[store: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Key prefix to store all configurations with. Must end in /.
[prefix: &amp;lt;string&amp;gt; | default = &amp;#34;configurations/&amp;#34;]

# Configuration for a Consul client. Only applies if store
# is &amp;#34;consul&amp;#34;
consul:
  # The hostname and port of Consul.
  [host: &amp;lt;string&amp;gt; | duration = &amp;#34;localhost:8500&amp;#34;]

  # The ACL Token used to interact with Consul.
  [acltoken: &amp;lt;string&amp;gt;]

  # The HTTP timeout when communicating with Consul
  [httpclienttimeout: &amp;lt;duration&amp;gt; | default = 20s]

  # Whether or not consistent reads to Consul are enabled.
  [consistentreads: &amp;lt;boolean&amp;gt; | default = true]

# Configuration for an ETCD v3 client. Only applies if
# store is &amp;#34;etcd&amp;#34;
etcd:
  # The ETCD endpoints to connect to.
  endpoints:
    - &amp;lt;string&amp;gt;

  # The Dial timeout for the ETCD connection.
  [dial_tmeout: &amp;lt;duration&amp;gt; | default = 10s]

  # The maximum number of retries to do for failed ops to ETCD.
  [max_retries: &amp;lt;int&amp;gt; | default = 10]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;lifecycler_config&#34;&gt;lifecycler_config&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;lifecycler_config&lt;/code&gt; block configures the lifecycler; the component that
Agents use to cluster together.&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 the distributed hash ring storage.
ring:
  # KV store for getting and sending distributed hash ring updates.
  kvstore: &amp;lt;kvstore_config&amp;gt;

  # Specifies when other agents in the clsuter should be considered
  # unhealthy if they haven&amp;#39;t sent a heartbeat within this duration.
  [heartbeat_timeout: &amp;lt;duration&amp;gt; | default = &amp;#34;1m&amp;#34;]

# Number of tokens to generate for the distributed hash ring.
[num_tokens: &amp;lt;int&amp;gt; | default = 128]

# How often agents should send a heartbeat to the distributed hash
# ring.
[heartbeat_period: &amp;lt;duration&amp;gt; | default = &amp;#34;5s&amp;#34;]

# How long to wait for tokens from other agents after generating
# a new set to resolve collisions. Useful only when using a gossip
# KV store.
[observe_period: &amp;lt;duration&amp;gt; | default = &amp;#34;0s&amp;#34;]

# Period to wait before joining the ring. 0s means to join immediately.
[join_after: &amp;lt;duration&amp;gt; | default = &amp;#34;0s&amp;#34;]

# Minimum duration to wait before marking the agent as ready to receive
# traffic. Used to work around race conditions for multiple agents exiting
# the distributed hash ring at the same time.
[min_ready_duration: &amp;lt;duration&amp;gt; | default = &amp;#34;1m&amp;#34;]

# Network interfaces to resolve addresses defined by other agents
# registered in distributed hash ring.
[interface_names: &amp;lt;string array&amp;gt; | default = [&amp;#34;eth0&amp;#34;, &amp;#34;en0&amp;#34;]]

# Duration to sleep before exiting. Ensures that metrics get scraped
# before the process quits.
[final_sleep: &amp;lt;duration&amp;gt; | default = &amp;#34;30s&amp;#34;]

# File path to store tokens. If empty, tokens will not be stored during
# shutdown and will not be restored at startup.
[tokens_file_path: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]

# Availability zone of the host the agent is running on. Default is an
# empty string which disables zone awareness for writes.
[availability_zone: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;scraping_service_client_config&#34;&gt;scraping_service_client_config&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;scraping_service_client_config&lt;/code&gt; block configures how clustered Agents will
generate gRPC clients to connect to each other.&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_config:
  # Maximum size in bytes the gRPC client will accept from the connected server.
  [max_recv_msg_size: &amp;lt;int&amp;gt; | default = 104857600]

  # Maximum size in bytes the gRPC client will sent to the connected server.
  [max_send_msg_size: &amp;lt;int&amp;gt; | default = 16777216]

  # Whether messages should be gzipped.
  [use_gzip_compression: &amp;lt;boolean&amp;gt; | default = false]

  # The rate limit for gRPC clients; 0 means no rate limit.
  [rate_limit: &amp;lt;float64&amp;gt; | default = 0]

  # gRPC burst allowed for rate limits.
  [rate_limit_burst: &amp;lt;int&amp;gt; | default = 0]

  # Controls if when a rate limit is hit whether the client should
  # retry the request.
  [backoff_on_ratelimits: &amp;lt;boolean&amp;gt; | default = false]

  # Configures the retry backoff when backoff_on_ratelimits is
  # true.
  backoff_config:
    # The minimum delay when backing off.
    [min_period: &amp;lt;duration&amp;gt; | default = &amp;#34;100ms&amp;#34;]

    # The maximum delay when backing off.
    [max_period: &amp;lt;duration&amp;gt; | default = &amp;#34;10s&amp;#34;]

    # The number of times to backoff and retry before failing.
    [max_retries: &amp;lt;int&amp;gt; | default = 10]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;global_config&#34;&gt;global_config&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;global_config&lt;/code&gt; block configures global values for all launched Prometheus
instances.&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 frequently should Prometheus instances scrape.
[scrape_interval: duration | default = &amp;#34;1m&amp;#34;]

# How long to wait before timing out a scrape from a target.
[scrape_timeout: duration | default = &amp;#34;10s&amp;#34;]

# A list of static labels to add for all metrics.
external_labels:
  { &amp;lt;string&amp;gt;: &amp;lt;string&amp;gt; }

# Default set of remote_write endpoints. If an instance doesn&amp;#39;t define any
# remote_writes, it will use this list.
remote_write:
  - [&amp;lt;remote_write&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; For more information on remote_write, refer to the &lt;a href=&#34;https://prometheus.io/docs/prometheus/2.45/configuration/configuration/#remote_write&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The following default values set by Grafana Agent Static Mode are different than the default set by Prometheus:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;remote_write&lt;/code&gt;: &lt;code&gt;send_exemplars&lt;/code&gt; default value is &lt;code&gt;true&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;remote_write&lt;/code&gt;: &lt;code&gt;queue_config&lt;/code&gt;: &lt;code&gt;retry_on_http_429&lt;/code&gt; default value is &lt;code&gt;true&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;metrics_instance_config&#34;&gt;metrics_instance_config&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;metrics_instance_config&lt;/code&gt; block configures an individual metrics
instance, which acts as its own mini Prometheus-compatible agent, though
without support for the TSDB.&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 instance. Must be present. Will be added as a label to agent
# metrics.
name: string

# Whether this agent instance should only scrape from targets running on the
# same machine as the agent process.
[host_filter: &amp;lt;boolean&amp;gt; | default = false]

# Relabel configs to apply against discovered targets. The relabeling is
# temporary and just used for filtering targets.
host_filter_relabel_configs:
  [ - &amp;lt;relabel_config&amp;gt; ... ]

# How frequently the WAL truncation process should run. Every iteration of
# the truncation will checkpoint old series and remove old samples. If data
# has not been sent within this window, some of it may be lost.
#
# The size of the WAL will increase with less frequent truncations. Making
# truncations more frequent reduces the size of the WAL but increases the
# chances of data loss when remote_write is failing for longer than the
# specified frequency.
[wal_truncate_frequency: &amp;lt;duration&amp;gt; | default = &amp;#34;60m&amp;#34;]

# The minimum amount of time that series and samples should exist in the WAL
# before being considered for deletion. The consumed disk space of the WAL will
# increase by making this value larger.
#
# Setting this value to 0s is valid, but may delete series before all
# remote_write shards have been able to write all data, and may cause errors on
# slower machines.
[min_wal_time: &amp;lt;duration&amp;gt; | default = &amp;#34;5m&amp;#34;]

# The maximum amount of time that series and samples may exist within the WAL
# before being considered for deletion. Series that have not received writes
# since this period will be removed, and all samples older than this period will
# be removed.
#
# This value is useful in long-running network outages, preventing the WAL from
# growing forever.
#
# Must be larger than min_wal_time.
[max_wal_time: &amp;lt;duration&amp;gt; | default = &amp;#34;4h&amp;#34;]

# Deadline for flushing data when a Prometheus instance shuts down
# before giving up and letting the shutdown proceed.
[remote_flush_deadline: &amp;lt;duration&amp;gt; | default = &amp;#34;1m&amp;#34;]

# When true, writes staleness markers to all active series to
# remote_write.
[write_stale_on_shutdown: &amp;lt;boolean&amp;gt; | default = false]

# A list of scrape configuration rules.
scrape_configs:
  - [&amp;lt;scrape_config&amp;gt;]

# A list of remote_write targets.
remote_write:
  - [&amp;lt;remote_write&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; More information on the following types can be found on the Prometheus
website:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://prometheus.io/docs/prometheus/2.45/configuration/configuration/#relabel_config&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;relabel_config&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://prometheus.io/docs/prometheus/2.45/configuration/configuration/#scrape_config&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;scrape_config&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://prometheus.io/docs/prometheus/2.45/configuration/configuration/#remote_write&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;remote_write&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;data-retention&#34;&gt;Data retention&lt;/h2&gt;


&lt;div data-shared=&#34;/wal-data-retention.md&#34;&gt;
            &lt;p&gt;The &lt;code&gt;prometheus.remote_write&lt;/code&gt; component uses a Write Ahead Log (WAL) to prevent
data loss during network outages. The component buffers the received metrics in
a WAL for each configured endpoint. The queue shards can use the WAL after the
network outage is resolved and flush the buffered metrics to the endpoints.&lt;/p&gt;
&lt;p&gt;The WAL records metrics in 128 MB files called segments. To avoid having a WAL
that grows on-disk indefinitely, the component &lt;em&gt;truncates&lt;/em&gt; its segments on a
set interval.&lt;/p&gt;
&lt;p&gt;On each truncation, the WAL deletes references to series that are no longer
present and also &lt;em&gt;checkpoints&lt;/em&gt; roughly the oldest two thirds of the segments
(rounded down to the nearest integer) written to it since the last truncation
period. A checkpoint means that the WAL only keeps track of the unique
identifier for each existing metrics series, and can no longer use the samples
for remote writing. If that data has not yet been pushed to the remote
endpoint, it is lost.&lt;/p&gt;
&lt;p&gt;This behavior dictates the data retention for the &lt;code&gt;prometheus.remote_write&lt;/code&gt;
component. It also means that it&amp;rsquo;s impossible to directly correlate data
retention directly to the data age itself, as the truncation logic works on
&lt;em&gt;segments&lt;/em&gt;, not the samples themselves. This makes data retention less
predictable when the component receives a non-consistent rate of data.&lt;/p&gt;
&lt;p&gt;The 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/prometheus.remote_write#wal-block&#34;&gt;WAL block&lt;/a&gt; in Flow mode, or the 
    &lt;a href=&#34;/docs/agent/v0.43/static/configuration/metrics-config/&#34;&gt;metrics config&lt;/a&gt; in Static mode
contain some configurable parameters that can be used to control the tradeoff
between memory usage, disk usage, and data retention.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;truncate_frequency&lt;/code&gt; or &lt;code&gt;wal_truncate_frequency&lt;/code&gt; parameter configures the
interval at which truncations happen. A lower value leads to reduced memory
usage, but also provides less resiliency to long outages.&lt;/p&gt;
&lt;p&gt;When a WAL clean-up starts, the most recently successfully sent timestamp is
used to determine how much data is safe to remove from the WAL.
The &lt;code&gt;min_keepalive_time&lt;/code&gt; or &lt;code&gt;min_wal_time&lt;/code&gt; controls the minimum age of samples
considered for removal. No samples more recent than &lt;code&gt;min_keepalive_time&lt;/code&gt; are
removed. The &lt;code&gt;max_keepalive_time&lt;/code&gt; or &lt;code&gt;max_wal_time&lt;/code&gt; controls the maximum age of
samples that can be kept in the WAL. Samples older than
&lt;code&gt;max_keepalive_time&lt;/code&gt; are forcibly removed.&lt;/p&gt;
&lt;h3 id=&#34;extended-remote_write-outages&#34;&gt;Extended &lt;code&gt;remote_write&lt;/code&gt; outages&lt;/h3&gt;
&lt;p&gt;When the remote write endpoint is unreachable over a period of time, the most
recent successfully sent timestamp is not updated. The
&lt;code&gt;min_keepalive_time&lt;/code&gt; and &lt;code&gt;max_keepalive_time&lt;/code&gt; arguments control the age range
of data kept in the WAL.&lt;/p&gt;
&lt;p&gt;If the remote write outage is longer than the &lt;code&gt;max_keepalive_time&lt;/code&gt; parameter,
then the WAL is truncated, and the oldest data is lost.&lt;/p&gt;
&lt;h3 id=&#34;intermittent-remote_write-outages&#34;&gt;Intermittent &lt;code&gt;remote_write&lt;/code&gt; outages&lt;/h3&gt;
&lt;p&gt;If the remote write endpoint is intermittently reachable, the most recent
successfully sent timestamp is updated whenever the connection is successful.
A successful connection updates the series&amp;rsquo; comparison with
&lt;code&gt;min_keepalive_time&lt;/code&gt; and triggers a truncation on the next &lt;code&gt;truncate_frequency&lt;/code&gt;
interval which checkpoints two thirds of the segments (rounded down to the
nearest integer) written since the previous truncation.&lt;/p&gt;
&lt;h3 id=&#34;falling-behind&#34;&gt;Falling behind&lt;/h3&gt;
&lt;p&gt;If the queue shards cannot flush data quickly enough to keep
up-to-date with the most recent data buffered in the WAL, we say that the
component is &amp;lsquo;falling behind&amp;rsquo;.
It&amp;rsquo;s not unusual for the component to temporarily fall behind 2 or 3 scrape intervals.
If the component falls behind more than one third of the data written since the
last truncate interval, it is possible for the truncate loop to checkpoint data
before being pushed to the remote_write endpoint.&lt;/p&gt;
&lt;h3 id=&#34;wal-corruption&#34;&gt;WAL corruption&lt;/h3&gt;
&lt;p&gt;WAL corruption can occur when Grafana Agent unexpectedly stops while the latest WAL segments
are still being written to disk. For example, the host computer has a general disk failure
and crashes before you can stop Grafana Agent and other running services. When you restart Grafana
Agent, it verifies the WAL, removing any corrupt segments it finds. Sometimes, this repair
is unsuccessful, and you must manually delete the corrupted WAL to continue.&lt;/p&gt;
&lt;p&gt;If the WAL becomes corrupted, Grafana Agent writes error messages such as
&lt;code&gt;err=&amp;quot;failed to find segment for index&amp;quot;&lt;/code&gt; to the log file.&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;Deleting a WAL segment or a WAL file permanently deletes the stored WAL data.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;To delete the corrupted WAL:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Stop Grafana Agent.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Find and delete the contents of the &lt;code&gt;wal&lt;/code&gt; directory.&lt;/p&gt;
&lt;p&gt;By default the &lt;code&gt;wal&lt;/code&gt; directory is a subdirectory
of the &lt;code&gt;data-agent&lt;/code&gt; directory located in the Grafana Agent working directory. The WAL data directory
may be different than the default depending on the 
    &lt;a href=&#34;/docs/agent/v0.43/static/configuration/metrics-config/&#34;&gt;wal_directory&lt;/a&gt; setting in your Static configuration
file or the path specified by the Flow 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/run/&#34;&gt;command line flag&lt;/a&gt; &lt;code&gt;--storage-path&lt;/code&gt;.&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;There is one &lt;code&gt;wal&lt;/code&gt; directory per:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Metrics instance running in Static mode&lt;/li&gt;
&lt;li&gt;&lt;code&gt;prometheus.remote_write&lt;/code&gt; component running in Flow mode&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start Grafana Agent and verify that the WAL is working correctly.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
]]></content><description>&lt;h1 id="metrics_config">metrics_config&lt;/h1>
&lt;p>The &lt;code>metrics_config&lt;/code> block is used to define a collection of metrics
instances. Each instance defines a collection of Prometheus-compatible
scrape_configs and remote_write rules. Most users will only need to
define one instance.&lt;/p></description></item><item><title>logs_config</title><link>https://grafana.com/docs/agent/v0.43/static/configuration/logs-config/</link><pubDate>Thu, 21 Nov 2024 17:35:09 +0000</pubDate><guid>https://grafana.com/docs/agent/v0.43/static/configuration/logs-config/</guid><content><![CDATA[&lt;h1 id=&#34;logs_config&#34;&gt;logs_config&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;logs_config&lt;/code&gt; block configures how the Agent collects logs and sends them to
a Loki push API endpoint. &lt;code&gt;logs_config&lt;/code&gt; is identical to how Promtail is
configured, except deprecated fields have been removed and the server_config is
not supported.&lt;/p&gt;
&lt;p&gt;Refer to the
&lt;a href=&#34;/docs/loki/latest/send-data/promtail/configuration/&#34;&gt;Promtail documentation&lt;/a&gt;
for the supported values for these fields.&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 Loki Promtail positions files in. Positions files are
# required to read logs, and are used to store the last read offset of log
# sources. The positions files will be stored in
# &amp;lt;positions_directory&amp;gt;/&amp;lt;logs_instance_config.name&amp;gt;.yml.
#
# Optional only if every config has a positions.filename manually provided.
#
# This directory will be automatically created if it doesn&amp;#39;t exist.
[positions_directory: &amp;lt;string&amp;gt;]

# Configure values for all Loki Promtail instances.
[global: &amp;lt;global_config&amp;gt;]

# Loki Promtail instances to run for log collection.
configs:
  - [&amp;lt;logs_instance_config&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;global_config&#34;&gt;global_config&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;global_config&lt;/code&gt; block configures global values for all launched Loki Promtail
instances.&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;clients:
  - [&amp;lt;promtail.client_config&amp;gt;]
# Configure how frequently log files from disk get polled for changes.
[file_watch_config: &amp;lt;file_watch_config&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; More information on the following types can be found on the
documentation for Promtail:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;/docs/loki/latest/send-data/promtail/configuration/#clients&#34;&gt;&lt;code&gt;promtail.client_config&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;file_watch_config&#34;&gt;file_watch_config&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;file_watch_config&lt;/code&gt; block configures how often to poll log files from disk
for changes:&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;# Minimum frequency to poll for files. Any time file changes are detected, the
# poll frequency gets reset to this duration.
  [min_poll_frequency: &amp;lt;duration&amp;gt; | default = &amp;#34;250ms&amp;#34;]
  # Maximum frequency to poll for files. Any time no file changes are detected,
  # the poll frequency doubles in value up to the maximum duration specified by
  # this value.
  #
  # The default is set to the same as min_poll_frequency.
  [max_poll_frequency: &amp;lt;duration&amp;gt; | default = &amp;#34;250ms&amp;#34;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;logs_instance_config&#34;&gt;logs_instance_config&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;logs_instance_config&lt;/code&gt; block is an individual instance of Promtail with its
own set of scrape rules and where to forward logs. It is identical to how
Promtail is configured, except deprecated fields have been removed and the
&lt;code&gt;server_config&lt;/code&gt; block is not supported.&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 this config. Required, and must be unique across all Loki configs.
# The name of the config will be the value of a logs_config label for all
# Loki Promtail metrics.
name: &amp;lt;string&amp;gt;

clients:
  - [&amp;lt;promtail.client_config&amp;gt;]

# Optional configuration for where to store the positions files. If
# positions.filename is left empty, the file will be stored in
# &amp;lt;logs_config.positions_directory&amp;gt;/&amp;lt;logs_instance_config.name&amp;gt;.yml.
#
# The directory of the positions file will automatically be created on start up
# if it doesn&amp;#39;t already exist..
[positions: &amp;lt;promtail.position_config&amp;gt;]

scrape_configs:
  - [&amp;lt;promtail.scrape_config&amp;gt;]

[target_config: &amp;lt;promtail.target_config&amp;gt;]

[limits_config: &amp;lt;promtail.limits_config&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; More information on the following types can be found on the
documentation for Promtail:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;/docs/loki/latest/send-data/promtail/configuration/#clients&#34;&gt;&lt;code&gt;promtail.client_config&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/loki/latest/send-data/promtail/configuration/#scrape_configs&#34;&gt;&lt;code&gt;promtail.scrape_config&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/loki/latest/send-data/promtail/configuration/#target_config&#34;&gt;&lt;code&gt;promtail.target_config&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/loki/latest/send-data/promtail/configuration/#limits_config&#34;&gt;&lt;code&gt;promtail.limits_config&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Backticks in values are not supported.&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;  Because of how YAML treats backslashes in double-quoted strings,
all backslashes in a regex expression must be escaped when using double
quotes. But because of double processing, in Grafana Agent config file
you must use quadruple backslash (&lt;code&gt;\\\\&lt;/code&gt;) construction to add backslashes
into regular expressions, here is example for &lt;code&gt;name=(\w&#43;)\s&lt;/code&gt; regex:&lt;/p&gt;&lt;/blockquote&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&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&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;  selector: &amp;#39;{app=&amp;#34;my-app&amp;#34;} |~ &amp;#34;name=(\\\\w&amp;#43;)\\\\s&amp;#34;&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Using single or double backslash construction produces the error:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&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&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;failed to make file target manager: invalid match stage config: invalid selector syntax for match stage: parse error at line 1, col 40: literal not terminated&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Using backticks produces the error:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&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&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;invalid match stage config: invalid selector syntax for match stage: parse error at line 1, col 51: syntax error: unexpected IDENTIFIER, expecting STRING&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="logs_config">logs_config&lt;/h1>
&lt;p>The &lt;code>logs_config&lt;/code> block configures how the Agent collects logs and sends them to
a Loki push API endpoint. &lt;code>logs_config&lt;/code> is identical to how Promtail is
configured, except deprecated fields have been removed and the server_config is
not supported.&lt;/p></description></item><item><title>traces_config</title><link>https://grafana.com/docs/agent/v0.43/static/configuration/traces-config/</link><pubDate>Wed, 11 Sep 2024 17:43:35 +0000</pubDate><guid>https://grafana.com/docs/agent/v0.43/static/configuration/traces-config/</guid><content><![CDATA[&lt;h1 id=&#34;traces_config&#34;&gt;traces_config&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;traces_config&lt;/code&gt; block configures a set of Tempo instances, each of which
configures its own tracing pipeline. Having multiple configs allows you to
configure multiple distinct pipelines, each of which collects spans and sends
them to a different location.&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;If you are using multiple configs, you must manually set port numbers for
each receiver, otherwise they will all try to use the same port and fail to
start.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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;traces_instance_config&amp;gt; ... ]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;traces_instance_config&#34;&gt;traces_instance_config&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;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 configures the name of this Tempo instance. Names must be non-empty and
# unique across all Tempo instances. The value of the name here will appear in
# logs and as a label on metrics.
name: &amp;lt;string&amp;gt;

# This field allows for the general manipulation of tags on spans that pass
# through this agent. A common use may be to add an environment or cluster
# variable.
[ attributes: &amp;lt;attributes.config&amp;gt; ]

# This field allows to configure grouping spans into batches. Batching helps
# better compress the data and reduce the number of outgoing connections
# required transmit the data.
[ batch: &amp;lt;batch.config&amp;gt; ]

remote_write:
  # host:port to send traces to.
  # Here must be the port of gRPC receiver, not the Tempo default port.
  # Example for cloud instances: `tempo-us-central1.grafana.net:443`
  # For local / on-premises instances: `localhost:55680` or `tempo.example.com:14250`
  # Note: for non-encrypted connections you must also set `insecure: true`
  - endpoint: &amp;lt;string&amp;gt;

    # Custom HTTP headers to be sent along with each remote write request.
    # Be aware that &amp;#39;authorization&amp;#39; header will be overwritten in presence
    # of basic_auth.
    headers:
      [ &amp;lt;string&amp;gt;: &amp;lt;string&amp;gt; ... ]

    # Controls whether compression is enabled.
    [ compression: &amp;lt;string&amp;gt; | default = &amp;#34;gzip&amp;#34; | supported = &amp;#34;none&amp;#34;, &amp;#34;gzip&amp;#34;]

    # Controls what protocol to use when exporting traces.
    # Only &amp;#34;grpc&amp;#34; is supported in Grafana Cloud.
    [ protocol: &amp;lt;string&amp;gt; | default = &amp;#34;grpc&amp;#34; | supported = &amp;#34;grpc&amp;#34;, &amp;#34;http&amp;#34; ]

    # Controls what format to use when exporting traces, in combination with protocol.
    # protocol/format supported combinations are grpc/otlp and http/otlp.
    # Only grpc/otlp is supported in Grafana Cloud.
    [ format: &amp;lt;string&amp;gt; | default = &amp;#34;otlp&amp;#34; | supported = &amp;#34;otlp&amp;#34; ]

    # Controls whether or not TLS is required. See https://godoc.org/google.golang.org/grpc#WithInsecure
    [ insecure: &amp;lt;boolean&amp;gt; | default = false ]

    # Deprecated in favor of tls_config
    # If both `insecure_skip_verify` and `tls_config.insecure_skip_verify` are used,
    # the latter take precedence.
    [ insecure_skip_verify: &amp;lt;bool&amp;gt; | default = false ]

    # Configures opentelemetry exporters to use the OpenTelemetry auth extension `oauth2clientauthextension`.
    # Can not be used in combination with `basic_auth`.
    # See https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.96.0/extension/oauth2clientauthextension/README.md
    oauth2:
      # Configures the TLS settings specific to the oauth2 client
      # The client identifier issued to the oauth client
      [ client_id: &amp;lt;string&amp;gt; ]
      # The secret string associated with the oauth client
      [ client_secret: &amp;lt;string&amp;gt; ]
      # Additional parameters for requests to the token endpoint
      [ endpoint_params: &amp;lt;string&amp;gt; ]
      # The resource server&amp;#39;s token endpoint URL
      [ token_url: &amp;lt;string&amp;gt; ]
      # Optional, requested permissions associated with the oauth client
      [ scopes: [&amp;lt;string&amp;gt;] ]
      # Optional, specifies the timeout fetching tokens from the token_url. Default: no timeout
      [ timeout: &amp;lt;duration&amp;gt; ]
      # TLS client configuration for the underneath client to authorization server.
      # https://github.com/open-telemetry/opentelemetry-collector/blob/v0.96.0/config/configtls/README.md
      tls:
        # Disable validation of the server certificate.
        [ insecure: &amp;lt;bool&amp;gt; | default = false ]
        # InsecureSkipVerify will enable TLS but not verify the certificate.
        [ insecure_skip_verify: &amp;lt;bool&amp;gt; | default = false ]
        # ServerName requested by client for virtual hosting.
        # This sets the ServerName in the TLSConfig. Please refer to
        # https://godoc.org/crypto/tls#Config for more information.
        [ server_name_override: &amp;lt;string&amp;gt; ]
        # Path to the CA cert. For a client this verifies the server certificate. If empty uses system root CA.
        [ ca_file: &amp;lt;string&amp;gt; ]
        # In memory PEM encoded cert.
        [ ca_pem: &amp;lt;string&amp;gt; ]
        # Path to the TLS cert to use for TLS required connections
        [ cert_file: &amp;lt;string&amp;gt; ]
        # In memory PEM encoded TLS cert to use for TLS required connections.
        [ cert_pem: &amp;lt;string&amp;gt; ]
        # Path to the TLS key to use for TLS required connections
        [ key_file: &amp;lt;string&amp;gt; ]
        # In memory PEM encoded TLS key to use for TLS required connections.
        [ key_pem: &amp;lt;string&amp;gt; ]
        # Minimum acceptable TLS version.
        [ min_version: &amp;lt;string&amp;gt; | default = &amp;#34;1.2&amp;#34; ]
        # Maximum acceptable TLS version.
        # If not set, it is handled by crypto/tls - currently it is &amp;#34;1.3&amp;#34;.
        [ max_version: &amp;lt;string&amp;gt; | default = &amp;#34;&amp;#34; ]
        # The duration after which the certificate will be reloaded.
        # If not set, it will never be reloaded.
        [ reload_interval: &amp;lt;duration&amp;gt; ]
        # If true, load system CA certificates pool in addition to the certificates
        # configured in this struct.
        [ include_system_ca_certs_pool: &amp;lt;duration&amp;gt; ]
        # A list of TLS cipher suites that the TLS transport can use.
        # If left blank, a safe default list is used.
        # See https://go.dev/src/crypto/tls/cipher_suites.go for a list of supported cipher suites.
        [ cipher_suites: &amp;lt;duration&amp;gt; ]

    # Controls TLS settings of the exporter&amp;#39;s client:
    # https://prometheus.io/docs/prometheus/2.45/configuration/configuration/#tls_config
    # This should be used only if `insecure` is set to false
    tls_config:
      # Path to the CA cert. For a client this verifies the server certificate. If empty uses system root CA.
      [ ca_file: &amp;lt;string&amp;gt; ]
      # Path to the TLS cert to use for TLS required connections
      [ cert_file: &amp;lt;string&amp;gt; ]
      # Path to the TLS key to use for TLS required connections
      [ key_file: &amp;lt;string&amp;gt; ]
      # Disable validation of the server certificate.
      [ insecure_skip_verify: &amp;lt;bool&amp;gt; | default = false ]

    # Sets the `Authorization` header on every trace push with the
    # configured username and password.
    # password and password_file are mutually exclusive.
    basic_auth:
      [ username: &amp;lt;string&amp;gt; ]
      [ password: &amp;lt;secret&amp;gt; ]
      [ password_file: &amp;lt;string&amp;gt; ]

    [ sending_queue: &amp;lt;otlpexporter.sending_queue&amp;gt; ]
    [ retry_on_failure: &amp;lt;otlpexporter.retry_on_failure&amp;gt; ]

# This processor writes a well formatted log line to a logs instance for each span, root, or process
# that passes through the Agent. This allows for automatically building a mechanism for trace
# discovery and building metrics from traces using Loki. It should be considered experimental.
automatic_logging:
  # Indicates where the stream of log lines should go. Either supports writing
  # to a logs instance defined in this same config or to stdout.
  [ backend: &amp;lt;string&amp;gt; | default = &amp;#34;stdout&amp;#34; | supported = &amp;#34;stdout&amp;#34;, &amp;#34;logs_instance&amp;#34; ]
  # Indicates the logs instance to write logs to.
  # Required if backend is set to logs_instance.
  [ logs_instance_name: &amp;lt;string&amp;gt; ]
  # Log one line per span. Warning! possibly very high volume
  [ spans: &amp;lt;boolean&amp;gt; ]
  # Log one line for every root span of a trace.
  [ roots: &amp;lt;boolean&amp;gt; ]
  # Log one line for every process
  [ processes: &amp;lt;boolean&amp;gt; ]
  # Additional span attributes to log
  [ span_attributes: &amp;lt;string array&amp;gt; ]
  # Additional process attributes to log
  [ process_attributes: &amp;lt;string array&amp;gt; ]
  # Timeout on writing logs to Loki when backend is &amp;#34;logs_instance.&amp;#34;
  [ timeout: &amp;lt;duration&amp;gt; | default = 1ms ]
  # Configures a set of key values that will be logged as labels
  # They need to be span or process attributes logged in the log line
  #
  # This feature only applies when `backend = logs_instance`
  #
  # Loki only accepts alphanumeric and &amp;#34;_&amp;#34; as valid characters for labels.
  # Labels are sanitized by replacing invalid characters with underscores.
  [ labels: &amp;lt;string array&amp;gt; ]
  overrides:
    [ logs_instance_tag: &amp;lt;string&amp;gt; | default = &amp;#34;traces&amp;#34; ]
    [ service_key: &amp;lt;string&amp;gt; | default = &amp;#34;svc&amp;#34; ]
    [ span_name_key: &amp;lt;string&amp;gt; | default = &amp;#34;span&amp;#34; ]
    [ status_key: &amp;lt;string&amp;gt; | default = &amp;#34;status&amp;#34; ]
    [ duration_key: &amp;lt;string&amp;gt; | default = &amp;#34;dur&amp;#34; ]
    [ trace_id_key: &amp;lt;string&amp;gt; | default = &amp;#34;tid&amp;#34; ]

# Receiver configurations are mapped directly into the OpenTelemetry receivers
# block. At least one receiver is required.
# The Agent uses OpenTelemetry v0.96.0. Refer to the corresponding receiver&amp;#39;s config.
#
# Supported receivers: otlp, jaeger, kafka, opencensus and zipkin.
receivers: &amp;lt;receivers&amp;gt;

# A list of prometheus scrape configs.  Targets discovered through these scrape
# configs have their __address__ matched against the ip on incoming spans. If a
# match is found then relabeling rules are applied.
scrape_configs:
  [ - &amp;lt;scrape_config&amp;gt; ... ]
# Defines what method is used when adding k/v to spans.
# Options are `update`, `insert` and `upsert`.
# `update` only modifies an existing k/v and `insert` only appends if the k/v
# is not present. `upsert` does both.
[ prom_sd_operation_type: &amp;lt;string&amp;gt; | default = &amp;#34;upsert&amp;#34; ]
# Configures what methods to use to do association between spans and pods.
# PromSD processor matches the IP address of the metadata labels from the k8s API
# with the IP address obtained from the specified pod association method.
# If a match is found then the span is labeled.
#
# Options are `ip`, `net.host.ip`, `k8s.pod.ip`, `hostname` and `connection`.
#   - `ip`, `net.host.ip` and `k8s.pod.ip`, `hostname` match spans tags.
#   - `connection` inspects the context from the incoming requests (gRPC and HTTP).
#
# Tracing instrumentation is commonly the responsible for tagging spans
# with IP address to the labels mentioned above.
# If running on kubernetes, `k8s.pod.ip` can be automatically attached via the
# downward API. For example, if you&amp;#39;re using OTel instrumentation libraries, set
# OTEL_RESOURCE_ATTRIBUTES=k8s.pod.ip=$(POD_IP) to inject spans with the sender
# pod&amp;#39;s IP.
#
# By default, all methods are enabled, and evaluated in the order specified above.
# Order of evaluation is honored when multiple methods are enabled.
prom_sd_pod_associations:
  [ - &amp;lt;string&amp;gt; ... ]

# spanmetrics supports aggregating Request, Error and Duration (R.E.D) metrics
# from span data.
#
# spanmetrics generates two metrics from spans and uses remote_write or
# OpenTelemetry Prometheus exporters to serve the metrics locally.
#
# In order to use the remote_write exporter, you have to configure a Prometheus
# instance in the Agent and pass its name to the `metrics_instance` field.
#
# If you want to use the OpenTelemetry Prometheus exporter, you have to
# configure handler_endpoint and then scrape that endpoint.
#
# The first generated metric is `calls`, a counter to compute requests.
# The second generated metric is `latency`, a histogram to compute the
# operation&amp;#39;s duration.
#
# If you want to rename the generated metrics, you can configure the `namespace`
# option of prometheus exporter.
#
# This is an experimental feature of Opentelemetry-Collector and the behavior
# may change in the future.
spanmetrics:
  # latency_histogram_buckets and dimensions are the same as the configs in
  # spanmetricsprocessor.
  [ latency_histogram_buckets: &amp;lt;spanmetricsprocessor.latency_histogram_buckets&amp;gt; ]
  [ dimensions: &amp;lt;spanmetricsprocessor.dimensions&amp;gt; ]
  # const_labels are labels that will always get applied to the exported
  # metrics.
  const_labels:
    [ &amp;lt;string&amp;gt;: &amp;lt;string&amp;gt; ... ]
  # Metrics are namespaced to `traces_spanmetrics` by default.
  # They can be further namespaced, i.e. `{namespace}_traces_spanmetrics`
  [ namespace: &amp;lt;string&amp;gt; ]
  # metrics_instance is the metrics instance used to remote write metrics.
  [ metrics_instance: &amp;lt;string&amp;gt; ]
  # handler_endpoint defines the endpoint where the OTel prometheus exporter will be exposed.
  [ handler_endpoint: &amp;lt;string&amp;gt; ]
  # dimensions_cache_size defines the size of cache for storing Dimensions.
  [ dimensions_cache_size: &amp;lt;int&amp;gt; | default = 1000 ]
  # aggregation_temporality configures whether to reset the metrics after flushing.
  # It can be either AGGREGATION_TEMPORALITY_CUMULATIVE or AGGREGATION_TEMPORALITY_DELTA.
  [ aggregation_temporality: &amp;lt;string&amp;gt; | default = &amp;#34;AGGREGATION_TEMPORALITY_CUMULATIVE&amp;#34; ]
  # metrics_flush_interval configures how often to flush generated metrics.
  [ metrics_flush_interval: &amp;lt;duration&amp;gt; | default = 15s ]

# tail_sampling supports tail-based sampling of traces in the agent.
#
# Policies can be defined that determine what traces are sampled and sent to the
# backends and what traces are dropped.
#
# In order to make a correct sampling decision it&amp;#39;s important that the agent has
# a complete trace. This is achieved by waiting a given time for all the spans
# before evaluating the trace.
#
# Tail sampling also supports multi agent deployments, allowing to group all
# spans of a trace in the same agent by load balancing the spans by trace ID
# between the instances.
# * To make use of this feature, check load_balancing below *
tail_sampling:
  # policies define the rules by which traces will be sampled. Multiple policies
  # can be added to the same pipeline.
  policies:
    [ - &amp;lt;tailsamplingprocessor.policies&amp;gt; ... ]

  # Time that to wait before making a decision for a trace.
  # Longer wait times reduce the probability of sampling an incomplete trace at
  # the cost of higher memory usage.
  [ decision_wait: &amp;lt;duration&amp;gt; | default = 5s ]

  # Optional, number of traces kept in memory
  [ num_traces: &amp;lt;int&amp;gt; | default = 50000 ]

  # Optional, expected number of new traces (helps in allocating data structures)
  [ expected_new_traces_per_sec: &amp;lt;int&amp;gt; | default = 0 ]

# load_balancing configures load balancing of spans across multi agent deployments.
# It ensures that all spans of a trace are sampled in the same instance.
# It works by exporting spans based on their traceID via consistent hashing.
#
# Enabling this feature is required for &amp;#34;tail_sampling&amp;#34;, &amp;#34;spanmetrics&amp;#34;, and &amp;#34;service_graphs&amp;#34;
# to correctly work when spans are ingested by multiple agent instances.
#
# Load balancing works by layering two pipelines and consistently exporting
# spans belonging to a trace to the same agent instance.
# Agent instances need to be able to communicate with each other via gRPC.
#
# When load_balancing is enabled:
# 1. When an Agent receives spans from the configured &amp;#34;receivers&amp;#34;.
# 2. If the &amp;#34;attributes&amp;#34; processor is configured, it will run through all the spans.
# 3. The spans will be exported using the &amp;#34;load_balancing&amp;#34; configuration to any of the Agent instances.
#    This may or may not be the same Agent which has already received the span.
# 4. The Agent which received the span from the loadbalancer will run these processors, 
#    in this order, if they are configured:
#    1. &amp;#34;spanmetrics&amp;#34;
#    2. &amp;#34;service_graphs&amp;#34;
#    3. &amp;#34;tail_sampling&amp;#34;
#    4. &amp;#34;automatic_logging&amp;#34;
#    5. &amp;#34;batch&amp;#34;
# 5. The spans are then remote written using the &amp;#34;remote_write&amp;#34; configuration.
# 
# Load balancing significantly increases CPU usage. This is because spans are
# exported an additional time between agents.
load_balancing:
  # resolver configures the resolution strategy for the involved backends
  # It can be either &amp;#34;static&amp;#34;, &amp;#34;dns&amp;#34; or &amp;#34;kubernetes&amp;#34;.
  resolver:
    static:
      # A fixed list of hostnames.
      hostnames:
        [ - &amp;lt;string&amp;gt; ... ]
    dns:
      # DNS hostname from which to resolve IP addresses.
      hostname: &amp;lt;string&amp;gt;
      # Port number to use with the resolved IP address when exporting spans.
      [ port: &amp;lt;int&amp;gt; | default = 4317 ]
      # Resolver interval
      [ interval: &amp;lt;duration&amp;gt; | default = 5s ]
      # Resolver timeout
      [ timeout: &amp;lt;duration&amp;gt; | default = 1s ]
    # The kubernetes resolver receives IP addresses of a Kubernetes service 
    # from the Kubernetes API. It does not require polling. The Kubernetes API
    # notifies the Agent when a new pod is available and when an old pod has exited.
    #
    # For the kubernetes resolver to work, Agent must be running under
    # a system account with &amp;#34;list&amp;#34;, &amp;#34;watch&amp;#34; and &amp;#34;get&amp;#34; permissions.
    kubernetes:
      service: &amp;lt;string&amp;gt;
      [ ports: &amp;lt;int array&amp;gt; | default = 4317 ]

  # routing_key can be either &amp;#34;traceID&amp;#34; or &amp;#34;service&amp;#34;:
  # * &amp;#34;service&amp;#34;: exports spans based on their service name.
  # * &amp;#34;traceID&amp;#34;: exports spans based on their traceID.
  [ routing_key: &amp;lt;string&amp;gt; | default = &amp;#34;traceID&amp;#34; ]

  # receiver_port is the port the instance will use to receive load balanced traces
  receiver_port: [ &amp;lt;int&amp;gt; | default = 4318 ]

  # Load balancing is done via an otlp exporter.
  # The remaining configuration is common with the remote_write block.
  exporter:
    # Controls whether compression is enabled.
    [ compression: &amp;lt;string&amp;gt; | default = &amp;#34;gzip&amp;#34; | supported = &amp;#34;none&amp;#34;, &amp;#34;gzip&amp;#34;]

    # Controls whether or not TLS is required.
    [ insecure: &amp;lt;boolean&amp;gt; | default = false ]

    # Disable validation of the server certificate. Only used when insecure is set
    # to false.
    [ insecure_skip_verify: &amp;lt;bool&amp;gt; | default = false ]

    # Sets the `Authorization` header on every trace push with the
    # configured username and password.
    # password and password_file are mutually exclusive.
    basic_auth:
      [ username: &amp;lt;string&amp;gt; ]
      [ password: &amp;lt;secret&amp;gt; ]
      [ password_file: &amp;lt;string&amp;gt; ]

# service_graphs configures processing of traces for building service graphs in
# the form of prometheus metrics. The generated metrics represent edges between
# nodes in the graph. Nodes are represented by `client` and `server` labels.
#
#  e.g. tempo_service_graph_request_total{client=&amp;#34;app&amp;#34;, server=&amp;#34;db&amp;#34;} 20
#
# Service graphs works by inspecting spans and looking for the tag `span.kind`.
# If it finds the span kind to be client or server, it stores the request in a
# local in-memory store.
#
# That request waits until its corresponding client or server pair span is
# processed or until the maximum waiting time has passed.
# When either of those conditions is reached, the request is processed and
# removed from the local store. If the request is complete by that time, it&amp;#39;ll
# be recorded as an edge in the graph.
#
# Service graphs supports multi-agent deployments, allowing to group all spans
# of a trace in the same agent by load balancing the spans by trace ID between
# the instances.
# * To make use of this feature, check load_balancing above *
service_graphs:
  [ enabled: &amp;lt;bool&amp;gt; | default = false ]

  # configures the time the processor will wait since a span is consumed until
  # it&amp;#39;s considered expired if its paired has not been processed.
  #
  # increasing the waiting time will increase the percentage of paired spans.
  # retaining unpaired spans for longer will make reaching max_items more likely.
  [ wait: &amp;lt;duration&amp;gt; | default = 10s ]

  # configures the max amount of edges that will be stored in memory.
  #
  # spans that arrive to the processor that do not pair with an already
  # processed span are dropped.
  #
  # a higher max number of items increases the max throughput of processed spans
  # with a higher memory consumption.
  [ max_items: &amp;lt;integer&amp;gt; | default = 10_000 ]

  # configures the number of workers that will process completed edges concurrently.
  # as edges are completed, they get queued to be collected as metrics for the graph.
  [ workers: &amp;lt;integer&amp;gt; | default = 10 ]

  # configures what status codes are considered as successful (e.g. HTTP 404).
  #
  # by default, a request is considered failed in the following cases:
  #   1. HTTP status is not 2XX
  #   1. gRPC status code is not OK
  #   1. span status is Error
  success_codes:
    # http status codes not to be considered as failure
    http:
      [ - &amp;lt;int&amp;gt; ... ]
    # grpc status codes not to be considered as failure
    grpc:
      [ - &amp;lt;int&amp;gt; ... ]

# jaeger_remote_sampling configures one or more jaeger remote sampling extensions.
# For more details about the configuration please consult the OpenTelemetry documentation:
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.96.0/extension/jaegerremotesampling
#
# Example config:
#
# jaeger_remote_sampling:
#   - source:
#       remote:
#         endpoint: jaeger-collector:14250
#         tls:
#           insecure: true
#   - source:
#       reload_interval: 1s
#       file: /etc/otelcol/sampling_strategies.json
#
jaeger_remote_sampling:
  [ - &amp;lt;jaeger_remote_sampling&amp;gt; ... ]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;More information on the following types can be found on the documentation for their respective projects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.96.0/processor/attributesprocessor&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;attributes.config&lt;/code&gt;: OpenTelemetry-Collector&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector/tree/v0.96.0/processor/batchprocessor&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;batch.config&lt;/code&gt;: OpenTelemetry-Collector&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector/tree/v0.96.0/exporter/otlpexporter&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;otlpexporter.sending_queue&lt;/code&gt;: OpenTelemetry-Collector&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector/tree/v0.96.0/exporter/otlpexporter&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;otlpexporter.retry_on_failure&lt;/code&gt;: OpenTelemetry-Collector&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;receivers&lt;/code&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.96.0/receiver/jaegerreceiver&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;jaegerreceiver&lt;/code&gt;: OpenTelemetry-Collector-Contrib&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.96.0/receiver/kafkareceiver&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;kafkareceiver&lt;/code&gt;: OpenTelemetry-Collector-Contrib&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector/tree/v0.96.0/receiver/otlpreceiver&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;otlpreceiver&lt;/code&gt;: OpenTelemetry-Collector&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.96.0/receiver/opencensusreceiver&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;opencensusreceiver&lt;/code&gt;: OpenTelemetry-Collector-Contrib&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.96.0/receiver/zipkinreceiver&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;zipkinreceiver&lt;/code&gt;: OpenTelemetry-Collector-Contrib&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://prometheus.io/docs/prometheus/2.45/configuration/configuration/#scrape_config&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;scrape_config&lt;/code&gt;: Prometheus&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.96.0/processor/spanmetricsprocessor/config.go#L37-L39&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;spanmetricsprocessor.latency_histogram_buckets&lt;/code&gt;: OpenTelemetry-Collector-Contrib&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.96.0/processor/spanmetricsprocessor/config.go#L41-L48&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;spanmetricsprocessor.dimensions&lt;/code&gt;: OpenTelemetry-Collector-Contrib&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.96.0/processor/tailsamplingprocessor&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;tailsamplingprocessor.policies&lt;/code&gt;: OpenTelemetry-Collector-Contrib&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="traces_config">traces_config&lt;/h1>
&lt;p>The &lt;code>traces_config&lt;/code> block configures a set of Tempo instances, each of which
configures its own tracing pipeline. Having multiple configs allows you to
configure multiple distinct pipelines, each of which collects spans and sends
them to a different location.&lt;/p></description></item><item><title>integrations_config</title><link>https://grafana.com/docs/agent/v0.43/static/configuration/integrations/</link><pubDate>Wed, 11 Sep 2024 17:43:35 +0000</pubDate><guid>https://grafana.com/docs/agent/v0.43/static/configuration/integrations/</guid><content><![CDATA[&lt;h1 id=&#34;integrations_config&#34;&gt;integrations_config&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;integrations_config&lt;/code&gt; block configures how the Agent runs integrations that
scrape and send metrics without needing to run specific Prometheus exporters or
manually write &lt;code&gt;scrape_configs&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;# Controls the Agent integration
agent:
  # Enables the Agent integration, allowing the Agent to automatically
  # collect and send metrics about itself.
  [enabled: &amp;lt;boolean&amp;gt; | default = false]

  # Sets an explicit value for the instance label when the integration is
  # self-scraped. Overrides inferred values.
  #
  # The default value for this integration is inferred from the agent hostname
  # and HTTP listen port, delimited by a colon.
  [instance: &amp;lt;string&amp;gt;]

  # Automatically collect metrics from this integration. If disabled,
  # the agent integration will be run but not scraped and thus not
  # remote_written. Metrics for the integration will be exposed at
  # /integrations/agent/metrics and can be scraped by an external process.
  [scrape_integration: &amp;lt;boolean&amp;gt; | default = &amp;lt;integrations_config.scrape_integrations&amp;gt;]

  # How often should the metrics be collected? Defaults to
  # prometheus.global.scrape_interval.
  [scrape_interval: &amp;lt;duration&amp;gt; | default = &amp;lt;global_config.scrape_interval&amp;gt;]

  # The timeout before considering the scrape a failure. Defaults to
  # prometheus.global.scrape_timeout.
  [scrape_timeout: &amp;lt;duration&amp;gt; | default = &amp;lt;global_config.scrape_timeout&amp;gt;]

  # How frequent to truncate the WAL for this integration.
  [wal_truncate_frequency: &amp;lt;duration&amp;gt; | default = &amp;#34;60m&amp;#34;]

  # Allows for relabeling labels on the target.
  relabel_configs:
    [- &amp;lt;relabel_config&amp;gt; ... ]

  # Relabel metrics coming from the integration, allowing to drop series
  # from the integration that you don&amp;#39;t care about.
  metric_relabel_configs:
    [ - &amp;lt;relabel_config&amp;gt; ... ]

# Client TLS Configuration
# Client Cert/Key Values need to be defined if the server is requesting a certificate
#  (Client Auth Type = RequireAndVerifyClientCert || RequireAnyClientCert).
http_tls_config: &amp;lt;tls_config&amp;gt;

# Controls the apache_http integration
apache_http: &amp;lt;apache_http_config&amp;gt;

# Controls the node_exporter integration
node_exporter: &amp;lt;node_exporter_config&amp;gt;

# Controls the process_exporter integration
process_exporter: &amp;lt;process_exporter_config&amp;gt;

# Controls the mysqld_exporter integration
mysqld_exporter: &amp;lt;mysqld_exporter_config&amp;gt;

# Controls the oracledb integration
oracledb: &amp;lt;oracledb_config&amp;gt;

# Controls the redis_exporter integration
redis_exporter: &amp;lt;redis_exporter_config&amp;gt;

# Controls the dnsmasq_exporter integration
dnsmasq_exporter: &amp;lt;dnsmasq_exporter_config&amp;gt;

# Controls the elasticsearch_exporter integration
elasticsearch_exporter: &amp;lt;elasticsearch_exporter_config&amp;gt;

# Controls the memcached_exporter integration
memcached_exporter: &amp;lt;memcached_exporter_config&amp;gt;

# Controls the mssql integration
mssql: &amp;lt;mssql_config&amp;gt;

# Controls the postgres_exporter integration
postgres_exporter: &amp;lt;postgres_exporter_config&amp;gt;

# Controls the snmp_exporter integration
snmp_exporter: &amp;lt;snmp_exporter_config&amp;gt;

# Controls the snowflake integration
snowflake: &amp;lt;snowflake_config&amp;gt;

# Controls the statsd_exporter integration
statsd_exporter: &amp;lt;statsd_exporter_config&amp;gt;

# Controls the consul_exporter integration
consul_exporter: &amp;lt;consul_exporter_config&amp;gt;

# Controls the windows_exporter integration
windows_exporter: &amp;lt;windows_exporter_config&amp;gt;

# Controls the kafka_exporter integration
kafka_exporter: &amp;lt;kafka_exporter_config&amp;gt;

# Controls the mongodb_exporter integration
mongodb_exporter: &amp;lt;mongodb_exporter_config&amp;gt;

# Controls the github_exporter integration
github_exporter: &amp;lt;github_exporter_config&amp;gt;

# Controls the blackbox_exporter integration
blackbox: &amp;lt;blackbox_config&amp;gt;

# Controls the CloudWatch exporter integration
cloudwatch_exporter: &amp;lt;cloudwatch_exporter_config&amp;gt;

# Controls the azure_exporter integration
azure_exporter: &amp;lt;azure_exporter_config&amp;gt;

# Controls the gcp_exporter integration
gcp_exporter: &amp;lt;gcp_exporter_config&amp;gt;

# Controls the squid integration
squid: &amp;lt;squid_config&amp;gt;

# Automatically collect metrics from enabled integrations. If disabled,
# integrations will be run but not scraped and thus not remote_written. Metrics
# for integrations will be exposed at /integrations/&amp;lt;integration_key&amp;gt;/metrics
# and can be scraped by an external process.
[scrape_integrations: &amp;lt;boolean&amp;gt; | default = true]

# Extra labels to add to all samples coming from integrations.
labels:
  { &amp;lt;string&amp;gt;: &amp;lt;string&amp;gt; }

# The period to wait before restarting an integration that exits with an
# error.
[integration_restart_backoff: &amp;lt;duration&amp;gt; | default = &amp;#34;5s&amp;#34;]

# A list of remote_write targets. Defaults to global_config.remote_write.
# If provided, overrides the global defaults.
prometheus_remote_write:
  - [&amp;lt;remote_write&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="integrations_config">integrations_config&lt;/h1>
&lt;p>The &lt;code>integrations_config&lt;/code> block configures how the Agent runs integrations that
scrape and send metrics without needing to run specific Prometheus exporters or
manually write &lt;code>scrape_configs&lt;/code>:&lt;/p></description></item><item><title>Scraping service (Beta)</title><link>https://grafana.com/docs/agent/v0.43/static/configuration/scraping-service/</link><pubDate>Wed, 11 Sep 2024 17:43:35 +0000</pubDate><guid>https://grafana.com/docs/agent/v0.43/static/configuration/scraping-service/</guid><content><![CDATA[&lt;h1 id=&#34;scraping-service-beta&#34;&gt;Scraping service (Beta)&lt;/h1&gt;
&lt;p&gt;The Grafana Agent scraping service allows you to cluster a set of Agent processes and distribute the scrape load.&lt;/p&gt;
&lt;p&gt;Determining what to scrape is done by writing instance configuration files to an

    &lt;a href=&#34;/docs/agent/v0.43/static/api/&#34;&gt;API&lt;/a&gt;, which then stores the configuration files in a KV store backend.
All agents in the cluster &lt;strong&gt;must&lt;/strong&gt; use the same KV store to see the same set
of configuration files.&lt;/p&gt;
&lt;p&gt;Each process of the Grafana Agent can be running multiple independent
&amp;ldquo;instances&amp;rdquo; at once, where an &amp;ldquo;instance&amp;rdquo; refers to the combination of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Service discovery for all &lt;code&gt;scrape_configs&lt;/code&gt; within that loaded configuration&lt;/li&gt;
&lt;li&gt;Scrapes metrics from all discovered targets&lt;/li&gt;
&lt;li&gt;Stores data in its own Write-Ahead Log specific to the loaded configuration&lt;/li&gt;
&lt;li&gt;Remote Writes scraped metrics to the configured &lt;code&gt;remote_write&lt;/code&gt; destinations
specified within the loaded configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &amp;ldquo;instance configuration file,&amp;rdquo; then, is the configuration file that
specifies the set of &lt;code&gt;scrape_configs&lt;/code&gt; and &lt;code&gt;remote_write&lt;/code&gt; endpoints. For example,
a small instance configuration file looks like this:&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;scrape_configs:
  - job_name: self-scrape
    static_configs:
      - targets: [&amp;#39;localhost:9090&amp;#39;]
        labels:
          process: &amp;#39;agent&amp;#39;
remote_write:
  - url: http://cortex:9009/api/prom/push&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The full set of supported options for an instance configuration file is
available in the

    &lt;a href=&#34;/docs/agent/v0.43/static/configuration/metrics-config/&#34;&gt;&lt;code&gt;metrics-config.md&lt;/code&gt; file&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Multiple instance configuration files are necessary for sharding. Each
config file is distributed to a particular agent on the cluster based on the
hash of its contents.&lt;/p&gt;
&lt;p&gt;When the scraping service is enabled, Agents &lt;strong&gt;disallow&lt;/strong&gt; specifying
instance configurations locally in the configuration file; using the KV store
is required. &lt;a href=&#34;#agentctl&#34;&gt;&lt;code&gt;agentctl&lt;/code&gt;&lt;/a&gt; can be used to manually sync
instance configuration files to the Agent&amp;rsquo;s API server.&lt;/p&gt;
&lt;h2 id=&#34;distributed-hash-ring&#34;&gt;Distributed hash ring&lt;/h2&gt;
&lt;p&gt;The scraping service uses a Distributed Hash Ring (commonly called &amp;ldquo;the
ring&amp;rdquo;) to cluster agents and to shard configurations within that ring. Each
Agent joins the ring with a random distinct set of &lt;em&gt;tokens&lt;/em&gt; that are used for
sharding. The default number of generated tokens is 128.&lt;/p&gt;
&lt;p&gt;The Distributed Hash Ring is also stored in a KV store. Since a KV store is
also needed for storing configuration files, it is encouraged to re-use
the same KV store for the ring.&lt;/p&gt;
&lt;p&gt;When sharding, the Agent currently uses the name of a configuration file
stored in the KV store for load distribution. Configuration names are guaranteed to be
unique keys. The hash of the name is used as the &lt;em&gt;lookup key&lt;/em&gt; in the ring and
determines which agent (based on token) should be responsible for that configuration.
&amp;ldquo;Price is Right&amp;rdquo; rules are used for the Agent lookup; the Agent owning the token
with the closest value to the key without going over is responsible for the
configuration.&lt;/p&gt;
&lt;p&gt;All Agents are simultaneously watching the KV store for changes to the set of
configuration files. When a configuration file is added or updated in the configuration
store, each Agent will run the configuration name hash through their copy of the Hash
Ring to determine if they are responsible for that config.&lt;/p&gt;
&lt;p&gt;When an Agent receives a new configuration that it is responsible for, it launches a
new instance from the instance configuration. If a configuration is deleted from the KV store,
this will be detected by the owning Agent, and it will stop the metric collection
process for that configuration file.&lt;/p&gt;
&lt;p&gt;When an Agent receives an event for an updated configuration file that they used to
be the owner of but are no longer the owner, the associated instance for that
configuration file is stopped for that Agent. This can happen when the cluster
size changes.&lt;/p&gt;
&lt;p&gt;The scraping service currently does not support replication. Only one agent
at a time will be responsible for scraping a certain configuration.&lt;/p&gt;
&lt;h3 id=&#34;resharding&#34;&gt;Resharding&lt;/h3&gt;
&lt;p&gt;When a new Agent joins or leaves the cluster, the set of tokens in the ring may
cause configurations to hash to a new Agent. The process of responding to this
action is called &amp;ldquo;resharding.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Resharding is run:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;When an Agent joins the ring&lt;/li&gt;
&lt;li&gt;When an Agent leaves the ring&lt;/li&gt;
&lt;li&gt;When the KV store sends a notification indicating a configuration has changed.&lt;/li&gt;
&lt;li&gt;On a specified interval if KV change events have not fired.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The resharding process involves each Agent retrieving the full set of
configurations stored in the KV store and determining if:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The configuration owned by the current resharding Agent has changed and needs to
be reloaded.&lt;/li&gt;
&lt;li&gt;The configuration is no longer owned by the current resharding Agent and the
associated instance should be stopped.&lt;/li&gt;
&lt;li&gt;The configuration has been deleted, and the associated instance should be stopped.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;p&gt;Because distribution is determined by the number of configuration files and not how
many targets exist per configuration file, the best amount of distribution is achieved
when each configuration file has the lowest amount of targets possible. The best
distribution will be achieved if each configuration file stored in the KV store is
limited to one static configuration with only one target.&lt;/p&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;Here&amp;rsquo;s an example &lt;code&gt;agent.yaml&lt;/code&gt; configuration file that uses the same &lt;code&gt;etcd&lt;/code&gt; server for
both configuration storage and the distributed hash ring storage:&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;server:
  log_level: debug

metrics:
  global:
    scrape_interval: 1m
  scraping_service:
    enabled: true
    kvstore:
      store: etcd
      etcd:
        endpoints:
          - etcd:2379
    lifecycler:
      ring:
        replication_factor: 1
        kvstore:
          store: etcd
          etcd:
            endpoints:
              - etcd:2379&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Note that there are no instance configurations present in this example; instance
configurations must be passed to the API for the Agent to start scraping metrics.&lt;/p&gt;
&lt;h2 id=&#34;agentctl&#34;&gt;agentctl&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;agentctl&lt;/code&gt; is a tool included with this repository that helps users interact
with the new Config Management API. The &lt;code&gt;agentctl config-sync&lt;/code&gt; subcommand uses
local YAML files as a source of truth and syncs their contents with the API.
Entries in the API not in the synced directory will be deleted.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;agentctl&lt;/code&gt; is distributed in binary form with each release and as a Docker
container with the &lt;code&gt;grafana/agentctl&lt;/code&gt; image. Tanka configurations that
utilize &lt;code&gt;grafana/agentctl&lt;/code&gt; and sync a set of configurations to the API
are planned for the future.&lt;/p&gt;
&lt;h2 id=&#34;debug-ring-endpoint&#34;&gt;Debug Ring endpoint&lt;/h2&gt;
&lt;p&gt;You can use the &lt;code&gt;/debug/ring&lt;/code&gt; endpoint to troubleshoot issues with the scraping service in Scraping Service Mode.
It provides information about the Distributed Hash Ring and the current distribution of configurations among Agents in the cluster.
It also allows you to forget an instance in the ring manually.&lt;/p&gt;
&lt;p&gt;You can access this endpoint by making an HTTP request to the Agent&amp;rsquo;s API server.&lt;/p&gt;
&lt;p&gt;Information returned by the &lt;code&gt;/debug/ring&lt;/code&gt; endpoint includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The list of Agents in the cluster, and their respective tokens used for sharding.&lt;/li&gt;
&lt;li&gt;The list of configuration files in the KV store and associated hash values used for lookup in the ring.&lt;/li&gt;
&lt;li&gt;The unique instance ID assigned to each instance of the Agent running in the cluster.
The instance ID is a unique identifier assigned to each running instance of the Agent within the cluster.
The exact details of the instance ID generation might be specific to the implementation of the Grafana Agent.&lt;/li&gt;
&lt;li&gt;The time of the &amp;ldquo;Last Heartbeat&amp;rdquo; of each instance. The Last Heartbeat is the last time the instance was active in the ring.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="scraping-service-beta">Scraping service (Beta)&lt;/h1>
&lt;p>The Grafana Agent scraping service allows you to cluster a set of Agent processes and distribute the scrape load.&lt;/p>
&lt;p>Determining what to scrape is done by writing instance configuration files to an
&lt;a href="/docs/agent/v0.43/static/api/">API&lt;/a>, which then stores the configuration files in a KV store backend.
All agents in the cluster &lt;strong>must&lt;/strong> use the same KV store to see the same set
of configuration files.&lt;/p></description></item><item><title>Agent Management - Experimental</title><link>https://grafana.com/docs/agent/v0.43/static/configuration/agent-management/</link><pubDate>Wed, 11 Sep 2024 17:43:35 +0000</pubDate><guid>https://grafana.com/docs/agent/v0.43/static/configuration/agent-management/</guid><content><![CDATA[&lt;h1 id=&#34;agent-management---experimental&#34;&gt;Agent Management - Experimental&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Agent Management is under active development. Backwards incompatible changes to its API are to be expected. Feedback is much appreciated. This is a feature that MAY NOT make it production.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Agent Management enables centralized management of fleets of Grafana Agents.&lt;/p&gt;
&lt;p&gt;In this mode, Grafana Agent polls and dynamically reloads its configuration from a remote API server.&lt;/p&gt;
&lt;p&gt;Remote Configurations are composed of a base configuration and a set of snippets. Snippets are applied conditionally via label matching.&lt;/p&gt;
&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;Agent Management can be used by passing the flag &lt;code&gt;-enable-features=agent-management&lt;/code&gt;. When enabled, the file referred to &lt;code&gt;-config.file&lt;/code&gt; will be loaded as an agent management configuration file.&lt;/p&gt;
&lt;p&gt;Agent Management configuration files are YAML documents which conform the following schema:&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;# Agent Management configuration.
agent_management:
  # Host of the API server to connect to.
  host: &amp;lt;string&amp;gt;

  # Protocol to use when connecting to the API server (http|https).
  protocol: &amp;lt;string&amp;gt;

  # The polling interval for fetching the configuration.
  polling_interval: &amp;lt;string&amp;gt;

  # Sets the `Authorization` header on every request with the
  # configured username and password.
  basic_auth:
    [ username: &amp;lt;string&amp;gt; ]
    [ password_file: &amp;lt;string&amp;gt; ]

  # Optional proxy URL.
  [ proxy_url: &amp;lt;string&amp;gt; ]

  # Comma-separated string that can contain IPs, CIDR notation, domain names
  # that should be excluded from proxying. IP and domain names can
  # contain port numbers.
  [ no_proxy: &amp;lt;string&amp;gt; ]

  # Use proxy URL indicated by environment variables (HTTP_PROXY, https_proxy, HTTPs_PROXY, https_proxy, and no_proxy)
  [ proxy_from_environment: &amp;lt;boolean&amp;gt; | default: false ]

  # Specifies headers to send to proxies during CONNECT requests.
  [ proxy_connect_header:
    [ &amp;lt;string&amp;gt;: [&amp;lt;secret&amp;gt;, ...] ] ]

  # Fields specific to remote configuration.
  remote_configuration:
    # A path to a directory where the remote configuration will be cached. The directory must be writeable.
    cache_location: &amp;lt;string&amp;gt;

    # The namespace to use.
    namespace: &amp;lt;string&amp;gt;

    # Set of self-identifying labels used for snippet selection.
    labels:
      [ &amp;lt;labelname&amp;gt;: &amp;lt;labelvalue&amp;gt; ... ]

    # Whether to use labels from the label management service. If enabled, labels from the API supersede the ones configured in the agent. The agent_id field must be defined.
    label_management_enabled: &amp;lt;bool&amp;gt; | default = false

    # A unique ID for the agent, which is used to identify the agent.
    agent_id: &amp;lt;string&amp;gt;

    # Whether to accept HTTP 304 Not Modified responses from the API server. If enabled, the agent will use the cached configuration if the API server responds with HTTP 304 Not Modified. You can set this argument to `false` for debugging or testing.
    accept_http_not_modified: &amp;lt;bool&amp;gt; | default = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;api&#34;&gt;API&lt;/h2&gt;
&lt;p&gt;Grafana Agents with Agent Management enabled continuously poll the API server for an up-to-date configuration. The API server is expected to implement a &lt;code&gt;GET /agent-management/api/agent/v2/namespace/:namespace/remote_config&lt;/code&gt; HTTP endpoint returning a successful response with the following body 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;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 base configuration for the Agent.
base_config: |
  &amp;lt;grafana_agent_config&amp;gt;
# A set of snippets to be conditionally merged into the base configuration.
snippets:
  [ &amp;lt;snippet_name&amp;gt;: &amp;lt;snippet_content&amp;gt; ... ]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;grafana_agent_config&#34;&gt;grafana_agent_config&lt;/h3&gt;
&lt;p&gt;This is a standard Grafana Agent &lt;a href=&#34;/docs/agent/latest/static/configuration/&#34;&gt;static mode configuration&lt;/a&gt;. Typically used to configure the server, remote_writes, and other global configuration.&lt;/p&gt;
&lt;h3 id=&#34;snippet_content&#34;&gt;snippet_content&lt;/h3&gt;
&lt;p&gt;The snippet content is a YAML document which conforms to the following schema:&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;# Config provides the actual snippet configuration.
config: |
  [metrics_scrape_configs]:
  - [&amp;lt;scrape_config&amp;gt; ... ]
  [logs_scrape_configs]:
  - [&amp;lt;promtail.scrape_config&amp;gt; ... ]
  [integration_configs]:
    [&amp;lt;integrations_config&amp;gt; ... ]
# Selector is a set of labels used to decide which snippets to apply to the final configuration.
selector:
  [ &amp;lt;labelname&amp;gt;: &amp;lt;labelvalue&amp;gt; ... ]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; More information on the following types can be found in their respective documentation pages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://prometheus.io/docs/prometheus/2.45/configuration/configuration/#scrape_config&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;scrape_config&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/loki/latest/clients/promtail/configuration/#scrape_configs&#34;&gt;&lt;code&gt;promtail.scrape_config&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/agent/latest/static/configuration/integrations/&#34;&gt;&lt;code&gt;integrations_config&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Snippet selection is currently done in the API server. This behaviour is subject to change in the future.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h3 id=&#34;example-response-body&#34;&gt;Example response body&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;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_config: |
  server:
    log_level: info
  metrics:
    global:
      remote_write:
        - basic_auth:
            password_file: key.txt
            username: 123
          url: https://myserver.com/api/prom/push
  logs:
    positions_directory: /var/lib/grafana-agent
    global:
      clients:
        - basic_auth:
            password_file: key.txt
            username: 456
          url: https://myserver.com/loki/api/v1/push
snippets:
  snip1:
    config: |
      metrics_scrape_configs:
      - job_name: &amp;#39;prometheus&amp;#39;
        scrape_interval: 60s
        static_configs:
        - targets: [&amp;#39;localhost:9090&amp;#39;]
      logs_scrape_configs:
      - job_name: &amp;#39;loki&amp;#39;
        static_configs:
        - targets: [&amp;#39;localhost:3100&amp;#39;]
      integration_configs:
        node_exporter:
          enabled: true
    selector:
      os: linux
      app: app1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Base configurations and snippets can contain go&amp;rsquo;s &lt;a href=&#34;https://pkg.go.dev/text/template&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;text/template&lt;/a&gt; actions. If you need preserve the literal value of a template action, you can escape it using backticks. For example:&lt;/p&gt;&lt;/blockquote&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&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&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;{{ `{{ .template_var }}` }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="agent-management---experimental">Agent Management - Experimental&lt;/h1>
&lt;p>&lt;strong>Agent Management is under active development. Backwards incompatible changes to its API are to be expected. Feedback is much appreciated. This is a feature that MAY NOT make it production.&lt;/strong>&lt;/p></description></item></channel></rss>