<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Components and pipelines on Grafana Labs</title><link>https://grafana.com/docs/learning-hub/intro-to-alloy/03-components-and-pipelines/</link><description>Recent content in Components and pipelines on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/learning-hub/intro-to-alloy/03-components-and-pipelines/index.xml" rel="self" type="application/rss+xml"/><item><title>What is a component</title><link>https://grafana.com/docs/learning-hub/intro-to-alloy/03-components-and-pipelines/08-what-is-a-component/</link><pubDate>Fri, 14 Aug 2026 09:40:11 -0500</pubDate><guid>https://grafana.com/docs/learning-hub/intro-to-alloy/03-components-and-pipelines/08-what-is-a-component/</guid><content><![CDATA[&lt;h2 id=&#34;what-is-a-component&#34;&gt;What is a component&lt;/h2&gt;
&lt;p&gt;You describe Alloy&amp;rsquo;s collect, transform, and send work with components.&lt;/p&gt;
&lt;p&gt;In Alloy, a component is a building block that does one job. Components do the three jobs, collect, transform, and send, plus one more: finding the endpoints to collect from, called targets.&lt;/p&gt;
&lt;p&gt;You connect components so that data flows through a pipeline that matches your needs. A pipeline is a chain of connected components that data passes through from source to destination.&lt;/p&gt;
&lt;h2 id=&#34;type-and-label&#34;&gt;Type and label&lt;/h2&gt;
&lt;p&gt;Each component has a type and a label. Take &lt;code&gt;loki.write &amp;quot;local&amp;quot;&lt;/code&gt; as an example. &lt;code&gt;loki.write&lt;/code&gt; is the type, and it tells you what kind of work the component does. &lt;code&gt;&amp;quot;local&amp;quot;&lt;/code&gt; is the label, and it identifies this specific instance. Labels matter because you can run more than one &lt;code&gt;loki.write&lt;/code&gt; component in a configuration, and you need a way to tell them apart.&lt;/p&gt;
&lt;p&gt;The type and label combine to form the component&amp;rsquo;s identifier, &lt;code&gt;loki.write.local&lt;/code&gt;. Use this identifier to reference the component&amp;rsquo;s exports elsewhere in your configuration.&lt;/p&gt;
&lt;p&gt;A component label isn&amp;rsquo;t the same as a label attached to telemetry data, such as a Prometheus metric label. A component label identifies a piece of your configuration. A telemetry label is metadata that travels with the data itself as it moves through the pipeline.&lt;/p&gt;
]]></content><description>&lt;h2 id="what-is-a-component">What is a component&lt;/h2>
&lt;p>You describe Alloy&amp;rsquo;s collect, transform, and send work with components.&lt;/p>
&lt;p>In Alloy, a component is a building block that does one job. Components do the three jobs, collect, transform, and send, plus one more: finding the endpoints to collect from, called targets.&lt;/p></description></item><item><title>A pipeline in action</title><link>https://grafana.com/docs/learning-hub/intro-to-alloy/03-components-and-pipelines/09-build-a-pipeline/</link><pubDate>Fri, 14 Aug 2026 09:40:11 -0500</pubDate><guid>https://grafana.com/docs/learning-hub/intro-to-alloy/03-components-and-pipelines/09-build-a-pipeline/</guid><content><![CDATA[&lt;h2 id=&#34;a-pipeline-in-action&#34;&gt;A pipeline in action&lt;/h2&gt;
&lt;p&gt;Here is a small pipeline that collects logs from files and writes them to Loki, a Grafana backend for log storage. This example focuses on the shape of the pipeline, not the syntax details, which come later in this journey.&lt;/p&gt;
&lt;p&gt;This configuration comes from the runnable &lt;code&gt;logs-file&lt;/code&gt; example in the &lt;a href=&#34;https://github.com/grafana/alloy-scenarios/tree/main/logs-file&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;alloy-scenarios repository&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;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_match &amp;#34;local_files&amp;#34; {
  path_targets = [{&amp;#34;__path__&amp;#34; = &amp;#34;/temp/logs/*.log&amp;#34;, &amp;#34;job&amp;#34; = &amp;#34;python&amp;#34;}]
  sync_period  = &amp;#34;5s&amp;#34;
}

loki.source.file &amp;#34;log_scrape&amp;#34; {
  targets       = local.file_match.local_files.targets
  forward_to    = [loki.write.local.receiver]
  tail_from_end = true
}

loki.write &amp;#34;local&amp;#34; {
  endpoint {
    url = &amp;#34;http://loki:3100/loki/api/v1/push&amp;#34;
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;read-it-as-discover-collect-send&#34;&gt;Read it as discover, collect, send&lt;/h2&gt;
&lt;p&gt;This short path uses discovery to start collecting, then sends the data on. It skips the transform job. Processing components often sit between collect and send in fuller pipelines.&lt;/p&gt;
&lt;p&gt;Follow the data from top to bottom, from discovering log files through to sending entries to Loki.&lt;/p&gt;

&lt;div class=&#34;learning-hub-image&#34;&gt;
  &lt;a href=&#34;pipeline-flow.svg&#34; title=&#34;local.file_match discovers files, loki.source.file collects them, loki.write sends the entries, and the entries arrive in Loki.&#34;&gt;
    &lt;img
      class=&#34;lazyload d-inline-block&#34;
      data-src=&#34;pipeline-flow.svg&#34;
      alt=&#34;local.file_match discovers files, loki.source.file collects them, loki.write sends the entries, and the entries arrive in Loki.&#34; width=&#34;890&#34; height=&#34;200&#34;/&gt;
    &lt;div class=&#34;learning-hub-image__zoom&#34;&gt;
      &lt;svg width=&#34;24&#34; height=&#34;24&#34; viewBox=&#34;0 0 24 24&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
        &lt;path d=&#34;M21 21L15 15M17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10Z&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
        &lt;path d=&#34;M10 7V13M7 10H13&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34; stroke-linecap=&#34;round&#34;/&gt;
      &lt;/svg&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Discover:&lt;/strong&gt; &lt;code&gt;local.file_match&lt;/code&gt; finds matching log files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Collect:&lt;/strong&gt; &lt;code&gt;loki.source.file&lt;/code&gt; tails those files and forwards the log entries.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Send:&lt;/strong&gt; &lt;code&gt;loki.write&lt;/code&gt; sends the entries to Loki.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each component hands its work to the next, so the three components together form one pipeline.&lt;/p&gt;
&lt;h2 id=&#34;real-pipelines-do-more&#34;&gt;Real pipelines do more&lt;/h2&gt;
&lt;p&gt;This example keeps the path short. Real production pipelines often add processing components between the collect and send steps to add or change identifying fields, parse log lines, filter unwanted data, or redact secrets.&lt;/p&gt;
]]></content><description>&lt;h2 id="a-pipeline-in-action">A pipeline in action&lt;/h2>
&lt;p>Here is a small pipeline that collects logs from files and writes them to Loki, a Grafana backend for log storage. This example focuses on the shape of the pipeline, not the syntax details, which come later in this journey.&lt;/p></description></item><item><title>Resources</title><link>https://grafana.com/docs/learning-hub/intro-to-alloy/03-components-and-pipelines/10-resources/</link><pubDate>Fri, 14 Aug 2026 09:40:11 -0500</pubDate><guid>https://grafana.com/docs/learning-hub/intro-to-alloy/03-components-and-pipelines/10-resources/</guid><content><![CDATA[&lt;h2 id=&#34;resources&#34;&gt;Resources&lt;/h2&gt;
&lt;p&gt;Use these resources to learn more about components and how they form pipelines.&lt;/p&gt;
&lt;h2 id=&#34;documentation&#34;&gt;Documentation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;/docs/alloy/latest/get-started/syntax/&#34;&gt;Alloy syntax&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;/docs/alloy/latest/get-started/components/configure-components/&#34;&gt;Configure components&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;runnable-examples&#34;&gt;Runnable examples&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/grafana/alloy-scenarios&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;alloy-scenarios&lt;/a&gt;: self-contained runnable examples for logs, metrics, traces, and more&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h2 id="resources">Resources&lt;/h2>
&lt;p>Use these resources to learn more about components and how they form pipelines.&lt;/p>
&lt;h2 id="documentation">Documentation&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="/docs/alloy/latest/get-started/syntax/">Alloy syntax&lt;/a>&lt;/li>
&lt;li>&lt;a href="/docs/alloy/latest/get-started/components/configure-components/">Configure components&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="runnable-examples">Runnable examples&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://github.com/grafana/alloy-scenarios" target="_blank" rel="noopener noreferrer">alloy-scenarios&lt;/a>: self-contained runnable examples for logs, metrics, traces, and more&lt;/li>
&lt;/ul></description></item></channel></rss>