README
¶
Deprecation notice: Grafana Agent has been deprecated and is now in Long-Term Support mode. We recommend migrating to the new Grafana Alloy collector, which is built on the foundation of Grafana Agent Flow.
For more information, read our blog posts about Alloy and how to easily migrate from Agent to Alloy:
Grafana Agent is an OpenTelemetry Collector distribution with configuration inspired by Terraform. It is designed to be flexible, performant, and compatible with multiple ecosystems such as Prometheus and OpenTelemetry.
Grafana Agent is based around components. Components are wired together to form programmable observability pipelines for telemetry collection, processing, and delivery.
NOTE: This page focuses mainly on "Flow mode," the Terraform-inspired revision of Grafana Agent.
Grafana Agent can collect, transform, and send data to:
- The Prometheus ecosystem
- The OpenTelemetry ecosystem
- The Grafana open source ecosystem (Loki, Grafana, Tempo, Mimir, Pyroscope)
Why use Grafana Agent?
- Vendor-neutral: Fully compatible with the Prometheus, OpenTelemetry, and Grafana open source ecosystems.
- Every signal: Collect telemetry data for metrics, logs, traces, and continuous profiles.
- Scalable: Deploy on any number of machines to collect millions of active series and terabytes of logs.
- Battle-tested: Grafana Agent extends the existing battle-tested code from the Prometheus and OpenTelemetry Collector projects.
- Powerful: Write programmable pipelines with ease, and debug them using a built-in UI.
- Batteries included: Integrate with systems like MySQL, Kubernetes, and Apache to get telemetry that's immediately useful.
Getting started
Check out our documentation to see:
- Installation instructions for Grafana Agent Flow
- Details about Grafana Agent Flow
- Steps for Getting started with Grafana Agent Flow
- The list of Grafana Agent Flow Components
Example
// Discover Kubernetes pods to collect metrics from.
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]
}
// Get an API key from disk.
local.file "apikey" {
filename = "/var/data/my-api-key.txt"
is_secret = true
}
// 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
}
}
}
We maintain an example Docker Compose environment that can be used to launch dependencies to play with Grafana Agent locally.
Release cadence
A new minor release is planned every six weeks.
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.
Community
To engage with the Grafana Agent community:
- Chat with us on our community Slack channel. To invite yourself to the
Grafana Slack, visit https://slack.grafana.com/ and join the
#agent
channel. - Ask questions on the Discussions page.
- File an issue for bugs, issues, and feature suggestions.
- Attend the monthly community call.
Contribute
Refer to our contributors guide to learn how to contribute.
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
grafana-agent-flow
Command grafana-agent-flow is an Flow mode-only binary.
|
Command grafana-agent-flow is an Flow mode-only binary. |
grafana-agent-service
Command grafana-agent-service is a Windows binary which manages Grafana Agent as a Windows service.
|
Command grafana-agent-service is a Windows binary which manages Grafana Agent as a Windows service. |
grafana-agentctl
Command grafana-agentctl provides utilities for interacting with Grafana Agent.
|
Command grafana-agentctl provides utilities for interacting with Grafana Agent. |
e2e
module
|
|
internal
|
|
static
|
|
client
Package client provides a client interface to the Agent HTTP API.
|
Package client provides a client interface to the Agent HTTP API. |
config/features
Package features enables a way to encode enabled features in a flag.FlagSet.
|
Package features enables a way to encode enabled features in a flag.FlagSet. |
integrations/agent
Package agent is an "example" integration that has very little functionality, but is still useful in practice.
|
Package agent is an "example" integration that has very little functionality, but is still useful in practice. |
integrations/apache_http
Package apache_http embeds https://github.com/Lusitaniae/apache_exporter
|
Package apache_http embeds https://github.com/Lusitaniae/apache_exporter |
integrations/config
Package config provides common configuration structs shared among implementations of integrations.Integration.
|
Package config provides common configuration structs shared among implementations of integrations.Integration. |
integrations/consul_exporter
Package consul_exporter embeds https://github.com/prometheus/consul_exporter
|
Package consul_exporter embeds https://github.com/prometheus/consul_exporter |
integrations/dnsmasq_exporter
Package dnsmasq_exporter embeds https://github.com/google/dnsmasq_exporter
|
Package dnsmasq_exporter embeds https://github.com/google/dnsmasq_exporter |
integrations/elasticsearch_exporter
Package elasticsearch_exporter instantiates the exporter from github.com/justwatchcom/elasticsearch_exporter - replaced for github.com/prometheus-community/elasticsearch_exporter Using the YAML config provided by the agent
|
Package elasticsearch_exporter instantiates the exporter from github.com/justwatchcom/elasticsearch_exporter - replaced for github.com/prometheus-community/elasticsearch_exporter Using the YAML config provided by the agent |
integrations/install
Package install registers all in-source integrations for use.
|
Package install registers all in-source integrations for use. |
integrations/memcached_exporter
Package memcached_exporter embeds https://github.com/google/memcached_exporter
|
Package memcached_exporter embeds https://github.com/google/memcached_exporter |
integrations/mysqld_exporter
Package mysqld_exporter embeds https://github.com/prometheus/mysqld_exporter
|
Package mysqld_exporter embeds https://github.com/prometheus/mysqld_exporter |
integrations/postgres_exporter
Package postgres_exporter embeds https://github.com/prometheus/postgres_exporter
|
Package postgres_exporter embeds https://github.com/prometheus/postgres_exporter |
integrations/process_exporter
Package process_exporter embeds https://github.com/ncabatoff/process-exporter
|
Package process_exporter embeds https://github.com/ncabatoff/process-exporter |
integrations/redis_exporter
Package redis_exporter embeds https://github.com/oliver006/redis_exporter
|
Package redis_exporter embeds https://github.com/oliver006/redis_exporter |
integrations/snmp_exporter
Package snmp_exporter embeds https://github.com/prometheus/snmp_exporter
|
Package snmp_exporter embeds https://github.com/prometheus/snmp_exporter |
integrations/statsd_exporter
Package statsd_exporter embeds https://github.com/prometheus/statsd_exporter
|
Package statsd_exporter embeds https://github.com/prometheus/statsd_exporter |
integrations/v2
Package integrations provides a way to run and manage Grafana Agent "integrations," which integrate some external system (such as MySQL) to Grafana Agent's existing metrics, logging, and tracing subsystems.
|
Package integrations provides a way to run and manage Grafana Agent "integrations," which integrate some external system (such as MySQL) to Grafana Agent's existing metrics, logging, and tracing subsystems. |
integrations/v2/agent
Package agent is an "example" integration that has very little functionality, but is still useful in practice.
|
Package agent is an "example" integration that has very little functionality, but is still useful in practice. |
integrations/v2/apache_http
Package apache_http embeds https://github.com/Lusitaniae/apache_exporter
|
Package apache_http embeds https://github.com/Lusitaniae/apache_exporter |
integrations/v2/autoscrape
Package autoscrape implements a scraper for integrations.
|
Package autoscrape implements a scraper for integrations. |
integrations/v2/eventhandler
Package eventhandler watches for Kubernetes Event objects and hands them off to Agent's Logs subsystem (embedded promtail)
|
Package eventhandler watches for Kubernetes Event objects and hands them off to Agent's Logs subsystem (embedded promtail) |
integrations/v2/snmp_exporter
Package snmp_exporter embeds https://github.com/prometheus/snmp_exporter
|
Package snmp_exporter embeds https://github.com/prometheus/snmp_exporter |
logs
Package logs implements logs support for the Grafana Agent.
|
Package logs implements logs support for the Grafana Agent. |
metrics
Package metrics implements a Prometheus-lite client for service discovery, scraping metrics into a WAL, and remote_write.
|
Package metrics implements a Prometheus-lite client for service discovery, scraping metrics into a WAL, and remote_write. |
metrics/instance
Package instance provides a mini Prometheus scraper and remote_writer.
|
Package instance provides a mini Prometheus scraper and remote_writer. |
metrics/instance/configstore
Package configstore abstracts the concepts of where instance files get retrieved.
|
Package configstore abstracts the concepts of where instance files get retrieved. |
operator/assets
Package assets contains helper types used for loading in static assets when configuring the Grafana Agent.
|
Package assets contains helper types used for loading in static assets when configuring the Grafana Agent. |
operator/config
Package config generates Grafana Agent configuration based on Kubernetes resources.
|
Package config generates Grafana Agent configuration based on Kubernetes resources. |
operator/hierarchy
Package hierarchy provides tools to discover a resource hierarchy.
|
Package hierarchy provides tools to discover a resource hierarchy. |
operator/logutil
Package logutil implements an adaptor for the go-kit logger, which is used in the Grafana Agent project, and go-logr, which is used in controller-runtime.
|
Package logutil implements an adaptor for the go-kit logger, which is used in the Grafana Agent project, and go-logr, which is used in controller-runtime. |
server
Package server implements the HTTP and gRPC server used throughout Grafana Agent.
|
Package server implements the HTTP and gRPC server used throughout Grafana Agent. |
tools
|
|
agentlint
Module
|