Grafana Alloy Component

OpenTelemetry-compatible telemetry collector from Grafana. Collects, processes, and forwards logs, metrics, and traces to observability backends.

Architecture

Alloy Agent - Telemetry collection (DaemonSet)
Receivers - OTLP, Prometheus, file inputs
Processors - Transform, filter, batch
Exporters - Loki, Prometheus, S3

Quick Reference

Attribute Example Default Effect
namespace REQ alloy - Kubernetes namespace
mode daemonset daemonset daemonset, deployment
enable_logs true true Collect container logs
enable_metrics true true Scrape Prometheus metrics

Link Variables

Variable Link Type Purpose
__loki alloy-loki Log destination (Loki push API)
__prometheus prometheus-alloy Metrics destination
__prometheus_collect alloy-prometheus Self-monitoring metrics
__minio alloy-minio S3 storage for logs
__bucket alloy-bucket Specific bucket destination

Pipeline Configuration

Log Pipeline (with __loki):
- discovery.kubernetes (pod discovery)
- loki.source.kubernetes (log scraping)
- loki.process (label extraction)
- loki.write (push to Loki)

Metrics Pipeline (with __prometheus):
- prometheus.scrape (metrics collection)
- prometheus.relabel (label manipulation)
- prometheus.remote_write (push to Prometheus)

Generated Files

File Condition Contains
helm/helm-values.yaml Always Alloy Helm configuration
secret/config.alloy Always River configuration file

Ports

Port Purpose Protocol
4317 OTLP gRPC receiver gRPC
4318 OTLP HTTP receiver HTTP
12345 Alloy UI HTTP

River Configuration Language

Example config.alloy:
discovery.kubernetes "pods" {
  role = "pod"
}

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"
  }
}

Technical Info

Chart Version: 4.7.4
Ports: 4317 (OTLP gRPC), 4318 (OTLP HTTP), 12345 (UI)
Config Language: River (Grafana's HCL-like DSL)