Skip to content
HoginHogin
Go back

Grafana Alloy: one agent instead of a zoo — logs, metrics, traces and profiles in a single pipeline

8 мин чтения

Grafana Agent is officially dead: on November 1, 2025 it reached end-of-life — no more releases, only migration. Its successor, Grafana Alloy, collects metrics, logs, traces and profiles in a single process with a single config, and in autumn 2026 it reached database observability. If your nodes run a Prometheus scraper, a log shipper and an OTel sidecar in parallel — here is how that becomes one deployment.

Table of contents

Open Table of contents

The zoo: how many agents do you operate

A typical cluster accumulates agents on the “one beast per signal” principle:

Two to four agents per node, each with its own config format, release cadence, RBAC and failure modes: the log shipper dies on a bad regex, the scraper on cardinality — and the causes live in three different places. Grafana Agent tried to merge the zoo but grew two heads itself — static on YAML and Flow on River — and both modes hit EOL. The point of convergence is Alloy: Flow as the foundation, with Prometheus, OTel Collector and Pyroscope components inside.

A zoo of one agent per signal — versus a single Alloy process

How to read an Alloy config

The config is a set of components namespace.component "label". A component has arguments (input) and exports (output), and the arrows between them are plain expressions:

discovery.relabel "pods" {
  targets = discovery.kubernetes.pods.targets   // output of one
  rule { ... }
}

prometheus.scrape "pods" {
  targets    = discovery.relabel.pods.output    // input of another
  forward_to = [prometheus.remote_write.default.receiver]
}

Three rules for reading it:

The language used to be called River (an Agent Flow inheritance) and is now officially the “Alloy config syntax” — same essence: braces, expressions, alloy fmt in CI. Namespaces follow signal providers: prometheus.* (scrape, remote_write, discovery), otelcol.* (receivers, processors, exporters from OTel Collector), loki.* (source and write), pyroscope.* (profiles), remote.* and import.* (values and config fragments from outside).

Three signals — metrics, traces, logs — flow through one config's components to their backends

What one agent changes

Migrating off Grafana Agent

The fork: Alloy versus OTel Collector

We covered a minimal OTel Collector separately — the industry standard; Alloy does not “kill” it but occupies the neighboring niche:

Alloy is more convenient when:

Collector is mandatory when:

Grafana AlloyOTel Collector
ConfigRiver/DAG, expression wiringYAML: receivers → processors → exporters
Prometheus scrapingdiscovery.* + prometheus.scrapeprometheus receiver inside YAML
Kubernetes logsloki.source.kubernetesfilelog receiver
Profilespyroscope.* + OTLPOTLP profiles
Pipeline UIlive component graphnone — zpages and metrics
Component basea subset of contrib + Grafana specificsall of contrib + custom builds
Best forGrafana stack, one agent, speedany backend, the standard, custom distributions

The fork: Grafana stack — Alloy; multi-backend and custom builds — OTel Collector

The two also cascade well: Alloy on nodes collects and normalizes, then OTLP flows to a central Collector gateway that routes to all backends, including non-Grafana ones.

What you need to assemble the pipeline in a cluster

You need a cluster, Helm 3, and live backends (Prometheus or Mimir, Loki, Tempo) — substitute your own addresses. The whole agent is one file, config.alloy.

1. Install. A DaemonSet from the official chart, config straight from the file:

helm repo add grafana https://grafana.github.io/helm-charts
helm upgrade --install alloy grafana/alloy \
  --namespace monitoring --create-namespace \
  --set controller.type=daemonset \
  --set-file alloy.configMap.content=config.alloy

A DaemonSet for logs and node exporters; for central OTLP intake, run a second release with controller.type=deployment.

2. Metrics: annotations → scrape → Prometheus.

discovery.kubernetes "pods" {
  role = "pod"
}

discovery.relabel "pods" {
  targets = discovery.kubernetes.pods.targets

  rule {
    source_labels = ["__meta_kubernetes_pod_annotation_prometheus_io_scrape"]
    regex         = "true"
    action        = "keep"
  }
  rule {
    source_labels = ["__address__", "__meta_kubernetes_pod_annotation_prometheus_io_port"]
    regex         = "([^:]+)(?::\\d+)?;(\\d+)"
    replacement   = "$1:$2"
    target_label  = "__address__"
  }
}

prometheus.scrape "pods" {
  targets         = discovery.relabel.pods.output
  scrape_interval = "30s"
  forward_to      = [prometheus.remote_write.default.receiver]
}

prometheus.remote_write "default" {
  endpoint {
    url = "http://prometheus:9090/api/v1/write"
  }
}

A pod annotated with prometheus.io/scrape: "true" and optional port/path is picked up automatically.

3. Traces: OTLP → batch → Tempo. Applications send OTLP to alloy:4317 (gRPC) or :4318 (HTTP):

otelcol.receiver.otlp "apps" {
  http {}
  grpc {}

  output {
    traces = [otelcol.processor.batch.traces.input]
  }
}

otelcol.processor.batch "traces" {
  output {
    traces = [otelcol.exporter.otlp.tempo.input]
  }
}

otelcol.exporter.otlp "tempo" {
  client {
    endpoint = "tempo:4317"
    tls {
      insecure = true
    }
  }
}

4. Logs: pods → Loki. The same discovery feeds container-log targets:

loki.source.kubernetes "pods" {
  targets    = discovery.kubernetes.pods.targets
  forward_to = [loki.write.default.receiver]
}

loki.write "default" {
  endpoint {
    url = "http://loki:3100/loki/api/v1/push"
  }
}

Filter noisy namespaces with a rule using action = "drop" in a separate discovery.relabel — the same format as for metrics.

5. Config without a redeploy. Volatile parts move out of the main file: remote.http/remote.s3 pull values (tokens, endpoints), while import.git and import.kubernetes.configmap pull whole config fragments:

import.kubernetes.configmap "extras" {
  name      = "alloy-extras"
  namespace = "monitoring"
}

Alloy watches the source: a ConfigMap apply or a Git push is picked up on the fly, without restarting the pod. The old remote.cfg from Agent Flow lives on this way — as values via remote.*.

How to verify it works

kubectl -n monitoring get pods -l app.kubernetes.io/name=alloy
kubectl -n monitoring port-forward svc/alloy 12345:12345

Bottom line

Alloy is the fastest way to assemble the telemetry plane around Grafana: one process instead of an agent zoo, one River config, a live UI and hot updates; the price is tying the component interface to the Grafana ecosystem. The OTel Collector remains the industry standard for everything else: multi-backend, neutrality, custom distributions, gateway topologies. Choose by purpose, not by hype: a Grafana stack — take Alloy and stop multiplying agents; heterogeneous backends and a hard standard requirement — Collector, and they work best cascaded. How to build a Collector the paved way — in our earlier article.


Share this post:

Next Post
OpenEverest (formerly Percona Everest): your own DBaaS for MySQL, PostgreSQL and MongoDB on Kubernetes