<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>The Grafana Alloy command-line interface on Grafana Labs</title><link>https://grafana.com/docs/alloy/v1.15/reference/cli/</link><description>Recent content in The Grafana Alloy command-line interface on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/alloy/v1.15/reference/cli/index.xml" rel="self" type="application/rss+xml"/><item><title>convert</title><link>https://grafana.com/docs/alloy/v1.15/reference/cli/convert/</link><pubDate>Mon, 30 Mar 2026 15:47:22 +0000</pubDate><guid>https://grafana.com/docs/alloy/v1.15/reference/cli/convert/</guid><content><![CDATA[&lt;h1 id=&#34;convert&#34;&gt;&lt;code&gt;convert&lt;/code&gt;&lt;/h1&gt;


&lt;div data-shared=&#34;stability/public_preview.md&#34;&gt;
            &lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Public preview&lt;/strong&gt;: This is a &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;public preview&lt;/a&gt; component.
Public preview components are subject to breaking changes, and may be replaced with equivalent functionality that cover the same use case.
To enable and use a public preview component, you must set the &lt;code&gt;stability.level&lt;/code&gt; 
    &lt;a href=&#34;/docs/alloy/v1.15/reference/cli/run/&#34;&gt;flag&lt;/a&gt; to &lt;code&gt;public-preview&lt;/code&gt; or below.&lt;/p&gt;&lt;/blockquote&gt;
&lt;/div&gt;

        
&lt;p&gt;The &lt;code&gt;convert&lt;/code&gt; command converts a supported configuration format to the Alloy configuration format.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&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;shell&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-shell&#34;&gt;alloy convert [&amp;lt;FLAG&amp;gt; ...] &amp;lt;FILE_NAME&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;FLAG&amp;gt;&lt;/code&gt;&lt;/em&gt;: One or more flags that define the input and output of the command.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;FILE_NAME&amp;gt;&lt;/code&gt;&lt;/em&gt;: The Alloy configuration file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the &lt;em&gt;&lt;code&gt;&amp;lt;FILE_NAME&amp;gt;&lt;/code&gt;&lt;/em&gt; argument isn&amp;rsquo;t provided or if the &lt;em&gt;&lt;code&gt;&amp;lt;FILE_NAME&amp;gt;&lt;/code&gt;&lt;/em&gt; argument is equal to &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;convert&lt;/code&gt; converts the contents of standard input.
Otherwise, &lt;code&gt;convert&lt;/code&gt; reads and converts the file from disk specified by the argument.&lt;/p&gt;
&lt;p&gt;There are several different flags available for the &lt;code&gt;convert&lt;/code&gt; command. You can use the &lt;code&gt;--output&lt;/code&gt; flag to write the contents of the converted configuration to a specified path.
You can use the &lt;code&gt;--report&lt;/code&gt; flag to generate a diagnostic report.
The &lt;code&gt;--bypass-errors&lt;/code&gt; flag allows you to bypass any &lt;a href=&#34;#errors&#34;&gt;errors&lt;/a&gt; generated during the file conversion.&lt;/p&gt;
&lt;p&gt;The command fails if the source configuration has syntactically incorrect configuration or can&amp;rsquo;t be converted to an Alloy configuration.&lt;/p&gt;
&lt;p&gt;The following flags are supported:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--output&lt;/code&gt;, &lt;code&gt;-o&lt;/code&gt;: The filepath and filename where the output is written.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--report&lt;/code&gt;, &lt;code&gt;-r&lt;/code&gt;: The filepath and filename where the report is written.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--source-format&lt;/code&gt;, &lt;code&gt;-f&lt;/code&gt;: Required. The format of the source file. Supported formats: &lt;a href=&#34;#opentelemetry-collector&#34;&gt;&lt;code&gt;otelcol&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;#prometheus&#34;&gt;&lt;code&gt;prometheus&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;#promtail&#34;&gt;&lt;code&gt;promtail&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;#static&#34;&gt;&lt;code&gt;static&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--bypass-errors&lt;/code&gt;, &lt;code&gt;-b&lt;/code&gt;: Enable bypassing errors when converting.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--extra-args&lt;/code&gt;, &lt;code&gt;-e&lt;/code&gt;: Extra arguments from the original format used by the converter.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;defaults&#34;&gt;Defaults&lt;/h3&gt;
&lt;p&gt;Alloy defaults are managed as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If a provided source configuration value matches an Alloy default value, the property is left off the output.&lt;/li&gt;
&lt;li&gt;If a non-provided source configuration value default matches an Alloy default value, the property is left off the output.&lt;/li&gt;
&lt;li&gt;If a non-provided source configuration value default doesn&amp;rsquo;t match an Alloy default value, the default value is included in the output.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;errors&#34;&gt;Errors&lt;/h3&gt;
&lt;p&gt;Errors are defined as non-critical issues identified during the conversion where an output can still be generated.
You can use the &lt;code&gt;--bypass-errors&lt;/code&gt; flag to bypass these errors.&lt;/p&gt;
&lt;h3 id=&#34;opentelemetry-collector&#34;&gt;OpenTelemetry Collector&lt;/h3&gt;
&lt;p&gt;You can use the &lt;code&gt;--source-format=otelcol&lt;/code&gt; to convert the source configuration from an &lt;a href=&#34;https://opentelemetry.io/docs/collector/configuration/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Collector&lt;/a&gt; to a Alloy configuration.&lt;/p&gt;
&lt;p&gt;Many OpenTelemetry Collector components are supported.
Review the &lt;code&gt;otelcol.*&lt;/code&gt; component information in the &lt;a href=&#34;../../components/otelcol/&#34;&gt;Component Reference&lt;/a&gt; for more information about &lt;code&gt;otelcol&lt;/code&gt; components that you can convert.
If a source configuration has unsupported features, you will receive &lt;a href=&#34;#errors&#34;&gt;errors&lt;/a&gt; when you convert it to an Alloy configuration.
The converter raises warnings for configuration options that may require your attention.&lt;/p&gt;
&lt;p&gt;Refer to &lt;a href=&#34;../../../set-up/migrate/from-otelcol/&#34;&gt;Migrate from OpenTelemetry Collector to Alloy&lt;/a&gt; for a detailed migration guide.&lt;/p&gt;
&lt;h3 id=&#34;prometheus&#34;&gt;Prometheus&lt;/h3&gt;
&lt;p&gt;Using the &lt;code&gt;--source-format=prometheus&lt;/code&gt; will convert the source configuration from &lt;a href=&#34;https://prometheus.io/docs/prometheus/2.45/configuration/configuration/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus v2.45&lt;/a&gt; to an Alloy configuration.&lt;/p&gt;
&lt;p&gt;This includes Prometheus features such as &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;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;a href=&#34;https://prometheus.io/docs/prometheus/2.45/configuration/configuration/#metric_relabel_configs&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;metric_relabel_configs&lt;/code&gt;&lt;/a&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;, and many supported &lt;code&gt;*_sd_configs&lt;/code&gt;.
Unsupported features in a source configuration result in &lt;a href=&#34;#errors&#34;&gt;errors&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Refer to &lt;a href=&#34;../../../set-up/migrate/from-prometheus/&#34;&gt;Migrate from Prometheus to Alloy&lt;/a&gt; for a detailed migration guide.&lt;/p&gt;
&lt;h3 id=&#34;promtail&#34;&gt;Promtail&lt;/h3&gt;
&lt;p&gt;Using the &lt;code&gt;--source-format=promtail&lt;/code&gt; will convert the source configuration from &lt;a href=&#34;/docs/loki/v2.8.x/clients/promtail/&#34;&gt;Promtail v2.8.x&lt;/a&gt; to an Alloy configuration.&lt;/p&gt;
&lt;p&gt;Nearly all &lt;a href=&#34;/docs/loki/v2.8.x/clients/promtail/configuration/&#34;&gt;Promtail features&lt;/a&gt; are supported and can be converted to Alloy configuration.&lt;/p&gt;
&lt;p&gt;If you have unsupported features in a source configuration, you will receive &lt;a href=&#34;#errors&#34;&gt;errors&lt;/a&gt; when you convert to an Alloy configuration.
The converter will also raise warnings for configuration options that may require your attention.&lt;/p&gt;
&lt;p&gt;Refer to &lt;a href=&#34;../../../set-up/migrate/from-promtail/&#34;&gt;Migrate from Promtail to Alloy&lt;/a&gt; for a detailed migration guide.&lt;/p&gt;
&lt;h3 id=&#34;static&#34;&gt;Static&lt;/h3&gt;
&lt;p&gt;Using the &lt;code&gt;--source-format=static&lt;/code&gt; will convert the source configuration from a &lt;a href=&#34;/docs/agent/latest/static/&#34;&gt;Grafana Agent Static&lt;/a&gt; configuration to an Alloy configuration.&lt;/p&gt;
&lt;p&gt;Include &lt;code&gt;--extra-args&lt;/code&gt; for passing additional command line flags from the original format.
For example, &lt;code&gt;--extra-args=&amp;quot;-enable-features=integrations-next&amp;quot;&lt;/code&gt; converts a Grafana Agent Static &lt;a href=&#34;/docs/agent/latest/static/configuration/integrations/integrations-next/&#34;&gt;integrations-next&lt;/a&gt; configuration to an Alloy configuration.
You can also expand environment variables with &lt;code&gt;--extra-args=&amp;quot;-config.expand-env&amp;quot;&lt;/code&gt;.
You can combine multiple command line flags with a space between each flag, for example &lt;code&gt;--extra-args=&amp;quot;-enable-features=integrations-next -config.expand-env&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you have unsupported features in a Grafana Agent Static mode source configuration, you will receive &lt;a href=&#34;#errors&#34;&gt;errors&lt;/a&gt; when you convert to an Alloy configuration.
The converter also raises warnings for configuration options that may require your attention.&lt;/p&gt;
&lt;p&gt;Refer to &lt;a href=&#34;../../../set-up/migrate/from-static/&#34;&gt;Migrate from Grafana Agent Static to Alloy&lt;/a&gt; for a detailed migration guide.&lt;/p&gt;
]]></content><description>&lt;h1 id="convert">&lt;code>convert&lt;/code>&lt;/h1>
&lt;div data-shared="stability/public_preview.md">
&lt;blockquote>
&lt;p>&lt;strong>Public preview&lt;/strong>: This is a &lt;a href="/docs/release-life-cycle/">public preview&lt;/a> component.
Public preview components are subject to breaking changes, and may be replaced with equivalent functionality that cover the same use case.
To enable and use a public preview component, you must set the &lt;code>stability.level&lt;/code>
&lt;a href="/docs/alloy/v1.15/reference/cli/run/">flag&lt;/a> to &lt;code>public-preview&lt;/code> or below.&lt;/p></description></item><item><title>fmt</title><link>https://grafana.com/docs/alloy/v1.15/reference/cli/fmt/</link><pubDate>Mon, 30 Mar 2026 15:47:22 +0000</pubDate><guid>https://grafana.com/docs/alloy/v1.15/reference/cli/fmt/</guid><content><![CDATA[&lt;h1 id=&#34;fmt&#34;&gt;&lt;code&gt;fmt&lt;/code&gt;&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;fmt&lt;/code&gt; command formats a given Alloy configuration file.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&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;shell&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-shell&#34;&gt;alloy fmt [&amp;lt;FLAG&amp;gt; ...] &amp;lt;FILE_NAME&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;FLAG&amp;gt;&lt;/code&gt;&lt;/em&gt;: One or more flags that define the input and output of the command.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;FILE_NAME&amp;gt;&lt;/code&gt;&lt;/em&gt;: The Alloy configuration file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the &lt;em&gt;&lt;code&gt;&amp;lt;FILE_NAME&amp;gt;&lt;/code&gt;&lt;/em&gt; argument isn&amp;rsquo;t provided or if the &lt;em&gt;&lt;code&gt;&amp;lt;FILE_NAME&amp;gt;&lt;/code&gt;&lt;/em&gt; argument is equal to &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;fmt&lt;/code&gt; formats the contents of standard input.
Otherwise, &lt;code&gt;fmt&lt;/code&gt; reads and formats the file from disk specified by the argument.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;--write&lt;/code&gt; flag can be specified to replace the contents of the original file on disk with the formatted results.
&lt;code&gt;--write&lt;/code&gt; can only be provided when &lt;code&gt;fmt&lt;/code&gt; isn&amp;rsquo;t reading from standard input.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;--test&lt;/code&gt; flag can be specified to test if the contents of the file are formatted correctly.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;--write&lt;/code&gt; and &lt;code&gt;--test&lt;/code&gt; flags are mutually exclusive.&lt;/p&gt;
&lt;p&gt;The command fails if the file being formatted has syntactically incorrect Alloy configuration, but doesn&amp;rsquo;t validate whether Alloy components are configured properly.&lt;/p&gt;
&lt;p&gt;The following flags are supported:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--write&lt;/code&gt;, &lt;code&gt;-w&lt;/code&gt;: Write the formatted file back to disk when not reading from standard input.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--test&lt;/code&gt;, &lt;code&gt;-t&lt;/code&gt;: Only test the input and return a non-zero exit code if changes would have been made.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="fmt">&lt;code>fmt&lt;/code>&lt;/h1>
&lt;p>The &lt;code>fmt&lt;/code> command formats a given Alloy configuration file.&lt;/p>
&lt;h2 id="usage">Usage&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">shell&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-shell">alloy fmt [&amp;lt;FLAG&amp;gt; ...] &amp;lt;FILE_NAME&amp;gt;&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>Replace the following:&lt;/p></description></item><item><title>run</title><link>https://grafana.com/docs/alloy/v1.15/reference/cli/run/</link><pubDate>Mon, 30 Mar 2026 15:47:22 +0000</pubDate><guid>https://grafana.com/docs/alloy/v1.15/reference/cli/run/</guid><content><![CDATA[&lt;h1 id=&#34;run&#34;&gt;&lt;code&gt;run&lt;/code&gt;&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;run&lt;/code&gt; command runs the Alloy Default Engine in the foreground until an interrupt is received.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&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;shell&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-shell&#34;&gt;alloy run [&amp;lt;FLAG&amp;gt; ...] &amp;lt;PATH_NAME&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;FLAG&amp;gt;&lt;/code&gt;&lt;/em&gt;: One or more flags that define the input and output of the command.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;PATH_NAME&amp;gt;&lt;/code&gt;&lt;/em&gt;: Required. The Alloy configuration file or directory path.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the &lt;em&gt;&lt;code&gt;&amp;lt;PATH_NAME&amp;gt;&lt;/code&gt;&lt;/em&gt; argument isn&amp;rsquo;t provided, or if the configuration path can&amp;rsquo;t be loaded or contains errors during the initial load, the &lt;code&gt;run&lt;/code&gt; command immediately exits and shows an error message.&lt;/p&gt;
&lt;p&gt;If you provide a directory path for  the &lt;em&gt;&lt;code&gt;&amp;lt;PATH_NAME&amp;gt;&lt;/code&gt;&lt;/em&gt;, Alloy finds &lt;code&gt;*.alloy&lt;/code&gt; files, ignoring nested directories, and loads them as a single configuration source.
However, component names must be &lt;strong&gt;unique&lt;/strong&gt; across all Alloy configuration files, and configuration blocks must not be repeated.&lt;/p&gt;
&lt;p&gt;Alloy continues to run if subsequent reloads of the configuration file fail, potentially marking components as unhealthy depending on the nature of the failure.
When this happens, Alloy continues functioning in the last valid state.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;run&lt;/code&gt; launches an HTTP server that exposes metrics about itself and its components.
The HTTP server is also exposes a UI at &lt;code&gt;/&lt;/code&gt; for debugging running components.&lt;/p&gt;
&lt;p&gt;The following flags are supported:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--server.http.enable-pprof&lt;/code&gt;: Enable &lt;a href=&#34;http://pkg.go.dev/net/http/pprof&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;/debug/pprof&lt;/code&gt;&lt;/a&gt; profiling endpoints. (default &lt;code&gt;true&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--server.http.memory-addr&lt;/code&gt;: Address to listen for &lt;a href=&#34;../../../get-started/component_controller/#in-memory-traffic&#34;&gt;in-memory HTTP traffic&lt;/a&gt; on (default &lt;code&gt;&amp;quot;alloy.internal:12345&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--server.http.listen-addr&lt;/code&gt;: Address to listen for HTTP traffic on (default &lt;code&gt;&amp;quot;127.0.0.1:12345&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--server.http.ui-path-prefix&lt;/code&gt;: Base path where the UI is exposed (default &lt;code&gt;&amp;quot;/&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--storage.path&lt;/code&gt;: Base directory where components can store data (default &lt;code&gt;&amp;quot;data-alloy/&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--disable-reporting&lt;/code&gt;: Disable &lt;a href=&#34;../../../data-collection/&#34;&gt;data collection&lt;/a&gt; (default &lt;code&gt;false&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--disable-support-bundle&lt;/code&gt;: Disable &lt;a href=&#34;../../../troubleshoot/support_bundle/&#34;&gt;support bundle&lt;/a&gt; endpoint (default &lt;code&gt;false&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.enabled&lt;/code&gt;: Start Alloy in clustered mode (default &lt;code&gt;false&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.node-name&lt;/code&gt;: The name to use for this node (defaults to the environment&amp;rsquo;s hostname).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.join-addresses&lt;/code&gt;: Comma-separated list of addresses to join the cluster at (default &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;). Mutually exclusive with &lt;code&gt;--cluster.discover-peers&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.discover-peers&lt;/code&gt;: List of key-value tuples for discovering peers (default &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;). Mutually exclusive with &lt;code&gt;--cluster.join-addresses&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.rejoin-interval&lt;/code&gt;: How often to rejoin the list of peers (default &lt;code&gt;&amp;quot;60s&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.advertise-address&lt;/code&gt;: Address to advertise to other cluster nodes (default &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.advertise-interfaces&lt;/code&gt;: List of interfaces used to infer an address to advertise. Set to &lt;code&gt;all&lt;/code&gt; to use all available network interfaces on the system. (default &lt;code&gt;&amp;quot;eth0,en0&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.max-join-peers&lt;/code&gt;: Number of peers to join from the discovered set (default &lt;code&gt;5&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.name&lt;/code&gt;: Name to prevent nodes without this identifier from joining the cluster (default &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.enable-tls&lt;/code&gt;: Specifies whether TLS should be used for communication between peers (default &lt;code&gt;false&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.tls-ca-path&lt;/code&gt;: Path to the CA certificate file used for peer communication over TLS.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.tls-cert-path&lt;/code&gt;: Path to the certificate file used for peer communication over TLS.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.tls-key-path&lt;/code&gt;: Path to the key file used for peer communication over TLS.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.tls-server-name&lt;/code&gt;: Server name used for peer communication over TLS.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.wait-for-size&lt;/code&gt;: Wait for the cluster to reach the specified number of instances before allowing components that use clustering to begin processing. Zero means disabled (default &lt;code&gt;0&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--cluster.wait-timeout&lt;/code&gt;: Maximum duration to wait for minimum cluster size before proceeding with available nodes. Zero means wait forever, no timeout (default &lt;code&gt;0&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--config.format&lt;/code&gt;: Specifies the source file format. Supported formats: &lt;code&gt;alloy&lt;/code&gt;, &lt;code&gt;otelcol&lt;/code&gt;, &lt;code&gt;prometheus&lt;/code&gt;, &lt;code&gt;promtail&lt;/code&gt;, and &lt;code&gt;static&lt;/code&gt; (default &lt;code&gt;&amp;quot;alloy&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--config.bypass-conversion-errors&lt;/code&gt;: Enable bypassing errors during conversion (default &lt;code&gt;false&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--config.extra-args&lt;/code&gt;: Extra arguments from the original format used by the converter.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--stability.level&lt;/code&gt;: The minimum permitted stability level of functionality. Supported values: &lt;code&gt;experimental&lt;/code&gt;, &lt;code&gt;public-preview&lt;/code&gt;, and &lt;code&gt;generally-available&lt;/code&gt; (default &lt;code&gt;&amp;quot;generally-available&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--feature.community-components.enabled&lt;/code&gt;: Enable community components (default &lt;code&gt;false&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--feature.component-shutdown-deadline&lt;/code&gt;: Maximum duration to wait for a component to shut down before giving up and logging an error (default &lt;code&gt;&amp;quot;10m&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--feature.prometheus.direct-fanout.enabled&lt;/code&gt;: Enable experimental direct fanout for metric forwarding without a global label store.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--windows.priority&lt;/code&gt;: The priority to set for the Alloy process when running on Windows. This is only available on Windows. Supported values: &lt;code&gt;above_normal&lt;/code&gt;, &lt;code&gt;below_normal&lt;/code&gt;, &lt;code&gt;normal&lt;/code&gt;, &lt;code&gt;high&lt;/code&gt;, &lt;code&gt;idle&lt;/code&gt;, or &lt;code&gt;realtime&lt;/code&gt; (default &lt;code&gt;&amp;quot;normal&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The &lt;code&gt;--feature.prometheus.direct-fanout.enabled&lt;/code&gt; flag is an &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;experimental&lt;/a&gt; feature.
Experimental features are subject to frequent breaking changes, and may be removed with no equivalent replacement.
To enable and use an experimental feature, you must set the &lt;code&gt;stability.level&lt;/code&gt; &lt;a href=&#34;#permitted-stability-levels&#34;&gt;flag&lt;/a&gt; to &lt;code&gt;experimental&lt;/code&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;



&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The &lt;code&gt;--windows.priority&lt;/code&gt; flag is in &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;Public preview&lt;/a&gt; and is not covered by Grafana Alloy &lt;a href=&#34;../../../introduction/backward-compatibility/&#34;&gt;backward compatibility&lt;/a&gt; guarantees.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;deprecated-flags&#34;&gt;Deprecated flags&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--feature.prometheus.metric-validation-scheme&lt;/code&gt;: This flag is deprecated and has no effect. You can configure the metric validation scheme individually for each &lt;code&gt;prometheus.scrape&lt;/code&gt; component in your Alloy configuration file.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;update-the-configuration-file&#34;&gt;Update the configuration file&lt;/h2&gt;
&lt;p&gt;The configuration file can be reloaded from disk by either:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sending an HTTP POST request to the &lt;code&gt;/-/reload&lt;/code&gt; endpoint.&lt;/li&gt;
&lt;li&gt;Sending a &lt;code&gt;SIGHUP&lt;/code&gt; signal to the Alloy process.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When this happens, the &lt;a href=&#34;../../../get-started/component_controller/&#34;&gt;component controller&lt;/a&gt; synchronizes the set of running components with the latest set of components specified in the configuration file.
Components that are no longer defined in the configuration file after reloading are shut down, and components that have been added to the configuration file since the previous reload are created.&lt;/p&gt;
&lt;p&gt;All components managed by the component controller are reevaluated after reloading.&lt;/p&gt;
&lt;h2 id=&#34;permitted-stability-levels&#34;&gt;Permitted stability levels&lt;/h2&gt;
&lt;p&gt;By default, Alloy only allows you to use functionality that is marked &lt;em&gt;Generally available&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;To use &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;Experimental&lt;/a&gt; or &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;Public preview&lt;/a&gt; functionality, set the &lt;code&gt;--stability.level&lt;/code&gt; flag to the level you want to use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--stability.level=experimental&lt;/code&gt;: Use functionality marked as &lt;em&gt;Experimental&lt;/em&gt; and above.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--stability.level=public-preview&lt;/code&gt;: Use functionality marked as &lt;em&gt;Public preview&lt;/em&gt; and above.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--stability.level=generally-available&lt;/code&gt;: Use functionality marked as &lt;em&gt;Generally available&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;Setting &lt;code&gt;--stability.level&lt;/code&gt; to &lt;code&gt;experimental&lt;/code&gt; or &lt;code&gt;public-preview&lt;/code&gt; may enable &lt;em&gt;Experimental&lt;/em&gt; or &lt;em&gt;Public preview&lt;/em&gt; behavior for items otherwise marked &lt;em&gt;Generally available&lt;/em&gt;, such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The component controller&lt;/li&gt;
&lt;li&gt;Components in the main configuration or in imported modules&lt;/li&gt;
&lt;li&gt;Configuration blocks in the main configuration&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Refer to &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;Release life cycle for Grafana Labs&lt;/a&gt; for the definition of each stability level.&lt;/p&gt;
&lt;h2 id=&#34;clustering&#34;&gt;Clustering&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;--cluster.enabled&lt;/code&gt; command-line argument starts Alloy in &lt;a href=&#34;../../../get-started/clustering/&#34;&gt;clustering&lt;/a&gt; mode.
The rest of the &lt;code&gt;--cluster.*&lt;/code&gt; command-line flags can be used to configure how nodes discover and connect to one another.&lt;/p&gt;
&lt;p&gt;Each cluster member&amp;rsquo;s name must be unique within the cluster.
Nodes which try to join with a conflicting name are rejected and fall back to bootstrapping a new cluster of their own.&lt;/p&gt;
&lt;p&gt;Peers communicate over HTTP/2 on the built-in HTTP server.
Each node must be configured to accept connections on &lt;code&gt;--server.http.listen-addr&lt;/code&gt; and the address defined or inferred in &lt;code&gt;--cluster.advertise-address&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If the &lt;code&gt;--cluster.advertise-address&lt;/code&gt; flag isn&amp;rsquo;t explicitly set, Alloy tries to infer a suitable one from &lt;code&gt;--cluster.advertise-interfaces&lt;/code&gt;.
If &lt;code&gt;--cluster.advertise-interfaces&lt;/code&gt; isn&amp;rsquo;t explicitly set, Alloy infers one from the &lt;code&gt;eth0&lt;/code&gt; and &lt;code&gt;en0&lt;/code&gt; local network interfaces.
Alloy will fail to start if it can&amp;rsquo;t determine the advertised address.
Since Windows doesn&amp;rsquo;t use the interface names &lt;code&gt;eth0&lt;/code&gt; or &lt;code&gt;en0&lt;/code&gt;, Windows users must explicitly pass at least one valid network interface for &lt;code&gt;--cluster.advertise-interfaces&lt;/code&gt; or a value for &lt;code&gt;--cluster.advertise-address&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The comma-separated list of addresses provided in &lt;code&gt;--cluster.join-addresses&lt;/code&gt; can either be IP addresses or DNS names to lookup (supports SRV and A/AAAA records).
In both cases, the port number can be specified with a &lt;code&gt;:&amp;lt;port&amp;gt;&lt;/code&gt; suffix. If ports aren&amp;rsquo;t provided, default of the port used for the HTTP listener is used.
If you don&amp;rsquo;t provide the port number explicitly, you must ensure that all instances use the same port for the HTTP listener.
Optionally, you may specify a DNS query type as a prefix for each address. See &lt;a href=&#34;#join-address-format&#34;&gt;join addresses format&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;--cluster.enable-tls&lt;/code&gt; flag can be set to enable TLS for peer-to-peer communications.
Additional arguments are required to configure the TLS client, including the CA certificate, the TLS certificate, the key, and the server name.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;--cluster.discover-peers&lt;/code&gt; command-line flag expects a list of tuples in the form of &lt;code&gt;provider=XXX key=val key=val ...&lt;/code&gt;.
Clustering uses the &lt;a href=&#34;https://github.com/hashicorp/go-discover&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;go-discover&lt;/a&gt; package to discover peers and fetch their IP addresses, based on the chosen provider and the filtering key-values it supports.
Clustering supports the default set of providers available in go-discover and registers the &lt;code&gt;k8s&lt;/code&gt; provider on top.&lt;/p&gt;
&lt;p&gt;If either the key or the value in a tuple pair contains a space, a backslash, or double quotes, then it must be quoted with double quotes.
Within this quoted string, the backslash can be used to escape double quotes or the backslash itself.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;--cluster.rejoin-interval&lt;/code&gt; flag defines how often each node should rediscover peers based on the contents of the &lt;code&gt;--cluster.join-addresses&lt;/code&gt; and &lt;code&gt;--cluster.discover-peers&lt;/code&gt; flags and try to rejoin them.
This operation is useful for addressing split-brain issues if the initial bootstrap is unsuccessful and for making clustering easier to manage in dynamic environments.
To disable this behavior, set the &lt;code&gt;--cluster.rejoin-interval&lt;/code&gt; flag to &lt;code&gt;&amp;quot;0s&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If &lt;code&gt;--cluster.rejoin-interval&lt;/code&gt; is set to &lt;code&gt;0s&lt;/code&gt;, then discovering peers using the &lt;code&gt;--cluster.join-addresses&lt;/code&gt; and &lt;code&gt;--cluster.discover-peers&lt;/code&gt; flags only happens at startup. After that, cluster nodes depend on gossiping messages with each other to converge on the cluster&amp;rsquo;s state.&lt;/p&gt;
&lt;p&gt;The first node that&amp;rsquo;s used to bootstrap a new cluster (also known as the &amp;ldquo;seed node&amp;rdquo;) can either omit the flags that specify peers to join or can try to connect to itself.&lt;/p&gt;
&lt;p&gt;To join or rejoin a cluster, Alloy tries to connect to a number of random peers limited by the &lt;code&gt;--cluster.max-join-peers&lt;/code&gt; flag.
This flag can be useful for clusters of significant sizes because connecting to a high number of peers can be an expensive operation.
To disable this behavior, set the &lt;code&gt;--cluster.max-join-peers&lt;/code&gt; flag to 0.
If the value of &lt;code&gt;--cluster.max-join-peers&lt;/code&gt; is higher than the number of peers discovered, Alloy connects to all of them.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;--cluster.wait-for-size&lt;/code&gt; flag specifies the minimum cluster size required before components that use clustering
begin processing traffic. When set to a value greater than zero, a node will join the cluster but the components that
use clustering will not take on any work until enough nodes are available. This ensures adequate cluster capacity - refer to
&lt;a href=&#34;../../../introduction/estimate-resource-usage/&#34;&gt;estimate resource usage&lt;/a&gt; for guidelines. The default value is &lt;code&gt;0&lt;/code&gt;, which disables this feature.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;--cluster.wait-timeout&lt;/code&gt; flag sets how long a node will wait for the cluster to reach the size specified by
&lt;code&gt;--cluster.wait-for-size&lt;/code&gt;. If the timeout expires, the node will proceed with available nodes. Setting this to &lt;code&gt;0&lt;/code&gt; (the
default) means wait indefinitely. For production environments, consider setting a timeout of several minutes as a
fallback.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;--cluster.name&lt;/code&gt; flag can be used to prevent clusters from accidentally merging.
When &lt;code&gt;--cluster.name&lt;/code&gt; is provided, nodes only join peers who share the same cluster name value.
By default, the cluster name is empty, and any node that doesn&amp;rsquo;t set the flag can join.
Attempting to join a cluster with a wrong &lt;code&gt;--cluster.name&lt;/code&gt; results in a &amp;ldquo;failed to join memberlist&amp;rdquo; error.&lt;/p&gt;
&lt;h3 id=&#34;join-address-format&#34;&gt;Join Address Format&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;--cluster.join-addresses&lt;/code&gt; flag supports DNS names with discovery mode prefix.
You select a discovery mode by adding one of the following supported prefixes to the address:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;dns&#43;&lt;/code&gt;&lt;/strong&gt;&lt;br /&gt;
The domain name after the prefix is looked up as an A/AAAA query.&lt;br /&gt;
For example: &lt;code&gt;dns&#43;alloy.local:11211&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;dnssrv&#43;&lt;/code&gt;&lt;/strong&gt;&lt;br /&gt;
The domain name after the prefix is looked up as a SRV query, and then each SRV record is resolved as an A/AAAA record.&lt;br /&gt;
For example: &lt;code&gt;dnssrv&#43;_alloy._tcp.alloy.namespace.svc.cluster.local&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;dnssrvnoa&#43;&lt;/code&gt;&lt;/strong&gt;&lt;br /&gt;
The domain name after the prefix is looked up as a SRV query, with no A/AAAA lookup made after that.&lt;br /&gt;
For example: &lt;code&gt;dnssrvnoa&#43;_alloy-memberlist._tcp.service.consul&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If no prefix is provided, Alloy will attempt to resolve the name using both A/AAAA and DNSSRV queries.&lt;/p&gt;
&lt;h3 id=&#34;clustering-states&#34;&gt;Clustering states&lt;/h3&gt;
&lt;p&gt;Clustered Alloys are in one of three states:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Viewer&lt;/strong&gt;: Alloy has a read-only view of the cluster and isn&amp;rsquo;t participating in workload distribution.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Participant&lt;/strong&gt;: Alloy is participating in workload distribution for components that have clustering enabled.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Terminating&lt;/strong&gt;: Alloy is shutting down and no longer assigning new work to itself.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each Alloy initially joins the cluster in the viewer state and then transitions to the participant state after the process startup completes.
Each Alloy then transitions to the terminating state when shutting down.&lt;/p&gt;
&lt;p&gt;The current state of a clustered Alloy is shown on the clustering page in the &lt;a href=&#34;../../../troubleshoot/debug/#clustering-page&#34;&gt;UI&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configuration-conversion&#34;&gt;Configuration conversion&lt;/h2&gt;


&lt;div data-shared=&#34;stability/public_preview.md&#34;&gt;
            &lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Public preview&lt;/strong&gt;: This is a &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;public preview&lt;/a&gt; component.
Public preview components are subject to breaking changes, and may be replaced with equivalent functionality that cover the same use case.
To enable and use a public preview component, you must set the &lt;code&gt;stability.level&lt;/code&gt; 
    &lt;a href=&#34;/docs/alloy/v1.15/reference/cli/run/&#34;&gt;flag&lt;/a&gt; to &lt;code&gt;public-preview&lt;/code&gt; or below.&lt;/p&gt;&lt;/blockquote&gt;
&lt;/div&gt;

        
&lt;p&gt;When you use the &lt;code&gt;--config.format&lt;/code&gt; command-line argument with a value other than &lt;code&gt;alloy&lt;/code&gt;, Alloy converts the configuration file from the source format to Alloy and immediately starts running with the new configuration.
This conversion uses the converter API described in the &lt;a href=&#34;../convert/&#34;&gt;alloy convert&lt;/a&gt; docs.&lt;/p&gt;
&lt;p&gt;If you include the &lt;code&gt;--config.bypass-conversion-errors&lt;/code&gt; command-line argument, Alloy ignores errors from the converter.
Use this argument with caution because the resulting conversion may not be equivalent to the original configuration.&lt;/p&gt;
&lt;p&gt;Include &lt;code&gt;--config.extra-args&lt;/code&gt; to pass additional command line flags from the original format to the converter.
Refer to &lt;a href=&#34;../convert/&#34;&gt;alloy convert&lt;/a&gt; for more details on how &lt;code&gt;extra-args&lt;/code&gt; work.&lt;/p&gt;
]]></content><description>&lt;h1 id="run">&lt;code>run&lt;/code>&lt;/h1>
&lt;p>The &lt;code>run&lt;/code> command runs the Alloy Default Engine in the foreground until an interrupt is received.&lt;/p>
&lt;h2 id="usage">Usage&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">shell&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-shell">alloy run [&amp;lt;FLAG&amp;gt; ...] &amp;lt;PATH_NAME&amp;gt;&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>Replace the following:&lt;/p></description></item><item><title>otel</title><link>https://grafana.com/docs/alloy/v1.15/reference/cli/otel/</link><pubDate>Mon, 30 Mar 2026 15:47:22 +0000</pubDate><guid>https://grafana.com/docs/alloy/v1.15/reference/cli/otel/</guid><content><![CDATA[&lt;h1 id=&#34;otel&#34;&gt;&lt;code&gt;otel&lt;/code&gt;&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;EXPERIMENTAL&lt;/strong&gt;: This is an &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;experimental&lt;/a&gt; feature.
Experimental features are subject to frequent breaking changes, and may be removed with no equivalent replacement.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The &lt;code&gt;otel&lt;/code&gt; command runs Alloy with the OTel Engine.
This command accepts OpenTelemetry Collector YAML configuration files.&lt;/p&gt;
&lt;p&gt;The OTel Engine includes receivers, processors, exporters, extensions, and connectors from the OpenTelemetry Collector core and contrib repositories.
This includes components for OTLP, Prometheus, Kafka, Zipkin, and other popular integrations.&lt;/p&gt;
&lt;p&gt;As with the &lt;code&gt;run&lt;/code&gt; command, this runs in the foreground until an interrupt is received.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&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;shell&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-shell&#34;&gt;alloy otel --config=&amp;lt;CONFIG_FILE&amp;gt; [&amp;lt;FLAGS&amp;gt; ...] &lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;CONFIG_FILE&amp;gt;&lt;/code&gt;&lt;/em&gt;: Path to an OpenTelemetry Collector configuration file.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;FLAGS&amp;gt;&lt;/code&gt;&lt;/em&gt;: One or more flags that &lt;a href=&#34;https://opentelemetry.io/docs/collector/configuration/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;configure the OpenTelemetry Collector&lt;/a&gt;.
These flags are the same as upstream.
Run &lt;code&gt;alloy otel --help&lt;/code&gt; to show the complete list of supported flags.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configuration&#34;&gt;Configuration&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;otel&lt;/code&gt; command accepts standard OpenTelemetry Collector YAML configuration files.
The configuration file defines receivers, processors, exporters, and other components that make up your telemetry pipeline.&lt;/p&gt;
&lt;h3 id=&#34;run-the-default-engine-in-parallel&#34;&gt;Run the Default Engine in parallel&lt;/h3&gt;
&lt;p&gt;The OTel Engine includes the option to run pipelines with the Default Engine alongside the OTel Engine.
Use the built-in Alloy Engine extension to enable this.&lt;/p&gt;
&lt;p&gt;This runs a Default Engine pipeline &lt;em&gt;in parallel&lt;/em&gt; to the OTel Engine pipeline.
The two pipelines can&amp;rsquo;t natively interact.&lt;/p&gt;
&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;
&lt;p&gt;Refer to &lt;a href=&#34;../../../set-up/otel_engine/&#34;&gt;The OpenTelemetry Engine&lt;/a&gt; for examples that show you how to run the OTel Engine and Alloy Engine extension.&lt;/p&gt;
&lt;h2 id=&#34;related-documentation&#34;&gt;Related documentation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://opentelemetry.io/docs/collector/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Collector documentation&lt;/a&gt;: Official OpenTelemetry Collector documentation.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="otel">&lt;code>otel&lt;/code>&lt;/h1>
&lt;blockquote>
&lt;p>&lt;strong>EXPERIMENTAL&lt;/strong>: This is an &lt;a href="/docs/release-life-cycle/">experimental&lt;/a> feature.
Experimental features are subject to frequent breaking changes, and may be removed with no equivalent replacement.&lt;/p>&lt;/blockquote>
&lt;p>The &lt;code>otel&lt;/code> command runs Alloy with the OTel Engine.
This command accepts OpenTelemetry Collector YAML configuration files.&lt;/p></description></item><item><title>tools</title><link>https://grafana.com/docs/alloy/v1.15/reference/cli/tools/</link><pubDate>Mon, 30 Mar 2026 15:47:22 +0000</pubDate><guid>https://grafana.com/docs/alloy/v1.15/reference/cli/tools/</guid><content><![CDATA[&lt;h1 id=&#34;tools&#34;&gt;&lt;code&gt;tools&lt;/code&gt;&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;tools&lt;/code&gt; command contains command line tooling grouped by Alloy component.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;Utilities in this command have no backward compatibility guarantees and may change or be removed between releases.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;subcommands&#34;&gt;Subcommands&lt;/h2&gt;
&lt;h3 id=&#34;prometheusremote_write-sample-stats&#34;&gt;prometheus.remote_write sample-stats&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;shell&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-shell&#34;&gt;alloy tools prometheus.remote_write sample-stats [&amp;lt;FLAG&amp;gt; ...] &amp;lt;WAL_DIRECTORY&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;FLAG&amp;gt;&lt;/code&gt;&lt;/em&gt;: One or more flags that define the input and output of the command.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;WAL_DIRECTORY&amp;gt;&lt;/code&gt;&lt;/em&gt;: The WAL directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;code&gt;sample-stats&lt;/code&gt; command reads the Write-Ahead Log (WAL) specified by &lt;em&gt;&lt;code&gt;&amp;lt;WAL_DIRECTORY&amp;gt;&lt;/code&gt;&lt;/em&gt; and collects information on metric samples within it.&lt;/p&gt;
&lt;p&gt;For each metric discovered, &lt;code&gt;sample-stats&lt;/code&gt; emits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The timestamp of the oldest sample received for that metric.&lt;/li&gt;
&lt;li&gt;The timestamp of the newest sample received for that metric.&lt;/li&gt;
&lt;li&gt;The total number of samples discovered for that metric.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By default, &lt;code&gt;sample-stats&lt;/code&gt; returns information for every metric in the WAL.
You can pass the &lt;code&gt;--selector&lt;/code&gt; flag to filter the reported metrics to a smaller set.&lt;/p&gt;
&lt;p&gt;The following flag is supported:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--selector&lt;/code&gt;: A PromQL label selector to filter data by. (default &lt;code&gt;{}&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;prometheusremote_write-target-stats&#34;&gt;prometheus.remote_write target-stats&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;shell&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-shell&#34;&gt;alloy tools prometheus.remote_write target-stats --job JOB --instance INSTANCE WAL_DIRECTORY&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;target-stats&lt;/code&gt; command reads the Write-Ahead Log (WAL) specified by &lt;code&gt;WAL_DIRECTORY&lt;/code&gt; and collects metric cardinality information for a specific target.&lt;/p&gt;
&lt;p&gt;For the target specified by the &lt;code&gt;--job&lt;/code&gt; and &lt;code&gt;--instance&lt;/code&gt; flags, unique metric names for that target are printed along with the number of series with that metric name.&lt;/p&gt;
&lt;p&gt;The following flags are supported:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--job&lt;/code&gt;: The &lt;code&gt;job&lt;/code&gt; label of the target.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--instance&lt;/code&gt;: The &lt;code&gt;instance&lt;/code&gt; label of the target.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;code&gt;--job&lt;/code&gt; and &lt;code&gt;--instance&lt;/code&gt; labels are required.&lt;/p&gt;
&lt;h3 id=&#34;prometheusremote_write-wal-stats&#34;&gt;prometheus.remote_write wal-stats&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;shell&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-shell&#34;&gt;alloy tools prometheus.remote_write wal-stats &amp;lt;WAL_DIRECTORY&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;WAL_DIRECTORY&amp;gt;&lt;/code&gt;&lt;/em&gt;: The WAL directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;code&gt;wal-stats&lt;/code&gt; command reads the Write-Ahead Log (WAL) specified by &lt;em&gt;&lt;code&gt;&amp;lt;WAL_DIRECTORY&amp;gt;&lt;/code&gt;&lt;/em&gt; and collects general information about it.&lt;/p&gt;
&lt;p&gt;The following information is reported:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The timestamp of the oldest sample in the WAL.&lt;/li&gt;
&lt;li&gt;The timestamp of the newest sample in the WAL.&lt;/li&gt;
&lt;li&gt;The total number of unique series defined in the WAL.&lt;/li&gt;
&lt;li&gt;The total number of samples in the WAL.&lt;/li&gt;
&lt;li&gt;The number of hash collisions detected, if any.&lt;/li&gt;
&lt;li&gt;The total number of invalid records in the WAL, if any.&lt;/li&gt;
&lt;li&gt;The most recent WAL checkpoint segment number.&lt;/li&gt;
&lt;li&gt;The oldest segment number in the WAL.&lt;/li&gt;
&lt;li&gt;The newest segment number in the WAL.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additionally, &lt;code&gt;wal-stats&lt;/code&gt; reports per-target information, where a target is defined as a unique combination of the &lt;code&gt;job&lt;/code&gt; and &lt;code&gt;instance&lt;/code&gt; label values.
For each target, &lt;code&gt;wal-stats&lt;/code&gt; reports the number of series and the number of metric samples associated with that target.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;wal-stats&lt;/code&gt; command doesn&amp;rsquo;t support any flags.&lt;/p&gt;
]]></content><description>&lt;h1 id="tools">&lt;code>tools&lt;/code>&lt;/h1>
&lt;p>The &lt;code>tools&lt;/code> command contains command line tooling grouped by Alloy component.&lt;/p>
&lt;div class="admonition admonition-caution">&lt;blockquote>&lt;p class="title text-uppercase">Caution&lt;/p>&lt;p>Utilities in this command have no backward compatibility guarantees and may change or be removed between releases.&lt;/p></description></item><item><title>Environment variables</title><link>https://grafana.com/docs/alloy/v1.15/reference/cli/environment-variables/</link><pubDate>Mon, 30 Mar 2026 15:47:22 +0000</pubDate><guid>https://grafana.com/docs/alloy/v1.15/reference/cli/environment-variables/</guid><content><![CDATA[&lt;h1 id=&#34;environment-variables&#34;&gt;Environment variables&lt;/h1&gt;
&lt;p&gt;You can use environment variables to control the run-time behavior of Grafana Alloy.&lt;/p&gt;
&lt;p&gt;The following environment variables are supported:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;GODEBUG&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HTTP_PROXY&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HTTPS_PROXY&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;NO_PROXY&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PPROF_MUTEX_PROFILING_PERCENT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PPROF_BLOCK_PROFILING_RATE&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GOMEMLIMIT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AUTOMEMLIMIT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AUTOMEMLIMIT_EXPERIMENT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GOGC&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GOMAXPROCS&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GOTRACEBACK&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Refer to the &lt;a href=&#34;https://pkg.go.dev/runtime&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Go runtime&lt;/a&gt; documentation for more information about Go runtime environment variables.&lt;/p&gt;
&lt;h2 id=&#34;godebug&#34;&gt;&lt;code&gt;GODEBUG&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;You can use the &lt;code&gt;GODEBUG&lt;/code&gt; environment variable to control the debugging variables within the Go runtime. The following arguments are supported.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Argument&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;x509usefallbackroots&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Enforce a fallback on the X.509 trusted root certificates. Set to &lt;code&gt;1&lt;/code&gt; to enable.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;netdns&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Control the DNS resolver and debugging. Set to &lt;code&gt;&amp;quot;go&amp;quot;&lt;/code&gt; for a pure Go resolver, &lt;code&gt;&amp;quot;cgo&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;win32&amp;quot;&lt;/code&gt; for a native resolver. Add &lt;code&gt;&#43;1&lt;/code&gt; or &lt;code&gt;&#43;2&lt;/code&gt; for debugging output. Example: &lt;code&gt;netdns=go&#43;1&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;-&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;http_proxy-https_proxy-no_proxy&#34;&gt;&lt;code&gt;HTTP_PROXY&lt;/code&gt;, &lt;code&gt;HTTPS_PROXY&lt;/code&gt;, &lt;code&gt;NO_PROXY&lt;/code&gt;&lt;/h2&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;For many Alloy components, there is an attribute named &lt;code&gt;proxy_from_environment&lt;/code&gt; that must be set to &lt;code&gt;true&lt;/code&gt; for the component&amp;rsquo;s HTTP client to use the proxy-related environment variables.
For example, in the &lt;code&gt;prometheus.remote_write&lt;/code&gt; component, this attribute is found within the &lt;code&gt;endpoint&lt;/code&gt; block.&lt;/p&gt;
&lt;p&gt;If Alloy doesn&amp;rsquo;t appear to be respecting your proxy configuration, make sure you configure the component to use proxy environment variables.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;You can use the &lt;code&gt;HTTP_PROXY&lt;/code&gt; environment variable to define the hostname or IP address of the proxy server for HTTP requests. For example, you can set the proxy to &lt;code&gt;http://proxy.example.com&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You can use the &lt;code&gt;HTTPS_PROXY&lt;/code&gt; environment variable to define the proxy server for HTTPS requests in the same manner as &lt;code&gt;HTTP_PROXY&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;NO_PROXY&lt;/code&gt; environment variable is used to define any hosts that should be excluded from proxying. &lt;code&gt;NO_PROXY&lt;/code&gt; should contain a comma delimited list of any of the following options.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Option&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Examples&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;IP Address&lt;/td&gt;
              &lt;td&gt;A single IP address (with optional port)&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;1.2.3.4&lt;/code&gt; or &lt;code&gt;1.2.3.4:80&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;CIDR Block&lt;/td&gt;
              &lt;td&gt;A group of IP addresses that share a network prefix.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;1.2.3.4/8&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Domain&lt;/td&gt;
              &lt;td&gt;A domain name matches that name and all subdomains. A domain name with a leading &amp;ldquo;.&amp;rdquo; matches subdomains only.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;example.com&lt;/code&gt; or &lt;code&gt;.example.com&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Asterisk&lt;/td&gt;
              &lt;td&gt;A single asterisk indicates that no proxying should be done.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;*&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;pprof_mutex_profiling_percent&#34;&gt;&lt;code&gt;PPROF_MUTEX_PROFILING_PERCENT&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;You can use the &lt;code&gt;PPROF_MUTEX_PROFILING_PERCENT&lt;/code&gt; environment variable to define the percentage of mutex profiles to retrieve from the pprof mutex endpoint.
If you set this variable to &lt;code&gt;5&lt;/code&gt;, then 5 percent of the mutexes are sampled.
By default, the sampling rate is set to &lt;code&gt;0.1%&lt;/code&gt;&lt;/p&gt;
&lt;h2 id=&#34;pprof_block_profiling_rate&#34;&gt;&lt;code&gt;PPROF_BLOCK_PROFILING_RATE&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;You can use the &lt;code&gt;PPROF_BLOCK_PROFILING_RATE&lt;/code&gt; environment variable to define the rate that goroutine blocking events are tracked. You can use the following values with this environment variable. The default value is &lt;code&gt;10000&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;0&lt;/code&gt;: Nothing is tracked.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1&lt;/code&gt;: All blocking events are tracked.&lt;/li&gt;
&lt;li&gt;A value greater than &lt;code&gt;1&lt;/code&gt;: The number of nanoseconds between samples.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;gomemlimit&#34;&gt;&lt;code&gt;GOMEMLIMIT&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Usually, the &lt;a href=&#34;https://pkg.go.dev/runtime&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Go runtime&lt;/a&gt; releases memory back to the operating system when requested.
In some environments, this may cause issues such as Out Of Memory (OOM) errors.
You can use the &lt;code&gt;GOMEMLIMIT&lt;/code&gt; environment variable to set a soft memory cap and limit the maximum memory Alloy can use.
You can set &lt;code&gt;GOMEMLIMIT&lt;/code&gt; to a numeric value in bytes with an optional unit suffix.
The supported unit suffixes are &lt;code&gt;B&lt;/code&gt;, &lt;code&gt;KiB&lt;/code&gt;, &lt;code&gt;MiB&lt;/code&gt;, &lt;code&gt;GiB&lt;/code&gt;, and &lt;code&gt;TiB&lt;/code&gt;.
Don&amp;rsquo;t treat the &lt;code&gt;GOMEMLIMIT&lt;/code&gt; environment variable as a hard memory limit.
Alloy  processes can use more memory if that memory is required.
A rough number is to set &lt;code&gt;GOMEMLIMIT&lt;/code&gt; to is 90% of the maximum memory required.
For example, if you want to keep memory usage below &lt;code&gt;10GiB&lt;/code&gt;, use &lt;code&gt;GOMEMLIMIT=9GiB&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;automatically-set-gomemlimit&#34;&gt;Automatically set &lt;code&gt;GOMEMLIMIT&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;GOMEMLIMIT&lt;/code&gt; environment variable is either automatically set to 90% of an available &lt;code&gt;cgroup&lt;/code&gt; value using the &lt;a href=&#34;https://github.com/KimMachineGun/automemlimit&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;automemlimit&lt;/code&gt;&lt;/a&gt; module, or you can explicitly set the &lt;code&gt;GOMEMLIMIT&lt;/code&gt; environment variable before you run Alloy.
You can also change the 90% ratio by setting the &lt;code&gt;AUTOMEMLIMIT&lt;/code&gt; environment variable to a float value between &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;1.0&lt;/code&gt;.
No changes occur if the limit can&amp;rsquo;t be determined and you didn&amp;rsquo;t explicitly define a  &lt;code&gt;GOMEMLIMIT&lt;/code&gt; value.
The &lt;code&gt;AUTOMEMLIMIT_EXPERIMENT&lt;/code&gt; variable can be set to &lt;code&gt;system&lt;/code&gt; to use the &lt;a href=&#34;https://github.com/KimMachineGun/automemlimit&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;automemlimit&lt;/code&gt;&lt;/a&gt; module&amp;rsquo;s System provider, which sets &lt;code&gt;GOMEMLIMIT&lt;/code&gt; based on the same ratio applied to the total system memory.
As &lt;code&gt;cgroup&lt;/code&gt; is a Linux specific concept, this is the only way to use the &lt;code&gt;automemlimit&lt;/code&gt; module to automatically set &lt;code&gt;GOMEMLIMIT&lt;/code&gt; on non-Linux OSes.&lt;/p&gt;
&lt;h2 id=&#34;gogc&#34;&gt;&lt;code&gt;GOGC&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;GOGC&lt;/code&gt; environment variable controls the mechanism that triggers Go&amp;rsquo;s garbage collection.
It represents the garbage collection target percentage.
A collection is triggered when the ratio of freshly allocated data to live data remaining after the previous collection reaches this percentage.
If you don&amp;rsquo;t provide this variable, GOGC defaults to &lt;code&gt;100&lt;/code&gt;.
You can set &lt;code&gt;GOGC=off&lt;/code&gt; to disable garbage collection.&lt;/p&gt;
&lt;p&gt;Configuring this value in conjunction with &lt;code&gt;GOMEMLIMIT&lt;/code&gt; can help in situations where Alloy is consuming too much memory.
Go provides a &lt;a href=&#34;https://tip.golang.org/doc/gc-guide#GOGC&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;very in-depth guide&lt;/a&gt; to understanding &lt;code&gt;GOGC&lt;/code&gt; and &lt;code&gt;GOMEMLIMIT&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;gomaxprocs&#34;&gt;&lt;code&gt;GOMAXPROCS&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;GOMAXPROCS&lt;/code&gt; environment variable defines the limit of OS threads that can simultaneously execute user-level Go code.
This limit doesn&amp;rsquo;t affect the number of threads that can be blocked in system calls on behalf of Go code and those threads aren&amp;rsquo;t counted against &lt;code&gt;GOMAXPROCS&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;gotraceback&#34;&gt;&lt;code&gt;GOTRACEBACK&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;GOTRACEBACK&lt;/code&gt; environment variable defines the behavior of the Go panic output.
The standard panic output behavior is usually sufficient to debug and resolve an issue.
If required, you can use this setting to collect additional information from the runtime.
The following values are supported:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Value&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Traces include runtime internal functions&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;none&lt;/code&gt; or &lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Omit goroutine stack traces entirely from the panic output.&lt;/td&gt;
              &lt;td&gt;-&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;single&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Print the stack trace for the current goroutine.&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;all&lt;/code&gt; or &lt;code&gt;1&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Print the stack traces for all user-created goroutines.&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;system&lt;/code&gt; or &lt;code&gt;2&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Print the stack traces for all user-created and runtime-created goroutines.&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;crash&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Similar to &lt;code&gt;system&lt;/code&gt;, but also triggers OS-specific additional behavior. For example, on Unix systems, this raises a SIGABRT to trigger a code dump.&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;wer&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Similar to &lt;code&gt;crash&lt;/code&gt;, but doesn&amp;rsquo;t disable Windows Error Reporting.&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="environment-variables">Environment variables&lt;/h1>
&lt;p>You can use environment variables to control the run-time behavior of Grafana Alloy.&lt;/p>
&lt;p>The following environment variables are supported:&lt;/p>
&lt;ul>
&lt;li>&lt;code>GODEBUG&lt;/code>&lt;/li>
&lt;li>&lt;code>HTTP_PROXY&lt;/code>&lt;/li>
&lt;li>&lt;code>HTTPS_PROXY&lt;/code>&lt;/li>
&lt;li>&lt;code>NO_PROXY&lt;/code>&lt;/li>
&lt;li>&lt;code>PPROF_MUTEX_PROFILING_PERCENT&lt;/code>&lt;/li>
&lt;li>&lt;code>PPROF_BLOCK_PROFILING_RATE&lt;/code>&lt;/li>
&lt;li>&lt;code>GOMEMLIMIT&lt;/code>&lt;/li>
&lt;li>&lt;code>AUTOMEMLIMIT&lt;/code>&lt;/li>
&lt;li>&lt;code>AUTOMEMLIMIT_EXPERIMENT&lt;/code>&lt;/li>
&lt;li>&lt;code>GOGC&lt;/code>&lt;/li>
&lt;li>&lt;code>GOMAXPROCS&lt;/code>&lt;/li>
&lt;li>&lt;code>GOTRACEBACK&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>Refer to the &lt;a href="https://pkg.go.dev/runtime" target="_blank" rel="noopener noreferrer">Go runtime&lt;/a> documentation for more information about Go runtime environment variables.&lt;/p></description></item><item><title>validate</title><link>https://grafana.com/docs/alloy/v1.15/reference/cli/validate/</link><pubDate>Mon, 30 Mar 2026 15:47:22 +0000</pubDate><guid>https://grafana.com/docs/alloy/v1.15/reference/cli/validate/</guid><content><![CDATA[&lt;h1 id=&#34;validate&#34;&gt;&lt;code&gt;validate&lt;/code&gt;&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;validate&lt;/code&gt; command validates an Alloy configuration file or directory path.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&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;shell&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-shell&#34;&gt;alloy validate [&amp;lt;FLAG&amp;gt; ...] &amp;lt;PATH_NAME&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;FLAG&amp;gt;&lt;/code&gt;&lt;/em&gt;: One or more flags that define the input and output of the command.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;PATH_NAME&amp;gt;&lt;/code&gt;&lt;/em&gt;: Required. The Alloy configuration file or directory path.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the configuration file is valid, the &lt;code&gt;validate&lt;/code&gt; command returns a zero exit code.
If the configuration file is invalid, the command returns a non-zero exit code and prints diagnostics generated during validation to &lt;code&gt;stderr&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you provide a directory path for the &lt;em&gt;&lt;code&gt;&amp;lt;PATH_NAME&amp;gt;&lt;/code&gt;&lt;/em&gt;, Alloy finds &lt;code&gt;*.alloy&lt;/code&gt; files, ignoring nested directories, and loads them as a single configuration source.&lt;/p&gt;
&lt;p&gt;The following flags are supported:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--config.format&lt;/code&gt;: Specifies the source file format. Supported formats: &lt;code&gt;alloy&lt;/code&gt;, &lt;code&gt;otelcol&lt;/code&gt;, &lt;code&gt;prometheus&lt;/code&gt;, &lt;code&gt;promtail&lt;/code&gt;, and &lt;code&gt;static&lt;/code&gt; (default &lt;code&gt;&amp;quot;alloy&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--config.bypass-conversion-errors&lt;/code&gt;: Enable bypassing errors during conversion (default &lt;code&gt;false&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--config.extra-args&lt;/code&gt;: Extra arguments from the original format used by the converter.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--stability.level&lt;/code&gt;: The minimum permitted stability level of functionality. Supported values: &lt;code&gt;experimental&lt;/code&gt;, &lt;code&gt;public-preview&lt;/code&gt;, and &lt;code&gt;generally-available&lt;/code&gt; (default &lt;code&gt;&amp;quot;generally-available&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--feature.community-components.enabled&lt;/code&gt;: Enable community components (default &lt;code&gt;false&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;When you validate the Alloy configuration, you must set the &lt;code&gt;--stability.level&lt;/code&gt; and &lt;code&gt;--feature.community-components.enabled&lt;/code&gt; arguments to the same values you want to use when you run Alloy.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;limitations&#34;&gt;Limitations&lt;/h2&gt;
&lt;p&gt;Validation is limited in scope. It currently checks for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Syntax errors in the Alloy configuration syntax&lt;/li&gt;
&lt;li&gt;Missing components&lt;/li&gt;
&lt;li&gt;Component name conflicts&lt;/li&gt;
&lt;li&gt;Required properties are set&lt;/li&gt;
&lt;li&gt;Unknown properties&lt;/li&gt;
&lt;li&gt;&lt;code&gt;foreach&lt;/code&gt; blocks&lt;/li&gt;
&lt;li&gt;&lt;code&gt;declare&lt;/code&gt; blocks&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="validate">&lt;code>validate&lt;/code>&lt;/h1>
&lt;p>The &lt;code>validate&lt;/code> command validates an Alloy configuration file or directory path.&lt;/p>
&lt;h2 id="usage">Usage&lt;/h2>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">shell&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-shell">alloy validate [&amp;lt;FLAG&amp;gt; ...] &amp;lt;PATH_NAME&amp;gt;&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>Replace the following:&lt;/p></description></item></channel></rss>