Open source

How Grafana Alloy works

Understanding the architecture and design of Alloy helps you use it effectively.

Where Alloy fits

A typical observability setup has three layers: data sources that generate telemetry, collection tools that gather and process it, and storage backends with visualization frontends for querying and exploring data.

Alloy operates in the collection layer, sitting between your data sources and your storage backends. It acts as the bridge between them, performing three main functions in your telemetry pipeline.

Collect telemetry data

Alloy gathers telemetry from any source in your infrastructure. You can configure it to scrape Prometheus endpoints for metrics or set up receivers to accept data pushed via the OpenTelemetry protocol. It tails log files and reads from system outputs to capture application and infrastructure logs. Service discovery automatically finds resources in Kubernetes, Docker, or cloud environments without requiring static configuration. You can also integrate with databases, message queues, and other systems to capture telemetry from specialized sources.

Transform and process data

Processing telemetry before sending it to backends optimizes costs and improves data quality. Create filters to drop unwanted data or redact sensitive information like tokens and credentials from logs before they reach storage. Add labels, metadata, or contextual information to enrich your data—for example, extract a cloud provider name from instance IDs to create useful aggregation labels. Standardize attribute names across services when different teams use inconsistent naming conventions. Implement sampling strategies to reduce high-volume data while preserving the signal you need for troubleshooting. Convert between formats, such as transforming Prometheus metrics to OpenTelemetry format, to ensure compatibility with your backends. Define routing rules to send different types of data to different destinations based on your operational requirements.

Send to backends

Alloy delivers processed telemetry to any storage system you choose. Send data to Grafana Cloud for managed observability, or export to your self-managed Grafana stack components. Connect to any Prometheus-compatible database for metrics and any OpenTelemetry-compatible backend for all signal types. Write to multiple destinations simultaneously, sending the same data to different systems or routing different data types to specialized backends.

Component-based architecture

Alloy uses modular components that work like building blocks. Each component performs a specific task, such as collecting metrics from Prometheus endpoints, receiving OpenTelemetry data, transforming and filtering telemetry, or sending data to backends.

You connect these components together to build pipelines that match your exact requirements. This modular approach makes configurations easier to understand, test, and maintain.

Programmable pipelines

Alloy uses a rich, expression-based configuration language that lets you reference data from one component in another, create dynamic configurations that respond to changing conditions, build reusable pipelines you can share across teams, and use built-in functions to transform and filter data.

Custom and shareable pipelines

You can create custom components that combine multiple components into a single, reusable unit. Share these custom components with your team or the community through the module system. Use pre-built modules from the community or create your own.

Enterprise-ready features

As your systems grow more complex, Alloy scales with you. Clustering lets you configure instances to form a cluster for automatic workload distribution and high availability. Centralized configuration retrieves settings from remote servers for fleet management. Kubernetes-native capabilities let you interact with Kubernetes resources directly without learning separate operators.

Built-in debugging tools

Alloy includes a built-in user interface that helps you visualize your component pipelines, inspect component states and outputs, troubleshoot configuration issues, and monitor performance.

Deployment patterns

Choose the deployment pattern that fits your architecture.

Edge deployment: Deploy Alloy close to your data sources for minimal latency. Run it as a DaemonSet in Kubernetes to collect from every node, install it on each host for infrastructure monitoring, or deploy it alongside applications for local processing.

Gateway deployment: Deploy Alloy as a centralized gateway. Configure your applications to send telemetry to Alloy gateways, which process and forward data to backends. Applications only need to know about the gateway endpoints.

Hybrid deployment: Combine edge and gateway approaches. Deploy edge instances to handle initial collection and filtering close to sources, then forward to gateway instances for aggregation and final processing. This pattern reduces bandwidth usage and enables centralized policy enforcement while maintaining local processing capabilities.

Integrations

Alloy integrates with Grafana Cloud and self-managed Grafana stacks, routing metrics to Mimir, logs to Loki, traces to Tempo, and profiles to Pyroscope. It also works with the broader Prometheus ecosystem through full compatibility with the Prometheus exposition format and service discovery mechanisms, and with any OpenTelemetry-compatible backend through OTLP support.

You can also connect to other ecosystems, including InfluxDB, Elasticsearch, and cloud platforms like AWS, Google Cloud Platform, and Azure.

Next steps