Open source

Who is this for?

This set of tutorials contains a collection of examples that build on each other to demonstrate how to configure and use Grafana Agent Flow. It assumes you have a basic understanding of what Grafana Agent is and telemetry collection in general. It also assumes a base level of familiarity with Prometheus and PromQL, Loki and LogQL, and basic Grafana navigation. It assumes no knowledge of Grafana Agent Flow or River concepts.

What is Flow?

Flow is a new way to configure Grafana Agent Flow. It is a declarative configuration language that allows you to define a pipeline of telemetry collection, processing, and output. It is built on top of the River configuration language, which is designed to be fast, simple, and debuggable.

What do I need to get started?

You will need a Linux or Unix environment with Docker installed. The examples are designed to be run on a single host so that you can run them on your laptop or in a VM. You are encouraged to follow along with the examples using a config.river file and experiment with the examples yourself.

To run the examples, you should have a Grafana Agent binary available. You can follow the instructions on how to Install Grafana Agent as a Standalone Binary to get a binary.

How should I follow along?

You can use this docker-compose file to set up a local Grafana instance alongside Loki and Prometheus pre-configured as datasources. The examples are designed to be run locally, so you can follow along and experiment with them yourself.

version: '3'
    image: grafana/loki:2.9.0
      - "3100:3100"
    command: -config.file=/etc/loki/local-config.yaml
    image: prom/prometheus:v2.47.0
      - --web.enable-remote-write-receiver
      - --config.file=/etc/prometheus/prometheus.yml
      - "9090:9090"
      - GF_PATHS_PROVISIONING=/etc/grafana/provisioning
      - sh
      - -euc
      - |
        mkdir -p /etc/grafana/provisioning/datasources
        cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml
        apiVersion: 1
        - name: Loki
          type: loki
          access: proxy
          orgId: 1
          url: http://loki:3100
          basicAuth: false
          isDefault: false
          version: 1
          editable: false
        - name: Prometheus
          type: prometheus
          orgId: 1
          url: http://prometheus:9090
          basicAuth: false
          isDefault: true
          version: 1
          editable: false
    image: grafana/grafana:latest
      - "3000:3000"

After running docker-compose up, open http://localhost:3000 in your browser to view the Grafana UI.

The tutorials are designed to be followed in order and generally build on each other. Each example explains what it does and how it works. They are designed to be run locally, so you can follow along and experiment with them yourself.

The Recommended Reading sections in each tutorial provide a list of documentation topics. To help you understand the concepts used in the example, read the recommended topics in the order given.