Menu

Caution

Grafana Alloy is the new name for our distribution of the OTel collector. Grafana Agent has been deprecated and is in Long-Term Support (LTS) through October 31, 2025. Grafana Agent will reach an End-of-Life (EOL) on November 1, 2025. Read more about why we recommend migrating to Grafana Alloy.

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Open source RSS

Grafana Agent Flow

Grafana Agent Flow is a component-based revision of Grafana Agent with a focus on ease-of-use, debuggability, and ability to adapt to the needs of power users.

Components allow for reusability, composability, and focus on a single task.

  • Reusability allows for the output of components to be reused as the input for multiple other components.
  • Composability allows for components to be chained together to form a pipeline.
  • Single task means the scope of a component is limited to one narrow task and thus has fewer side effects.

Features

  • Write declarative configurations with a Terraform-inspired configuration language.
  • Declare components to configure parts of a pipeline.
  • Use expressions to bind components together to build a programmable pipeline.
  • Includes a UI for debugging the state of a pipeline.

Grafana Agent Flow is a distribution of the OpenTelemetry Collector.

Each distribution offers a different collection of components and capabilities. As a distribution, Grafana Agent Flow includes dozens of OpenTelemetry-native components from the OpenTelemetry project and introduces new features such as programmable pipelines, clustering support, and the ability to share pipelines around the world.

In addition to being an OpenTelemetry Collector distribution, Grafana Agent Flow also includes first-class support for the Prometheus and Loki ecosystems, allowing you to mix-and-match your pipelines.

Example

river
// Discover Kubernetes pods to collect metrics from
discovery.kubernetes "pods" {
  role = "pod"
}

// Scrape metrics from Kubernetes pods and send to a prometheus.remote_write
// component.
prometheus.scrape "default" {
  targets    = discovery.kubernetes.pods.targets
  forward_to = [prometheus.remote_write.default.receiver]
}

// Get an API key from disk.
local.file "apikey" {
  filename  = "/var/data/my-api-key.txt"
  is_secret = true
}

// Collect and send metrics to a Prometheus remote_write endpoint.
prometheus.remote_write "default" {
  endpoint {
    url = "http://localhost:9009/api/prom/push"

    basic_auth {
      username = "MY_USERNAME"
      password = local.file.apikey.content
    }
  }
}

Grafana Agent Flow configuration generator

The Grafana Agent Flow configuration generator helps you get a head start on creating flow code.

Note

This feature is experimental, and it doesn’t support all River components.

Next steps

  • Install Grafana Agent Flow.
  • Learn about the core Concepts of Grafana Agent Flow.
  • Follow the Tutorials for hands-on learning of Grafana Agent Flow.
  • Consult the Tasks instructions to accomplish common objectives with Grafana Agent Flow.
  • Check out the Reference documentation to find specific information you might be looking for.