Home
Login

A programmable observability data collector based on OpenTelemetry, supporting metrics, logs, traces, and continuous profiling.

Apache-2.0Go 1.6kgrafanaagent Last Updated: 2025-06-24

Grafana Agent Project Detailed Introduction

Project Overview

Grafana Agent is a distribution of the OpenTelemetry Collector, with a configuration style inspired by Terraform. It is designed to be a flexible, high-performance, and ecosystem-compatible observability data collector, including Prometheus and OpenTelemetry.

⚠️ Important Note: Grafana Agent has been deprecated and is now in long-term support mode. It is recommended to migrate to Grafana Alloy, a new version built on Grafana Agent Flow.

Core Features

1. Vendor Neutrality

  • Full Compatibility: Fully compatible with Prometheus, OpenTelemetry, and the Grafana open-source ecosystem.
  • Multi-Signal Support: Collects metrics, logs, traces, and continuous profiling data.
  • Flexible Deployment: Can be deployed on any number of machines, handling millions of active series and TBs of logs.

2. Componentized Architecture

Grafana Agent is built on components. Components are connected together to form programmable observability pipelines for the collection, processing, and transmission of telemetry data.

3. Data Collection and Transmission

Grafana Agent can collect, transform, and send data to:

  • Prometheus Ecosystem
  • OpenTelemetry Ecosystem
  • Grafana Open Source Ecosystem (including Loki, Grafana, Tempo, Mimir, Pyroscope)

4. Enterprise-Grade Features

  • Scalability: Supports large-scale deployments, handling millions of active series.
  • Battle-Tested: Extends the battle-tested code of the Prometheus and OpenTelemetry Collector projects.
  • Powerful Functionality: Supports writing programmable pipelines and provides a built-in UI for debugging.
  • Out-of-the-Box: Integrates with systems like MySQL, Kubernetes, and Apache.

Technical Architecture

Flow Mode

This page mainly focuses on "Flow Mode," which is a Terraform-inspired revision of Grafana Agent. Flow Mode provides a more intuitive configuration method, allowing users to:

  • Easily set up and check configurations
  • Quickly iterate on telemetry pipelines
  • Reduce the learning curve

Configuration Example

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

// Collect metrics from Kubernetes pods
prometheus.scrape "default" {
  targets = discovery.kubernetes.pods.targets
  forward_to = [prometheus.remote_write.default.receiver]
}

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

// Send metrics to 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
    }
  }
}

Project Status and Migration

Deprecation Notice

Grafana Alloy is the new name for our OTel Collector distribution. Grafana Agent has been deprecated and will be provided with Long Term Support (LTS) until October 31, 2025. Grafana Agent will reach End of Life (EOL) on November 1, 2025.

Migration Recommendations

The project maintainers strongly recommend that users migrate to Grafana Alloy for reasons including:

  • Better performance and stability
  • Richer enterprise-grade features
  • Continuous feature updates and support

Installation and Deployment

Supported Platforms

  • Linux, macOS, Windows
  • Docker containers
  • Kubernetes clusters
  • Cloud platforms (AWS, GCP, Azure, etc.)

Quick Start

The project provides complete documentation and examples:

  • Detailed installation guide
  • Getting started tutorial
  • Component reference documentation
  • Docker Compose example environment

Typical Use Cases

1. Large-Scale Monitoring

Suitable for large-scale Prometheus deployments that need to handle millions of active series.

2. Multi-Signal Collection

Unified collection of metrics, logs, traces, and profiling data.

3. Hybrid Cloud Environments

Provides a consistent observability solution in multi-cloud and hybrid cloud environments.

4. DevOps Integration

Deep integration with CI/CD pipelines and GitOps workflows.

Summary

Grafana Agent, as a mature observability data collector, provides users with powerful telemetry data collection, processing, and transmission capabilities. Although the project has entered maintenance mode, its core concepts and architecture have laid a solid foundation for the next-generation Grafana Alloy. For existing users, it is recommended to gradually migrate to Grafana Alloy according to the official guide to obtain better performance and continuous support.

Star History Chart