# Table of Contents - [Grafana Alloy | Grafana Alloy documentation](#grafana-alloy-grafana-alloy-documentation) - [Supported platforms | Grafana Alloy documentation](#supported-platforms-grafana-alloy-documentation) - [Introduction to Grafana Alloy | Grafana Alloy documentation](#introduction-to-grafana-alloy-grafana-alloy-documentation) - [Community components | Grafana Alloy documentation](#community-components-grafana-alloy-documentation) - [Estimate Grafana Alloy resource usage | Grafana Alloy documentation](#estimate-grafana-alloy-resource-usage-grafana-alloy-documentation) - [Get started | Grafana Alloy documentation](#get-started-grafana-alloy-documentation) - [Alloy configuration syntax | Grafana Alloy documentation](#alloy-configuration-syntax-grafana-alloy-documentation) - [Release cadence | Grafana Alloy documentation](#release-cadence-grafana-alloy-documentation) - [Grafana Alloy backward compatibility | Grafana Alloy documentation](#grafana-alloy-backward-compatibility-grafana-alloy-documentation) - [Component controller | Grafana Alloy documentation](#component-controller-grafana-alloy-documentation) - [Components | Grafana Alloy documentation](#components-grafana-alloy-documentation) - [Custom components | Grafana Alloy documentation](#custom-components-grafana-alloy-documentation) - [Set up Grafana Alloy | Grafana Alloy documentation](#set-up-grafana-alloy-grafana-alloy-documentation) - [Install Grafana Alloy | Grafana Alloy documentation](#install-grafana-alloy-grafana-alloy-documentation) - [Clustering | Grafana Alloy documentation](#clustering-grafana-alloy-documentation) - [Modules | Grafana Alloy documentation](#modules-grafana-alloy-documentation) - [Deploy Grafana Alloy | Grafana Alloy documentation](#deploy-grafana-alloy-grafana-alloy-documentation) - [Migrate to Grafana Alloy | Grafana Alloy documentation](#migrate-to-grafana-alloy-grafana-alloy-documentation) - [Run Grafana Alloy | Grafana Alloy documentation](#run-grafana-alloy-grafana-alloy-documentation) - [Configure Grafana Alloy clustering in an existing installation | Grafana Alloy documentation](#configure-grafana-alloy-clustering-in-an-existing-installation-grafana-alloy-documentation) - [Set up meta-monitoring to collect Alloy telemetry | Grafana Alloy documentation](#set-up-meta-monitoring-to-collect-alloy-telemetry-grafana-alloy-documentation) - [Configure Grafana Alloy | Grafana Alloy documentation](#configure-grafana-alloy-grafana-alloy-documentation) - [Receive traces and metrics from Datadog-instrumented applications | Grafana Alloy documentation](#receive-traces-and-metrics-from-datadog-instrumented-applications-grafana-alloy-documentation) - [Configure Grafana Alloy on Windows | Grafana Alloy documentation](#configure-grafana-alloy-on-windows-grafana-alloy-documentation) - [Collect Kubernetes logs and forward them to Loki | Grafana Alloy documentation](#collect-kubernetes-logs-and-forward-them-to-loki-grafana-alloy-documentation) - [Configure Grafana Alloy on Linux | Grafana Alloy documentation](#configure-grafana-alloy-on-linux-grafana-alloy-documentation) - [Configure Grafana Alloy on Kubernetes | Grafana Alloy documentation](#configure-grafana-alloy-on-kubernetes-grafana-alloy-documentation) - [Collect OpenTelemetry data and forward it to any OpenTelemetry-compatible endpoint | Grafana Alloy documentation](#collect-opentelemetry-data-and-forward-it-to-any-opentelemetry-compatible-endpoint-grafana-alloy-documentation) - [Collect and forward data with Grafana Alloy | Grafana Alloy documentation](#collect-and-forward-data-with-grafana-alloy-grafana-alloy-documentation) - [Monitor Microsoft Windows servers and desktops with Grafana Alloy | Grafana Alloy documentation](#monitor-microsoft-windows-servers-and-desktops-with-grafana-alloy-grafana-alloy-documentation) - [Run Alloy as a non-root user in Kubernetes | Grafana Alloy documentation](#run-alloy-as-a-non-root-user-in-kubernetes-grafana-alloy-documentation) - [Configure Grafana Alloy on macOS | Grafana Alloy documentation](#configure-grafana-alloy-on-macos-grafana-alloy-documentation) - [Collect Prometheus metrics | Grafana Alloy documentation](#collect-prometheus-metrics-grafana-alloy-documentation) - [Monitor metrics and logs with Grafana Alloy | Grafana Alloy documentation](#monitor-metrics-and-logs-with-grafana-alloy-grafana-alloy-documentation) --- # Grafana Alloy | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Grafana Alloy Open source Grafana Alloy ============= Grafana Alloy combines the strengths of the leading collectors into one place. Whether observing applications, infrastructure, or both, Grafana Alloy can collect, process, and export telemetry signals to scale and future-proof your observability approach. * * * Overview ======== [](/media/docs/alloy/alloy_diagram_v2.svg) **Collect all your telemetry with one product** Choosing the right tools to collect, process, and export telemetry data can be a confusing and costly experience. The broad range of telemetry you need to process and the collectors you choose can vary widely depending on your observability goals. In addition, you face the challenge of addressing the constantly evolving needs of your observability strategy. For example, you may initially only need application observability, but you then discover that you must add infrastructure observability. Many organizations manage and configure multiple collectors to address these challenges, introducing more complexity and potential errors in their obervability strategy. **All signals, whether application, infrastructure, or both** Grafana Alloy has native pipelines for leading telemetry signals, such as Prometheus and OpenTelemetry, and databases such as Loki and Pyroscope. This permits logs, metrics, traces, and even mature support for profiling. **Enterprise strength observability** Grafana Alloy improves reliability and provides advanced features for Enterprise needs, such as clusters of fleets and balancing workloads. Grafana [Fleet Management](/docs/grafana-cloud/send-data/fleet-management/) helps you manage multiple Grafana Alloy deployments at scale. Explore ------- [Introduction to Alloy\ \ Learn about what Alloy can do for you.](./introduction/) [Install Alloy\ \ Learn how to install and uninstall Alloy on Docker, Kubernetes, Linux, macOS, or Windows.](./set-up/install/) [Run Alloy\ \ Learn how to start, restart, and stop Alloy after you have installed it.](./set-up/run/) [Configure Alloy\ \ Learn how to configure Alloy on Kubernetes, Linux, macOS, or Windows.](./configure/) [Migrate to Alloy\ \ Learn how to migrate to Alloy from Grafana Agent Operator, Prometheus, Promtail, Grafana Agent Static, or Grafana Agent Flow.](./set-up/migrate/) [Collect OpenTelemetry data\ \ Learn how to configure OpenTelemetry data delivery, configure batching, and receive OpenTelemetry data over OTLP.](./collect/opentelemetry-data/) [Concepts\ \ Learn about components, modules, clustering, and the Alloy configuration syntax.](./get-started/) [Reference\ \ Read the reference documentation about the command line tools, configuration blocks, components, and standard library.](./reference/) Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/_index.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/_index.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Supported platforms | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Introduction](/docs/alloy/latest/introduction/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Supported platforms Open source Supported platforms =================== The following operating systems and hardware architecture are supported. Linux ----- * Architectures: AMD64, ARM64 * Within the Linux distribution lifecycle Windows ------- * Minimum version: Windows Server 2016 or later, or Windows 10 or later. * Architectures: AMD64 macOS ----- * Minimum version: macOS 10.13 or later * Architectures: AMD64 on Intel, ARM64 on Apple Silicon FreeBSD ------- * Within the FreeBSD lifecycle * Architectures: AMD64 Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/introduction/supported-platforms.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/introduction/supported-platforms.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Introduction to Grafana Alloy | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Introduction Open source [RSS](/docs/alloy/latest/introduction/index.xml) Introduction to Grafana Alloy ============================= Alloy is a flexible, high performance, vendor-neutral distribution of the [OpenTelemetry](https://opentelemetry.io/ecosystem/distributions/) Collector. It’s fully compatible with the most popular open source observability standards such as OpenTelemetry and Prometheus. Alloy focuses on ease-of-use and the ability to adapt to the needs of power users. Key features ------------ Some of the key features of Alloy include: * **Custom components:** You can use Alloy to create and share custom components. Custom components combine a pipeline of existing components into a single, easy-to-understand component that’s just a few lines long. You can use pre-built custom components from the community, ones packaged by Grafana, or create your own. * **Reusable components:** You can use the output of a component as the input for multiple other components. * **Chained components:** You can chain components together to form a pipeline. * **Single task per component:** The scope of each component is limited to one specific task. * **GitOps compatibility:** Alloy uses frameworks to pull configurations from Git, S3, HTTP endpoints, and just about any other source. * **Clustering support:** Alloy has native clustering support. Clustering helps distribute the workload and ensures you have high availability. You can quickly create horizontally scalable deployments with minimal resource and operational overhead. * **Security:** Alloy helps you manage authentication credentials and connect to HashiCorp Vaults or Kubernetes clusters to retrieve secrets. * **Debugging utilities:** Alloy provides troubleshooting support and an embedded [user interface](../troubleshoot/debug/) to help you identify and resolve configuration problems. How does Alloy work as an OpenTelemetry collector? -------------------------------------------------- [](/media/docs/alloy/flow-diagram-small-alloy.png) ### Collect Alloy uses more than 120 components to collect telemetry data from applications, databases, and OpenTelemetry collectors. Alloy supports collection using multiple ecosystems, including OpenTelemetry and Prometheus. Telemetry data can be either pushed to Alloy, or Alloy can pull it from your data sources. ### Transform Alloy processes data and transforms it for sending. You can use transformations to inject extra metadata into telemetry or filter out unwanted data. ### Write Alloy sends data to OpenTelemetry-compatible databases or collectors, the Grafana stack, or Grafana Cloud. Alloy can also write alerting rules in compatible databases. Next steps ---------- * [Install](../set-up/install/) Alloy. * Learn about the core [Concepts](../get-started/) of Alloy. * Follow the [tutorials](../tutorials/) for hands-on learning about Alloy. * Learn how to [collect and forward data](../collect/) with Alloy. * Check out the [reference](../reference/) documentation to find information about the Alloy components, configuration blocks, and command line tools. Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/introduction/_index.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/introduction/_index.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Community components | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Get started](/docs/alloy/latest/get-started/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Community components Open source Community components ==================== **Community components** are [components](../components/) implemented and maintained by the community. While Grafana doesn’t offer commercial support for these components, they still undergo acceptance and review by the Alloy development team before being added to the repository. To use these community components, you must explicitly pass the `--feature.community-components.enabled` flag to the `run` command. **Community components** don’t have a stability level. They aren’t covered by the [backward compatibility strategy](../../introduction/backward-compatibility/) . > Warning > > **Community components** without a maintainer may be disabled or removed if the components prevent or block the development of Alloy. Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/get-started/community_components.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/get-started/community_components.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Estimate Grafana Alloy resource usage | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Introduction](/docs/alloy/latest/introduction/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Estimate resource usage Open source Estimate Grafana Alloy resource usage ===================================== This page provides guidance for expected resource usage of Alloy for each telemetry type, based on operational experience of some of the Alloy maintainers. > Note > > The resource usage depends on the workload, hardware, and the configuration used. The information on this page is a good starting point for most users, but your actual usage may be different. Prometheus metrics ------------------ The Prometheus metrics resource usage depends mainly on the number of active series that need to be scraped and the scrape interval. As a rule of thumb, **per each 1 million active series** and with the default scrape interval, you can expect to use approximately: * 0.4 CPU cores * 11 GiB of memory * 1.5 MiB/s of total network bandwidth, send and receive These recommendations are based on deployments that use [clustering](../../get-started/clustering/) , but they broadly apply to other deployment modes. Refer to [Deploy Grafana Alloy](../../set-up/deploy/) for more information on how to deploy Alloy. Loki logs --------- Loki logs resource usage depends mainly on the volume of logs ingested. As a rule of thumb, **per each 1 MiB/second of logs ingested**, you can expect to use approximately: * 1 CPU core * 120 MiB of memory These recommendations are based on Kubernetes DaemonSet deployments on clusters with relatively small number of nodes and high logs volume on each. The resource usage can be higher per each 1 MiB/second of logs if you have a large number of small nodes due to the constant overhead of running the Alloy on each node. Additionally, factors such as number of labels, number of files and average log line length may all play a role in the resource usage. Pyroscope profiles ------------------ Pyroscope profiles resource usage depends mainly on the volume of profiles. As a rule of thumb, **per each 100 profiles/second**, you can expect to use approximately: * 1 CPU core * 10 GiB of memory Factors such as size of each profile and frequency of fetching them also play a role in the overall resource usage. Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/introduction/estimate-resource-usage.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/introduction/estimate-resource-usage.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Get started | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Get started Open source [RSS](/docs/alloy/latest/get-started/index.xml) Get started =========== This section helps you get started with Grafana Alloy. * [Alloy configuration syntax](/docs/alloy/latest/get-started/configuration-syntax/) * [Community components](/docs/alloy/latest/get-started/community_components/) * [Components](/docs/alloy/latest/get-started/components/) * [Component controller](/docs/alloy/latest/get-started/component_controller/) * [Custom components](/docs/alloy/latest/get-started/custom_components/) * [Modules](/docs/alloy/latest/get-started/modules/) * [Clustering](/docs/alloy/latest/get-started/clustering/) Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/get-started/_index.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/get-started/_index.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Alloy configuration syntax | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Get started](/docs/alloy/latest/get-started/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Configuration syntax Open source [RSS](/docs/alloy/latest/get-started/configuration-syntax/index.xml) Alloy configuration syntax ========================== Grafana Alloy dynamically configures and connects components with the Alloy configuration syntax. Alloy handles the collection, transformation, and delivery of telemetry data. Each component in the configuration handles one of those tasks or specifies how data flows and how the components are bound together. [](/media/docs/alloy/flow-diagram-small-alloy.png) The following simple example shows the basic concepts and how an Alloy configuration comes together into a pipeline. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy // Collection: mount a local directory with a certain path spec local.file_match "applogs" { path_targets = [{"__path__" = "/tmp/app-logs/app.log"}] } // Collection: Take the file match as input, and scrape those mounted log files loki.source.file "local_files" { targets = local.file_match.applogs.targets // This specifies which component should process the logs next, the "link in the chain" forward_to = [loki.process.add_new_label.receiver] } // Transformation: pull some data out of the log message, and turn it into a label loki.process "add_new_label" { stage.logfmt { mapping = { "extracted_level" = "level", } } // Add the value of "extracted_level" from the extracted map as a "level" label stage.labels { values = { "level" = "extracted_level", } } // The next link in the chain is the local_loki "receiver" (receives the telemetry) forward_to = [loki.write.local_loki.receiver] } // Anything that comes into this component gets written to the loki remote API loki.write "local_loki" { endpoint { url = "http://loki:3100/loki/api/v1/push" } } The Alloy syntax aims to reduce errors in configuration files by making configurations easier to read and write. The Alloy syntax uses blocks, attributes, and expressions. You can copy and paste the blocks from the documentation to help you get started as quickly as possible. The Alloy syntax is declarative, so ordering components, blocks, and attributes doesn’t matter. The relationship between components determines the order of operations in the pipeline. Blocks ------ You use _Blocks_ to configure components and groups of attributes. Each block can contain any number of attributes or nested blocks. Blocks are steps in the overall pipeline expressed by the configuration. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy prometheus.remote_write "default" { endpoint { url = "http://localhost:9009/api/prom/push" } } The preceding example has two blocks: * `prometheus.remote_write "default"`: A labeled block which instantiates a `prometheus.remote_write` component. The label is the string `"default"`. * `endpoint`: An unlabeled block inside the component that configures an endpoint to send metrics to. This block sets the `url` attribute to specify the endpoint. Attributes ---------- You use _Attributes_ to configure individual settings. Attributes always take the form of `ATTRIBUTE_NAME = ATTRIBUTE_VALUE`. The following example shows how to set the `log_level` attribute to `"debug"`. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy log_level = "debug" Expressions ----------- You use expressions to compute the value of an attribute. The simplest expressions are constant values like `"debug"`, `32`, or `[1, 2, 3, 4]`. The Alloy syntax supports complex expressions, for example: * Referencing the exports of components: `local.file.password_file.content` * Mathematical operations: `1 + 2`, `3 * 4`, `(5 * 6) + (7 + 8)` * Equality checks: `local.file.file_a.content == local.file.file_b.content` * Calling functions from Alloy’s standard library: `sys.env("HOME")` retrieves the value of the `HOME` environment variable. You can use expressions for any attribute inside a component definition. ### Reference component exports The most common expression is to reference the exports of a component, for example, `local.file.password_file.content`. You form a reference to a component’s exports by merging the component’s name (for example, `local.file`), label (for example, `password_file`), and export name (for example, `content`), delimited by a period. Configuration syntax design goals --------------------------------- Alloy is: * _Fast_: The configuration language is fast, so the component controller can quickly evaluate changes. * _Simple_: The configuration language is easy to read and write to minimize the learning curve. * _Easy to debug_: The configuration language gives detailed information when there’s a mistake in the configuration file. The Alloy configuration syntax is a distinct language with custom syntax and features, such as first-class functions. * Blocks are a group of related settings and usually represent creating a component. Blocks have a name that consists of zero or more identifiers separated by `.`, an optional user label, and a body containing attributes and nested blocks. * Attributes appear within blocks and assign a value to a name. * Expressions represent a value, either literally or by referencing and combining other values. You use expressions to compute a value for an attribute. Tooling ------- You can use one or all of the following tools to help you write Alloy configuration files. * Editor support for: * [VSCode](https://github.com/grafana/vscode-alloy) * [Vim/Neovim](https://github.com/grafana/vim-alloy) * Code formatting using the [`alloy fmt` command](../../reference/cli/fmt/) Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/get-started/configuration-syntax/_index.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/get-started/configuration-syntax/_index.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Release cadence | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Introduction](/docs/alloy/latest/introduction/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Release cadence Open source Release cadence =============== A new minor release is planned every six weeks for Alloy. The release cadence is best-effort. If necessary, releases may be performed outside of this cadence, or a scheduled release date can be moved forwards or backwards. Minor releases published on cadence include updating dependencies for upstream OpenTelemetry Collector code if new versions are available. Minor releases published outside of the release cadence may not include these dependency updates. Patch and security releases may be created at any time. Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/introduction/release-cadence.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/introduction/release-cadence.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Grafana Alloy backward compatibility | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Introduction](/docs/alloy/latest/introduction/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Backward compatibility Open source Grafana Alloy backward compatibility ==================================== Grafana Alloy follows [semantic versioning](https://semver.org/) . [Exceptions](#exceptions) may arise that require a breaking change without a new major version. Alloy is stable, and we strive to maintain backward compatibility between minor and patch versions. Documented functionality that’s released as _Generally available_ is covered by backward compatibility, including: * **User configuration**, including the Alloy configuration syntax, the semantics of the configuration file, and the command-line interface. * **APIs**, for any network or code API released as v1.0.0 or later. * **Observability data used in official dashboards**, where the official set of dashboards are found in the [`alloy-mixin/`](https://github.com/grafana/alloy/tree/main/operations/alloy-mixin) directory. Exceptions ---------- We strive to maintain backward compatibility, but there are situations that may arise that require a breaking change without a new major version, deviating from [item 8 of the semver specification](https://semver.org/spec/v2.0.0.html#spec-item-8) : * **Security**: A security issue may arise that requires breaking compatibility. * **Legal requirements**: If an exposed behavior violates a licensing or legal requirement, a breaking change may be required. * **Specification errors**: If a specification for a feature is found to be incomplete or inconsistent, fixing the specification may require a breaking change. * **Bugs**: If a bug is found that goes against the documented specification of that functionality, fixing the bug may require breaking compatibility for users who are relying on the incorrect behavior. * **Upstream changes**: Much of the functionality of Alloy is built on top of other software, such as OpenTelemetry Collector and Prometheus. If upstream software breaks compatibility, we may need to reflect this in Alloy. * **Community components**: Community components are components implemented and maintained by the community. They aren’t covered by the backward compatibility strategy. We try, whenever possible, to resolve these issues without breaking compatibility. Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/introduction/backward-compatibility.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/introduction/backward-compatibility.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Component controller | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Get started](/docs/alloy/latest/get-started/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Component controller Open source Component controller ==================== The _component controller_ is the core part of Alloy which manages components at runtime. The component controller is responsible for: * Reading and validating the configuration file. * Managing the lifecycle of defined components. * Evaluating the arguments used to configure components. * Reporting the health of defined components. Component graph --------------- A relationship between [components](../components/) is created when an expression is used to set the argument of one component to an exported field of another component. The set of all components and the relationships between them define a [Directed Acyclic Graph](https://en.wikipedia.org/wiki/Directed_acyclic_graph) (DAG), which informs the component controller which references are valid and in what order components must be evaluated. For a configuration file to be valid, components must not reference themselves or contain a cyclic reference. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy // INVALID: local.file.some_file can not reference itself: local.file "self_reference" { filename = local.file.self_reference.content } alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy // INVALID: cyclic reference between local.file.a and local.file.b: local.file "a" { filename = local.file.b.content } local.file "b" { filename = local.file.a.content } Component evaluation -------------------- A component is _evaluated_ when its expressions are computed into concrete values. The computed values configure the component’s runtime behavior. The component controller is finished loading once all components are evaluated, configured, and running. The component controller only evaluates a given component after evaluating all of that component’s dependencies. Components that don’t depend on other components can be evaluated anytime during the evaluation process. Component reevaluation ---------------------- A [component](../components/) is dynamic. A component can update its exports any number of times throughout its lifetime. A _controller reevaluation_ is triggered when a component updates its exports. The component controller reevaluates any component that references the changed component, any components that reference those components, and so on, until all affected components are reevaluated. Component health ---------------- At any given time, a component can have one of the following health states: 1. Unknown: The default state. The component isn’t running yet. 2. Healthy: The component is working as expected. 3. Unhealthy: The component isn’t working as expected. 4. Exited: The component has stopped and is no longer running. By default, the component controller determines the health of a component. The component controller marks a component as healthy as long as that component is running and its most recent evaluation succeeded. Some components can report their own component-specific health information. For example, the `local.file` component reports itself as unhealthy if the file it was watching gets deleted. The overall health of a component is determined by combining the controller-reported health of the component with the component-specific health information. An individual component’s health is independent of the health of any other components it references. A component can be marked as healthy even if it references an exported field of an unhealthy component. Evaluation failures ------------------- When a component fails to evaluate, it’s marked as unhealthy with the reason for why the evaluation failed. When an evaluation fails, the component continues operating as normal. The component continues using its previous set of evaluated arguments and can continue exporting new values. This behavior prevents failure propagation. If your `local.file` component, which watches API keys, suddenly stops working, other components continue using the last valid API key until the component returns to a healthy state. In-memory traffic ----------------- Components that expose HTTP endpoints, such as [`prometheus.exporter.unix`](../../reference/components/prometheus/prometheus.exporter.unix) , can expose an internal address that completely bypasses the network and communicate in-memory. Components within the same process can communicate with one another without needing to be aware of any network-level protections such as authentication or mutual TLS. The internal address defaults to `alloy.internal:12345`. If this address collides with a real target on your network, change it to something unique using the `--server.http.memory-addr` flag in the [run](../../reference/cli/run/) command. Components must opt-in to using in-memory traffic. Refer to the individual documentation for components to learn if in-memory traffic is supported. Configuration file updates -------------------------- The `/-/reload` HTTP endpoint and the `SIGHUP` signal can inform the component controller to reload the configuration file. When this happens, the component controller synchronizes the set of running components with the ones in the configuration file, removing components no longer defined in the configuration file and creating new components added to the configuration file. All components managed by the controller are reevaluated after reloading. Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/get-started/component_controller.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/get-started/component_controller.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Components | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Get started](/docs/alloy/latest/get-started/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Components Open source Components ========== _Components_ are the building blocks of Alloy. Each component handles a single task, such as retrieving secrets or collecting Prometheus metrics. Components are composed of the following: * **Arguments:** Settings that configure a component. * **Exports:** Named values that a component exposes to other components. Each component has a name that describes what that component is responsible for. For example, the `local.file` component is responsible for retrieving the contents of files on disk. You specify components in the configuration file by first providing the component’s name with a user-specified label, and then by giving arguments to configure the component. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy discovery.kubernetes "pods" { role = "pod" } discovery.kubernetes "nodes" { role = "node" } You reference components by combining the component name with its label. For example, you can reference a `local.file` component labeled `foo` as `local.file.foo`. The combination of a component’s name and its label must be unique within the configuration file. Combining component names with a label means you can define multiple instances of a component as long as each instance has a different label value. Pipelines --------- Most arguments for a component in a configuration file are constant values, such as setting a `log_level` attribute to the quoted string `"debug"`. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy log_level = "debug" You use _expressions_ to dynamically compute the value of an argument at runtime. You can use expressions to retrieve the value of an environment variable (`log_level = sys.env("LOG_LEVEL")`) or to reference an exported field of another component (`log_level = local.file.log_level.content`). You create a dependent relationship when a component’s argument references an exported field of another component. A component’s arguments now depend on another component’s exports. The input of the component is re-evaluated whenever the exports of the components it references are updated. The flow of data through the set of references between components forms a _pipeline_. An example pipeline may look like this: 1. A `local.file` component watches a file that contains an API key. 2. A `prometheus.remote_write` component is configured to receive metrics and forward them to an external database using the API key from the `local.file` for authentication. 3. A `discovery.kubernetes` component discovers and exports Kubernetes Pods where metrics can be collected. 4. A `prometheus.scrape` component references the exports of the previous component, and sends collected metrics to the `prometheus.remote_write` component. [](/media/docs/alloy/diagram-concepts-example-pipeline.png) The following configuration file represents the pipeline. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy // Get our API key from disk. // // This component has an exported field called "content", holding the content // of the file. // // local.file will watch the file and update its exports any time the // file changes. local.file "api_key" { filename = "/var/data/secrets/api-key" // Mark this file as sensitive to prevent its value from being shown in the // UI. is_secret = true } // Create a prometheus.remote_write component, which other components can send // metrics to. // // This component exports a "receiver" value, which can be used by other // components to send metrics. prometheus.remote_write "prod" { endpoint { url = "https://prod:9090/api/v1/write" basic_auth { username = "admin" // Use the password file to authenticate with the production database. password = local.file.api_key.content } } } // Find Kubernetes pods where we can collect metrics. // // This component exports a "targets" value, which contains the list of // discovered pods. discovery.kubernetes "pods" { role = "pod" } // Collect metrics from Kubernetes pods and send them to prod. prometheus.scrape "default" { targets = discovery.kubernetes.pods.targets forward_to = [prometheus.remote_write.prod.receiver] } Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/get-started/components.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/get-started/components.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Custom components | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Get started](/docs/alloy/latest/get-started/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Custom components Open source Custom components ================= _Custom components_ are a way to create new components from a pipeline of built-in and other custom components. A custom component is composed of: * _Arguments_: Settings that configure the custom component. * _Exports_: Values that a custom component exposes to its consumers. * _Components_: Built-in and custom components that are run as part of the custom component. Create custom components ------------------------ You can create a new custom component using [the `declare` configuration block](../../reference/config-blocks/declare/) . The label of the block determines the name of the custom component. The following custom configuration blocks can be used inside a `declare` block: * [argument](../../reference/config-blocks/argument/) : Create a new named argument, whose current value can be referenced using the expression `argument.NAME.value`. Argument values are determined by the user of a custom component. * [export](../../reference/config-blocks/export/) : Expose a new named value to custom component users. Custom components are useful for reusing a common pipeline multiple times. To learn how to share custom components across multiple files, refer to [Modules](../modules/) . Example ------- This example creates a custom component called `add`, which exports the sum of two arguments: alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy declare "add" { argument "a" { } argument "b" { } export "sum" { value = argument.a.value + argument.b.value } } add "example" { a = 15 b = 17 } // add.example.sum == 32 Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/get-started/custom_components.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/get-started/custom_components.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Set up Grafana Alloy | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Set up Open source [RSS](/docs/alloy/latest/set-up/index.xml) Set up Grafana Alloy ==================== This section helps you install, migrate, run, and deploy Alloy. * [Install Grafana Alloy](/docs/alloy/latest/set-up/install/) * [Migrate to Grafana Alloy](/docs/alloy/latest/set-up/migrate/) * [Run Grafana Alloy](/docs/alloy/latest/set-up/run/) * [Deploy Grafana Alloy](/docs/alloy/latest/set-up/deploy/) Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/set-up/_index.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/set-up/_index.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Install Grafana Alloy | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Set up](/docs/alloy/latest/set-up/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Install Open source [RSS](/docs/alloy/latest/set-up/install/index.xml) Install Grafana Alloy ===================== You can install Alloy on Docker, Kubernetes, Linux, macOS, or Windows. Alloy supports the following architectures: * **Linux**: AMD64, ARM64 * **Windows**: AMD64 * **macOS**: AMD64 on Intel, ARM64 on Apple Silicon * **FreeBSD**: AMD64 > Note > > Installing Alloy on other operating systems is possible, but isn’t recommended or supported. * [Run Grafana Alloy in a Docker container](/docs/alloy/latest/set-up/install/docker/) * [Deploy Grafana Alloy on Kubernetes](/docs/alloy/latest/set-up/install/kubernetes/) * [Install Grafana Alloy on Linux](/docs/alloy/latest/set-up/install/linux/) * [Install Grafana Alloy on macOS](/docs/alloy/latest/set-up/install/macos/) * [Install Grafana Alloy on Windows](/docs/alloy/latest/set-up/install/windows/) * [Deploy Grafana Alloy on OpenShift](/docs/alloy/latest/set-up/install/openshift/) * [Install Grafana Alloy with Ansible](/docs/alloy/latest/set-up/install/ansible/) * [Install Grafana Alloy with Chef](/docs/alloy/latest/set-up/install/chef/) * [Install Grafana Alloy with Puppet](/docs/alloy/latest/set-up/install/puppet/) * [Install Grafana Alloy as a standalone binary](/docs/alloy/latest/set-up/install/binary/) Data collection --------------- By default, Alloy sends anonymous usage information to Grafana Labs. Refer to [data collection](%22../../../../data-collection/) for more information about what data Grafana collects and how you can opt-out. Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/set-up/install/_index.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/set-up/install/_index.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Clustering | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Get started](/docs/alloy/latest/get-started/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Clustering Open source Clustering ========== Clustering enables a fleet of Alloy deployments to work together for workload distribution and high availability. It helps create horizontally scalable deployments with minimal resource and operational overhead. To achieve this, Alloy makes use of an eventually consistent model that assumes all participating Alloy deployments are interchangeable and converge on using the same configuration file. The behavior of a standalone, non-clustered Alloy is the same as if it were a single-node cluster. You configure clustering by passing `cluster` command-line flags to the [run](../../reference/cli/run/#clustering) command. Use cases --------- ### Target auto-distribution Target auto-distribution is the most basic use case of clustering. It allows scraping components running on all peers to distribute the scrape load between themselves. Target auto-distribution requires that all Alloy deployments in the same cluster can reach the same service discovery APIs and scrape the same targets. You must explicitly enable target auto-distribution on components by defining a `clustering` block. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy prometheus.scrape "default" { clustering { enabled = true } ... } A cluster state change is detected when a node joins or a node leaves. All participating components locally recalculate target ownership and re-balance the number of targets they’re scraping without explicitly communicating ownership over the network. Target auto-distribution allows you to dynamically scale the number of Alloy deployments to distribute workload during peaks. It also provides resiliency because targets are automatically picked up by one of the node peers if a node leaves. Alloy uses a local consistent hashing algorithm to distribute targets, meaning that, on average, only ~1/N of the targets are redistributed. Refer to component reference documentation to discover whether it supports clustering, such as: * [`prometheus.scrape`](../../reference/components/prometheus/prometheus.scrape/#clustering-block) * [`pyroscope.scrape`](../../reference/components/pyroscope/pyroscope.scrape/#clustering-block) * [`prometheus.operator.podmonitors`](../../reference/components/prometheus/prometheus.operator.podmonitors/#clustering-block) * [`prometheus.operator.servicemonitors`](../../reference/components/prometheus/prometheus.operator.servicemonitors/#clustering-block) Cluster monitoring and troubleshooting -------------------------------------- You can use the Alloy UI [clustering page](../../troubleshoot/debug/#clustering-page) to monitor your cluster status. Refer to [Debug clustering issues](../../troubleshoot/debug/#debug-clustering-issues) for additional troubleshooting information. Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/get-started/clustering.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/get-started/clustering.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Modules | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Get started](/docs/alloy/latest/get-started/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Modules Open source Modules ======= A _Module_ is a unit of Alloy configuration, which combines all the other concepts, containing a mix of configuration blocks, instantiated components, and custom component definitions. The module passed as an argument to [the `run` command](../../reference/cli/run/) is called the _main configuration_. Modules can be [imported](#import-modules) to enable the reuse of [custom components](../custom_components/) defined by that module. Import modules -------------- A module can be _imported_, allowing the custom components defined by that module to be used by other modules, called the _importing module_. Modules can be imported from multiple locations using one of the `import` configuration blocks: * [`import.file`](../../reference/config-blocks/import.file/) : Imports a module from a file on disk. * [`import.git`](../../reference/config-blocks/import.git/) : Imports a module from a file located in a Git repository. * [`import.http`](../../reference/config-blocks/import.http/) : Imports a module from the response of an HTTP request. * [`import.string`](../../reference/config-blocks/import.string/) : Imports a module from a string. > Warning > > You can’t import a module that contains top-level blocks other than `declare` or `import`. Modules are imported into a _namespace_ where the top-level custom components of the imported module are exposed to the importing module. The label of the import block specifies the namespace of an import. For example, if a configuration contains a block called `import.file "my_module"`, then custom components defined by that module are exposed as `my_module.CUSTOM_COMPONENT_NAME`. Imported namespaces must be unique across a given importing module. If an import namespace matches the name of a built-in component namespace, such as `prometheus`, the built-in namespace is hidden from the importing module, and only components defined in the imported module may be used. > Warning > > If you choose a label that corresponds to an existing component for an `import` or a `declare` block, the component is shadowed and you won’t be able to use it in your configuration. For example, if you use the label `import.file "mimir"`, you won’t be able to use the existing components that start with `mimir` such as `mimir.rules.kubernetes` because it refers to the module imported via the `import` block. Example ------- This example module defines a component to filter out debug-level and info-level log lines: alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy declare "log_filter" { // argument.write_to is a required argument that specifies where filtered // log lines are sent. // // The value of the argument is retrieved in this file with // argument.write_to.value. argument "write_to" { optional = false } // loki.process.filter is our component which executes the filtering, // passing filtered logs to argument.write_to.value. loki.process "filter" { // Drop all debug- and info-level logs. stage.match { selector = `{job!=""} |~ "level=(debug|info)"` action = "drop" } // Send processed logs to our argument. forward_to = argument.write_to.value } // export.filter_input exports a value to the module consumer. export "filter_input" { // Expose the receiver of loki.process so the module importer can send // logs to our loki.process component. value = loki.process.filter.receiver } } You can save this module to a file called `helpers.alloy` and import it: alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy // Import our helpers.alloy module, exposing its custom components as // helpers.COMPONENT_NAME. import.file "helpers" { filename = "helpers.alloy" } loki.source.file "self" { targets = LOG_TARGETS // Forward collected logs to the input of our filter. forward_to = [helpers.log_filter.default.filter_input] } helpers.log_filter "default" { // Configure the filter to forward filtered logs to loki.write below. write_to = [loki.write.default.receiver] } loki.write "default" { endpoint { url = LOKI_URL } } Security -------- Since modules can load an arbitrary configuration from a potentially remote source, it’s important to carefully consider the security of your solution. The best practice is to ensure that the Alloy configuration can’t be changed by attackers. This includes the main Alloy configuration files as well as modules fetched from remote locations such as Git repositories or HTTP servers. Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/get-started/modules.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/get-started/modules.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Deploy Grafana Alloy | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Set up](/docs/alloy/latest/set-up/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Deploy Open source Deploy Grafana Alloy ==================== Alloy is a flexible, vendor-neutral telemetry collector. This flexibility means that Alloy doesn’t enforce a specific deployment topology but can work in multiple scenarios. This page lists common topologies used for Alloy deployments, when to consider using each topology, issues you may run into, and scaling considerations. As a centralized collection service ----------------------------------- Deploying Alloy as a centralized service is recommended for collecting application telemetry. This topology allows you to use a smaller number of collectors to coordinate service discovery, collection, and remote writing. [](/media/docs/alloy/collection-diagram-alloy.png) Using this topology requires deploying Alloy on separate infrastructure, and making sure that they can discover and reach these applications over the network. The main predictor for the size of an Alloy deployment is the number of active Prometheus metrics series it’s scraping. A rule of thumb is approximately 10 KB of memory for each series. We recommend you start looking towards horizontal scaling around the 1 million active series mark. ### Use Kubernetes StatefulSets Deploying Alloy as a StatefulSet is the recommended option for Prometheus metrics collection. The persistent Pod identifiers make it possible to consistently match volumes with pods so that you can use them for the WAL directory. You can also use a Kubernetes Deployment in cases where persistent storage isn’t required, such as a traces-only pipeline. ### Pros * Straightforward scaling using [clustering](../../configure/clustering/) * Minimizes the “noisy neighbor” effect * Easy to meta-monitor ### Cons * Requires running on separate infrastructure ### Use for * Scalable telemetry collection ### Don’t use for * Host-level metrics and logs As a host daemon ---------------- Deploying one Alloy instance per machine is required for collecting machine-level Prometheus metrics and logs, such as node\_exporter hardware and network metrics or journald system logs. [](/media/docs/alloy/host-diagram-alloy.png) Each Alloy instance requires you to open an outgoing connection for each remote endpoint it’s shipping data to. This can lead to NAT port exhaustion on the egress infrastructure. Each egress IP can support up to (65535 - 1024 = 64511) outgoing connections on different ports. So, if all Alloys are sending Prometheus metrics and log data, an egress IP can support up to 32,255 collectors. ### Use Kubernetes DaemonSets The simplest use case of the host daemon topology is a Kubernetes DaemonSet, and it’s required for node-level observability (for example cAdvisor metrics) and collecting Pod logs. ### Pros * Doesn’t require running on separate infrastructure * Typically leads to smaller-sized collectors * Lower network latency to instrumented applications ### Cons * Requires planning a process for provisioning Alloy on new machines, as well as keeping configuration up to date to avoid configuration drift * Not possible to scale independently when using Kubernetes DaemonSets * Scaling the topology can strain external APIs (like service discovery) and network infrastructure (like firewalls, proxy servers, and egress points) ### Use for * Collecting machine-level Prometheus metrics and logs (for example, node\_exporter hardware metrics, Kubernetes Pod logs) ### Don’t use for * Scenarios where Alloy grows so large it can become a noisy neighbor * Collecting an unpredictable amount of telemetry As a container sidecar ---------------------- Deploying Alloy as a container sidecar is only recommended for short-lived applications or specialized Alloy deployments. [](/media/docs/alloy/sidecar-diagram-alloy.png) ### Use Kubernetes Pod sidecars In a Kubernetes environment, the sidecar model consists of deploying Alloy as an extra container on the Pod. The Pod’s controller, network configuration, enabled capabilities, and available resources are shared between the actual application and the sidecar Alloy. ### Pros * Doesn’t require running on separate infrastructure * Straightforward networking with partner applications ### Cons * Doesn’t scale separately * Makes resource consumption harder to monitor and predict * Each Alloy instance doesn’t have a life cycle of its own, making it harder to do things like recovering from network outages ### Use for * Serverless services * Job/batch applications that work with a push model * Air-gapped applications that can’t be otherwise reached over the network ### Don’t use for * Long-lived applications * Scenarios where the Alloy deployment size grows so large it can become a noisy neighbor Process different types of telemetry in different Alloy instances ----------------------------------------------------------------- If the load on Alloy is small, you can process all necessary telemetry signals in the same Alloy process. For example, a single Alloy deployment can process all of the incoming metrics, logs, traces, and profiles. However, if the load on Alloy is big, it may be beneficial to process different telemetry signals in different deployments of Alloy. This provides better stability due to the isolation between processes. For example, an overloaded Alloy instance processing traces won’t impact an Alloy instance processing metrics. Different types of signal collection require different methods for scaling: * “Pull” components such as `prometheus.scrape` and `pyroscope.scrape` are scaled using hashmod sharing or clustering. * “Push” components such as `otelcol.receiver.otlp` are scaled by placing a load balancer in front of the components. ### Traces Scaling Alloy instances for tracing is very similar to [scaling OpenTelemetry Collector](https://opentelemetry.io/docs/collector/scaling/) instances. This similarity is because most Alloy components used for tracing are based on components from the OTel Collector. #### When to scale To decide whether scaling is necessary, check metrics such as: * `otelcol_receiver_refused_spans_total` from receivers such as `otelcol.receiver.otlp`. * `otelcol_receiver_refused_spans_total` from processors such as `otelcol.processor.batch`. * `otelcol_exporter_send_failed_spans_total` from exporters such as `otelcol.exporter.otlp` and `otelcol.exporter.loadbalancing`. #### Stateful and stateless components In the context of tracing, a “stateful component” is a component that needs to aggregate certain spans to work correctly. A “stateless Alloy” is an Alloy instance which doesn’t contain stateful components. Scaling stateful Alloy instances is more difficult, because spans must be forwarded to a specific Alloy instance according to a span property such as trace ID or a `service.name` attribute. You can forward spans with `otelcol.exporter.loadbalancing`. Examples of stateful components: * `otelcol.processor.tail_sampling` * `otelcol.connector.spanmetrics` * `otelcol.connector.servicegraph` A “stateless component” doesn’t need to aggregate specific spans to work correctly. It can work correctly even if it only has some of the spans of a trace. A stateless Alloy instance can be scaled without using `otelcol.exporter.loadbalancing`. For example, you could use an off-the-shelf load balancer to do a round-robin load balancing. Examples of stateless components: * `otelcol.processor.probabilistic_sampler` * `otelcol.processor.transform` * `otelcol.processor.attributes` * `otelcol.processor.span` Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/set-up/deploy.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/set-up/deploy.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Migrate to Grafana Alloy | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Set up](/docs/alloy/latest/set-up/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Migrate Open source [RSS](/docs/alloy/latest/set-up/migrate/index.xml) Migrate to Grafana Alloy ======================== This section details how to migrate to Alloy from other common solutions. * [Migrate Grafana Agent Static to Grafana Alloy](/docs/alloy/latest/set-up/migrate/from-static/) * [Migrate from Grafana Agent Operator to Grafana Alloy](/docs/alloy/latest/set-up/migrate/from-operator/) * [Migrate Grafana Agent Flow to Grafana Alloy](/docs/alloy/latest/set-up/migrate/from-flow/) * [Migrate from OpenTelemetry Collector to Grafana Alloy](/docs/alloy/latest/set-up/migrate/from-otelcol/) * [Migrate from Prometheus to Grafana Alloy](/docs/alloy/latest/set-up/migrate/from-prometheus/) * [Migrate from Promtail to Grafana Alloy](/docs/alloy/latest/set-up/migrate/from-promtail/) Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/set-up/migrate/_index.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/set-up/migrate/_index.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Run Grafana Alloy | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Set up](/docs/alloy/latest/set-up/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Run Open source [RSS](/docs/alloy/latest/set-up/run/index.xml) Run Grafana Alloy ================= Use the following pages to learn how to start, restart, and stop Alloy after it’s installed. For installation instructions, refer to [Install Grafana Alloy](../install/) . * [Run Grafana Alloy on Linux](/docs/alloy/latest/set-up/run/linux/) * [Run Grafana Alloy on macOS](/docs/alloy/latest/set-up/run/macos/) * [Run Grafana Alloy on Windows](/docs/alloy/latest/set-up/run/windows/) * [Run Grafana Alloy as a standalone binary](/docs/alloy/latest/set-up/run/binary/) Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/set-up/run/_index.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/set-up/run/_index.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Configure Grafana Alloy clustering in an existing installation | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Configure](/docs/alloy/latest/configure/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Clustering Open source [RSS](/docs/alloy/latest/configure/clustering/index.xml) Configure Alloy clustering in an existing installation ====================================================== You can configure Alloy to run with [clustering](../clustering/) so that individual Alloys can work together for workload distribution and high availability. This topic describes how to add clustering to an existing installation. Configure Alloy clustering with Helm Chart ------------------------------------------ This section guides you through enabling clustering when Alloy is installed on Kubernetes using the Alloy [Helm chart](../../set-up/install/kubernetes/) . ### Before you begin * Ensure that your `values.yaml` file has `controller.type` set to `statefulset`. ### Steps To configure clustering: 1. Amend your existing `values.yaml` file to add `clustering.enabled=true` inside the `alloy` block. yaml ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy alloy: clustering: enabled: true 2. Upgrade your installation to use the new `values.yaml` file: bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy helm upgrade -f values.yaml Replace the following: * _``_: The name of the installation you chose when you installed the Helm chart. 3. Use the Alloy [UI](../../troubleshoot/debug/#component-detail-page) to verify the cluster status: 1. Click **Clustering** in the navigation bar. 2. Ensure that all expected nodes appear in the resulting table. Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/configure/clustering/_index.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/configure/clustering/_index.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Set up meta-monitoring to collect Alloy telemetry | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Collect and forward data](/docs/alloy/latest/collect/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Collect Alloy telemetry Open source Set up meta-monitoring to collect Alloy telemetry ================================================= You can configure Alloy to collect its own telemetry and forward it to the backend of your choosing. This topic describes how to collect and forward metrics, logs, and traces data from Alloy. Components and configuration blocks used in this topic ------------------------------------------------------ * [`prometheus.exporter.self`](../../reference/components/prometheus/prometheus.exporter.self/) * [`prometheus.scrape`](../../reference/components/prometheus/prometheus.scrape/) * [`logging`](../../reference/config-blocks/logging/) * [`tracing`](../../reference/config-blocks/tracing/) Before you begin ---------------- * Identify where to send Alloy’s telemetry data. * Be familiar with the concept of [Components](../../get-started/components/) in Alloy. Meta-monitoring metrics ----------------------- Alloy exposes its internal metrics using the Prometheus exposition format. The metrics are exposed on a `/metrics` endpoint on an address configurable via the `--server.http.listen-addr` [command line flag](../../reference/cli/run/) . For example, `127.0.0.1:12345/metrics`. However, it’s also possible to access the same metrics using the `prometheus.exporter.self` component. In this task, you use the [`prometheus.exporter.self`](../../reference/components/prometheus/prometheus.exporter.self/) and [`prometheus.scrape`](../../reference/components/prometheus/prometheus.scrape/) components to scrape Alloy’s internal metrics and forward it to compatible Alloy components. 1. Add the following `prometheus.exporter.self` component to your configuration. The component accepts no arguments. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy prometheus.exporter.self "" { } Replace the following: * _``_: The label for the component such as `default` or `metamonitoring`. The label must be unique across all `prometheus.exporter.self` components in the same configuration file. 2. Add the following `prometheus.scrape` component to your configuration file. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy prometheus.scrape "" { targets = prometheus.exporter.self..targets forward_to = [] } Replace the following: * _``_: The label for the scrape component such as `default`. The label must be unique across all `prometheus.scrape` components in the same configuration file. * _``_: A comma-delimited list of component receivers to forward metrics to. For example, to send to a remote write component, use `prometheus.remote_write.WRITE_LABEL.receiver`. Similarly, to send data to a relabeling component, use `prometheus.relabel.PROCESS_LABEL.receiver`. To use data in the OTLP format, you can send data to a converter component, like `otelcol.receiver.prometheus.OTEL.receiver`. The following example demonstrates configuring a possible sequence of components. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy prometheus.exporter.self "default" { } prometheus.scrape "metamonitoring" { targets = prometheus.exporter.self.default.targets forward_to = [prometheus.remote_write.default.receiver] } prometheus.remote_write "default" { endpoint { url = "http://mimir:9009/api/v1/push" } } Meta-monitoring logs -------------------- The [logging](../../reference/config-blocks/logging/) block defines the logging behavior of Alloy. In this task, you use the [logging](../../reference/config-blocks/logging/) block to forward Alloy’s logs to a compatible component. The block is specified without a label and can only be provided once per configuration file. 1. Add the following `logging` configuration block to the top level of your configuration file. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy logging { level = "" format = "" write_to = [] } Replace the following: * _``_: The log level to use for Alloy’s logs. If the attribute isn’t set, it defaults to `info`. * _``_: The log format to use for Alloy’s logs. If the attribute isn’t set, it defaults to `logfmt`. * _``_: A comma-delimited list of component receivers to forward logs to. For example, to send to a processing component, use `loki.process.PROCESS_LABEL.receiver`. Similarly, to send data to a relabeling component, use `loki.relabel.PROCESS_LABEL.receiver`. To use data in the OTLP format, you can send data to a converter component, like `otelcol.receiver.loki.OTEL.receiver`. The following example demonstrates configuring the logging block and sending to a compatible component. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy logging { level = "warn" format = "json" write_to = [loki.write.default.receiver] } loki.write "default" { endpoint { url = "http://loki:3100/loki/api/v1/push" } } Meta-monitoring traces ---------------------- The [tracing](../../reference/config-blocks/tracing/) block defines the tracing behavior of Alloy. In this task, you use the [tracing](../../reference/config-blocks/tracing/) block to forward Alloy internal traces to a compatible component. The block is specified without a label and can only be provided once per configuration file. 1. Add the following `tracing` configuration block to the top level of your configuration file. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy tracing { sampling_fraction = write_to = [] } Replace the following: * _``_: The fraction of traces to keep. If the attribute isn’t set, it defaults to `0.1`. * _``_: A comma-delimited list of component receivers to forward traces to. For example, to send to an OpenTelemetry exporter component use `otelcol.exporter.otlp.EXPORT_LABEL.input`. The following example demonstrates configuring the tracing block and sending to a compatible component. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy tracing { sampling_fraction = 0.1 write_to = [otelcol.exporter.otlp.default.input] } otelcol.exporter.otlp "default" { client { endpoint = "tempo:4317" } } Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/collect/metamonitoring.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/collect/metamonitoring.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Configure Grafana Alloy | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Configure Open source [RSS](/docs/alloy/latest/configure/index.xml) Configure Grafana Alloy ======================= You can configure Alloy after it’s [installed](../set-up/install/) . The default configuration file location for Alloy is: * Linux: `/etc/alloy/config.alloy` * macOS: `$(brew --prefix)/etc/alloy/config.alloy` * Windows: `%ProgramFiles%\GrafanaLabs\Alloy\config.alloy` This section includes information that helps you configure Alloy. * [Configure Grafana Alloy clustering in an existing installation](/docs/alloy/latest/configure/clustering/) * [Configure Grafana Alloy on Kubernetes](/docs/alloy/latest/configure/kubernetes/) * [Configure Grafana Alloy on Linux](/docs/alloy/latest/configure/linux/) * [Configure Grafana Alloy on macOS](/docs/alloy/latest/configure/macos/) * [Configure Grafana Alloy on Windows](/docs/alloy/latest/configure/windows/) * [Run Alloy as a non-root user in Kubernetes](/docs/alloy/latest/configure/nonroot/) Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/configure/_index.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/configure/_index.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Receive traces and metrics from Datadog-instrumented applications | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Collect and forward data](/docs/alloy/latest/collect/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Collect Datadog traces and metrics Open source Receive traces and metrics from Datadog-instrumented applications ================================================================= You can configure Alloy to collect [Datadog](https://www.datadoghq.com/) traces and metrics and forward them to any OpenTelemetry-compatible database. This topic describes how to: * Configure Alloy to send traces and metrics. * Configure the Alloy Datadog Receiver. * Configure the Datadog Agent to forward traces and metrics to the Alloy Datadog Receiver. Before you begin ---------------- * Ensure that at least one instance of the [Datadog Agent](https://docs.datadoghq.com/agent/) is collecting metrics and traces. * Identify where to write the collected telemetry. Metrics can be written to [Prometheus](https://prometheus.io) or any other OpenTelemetry-compatible database such as Grafana Mimir, Grafana Cloud, or Grafana Enterprise Metrics. Traces can be written to Grafana Tempo, Grafana Cloud, or Grafana Enterprise Traces. * Be familiar with the concept of [Components](../../get-started/components/) in Alloy. Configure Alloy to send traces and metrics ------------------------------------------ Before components can collect Datadog telemetry signals, you must have a component responsible for writing this telemetry somewhere. The [otelcol.exporter.otlp](../../reference/components/otelcol/otelcol.exporter.otlp/) component is responsible for delivering OTLP data to OpenTelemetry-compatible endpoints. 1. Add the following `otelcol.exporter.otlp` component to your configuration file. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy otelcol.exporter.otlp "default" { client { endpoint = "" auth = otelcol.auth.basic.auth.handler } } Replace the following: * _``_: The full URL of the OpenTelemetry-compatible endpoint where metrics and traces are sent, such as `https://otlp-gateway-prod-eu-west-2.grafana.net/otlp`. 2. If your endpoint requires basic authentication, paste the following inside the `endpoint` block. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy basic_auth { username = "" password = "" } Replace the following: * _``_: The basic authentication username. * _``_: The basic authentication password or API key. Configure the Alloy Datadog Receiver ------------------------------------ 1. Add the following `otelcol.processor.batch` component to your configuration file. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy otelcol.processor.batch "default" { output { metrics = [otelcol.exporter.otlp.default.input] traces = [otelcol.exporter.otlp.default.input] } } 2. Add the following `otelcol.processor.deltatocumulative` component to your configuration file. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy otelcol.processor.deltatocumulative "default" { max_stale = "" max_streams = output { metrics = [otelcol.processor.batch.default.input] } } Replace the following: * _``_: How long until a series not receiving new samples is removed, such as “5m”. * _``_: The upper limit of streams to track. New streams exceeding this limit are dropped. 3. Add the following `otelcol.receiver.datadog` component to your configuration file. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy otelcol.receiver.datadog "default" { endpoint = ":" output { metrics = [otelcol.processor.deltatocumulative.default.input] traces = [otelcol.processor.batch.default.input] } } Replace the following: * _``_: The host address where the receiver listens. * _``_: The port where the receiver listens. 4. If your endpoint requires basic authentication, paste the following inside the `endpoint` block. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy basic_auth { username = "" password = "" } Replace the following: * _``_: The basic authentication username. * _``_: The basic authentication password or API key. Configure Datadog Agent to forward telemetry to the Alloy Datadog Receiver -------------------------------------------------------------------------- You can set up your Datadog Agent to forward Datadog metrics and traces simultaneously to Alloy and Datadog. We recommend this approach for current Datadog users who want to try using Alloy. 1. Add the following environment variables to your Datadog-agent installation. bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy DD_ADDITIONAL_ENDPOINTS='{"http://:": ["datadog-receiver"]}' DD_APM_ADDITIONAL_ENDPOINTS='{"http://:": ["datadog-receiver"]}' `DD_ADDITIONAL_ENDPOINTS` is used for forwarding metrics, whereas `DD_APM_ADDITIONAL_ENDPOINTS` is for traces. Replace the following: * _``_: The hostname where the Alloy receiver is found. * _``_: The port where the Alloy receiver is exposed. Alternatively, you might want your Datadog Agent to send metrics only to Alloy. You can do this by setting up your Datadog Agent in the following way: 1. Replace the DD\_URL in the configuration YAML: yaml ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy dd_url: http://: Or by setting an environment variable: bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy DD_DD_URL='{"http://:": ["datadog-receiver"]}' Run Alloy --------- The `otelcol.receiver.datadog` component is experimental. To use this component, you need to start Alloy with additional command line flags: bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy alloy run config.alloy --stability.level=experimental Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/collect/datadog-traces-metrics.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/collect/datadog-traces-metrics.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Configure Grafana Alloy on Windows | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Configure](/docs/alloy/latest/configure/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Windows Open source Configure Grafana Alloy on Windows ================================== To configure Alloy on Windows, perform the following steps: 1. Edit the default configuration file at `%PROGRAMFILES%\GrafanaLabs\Alloy\config.alloy`. 2. Restart the Alloy service: 1. Open the Windows Services manager: 1. Right click on the Start Menu and select **Run**. 2. Type `services.msc` and click **OK**. 2. Right click on the service called **Alloy**. 3. Click on **All Tasks > Restart**. Change command-line arguments ----------------------------- By default, the Alloy service will launch and pass the following arguments to the Alloy binary: * `run` * `%PROGRAMFILES%\GrafanaLabs\Alloy\config.alloy` * `--storage.path=%PROGRAMDATA%\GrafanaLabs\Alloy\data` To change the set of command-line arguments passed to the Alloy binary, perform the following steps: 1. Open the Registry Editor: 1. Right click on the Start Menu and select **Run**. 2. Type `regedit` and click **OK**. 2. Navigate to the key at the path `HKEY_LOCAL_MACHINE\SOFTWARE\GrafanaLabs\Alloy`. 3. Double-click on the value called **Arguments**\*. 4. In the dialog box, enter the arguments to pass to the Alloy binary. Make sure that each argument is on its own line. 5. Restart the Alloy service: 1. Open the Windows Services manager: 1. Right click on the Start Menu and select **Run**. 2. Type `services.msc` and click **OK**. 2. Right click on the service called **Alloy**. 3. Click on **All Tasks > Restart**. Change environment variable values ---------------------------------- The Go runtime provides several ways to modify the execution of a binary using [environment variables](../../reference/cli/environment-variables/) . To change the environment variables used by Alloy, perform the following steps. 1. Open the Registry Editor: 1. Right click on the Start Menu and select **Run**. 2. Type `regedit` and click **OK**. 2. Navigate to the key at the path `HKEY_LOCAL_MACHINE\SOFTWARE\GrafanaLabs\Alloy`. 3. Double-click on the multi-string value called **Environment**\*. 4. In the dialog box, enter the environment variable values to pass to the Alloy binary. Make sure that each variable is on its own line. 5. Restart the Alloy service: 1. Open the Windows Services manager (`services.msc`): 1. Right click on the Start Menu and select **Run**. 2. Type `services.msc` and click **OK**. 2. Right click on the service called **Alloy**. 3. Click on **All Tasks > Restart**. Expose the UI to other machines ------------------------------- By default, Alloy listens on the local network for its HTTP server. This prevents other machines on the network from being able to access the [UI for debugging](../../troubleshoot/debug/#alloy-ui) . To expose the UI to other machines, complete the following steps: 1. Follow [Change command-line arguments](#change-command-line-arguments) to edit command line flags passed to Alloy. 2. Add the following command line argument: shell ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy --server.http.listen-addr=LISTEN_ADDR:12345 Replace the following: * _``_: An IP address which other machines on the network have access to. For example, the IP address of the machine Alloy is running on. To listen on all interfaces, replace _``_ with `0.0.0.0`. Was this page helpful? ---------------------- ![👍](/media/images/svg/thumbs-up.svg) Yes ![👎](/media/images/svg/thumbs-up.svg) No [Suggest an edit in GitHub](https://github.com/grafana/alloy/edit/main/docs/sources/configure/windows.md) [Create a GitHub issue](https://github.com/grafana/alloy/issues/new?title=Documentation%20feedback:%20/docs/sources/configure/windows.md) [Email docs@grafana.com](mailto:docs@grafana.com) [Help and support](/help/) [Community](/community/) Related documentation --------------------- Related resources from Grafana Labs ----------------------------------- Additional helpful documentation, links, and articles: [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Incident management with Grafana IRM & SLOS in Grafana Cloud\ \ This webinar shows you how to prioritize critical resources through service level objective(SLO)-driven incident response and management (IRM).](/go/webinar/getting-started-with-grafana-incident-response-and-management-irm-and-slo-emea/) [![webinar icon](/static/assets/img/icons/grafana-icon-card-webinar.svg)\ \ 30 Apr\ \ Building advanced Grafana dashboards\ \ In this webinar, we’ll demo how to build and format Grafana dashboards.](/go/webinar/building-advanced-grafana-dashboards/) [![video icon](/static/assets/img/icons/grafana-icon-card-video.svg)\ \ 60 min\ \ Mastering OpenTelemetry instrumentation and Grafana\ \ Join our advanced OpenTelemetry webinar to learn about code-based instrumentation, best practices, and unlocking new use cases with Grafana and Grafana Cloud.](/go/webinar/mastering-code-based-instrumentation-with-opentelemetry-and-grafana/) --- # Collect Kubernetes logs and forward them to Loki | Grafana Alloy documentation Menu [Documentation](/docs/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Grafana Alloy](/docs/alloy/latest/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) [Collect and forward data](/docs/alloy/latest/collect/) ![breadcrumb arrow](/static/assets/img/icons/grafana-icon-breadcrumb-arrow-gray.svg) Collect Kubernetes logs Open source Collect Kubernetes logs and forward them to Loki ================================================ You can configure Alloy to collect logs and forward them to a [Loki](/oss/loki/) database. This topic describes how to: * Configure logs delivery. * Collect logs from Kubernetes Pods. Components used in this topic ----------------------------- * [`discovery.kubernetes`](../../reference/components/discovery/discovery.kubernetes/) * [`discovery.relabel`](../../reference/components/discovery/discovery.relabel/) * [`local.file_match`](../../reference/components/local/local.file_match/) * [`loki.source.file`](../../reference/components/loki/loki.source.file/) * [`loki.source.kubernetes`](../../reference/components/loki/loki.source.kubernetes/) * [`loki.source.kubernetes_events`](../../reference/components/loki/loki.source.kubernetes_events/) * [`loki.process`](../../reference/components/loki/loki.process/) * [`loki.write`](../../reference/components/loki/loki.write/) Before you begin ---------------- * Ensure that you are familiar with logs labelling when working with Loki. * Identify where to write collected logs. You can write logs to Loki endpoints such as Grafana Loki, Grafana Cloud, or Grafana Enterprise Logs. * Be familiar with the concept of [Components](../../get-started/components/) in Alloy. Configure logs delivery ----------------------- Before components can collect logs, you must have a component responsible for writing those logs somewhere. The [`loki.write`](../../reference/components/loki/loki.write/) component delivers logs to a Loki endpoint. After you define a `loki.write` component, you can use other Alloy components to forward logs to it. To configure a `loki.write` component for logs delivery, complete the following steps: 1. Add the following `loki.write` component to your configuration file. alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy loki.write "