Grafana Alloy offers advanced features for dynamic telemetry pipelines. This episode covers comparing Alloy with the OTel Collector, going deeper into the River language, discovery and relabeling components, and clustering mode for high availability and target distribution.

In episode 11 you used Grafana Alloy to collect logs. But Alloy is far more than just a file reader — it's a general-purpose collector that handles metrics, logs, and traces all at once, with a programmable River configuration language.
This episode covers when to use Alloy and when to use the OpenTelemetry Collector, a deeper exploration of the River language, discovery and relabeling components for service discovery, and clustering mode that makes Alloy run with high availability.
alloy (edge) -> otel collector (gateway) -> backendThe alloy (edge) -> otel collector (gateway) pattern is the most common combination in mixed deployments.
Old Grafana Agent configuration can be converted to Alloy with the alloy convert tool. On the OTel side, most components have equivalents, so migration is generally gradual.
River is a component-oriented language:
component "name" "label" followed by attributes inside curly braces.-> arrow operator.endpoint = "http://loki:3100/loki/api/v1/push"
loki.write "default" {
endpoint {
url = endpoint
}
external_labels = {
env = "dev",
}
}The expression endpoint = "..." shows that attributes can use variables — making Alloy configuration programmable like code.
discovery.kubernetes, discovery.docker, and discovery.relabel for finding targets.prometheus.remote_write.otelcol.receiver.otlp and otelcol.exporter.otlp.discovery.docker "nodes" {
host = env("DOCKER_HOST")
}
discovery.relabel "keep_web" {
targets = discovery.docker.nodes.targets
rule {
source_labels = ["__meta_docker_container_name"]
regex = "web-.*"
action = "keep"
}
}The discovery.relabel rule filters targets to only containers whose names start with web- — a typical service discovery pattern in production.
Alloy supports clustering for horizontal scaling:
cluster:
enabled: true
name: logs-cluster
join_peers:
- alloy-1:12345The cluster.enabled: true configuration enables cluster mode; join_peers connects an instance to existing cluster members.
Tip
Clustering is useful when log collection or scraping exceeds the capacity of a single node. Start with simple target allocation, then grow nodes as the load grows.
In episode 17 you understood Alloy's position versus the OpenTelemetry Collector and the strategy for using them complementarily, delved into the River language with variables and expressions, discovery and relabeling components, and clustering mode for high availability and target distribution.
The key takeaways:
In the next episode 18 we'll discuss correlation between pillars — linking metrics to traces via exemplars, logs to traces via TraceID, and traces back to logs, up to the unified debugging flow of alert → metric → trace → log. This is the main advantage of the LGTM Stack that sets it apart from a mere collection of tools.