<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Components on Grafana Labs</title><link>https://grafana.com/docs/alloy/v1.15/get-started/components/</link><description>Recent content in Components on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/alloy/v1.15/get-started/components/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure components</title><link>https://grafana.com/docs/alloy/v1.15/get-started/components/configure-components/</link><pubDate>Mon, 30 Mar 2026 15:47:22 +0000</pubDate><guid>https://grafana.com/docs/alloy/v1.15/get-started/components/configure-components/</guid><content><![CDATA[&lt;h1 id=&#34;configure-components&#34;&gt;Configure components&lt;/h1&gt;
&lt;p&gt;Components are the defining feature of Alloy.
They&amp;rsquo;re reusable pieces of business logic that perform a single task, such as retrieving secrets or collecting Prometheus metrics.
You can wire them together to form programmable pipelines of telemetry data.&lt;/p&gt;
&lt;p&gt;To build effective configurations, you need to understand how to define components, set their arguments, and connect them using exports.&lt;/p&gt;
&lt;h2 id=&#34;basic-component-syntax&#34;&gt;Basic component syntax&lt;/h2&gt;
&lt;p&gt;You create &lt;a href=&#34;../../../reference/components/&#34;&gt;components&lt;/a&gt; by defining a top-level block with a component name and a user-specified label.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Alloy&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-alloy&#34;&gt;COMPONENT_NAME &amp;#34;LABEL&amp;#34; {
  // Component configuration goes here
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For example, this creates a &lt;code&gt;local.file&lt;/code&gt; component with the label &amp;ldquo;&lt;code&gt;config&lt;/code&gt;&amp;rdquo;:&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;Alloy&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-alloy&#34;&gt;local.file &amp;#34;config&amp;#34; {
  filename = &amp;#34;/etc/app/settings.yaml&amp;#34;
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;a href=&#34;../component-controller/&#34;&gt;&lt;em&gt;component controller&lt;/em&gt;&lt;/a&gt; schedules components, reports their health and debug status, re-evaluates their arguments, and provides their exports.&lt;/p&gt;
&lt;h2 id=&#34;arguments-and-exports&#34;&gt;Arguments and exports&lt;/h2&gt;
&lt;p&gt;Most user interactions with components center around two basic concepts: &lt;em&gt;arguments&lt;/em&gt; and &lt;em&gt;exports&lt;/em&gt;.&lt;/p&gt;
&lt;h3 id=&#34;arguments&#34;&gt;Arguments&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Arguments&lt;/em&gt; are settings that modify a component&amp;rsquo;s behavior.
They can include attributes or nested unlabeled blocks, some of which you must provide and others that are optional.
Optional arguments that aren&amp;rsquo;t set use their default values.&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;Alloy&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-alloy&#34;&gt;local.file &amp;#34;targets&amp;#34; {
  filename = &amp;#34;/etc/alloy/targets&amp;#34;  // Required argument

  // Optional arguments
  poll_frequency = &amp;#34;1m&amp;#34;
  is_secret = false
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;exports&#34;&gt;Exports&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Exports&lt;/em&gt; are zero or more output values that other components can refer to.
They can be of any Alloy type.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;local.file.targets&lt;/code&gt; component from the previous example exposes the file content as a string in its exports.
You&amp;rsquo;ll learn how to reference these exports in &lt;a href=&#34;../../expressions/&#34;&gt;Expressions&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configuration-blocks&#34;&gt;Configuration blocks&lt;/h2&gt;
&lt;p&gt;Some components use nested blocks to organize related settings.&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;Alloy&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-alloy&#34;&gt;prometheus.remote_write &amp;#34;production&amp;#34; {
  endpoint {
    url = &amp;#34;https://prometheus.example.com/api/v1/write&amp;#34;

    basic_auth {
      username = &amp;#34;metrics&amp;#34;
      password_file = &amp;#34;/etc/secrets/password&amp;#34;
    }
  }

  queue_config {
    capacity = 10000
    batch_send_deadline = &amp;#34;5s&amp;#34;
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In this example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;endpoint&lt;/code&gt; is a block that configures the remote endpoint&lt;/li&gt;
&lt;li&gt;&lt;code&gt;basic_auth&lt;/code&gt; is a nested block within &lt;code&gt;endpoint&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;queue_config&lt;/code&gt; is another top-level block within the component&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;component-references&#34;&gt;Component references&lt;/h2&gt;
&lt;p&gt;To wire components together, use the exports of one as the arguments to another by using references.
References can only appear in component arguments.&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;Alloy&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-alloy&#34;&gt;local.file &amp;#34;api_key&amp;#34; {
  filename = &amp;#34;/etc/secrets/api.key&amp;#34;
}

prometheus.remote_write &amp;#34;production&amp;#34; {
  endpoint {
    url = &amp;#34;https://prometheus.example.com/api/v1/write&amp;#34;

    basic_auth {
      username = &amp;#34;metrics&amp;#34;
      password = local.file.api_key.content  // Reference to component export
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Each time the file contents change, the &lt;code&gt;local.file&lt;/code&gt; component updates its exports.
The component sends the updated value to the &lt;code&gt;prometheus.remote_write&lt;/code&gt; component&amp;rsquo;s &lt;code&gt;password&lt;/code&gt; field.&lt;/p&gt;
&lt;h3 id=&#34;reference-syntax&#34;&gt;Reference syntax&lt;/h3&gt;
&lt;p&gt;To reference a component export, combine three parts with periods:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Component name: &lt;code&gt;local.file&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Component label: &lt;code&gt;api_key&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Export name: &lt;code&gt;content&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Result: &lt;code&gt;local.file.api_key.content&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each argument and exported field has an underlying &lt;a href=&#34;../../expressions/types_and_values/&#34;&gt;type&lt;/a&gt;.
Alloy checks the expression type before assigning a value to an attribute.&lt;/p&gt;
&lt;h2 id=&#34;multiple-component-instances&#34;&gt;Multiple component instances&lt;/h2&gt;
&lt;p&gt;You can create multiple instances of the same component type by using different labels:&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;Alloy&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-alloy&#34;&gt;prometheus.scrape &amp;#34;api&amp;#34; {
  targets = [{&amp;#34;__address__&amp;#34; = &amp;#34;api.example.com:8080&amp;#34;}]
  forward_to = [prometheus.remote_write.production.receiver]
}

prometheus.scrape &amp;#34;database&amp;#34; {
  targets = [{&amp;#34;__address__&amp;#34; = &amp;#34;db.example.com:9090&amp;#34;}]
  forward_to = [prometheus.remote_write.production.receiver]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Both scrape configurations send metrics to the same &lt;code&gt;prometheus.remote_write&lt;/code&gt; component.&lt;/p&gt;
&lt;h2 id=&#34;component-rules&#34;&gt;Component rules&lt;/h2&gt;
&lt;p&gt;Components can&amp;rsquo;t form cycles.
This means that a component can&amp;rsquo;t reference itself directly or indirectly.
This prevents infinite loops from forming in your configuration.&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;Alloy&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-alloy&#34;&gt;// INVALID: Component can&amp;#39;t reference itself
local.file &amp;#34;self_reference&amp;#34; {
  filename = local.file.self_reference.content
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;Alloy&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-alloy&#34;&gt;// INVALID: Cyclic reference between components
local.file &amp;#34;a&amp;#34; {
  filename = local.file.b.content
}

local.file &amp;#34;b&amp;#34; {
  filename = local.file.a.content
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;p&gt;Now that you understand how to configure components, learn about more advanced topics:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../build-pipelines/&#34;&gt;Build data pipelines&lt;/a&gt; - Connect components together to create data processing workflows&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../component-controller/&#34;&gt;Component controller&lt;/a&gt; - Understand how Alloy manages components at runtime&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../expressions/&#34;&gt;Expressions&lt;/a&gt; - Write dynamic configuration using component references and functions&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../../reference/components/&#34;&gt;Component reference&lt;/a&gt; - Explore all available components and their arguments and exports&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For practical examples, try the &lt;a href=&#34;../../../tutorials/&#34;&gt;tutorials&lt;/a&gt; to build complete data collection pipelines.&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-components">Configure components&lt;/h1>
&lt;p>Components are the defining feature of Alloy.
They&amp;rsquo;re reusable pieces of business logic that perform a single task, such as retrieving secrets or collecting Prometheus metrics.
You can wire them together to form programmable pipelines of telemetry data.&lt;/p></description></item><item><title>Build data pipelines</title><link>https://grafana.com/docs/alloy/v1.15/get-started/components/build-pipelines/</link><pubDate>Mon, 30 Mar 2026 15:47:22 +0000</pubDate><guid>https://grafana.com/docs/alloy/v1.15/get-started/components/build-pipelines/</guid><content><![CDATA[&lt;h1 id=&#34;build-data-pipelines&#34;&gt;Build data pipelines&lt;/h1&gt;
&lt;p&gt;You learned about components in the previous section. They&amp;rsquo;re building blocks that perform tasks such as reading files, collecting metrics, or processing data.
Now you&amp;rsquo;ll learn how to connect components to create &lt;em&gt;pipelines&lt;/em&gt; that collect, transform, and send telemetry data.&lt;/p&gt;
&lt;h2 id=&#34;what-are-pipelines&#34;&gt;What are pipelines?&lt;/h2&gt;
&lt;p&gt;A pipeline forms when components reference each other&amp;rsquo;s exports.
You learned about component exports in the previous section. These are the values that running components make available to other components.&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;Alloy&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-alloy&#34;&gt;// Simple constant value
log_level = &amp;#34;debug&amp;#34;

// Expression that references a component export
api_key = local.file.secret.content&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When you use an expression like &lt;code&gt;local.file.secret.content&lt;/code&gt; in a component&amp;rsquo;s arguments, you create a dependency.
Alloy automatically re-evaluates the dependent component whenever the referenced component updates its exports.&lt;/p&gt;
&lt;h2 id=&#34;your-first-pipeline&#34;&gt;Your first pipeline&lt;/h2&gt;
&lt;p&gt;This pipeline reads a password from a file and uses it to authenticate with a remote system:&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;Alloy&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-alloy&#34;&gt;local.file &amp;#34;api_key&amp;#34; {
    filename = &amp;#34;/etc/secrets/api.key&amp;#34;
}

prometheus.remote_write &amp;#34;production&amp;#34; {
    endpoint {
        url = &amp;#34;http://localhost:9090/api/v1/write&amp;#34;

        basic_auth {
            username = &amp;#34;admin&amp;#34;
            password = local.file.api_key.content
        }
    }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This pipeline has two components:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;local.file&lt;/code&gt; reads a file and exports its content.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;prometheus.remote_write&lt;/code&gt; uses that content as a password.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The key configuration elements are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Component exports&lt;/strong&gt;: &lt;code&gt;local.file.api_key.content&lt;/code&gt; exports the file&amp;rsquo;s content.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Component references&lt;/strong&gt;: The &lt;code&gt;password&lt;/code&gt; attribute references the export from another component.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automatic updates&lt;/strong&gt;: When the file changes, Alloy automatically updates the password used by the remote write component.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 940px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/media/docs/alloy/diagram-example-basic-alloy.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/media/docs/alloy/diagram-example-basic-alloy.png&#34;data-srcset=&#34;/media/docs/alloy/diagram-example-basic-alloy.png?w=320 320w, /media/docs/alloy/diagram-example-basic-alloy.png?w=550 550w, /media/docs/alloy/diagram-example-basic-alloy.png?w=750 750w, /media/docs/alloy/diagram-example-basic-alloy.png?w=900 900w, /media/docs/alloy/diagram-example-basic-alloy.png?w=1040 1040w, /media/docs/alloy/diagram-example-basic-alloy.png?w=1240 1240w, /media/docs/alloy/diagram-example-basic-alloy.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Example pipeline with local.file and prometheus.remote_write components&#34;width=&#34;940&#34;height=&#34;170&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/alloy/diagram-example-basic-alloy.png&#34;
            alt=&#34;Example pipeline with local.file and prometheus.remote_write components&#34;width=&#34;940&#34;height=&#34;170&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h2 id=&#34;multi-stage-pipelines&#34;&gt;Multi-stage pipelines&lt;/h2&gt;
&lt;p&gt;You can chain multiple components together to create more complex pipelines.
This example shows a complete metrics collection pipeline:&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;Alloy&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-alloy&#34;&gt;// Discover Kubernetes pods to scrape
discovery.kubernetes &amp;#34;pods&amp;#34; {
  role = &amp;#34;pod&amp;#34;
}

// Scrape metrics from the discovered pods
prometheus.scrape &amp;#34;app_metrics&amp;#34; {
  targets    = discovery.kubernetes.pods.targets
  forward_to = [prometheus.remote_write.production.receiver]
}

// Send metrics to remote storage
prometheus.remote_write &amp;#34;production&amp;#34; {
  endpoint {
    url = &amp;#34;https://prometheus.example.com/api/v1/write&amp;#34;

    basic_auth {
      username = &amp;#34;metrics&amp;#34;
      password = local.file.api_key.content
    }
  }
}

// Read API key from file
local.file &amp;#34;api_key&amp;#34; {
  filename = &amp;#34;/etc/secrets/api-key&amp;#34;
  is_secret = true
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 880px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/media/docs/alloy/diagram-concepts-example-pipeline.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/media/docs/alloy/diagram-concepts-example-pipeline.png&#34;data-srcset=&#34;/media/docs/alloy/diagram-concepts-example-pipeline.png?w=320 320w, /media/docs/alloy/diagram-concepts-example-pipeline.png?w=550 550w, /media/docs/alloy/diagram-concepts-example-pipeline.png?w=750 750w, /media/docs/alloy/diagram-concepts-example-pipeline.png?w=900 900w, /media/docs/alloy/diagram-concepts-example-pipeline.png?w=1040 1040w, /media/docs/alloy/diagram-concepts-example-pipeline.png?w=1240 1240w, /media/docs/alloy/diagram-concepts-example-pipeline.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Example of a complete metrics pipeline&#34;width=&#34;880&#34;height=&#34;600&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/alloy/diagram-concepts-example-pipeline.png&#34;
            alt=&#34;Example of a complete metrics pipeline&#34;width=&#34;880&#34;height=&#34;600&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;This pipeline demonstrates several key concepts:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Service discovery&lt;/strong&gt;: &lt;code&gt;discovery.kubernetes&lt;/code&gt; finds targets to monitor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data collection&lt;/strong&gt;: &lt;code&gt;prometheus.scrape&lt;/code&gt; collects metrics from those targets.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data forwarding&lt;/strong&gt;: The &lt;code&gt;forward_to&lt;/code&gt; attribute connects components by sending data from one to another.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authentication&lt;/strong&gt;: The remote write component uses credentials from a file.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The &lt;code&gt;forward_to&lt;/code&gt; attribute is a special configuration element that creates data flow connections between components.
It accepts a list of component receivers that process the data.&lt;/p&gt;
&lt;h2 id=&#34;log-processing-pipeline&#34;&gt;Log processing pipeline&lt;/h2&gt;
&lt;p&gt;Here&amp;rsquo;s a more complex example that processes log data through multiple transformation stages:&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;Alloy&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-alloy&#34;&gt;// Read log files using glob patterns
loki.source.file &amp;#34;local_files&amp;#34; {
    targets    = [{__path__ = &amp;#34;/var/log/app/*.log&amp;#34;}]
    forward_to = [loki.process.add_labels.receiver]

    file_match {
        enabled = true
        sync_period = &amp;#34;10s&amp;#34;
    }
}

// Extract data from log messages and add labels
loki.process &amp;#34;add_labels&amp;#34; {
    stage.logfmt {
        mapping = {
            &amp;#34;extracted_level&amp;#34; = &amp;#34;level&amp;#34;,
            &amp;#34;extracted_service&amp;#34; = &amp;#34;service&amp;#34;,
        }
    }

    stage.labels {
        values = {
            &amp;#34;level&amp;#34; = &amp;#34;extracted_level&amp;#34;,
            &amp;#34;service&amp;#34; = &amp;#34;extracted_service&amp;#34;,
        }
    }

    forward_to = [loki.write.grafana_cloud.receiver]
}

// Send processed logs to Loki
loki.write &amp;#34;grafana_cloud&amp;#34; {
    endpoint {
        url = &amp;#34;https://logs-prod.grafana.net/loki/api/v1/push&amp;#34;

        basic_auth {
            username = &amp;#34;12345&amp;#34;
            password = local.file.api_key.content
        }
    }
}

// Read API credentials
local.file &amp;#34;api_key&amp;#34; {
    filename = &amp;#34;/etc/secrets/loki-key&amp;#34;
    is_secret = true
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This pipeline shows how data flows through multiple processing stages:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Discovery&lt;/strong&gt;: Find log files to monitor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Collection&lt;/strong&gt;: Read log entries from files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transformation&lt;/strong&gt;: Parse log messages and extract metadata.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enrichment&lt;/strong&gt;: Add structured labels to log entries.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Output&lt;/strong&gt;: Send processed logs to remote storage.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;pipeline-patterns&#34;&gt;Pipeline patterns&lt;/h2&gt;
&lt;p&gt;Use these common patterns to build effective data processing workflows.&lt;/p&gt;
&lt;h3 id=&#34;fan-out-pattern&#34;&gt;Fan-out pattern&lt;/h3&gt;
&lt;p&gt;Send data from one component to multiple destinations.
This uses the &lt;code&gt;forward_to&lt;/code&gt; attribute with multiple receivers:&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;Alloy&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-alloy&#34;&gt;prometheus.scrape &amp;#34;app_metrics&amp;#34; {
  targets = [{&amp;#34;__address__&amp;#34; = &amp;#34;app:8080&amp;#34;}]
  forward_to = [
    prometheus.remote_write.production.receiver,
    prometheus.remote_write.staging.receiver,
  ]
}

prometheus.remote_write &amp;#34;production&amp;#34; {
  endpoint {
    url = &amp;#34;https://prod-prometheus.example.com/api/v1/write&amp;#34;
  }
}

prometheus.remote_write &amp;#34;staging&amp;#34; {
  endpoint {
    url = &amp;#34;https://staging-prometheus.example.com/api/v1/write&amp;#34;
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This pattern is useful for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Testing changes in staging before production.&lt;/li&gt;
&lt;li&gt;Sending different datasets to different systems.&lt;/li&gt;
&lt;li&gt;Creating redundant data storage for reliability.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;chain-processing-pattern&#34;&gt;Chain processing pattern&lt;/h3&gt;
&lt;p&gt;Transform data through multiple stages:&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;Alloy&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-alloy&#34;&gt;loki.source.file &amp;#34;raw_logs&amp;#34; {
  targets = [{&amp;#34;__path__&amp;#34; = &amp;#34;/var/log/app.log&amp;#34;}]
  forward_to = [loki.process.parse.receiver]
}

loki.process &amp;#34;parse&amp;#34; {
  stage.json {
    expressions = {
      level = &amp;#34;level&amp;#34;,
      message = &amp;#34;msg&amp;#34;,
    }
  }
  forward_to = [loki.process.filter.receiver]
}

loki.process &amp;#34;filter&amp;#34; {
  stage.match {
    selector = &amp;#34;{level=\&amp;#34;error\&amp;#34;}&amp;#34;
    action   = &amp;#34;keep&amp;#34;
  }
  forward_to = [loki.write.alerts.receiver]
}

loki.write &amp;#34;alerts&amp;#34; {
  endpoint {
    url = &amp;#34;https://loki.example.com/loki/api/v1/push&amp;#34;
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This pattern demonstrates progressive data refinement:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Parse&lt;/strong&gt;: Extract structured data from raw logs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Filter&lt;/strong&gt;: Keep only relevant log entries (error level).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Output&lt;/strong&gt;: Send filtered logs to alerting system.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;p&gt;Follow these guidelines to build maintainable and efficient pipelines.&lt;/p&gt;
&lt;h3 id=&#34;keep-pipelines-focused&#34;&gt;Keep pipelines focused&lt;/h3&gt;
&lt;p&gt;Break complex pipelines into logical stages.
Each component should have a clear, single responsibility.&lt;/p&gt;
&lt;h3 id=&#34;use-descriptive-labels&#34;&gt;Use descriptive labels&lt;/h3&gt;
&lt;p&gt;Choose component labels that describe their purpose:&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;Alloy&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-alloy&#34;&gt;// Good: Descriptive labels
prometheus.scrape &amp;#34;api_metrics&amp;#34; { }
prometheus.scrape &amp;#34;database_metrics&amp;#34; { }

// Avoid: Generic labels
prometheus.scrape &amp;#34;scraper1&amp;#34; { }
prometheus.scrape &amp;#34;scraper2&amp;#34; { }&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;handle-secrets-securely&#34;&gt;Handle secrets securely&lt;/h3&gt;
&lt;p&gt;Mark sensitive components appropriately:&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;Alloy&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-alloy&#34;&gt;local.file &amp;#34;database_password&amp;#34; {
  filename = &amp;#34;/etc/secrets/db-password&amp;#34;
  is_secret = true  // Prevents value from appearing in UI
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;test-incrementally&#34;&gt;Test incrementally&lt;/h3&gt;
&lt;p&gt;Build pipelines step by step.
Start with basic data collection, then add processing and forwarding components.&lt;/p&gt;
&lt;h2 id=&#34;debug-pipelines&#34;&gt;Debug pipelines&lt;/h2&gt;
&lt;p&gt;When pipelines don&amp;rsquo;t work as expected:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Check component health&lt;/strong&gt; in the Alloy UI. Unhealthy components appear in red.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Verify component exports&lt;/strong&gt; contain expected data. Use the UI to inspect export values.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Review component dependencies&lt;/strong&gt; to ensure proper data flow. Check that &lt;code&gt;forward_to&lt;/code&gt; references match receiver exports.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check for reference cycles&lt;/strong&gt; - components can&amp;rsquo;t reference themselves directly or indirectly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Validate configuration syntax&lt;/strong&gt; - ensure you spell component and export names correctly.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The Alloy UI provides detailed information about component state, exports, and health status to help troubleshoot pipeline issues.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;p&gt;Now that you understand how to build pipelines, learn more about component management and dynamic configurations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../component-controller/&#34;&gt;Component controller&lt;/a&gt; - Learn how Alloy manages component execution&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../expressions/&#34;&gt;Expressions&lt;/a&gt; - Create dynamic configurations using functions and references&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For hands-on learning:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../../tutorials/&#34;&gt;Tutorials&lt;/a&gt; - Follow step-by-step guides to build complete monitoring solutions&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="build-data-pipelines">Build data pipelines&lt;/h1>
&lt;p>You learned about components in the previous section. They&amp;rsquo;re building blocks that perform tasks such as reading files, collecting metrics, or processing data.
Now you&amp;rsquo;ll learn how to connect components to create &lt;em>pipelines&lt;/em> that collect, transform, and send telemetry data.&lt;/p></description></item><item><title>Component controller</title><link>https://grafana.com/docs/alloy/v1.15/get-started/components/component-controller/</link><pubDate>Mon, 30 Mar 2026 15:47:22 +0000</pubDate><guid>https://grafana.com/docs/alloy/v1.15/get-started/components/component-controller/</guid><content><![CDATA[&lt;h1 id=&#34;component-controller&#34;&gt;Component controller&lt;/h1&gt;
&lt;p&gt;You learned how to build pipelines by connecting components through their exports and references in the previous section.
Now you&amp;rsquo;ll learn how the &lt;em&gt;component controller&lt;/em&gt; manages these components at runtime to make your pipelines work.&lt;/p&gt;
&lt;p&gt;The component controller is the core part of Alloy responsible for:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reading and validating the configuration file.&lt;/li&gt;
&lt;li&gt;Managing the lifecycle of defined components.&lt;/li&gt;
&lt;li&gt;Evaluating the arguments used to configure components.&lt;/li&gt;
&lt;li&gt;Reporting the health of defined components.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;component-graph&#34;&gt;Component graph&lt;/h2&gt;
&lt;p&gt;When you create pipelines, you establish relationships between components by referencing one component&amp;rsquo;s exports in another component&amp;rsquo;s arguments.
The component controller uses these relationships to build a &lt;a href=&#34;https://en.wikipedia.org/wiki/Directed_acyclic_graph&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Directed Acyclic Graph&lt;/a&gt; (DAG) that represents all components and their dependencies.&lt;/p&gt;
&lt;p&gt;This graph serves two critical purposes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Validation&lt;/strong&gt;: Ensures that component references are valid and don&amp;rsquo;t create circular dependencies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Evaluation order&lt;/strong&gt;: Determines the correct sequence for evaluating components so that dependencies are resolved before dependent components run.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For a configuration file to be valid, components can&amp;rsquo;t reference themselves or create circular dependencies.&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;Alloy&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-alloy&#34;&gt;// INVALID: local.file.some_file can&amp;#39;t reference itself:
local.file &amp;#34;self_reference&amp;#34; {
  filename = local.file.self_reference.content
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&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;Alloy&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-alloy&#34;&gt;// INVALID: cyclic reference between local.file.a and local.file.b:
local.file &amp;#34;a&amp;#34; {
  filename = local.file.b.content
}
local.file &amp;#34;b&amp;#34; {
  filename = local.file.a.content
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;component-evaluation&#34;&gt;Component evaluation&lt;/h2&gt;
&lt;p&gt;Component evaluation is the process of computing expressions in a component&amp;rsquo;s arguments into concrete values.
These values configure the component&amp;rsquo;s runtime behavior.&lt;/p&gt;
&lt;p&gt;The component controller follows a strict evaluation order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Dependency resolution&lt;/strong&gt;: The controller evaluates a component only after evaluating all its dependencies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parallel evaluation&lt;/strong&gt;: Components without dependencies can be evaluated in parallel during the initial startup.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Component creation&lt;/strong&gt;: After successful evaluation, the controller creates and starts the component instance.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The component controller is fully loaded once it evaluates, configures, and starts all components.&lt;/p&gt;
&lt;h2 id=&#34;component-reevaluation&#34;&gt;Component reevaluation&lt;/h2&gt;
&lt;p&gt;Components are dynamic and can update their exports multiple times during their lifetime.
For example, a &lt;code&gt;local.file&lt;/code&gt; component updates its exports whenever the file content changes.&lt;/p&gt;
&lt;p&gt;When a component updates its exports, the component controller triggers a &lt;em&gt;reevaluation&lt;/em&gt; process:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Identify dependents&lt;/strong&gt;: The controller finds all components that reference the changed component&amp;rsquo;s exports.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cascade evaluation&lt;/strong&gt;: The controller reevaluates those dependent components with the new export values.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Propagate changes&lt;/strong&gt;: If any dependent component also updates its exports, the process continues until all affected components are reevaluated.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This automatic reevaluation ensures that your pipelines stay current with changing data and conditions.&lt;/p&gt;
&lt;h2 id=&#34;component-health&#34;&gt;Component health&lt;/h2&gt;
&lt;p&gt;Every component has a health state that indicates whether it&amp;rsquo;s working properly.
The component controller tracks health to help you monitor and troubleshoot your pipelines.&lt;/p&gt;
&lt;p&gt;Components can be in one of these health states:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Unknown&lt;/strong&gt;: The default state when a component is created but not yet started.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Healthy&lt;/strong&gt;: The component is working as expected.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unhealthy&lt;/strong&gt;: The component encountered an error or isn&amp;rsquo;t working as expected.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exited&lt;/strong&gt;: The component has stopped and is no longer running.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The component controller determines health by combining multiple factors:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Evaluation health&lt;/strong&gt;: Whether the component&amp;rsquo;s arguments evaluated successfully.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Runtime health&lt;/strong&gt;: Whether the component is running without errors.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Component-specific health&lt;/strong&gt;: Some components report their own health status (for example, &lt;code&gt;local.file&lt;/code&gt; reports unhealthy if its target file is deleted).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A component&amp;rsquo;s health is independent of the health of components it references.
A component can be healthy even if it references exports from an unhealthy component.&lt;/p&gt;
&lt;h2 id=&#34;evaluation-failures&#34;&gt;Evaluation failures&lt;/h2&gt;
&lt;p&gt;When a component fails to evaluate its arguments (for example, due to invalid configuration or missing dependencies), the component controller marks it as unhealthy and logs the failure reason.&lt;/p&gt;
&lt;p&gt;Critically, the component continues operating with its last valid configuration.
This prevents failures from cascading through your entire pipeline.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If a &lt;code&gt;local.file&lt;/code&gt; component watching an API key file encounters a temporary file access error, dependent components continue using the last successfully read API key.&lt;/li&gt;
&lt;li&gt;If a &lt;code&gt;discovery.kubernetes&lt;/code&gt; component temporarily loses connection to the API server, scrapers continue monitoring the last discovered targets.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This graceful degradation keeps your monitoring operational even when individual components encounter temporary issues.&lt;/p&gt;
&lt;h2 id=&#34;in-memory-traffic&#34;&gt;In-memory traffic&lt;/h2&gt;
&lt;p&gt;Some components that expose HTTP endpoints, such as &lt;a href=&#34;../../../reference/components/prometheus/prometheus.exporter.unix&#34;&gt;&lt;code&gt;prometheus.exporter.unix&lt;/code&gt;&lt;/a&gt;, support in-memory communication for improved performance.
When components within the same Alloy process communicate, they can bypass the network stack entirely.&lt;/p&gt;
&lt;p&gt;Benefits of in-memory traffic:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt;: Eliminates network overhead for local component communication.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security&lt;/strong&gt;: No need for network-level authentication or TLS since communication stays within the process.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reliability&lt;/strong&gt;: Avoids potential network-related failures between components.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The internal address defaults to &lt;code&gt;alloy.internal:12345&lt;/code&gt;.
If this conflicts with a real network address, you can change it using the &lt;code&gt;--server.http.memory-addr&lt;/code&gt; flag when running Alloy.&lt;/p&gt;
&lt;p&gt;Components must explicitly support in-memory traffic to use this feature.
Check individual component documentation to see if it&amp;rsquo;s available.&lt;/p&gt;
&lt;h2 id=&#34;configuration-file-updates&#34;&gt;Configuration file updates&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;/-/reload&lt;/code&gt; HTTP endpoint and the &lt;code&gt;SIGHUP&lt;/code&gt; signal notify the component controller to reload the configuration file.
When reloading, the controller synchronizes the running components with the configuration file.
It removes components no longer defined and creates additional ones added to the file.
After reloading, the controller reevaluates all managed components.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;p&gt;Now that you understand how the component controller works, explore advanced component topics and monitoring:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../configure-components/&#34;&gt;Configure components&lt;/a&gt; - Learn how to write components the controller can manage&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../expressions/&#34;&gt;Expressions&lt;/a&gt; - Create dynamic configurations using functions and component references&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For monitoring and troubleshooting:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../../troubleshoot/controller_metrics/&#34;&gt;Monitor the component controller&lt;/a&gt; - Track component health and performance&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../../reference/cli/run/&#34;&gt;Alloy run command&lt;/a&gt; - Configuration options that affect the controller&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="component-controller">Component controller&lt;/h1>
&lt;p>You learned how to build pipelines by connecting components through their exports and references in the previous section.
Now you&amp;rsquo;ll learn how the &lt;em>component controller&lt;/em> manages these components at runtime to make your pipelines work.&lt;/p></description></item><item><title>Custom components</title><link>https://grafana.com/docs/alloy/v1.15/get-started/components/custom-components/</link><pubDate>Mon, 30 Mar 2026 15:47:22 +0000</pubDate><guid>https://grafana.com/docs/alloy/v1.15/get-started/components/custom-components/</guid><content><![CDATA[&lt;h1 id=&#34;custom-components&#34;&gt;Custom components&lt;/h1&gt;
&lt;p&gt;You learned how the component controller manages the lifecycle of components in the previous section.
Now you&amp;rsquo;ll learn how to create your own reusable components by combining existing components into &lt;em&gt;custom components&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Custom components allow you to package a pipeline of built-in and other custom components into a single, reusable unit.
This makes it easier to share common patterns across your configurations and across teams.&lt;/p&gt;
&lt;p&gt;A custom component includes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Arguments&lt;/strong&gt;: Settings that configure the custom component&amp;rsquo;s behavior.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exports&lt;/strong&gt;: Values the custom component exposes to consumers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Components&lt;/strong&gt;: Built-in and custom components that run as part of the custom component.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;create-custom-components&#34;&gt;Create custom components&lt;/h2&gt;
&lt;p&gt;Use the &lt;a href=&#34;../../../reference/config-blocks/declare/&#34;&gt;&lt;code&gt;declare&lt;/code&gt; configuration block&lt;/a&gt; to create a custom component.
The block&amp;rsquo;s label becomes the custom component&amp;rsquo;s name, which you can then use like any built-in component.&lt;/p&gt;
&lt;p&gt;Inside a &lt;code&gt;declare&lt;/code&gt; block, you can use these configuration blocks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../../reference/config-blocks/argument/&#34;&gt;&lt;code&gt;argument&lt;/code&gt;&lt;/a&gt;: Defines a named input parameter that users must provide when using your custom component. Access the value with &lt;code&gt;argument.NAME.value&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../../reference/config-blocks/export/&#34;&gt;&lt;code&gt;export&lt;/code&gt;&lt;/a&gt;: Defines a named output value that your custom component exposes to other components.&lt;/li&gt;
&lt;li&gt;Built-in and custom components: The actual pipeline logic that processes data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The component controller treats custom components the same as built-in components:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Evaluation&lt;/strong&gt;: Arguments are evaluated and passed to the internal pipeline.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Execution&lt;/strong&gt;: The internal components run and process data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Export updates&lt;/strong&gt;: When internal components update their exports, the custom component can update its own exports.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Health reporting&lt;/strong&gt;: The custom component&amp;rsquo;s health reflects the health of its internal components.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Custom components are particularly useful for packaging common pipeline patterns that you want to reuse across multiple configurations.&lt;/p&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;This example creates a custom component called &lt;code&gt;add&lt;/code&gt; that demonstrates the key concepts:&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;Alloy&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-alloy&#34;&gt;declare &amp;#34;add&amp;#34; {
    argument &amp;#34;a&amp;#34; {
        comment = &amp;#34;First number to add&amp;#34;
        optional = false
    }

    argument &amp;#34;b&amp;#34; {
        comment = &amp;#34;Second number to add&amp;#34;
        optional = false
    }

    export &amp;#34;sum&amp;#34; {
        value = argument.a.value &amp;#43; argument.b.value
    }
}

add &amp;#34;example&amp;#34; {
    a = 15
    b = 17
}

// Reference the export: add.example.sum == 32&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This custom component:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Declares two required arguments&lt;/strong&gt;: &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; with descriptive comments.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exports one value&lt;/strong&gt;: &lt;code&gt;sum&lt;/code&gt; that computes the addition of the two arguments.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Can be instantiated&lt;/strong&gt;: Create an instance labeled &lt;code&gt;example&lt;/code&gt; by providing values for &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exposes computed results&lt;/strong&gt;: Other components can reference &lt;code&gt;add.example.sum&lt;/code&gt; to use the result.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For more complex examples that combine multiple built-in components, refer to the &lt;a href=&#34;../../../reference/config-blocks/declare/&#34;&gt;&lt;code&gt;declare&lt;/code&gt; block reference&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;p&gt;Now that you understand custom components, explore related topics and advanced usage:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../../reference/config-blocks/&#34;&gt;Configuration blocks reference&lt;/a&gt; - Learn about &lt;code&gt;declare&lt;/code&gt;, &lt;code&gt;argument&lt;/code&gt;, and &lt;code&gt;export&lt;/code&gt; blocks in detail&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../configure-components/&#34;&gt;Configure components&lt;/a&gt; - Use custom components in your pipelines&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For sharing and organizing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../modules/&#34;&gt;Modules&lt;/a&gt; - Share custom components across multiple configuration files&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="custom-components">Custom components&lt;/h1>
&lt;p>You learned how the component controller manages the lifecycle of components in the previous section.
Now you&amp;rsquo;ll learn how to create your own reusable components by combining existing components into &lt;em>custom components&lt;/em>.&lt;/p></description></item><item><title>Community components</title><link>https://grafana.com/docs/alloy/v1.15/get-started/components/community-components/</link><pubDate>Mon, 30 Mar 2026 15:47:22 +0000</pubDate><guid>https://grafana.com/docs/alloy/v1.15/get-started/components/community-components/</guid><content><![CDATA[&lt;h1 id=&#34;community-components&#34;&gt;Community components&lt;/h1&gt;
&lt;p&gt;You learned how to create custom components by combining existing components in the previous section.
Now you&amp;rsquo;ll learn about &lt;em&gt;community components&lt;/em&gt;. These are specialized components that the Alloy community develops and maintains.&lt;/p&gt;
&lt;p&gt;Community components extend Alloy&amp;rsquo;s capabilities with vendor-specific integrations and specialized functionality that may not be suitable for core components.
They follow the same component architecture you&amp;rsquo;ve learned about but have different support and stability characteristics.&lt;/p&gt;
&lt;h2 id=&#34;what-are-community-components&#34;&gt;What are community components?&lt;/h2&gt;
&lt;p&gt;Community components are components that community members implement and maintain rather than the core Alloy team.
They&amp;rsquo;re particularly useful for:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Vendor-specific integrations&lt;/strong&gt;: Components for services that Grafana Labs doesn&amp;rsquo;t offer commercial support for.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Specialized functionality&lt;/strong&gt;: Components that serve specific use cases or niche requirements.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Experimental features&lt;/strong&gt;: New capabilities that need community validation before potential inclusion in core components.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Key characteristics of community components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Community ownership&lt;/strong&gt;: The community implements, maintains, and supports them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No commercial support&lt;/strong&gt;: Grafana Labs doesn&amp;rsquo;t provide commercial support for these components.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Review process&lt;/strong&gt;: The Alloy development team reviews and accepts them before adding them to the repository.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stability level&lt;/strong&gt;: They don&amp;rsquo;t have defined stability levels and aren&amp;rsquo;t covered by the &lt;a href=&#34;../../../introduction/backward-compatibility/&#34;&gt;backward compatibility strategy&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;enable-community-components&#34;&gt;Enable community components&lt;/h2&gt;
&lt;p&gt;Community components are disabled by default.
To use them, you must explicitly enable them when running Alloy:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;alloy run --feature.community-components.enabled config.alloy&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This flag ensures that you consciously choose to use components that have different support characteristics than core components.
After enabling community components, you can use them the same way as any built-in component in your configuration.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Grafana Labs may disable or remove &lt;strong&gt;community components&lt;/strong&gt; without a maintainer if they block or prevent the development of Alloy.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;p&gt;Now that you understand community components, explore how to find and use components in your configurations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../../reference/components/&#34;&gt;Component reference&lt;/a&gt; - Browse all available components including community components&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../configure-components/&#34;&gt;Configure components&lt;/a&gt; - Learn how to use components in your configuration&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For component selection guidance:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../../collect/choose-component/&#34;&gt;Choose a component&lt;/a&gt; - Get guidance on selecting the right component for your needs&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="community-components">Community components&lt;/h1>
&lt;p>You learned how to create custom components by combining existing components in the previous section.
Now you&amp;rsquo;ll learn about &lt;em>community components&lt;/em>. These are specialized components that the Alloy community develops and maintains.&lt;/p></description></item></channel></rss>