Section 3 · Components and pipelines

The building block that does one job in an Alloy pipeline

Estimated time: 1 min

What is a component

You describe Alloy’s collect, transform, and send work with components.

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.

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.

Type and label

Each component has a type and a label. Take loki.write "local" as an example. loki.write is the type, and it tells you what kind of work the component does. "local" is the label, and it identifies this specific instance. Labels matter because you can run more than one loki.write component in a configuration, and you need a way to tell them apart.

The type and label combine to form the component’s identifier, loki.write.local. Use this identifier to reference the component’s exports elsewhere in your configuration.

A component label isn’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.