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.
Install Grafana Agent on Linux
Install Grafana Agent and get it up and running on Linux.
Install on Debian or Ubuntu
- If your distribution supports the signed-by option, open a terminal and enter:
$ mkdir -p /etc/apt/keyrings/
$ wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg
$ echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
Otherwise, with the deprecated apt-key command:
$ echo "deb https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
$ wget -q -O - https://apt.grafana.com/gpg.key | apt-key add -
- After you add the repository, update package list:
sudo apt-get update
- Install Grafana Agent:
sudo apt-get install grafana-agent
Install on RPM-based Linux (CentOS, Fedora, OpenSuse, Red Hat)
- Manually create a new
.repo
file inside/etc/yum.repos.d
using a text editor:
$ sudo nano /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://rpm.grafana.com
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
- Verify that the repository is properly configured using
yum-config-manager
:
yum-config-manager grafana
- Install Grafana Agent:
sudo yum install grafana-agent
Operation guide
The Grafana Agent will be configured a systemd service after using the installation methods explained in the previous sections.
Start the Agent
To run the service you just need to type:
sudo systemctl start grafana-agent
You can check the status of the running agent typing:
sudo systemctl status grafana-agent
Alternately, you can configure the Grafana Agent to restart at boot:
sudo systemctl enable grafana-agent.service
Editing the Agent’s config file
By default, the config file is located in /etc/grafana-agent.yaml
. After editing the file
with the desired config, you need to restart the agent running:
sudo systemctl restart grafana-agent
Check the logs of running Agent
You can check the logs of running agent typing:
sudo journalctl -u grafana-agent
Sep 02 14:33:28 grafana systemd[1]: Started Monitoring system and forwarder.
Sep 02 14:33:28 grafana grafana-agent[1633180]: ts=2022-09-02T12:33:28Z level=info caller=traces/traces.go:143 msg="Traces Logger I>
Sep 02 14:37:45 grafana systemd[1]: Stopping Monitoring system and forwarder...