RousselTMLEARNING

Article · Alloy: From Discovery to Expertise

Internal Architecture

3. Internal architecture #

Components, services, and the Directed Acyclic Graph (DAG).

The component, the basic building block #

Anatomy of an Alloy component

Everything rests on the component. It receives arguments (what you write), runs continuously and publishes exports that other components read. It also has a health state, visible in the UI and through the API.

The graph (DAG) #

The component graph in the Alloy UI

At load time, the controller builds a directed acyclic graph (DAG) from the references. It first evaluates components with no dependency, then moves up. After that, when a component publishes a new export, only its dependants are re-evaluated. A newly discovered pod therefore does not disturb log sending.

The graph imposes rules, checked at load time. Here are the real messages from Alloy 1.21:

cycle detected: prometheus.relabel.a, prometheus.relabel.b
block prometheus.remote_write.a already declared at du.alloy:1:1
component "prometheus.remote_write.absent.receiver" does not exist or is out of scope
ErrorCauseFix
cycle detectedA sends to B, which sends to ABreak the loop: the graph must stay acyclic
already declaredTwo components with the same name and labelChange the label
does not exist or is out of scopeReference to a missing componentCheck the spelling or the scope of a declare

Where is the data? #

Some components write to disk, in the --storage.path folder (data-alloy by default). We found there, for example, the prometheus.remote_write WAL and the loki.source.file positions. Make this folder persistent: without it, a restart re-reads files or loses pending metrics.

Reloading without interruption #

A POST /-/reload reloads the configuration. We checked two cases:

  • Valid configuration: config reloaded response.
  • Invalid configuration: 400 response, and running components keep running with the old configuration.
Best practice: alloy run accepts a folder and loads all its .alloy files. Split by domain: 10-collecte.alloy, 20-envoi.alloy. We tested it: references work from one file to another.

📄 Grafana Alloy: Introduction and Architecture →

My progress

  • ⏱ Estimated time : ≈ 3 min

Sign in to track your progress and take notes. Sign in

⭐ Rate this lesson

5.0 initial rating from the teaching team

Sign in to rate this lesson →

💬 Recent discussions about this course

Ask a question about this lesson →See all discussions about this course

Course Glossary

Grafana Alloy

An open-source, vendor-neutral telemetry collector designed to replace Grafana Agent, fully compatible with OpenTelemetry (OTel).

Recommended Articles

Grafana Alloy: Understanding and exploiting the User Interface (UI)

Discover how to enable, secure, and use Grafana Alloy's built-in web interface to visualize your ...

The LGTM stack (Loki, Grafana, Tempo, Mimir): architecture and setup

Grafana Labs' LGTM stack: Loki for logs, Grafana for visualization, Tempo for traces, Mimir for m...

Grafana Alloy vs Grafana Agent vs Promtail: which one to choose?

Discover how telemetry collectors have evolved in the Grafana ecosystem. A detailed comparison of...

Grafana Alloy: collecting and transforming telemetry

Learn how to use Grafana Alloy to collect, transform and route logs, metrics and traces. Discover...

Grafana Alloy vs Dynatrace ActiveGate: Which to choose?

Comparison between Grafana Alloy and Dynatrace ActiveGate. Understand the fundamental differences...

Grafana Alloy vs OpenTelemetry Collector: Which One Should You Choose?

A detailed comparison between Grafana Alloy and the OpenTelemetry Collector. Discover the strengt...

OpenTelemetry Collector, Grafana Alloy and Bindplane: comparing three approaches to telemetry pipelines

Detailed comparison of three ways to manage telemetry pipelines: the OpenTelemetry Collector in Y...

Grafana Alloy components reference

A complete reference guide to all the components available in Grafana Alloy, organized by categor...

Grafana Faro: architecture and installation

Install Grafana Faro: the web SDK (npm or CDN), Alloy's faro.receiver, sending to Loki and Tempo,...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!