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

Start, restart, and stop Grafana Agent Flow

You can start, restart, and stop Grafana Agent Flow after it is installed.

Linux

Grafana Agent Flow is installed as a systemd service on Linux.

Start Grafana Agent Flow

To start Grafana Agent Flow, run the following command in a terminal window:

shell
sudo systemctl start grafana-agent-flow

(Optional) To verify that the service is running, run the following command in a terminal window:

shell
sudo systemctl status grafana-agent-flow

Configure Grafana Agent Flow to start at boot

To automatically run Grafana Agent Flow when the system starts, run the following command in a terminal window:

shell
sudo systemctl enable grafana-agent-flow.service

Restart Grafana Agent Flow

To restart Grafana Agent Flow, run the following command in a terminal window:

shell
sudo systemctl restart grafana-agent-flow

Stop Grafana Agent Flow

To stop Grafana Agent Flow, run the following command in a terminal window:

shell
sudo systemctl stop grafana-agent-flow

View Grafana Agent Flow logs on Linux

To view Grafana Agent Flow log files, run the following command in a terminal window:

shell
sudo journalctl -u grafana-agent-flow

macOS

Grafana Agent Flow is installed as a launchd service on macOS.

Start Grafana Agent Flow

To start Grafana Agent Flow, run the following command in a terminal window:

shell
brew services start grafana-agent-flow

Grafana Agent Flow automatically runs when the system starts.

(Optional) To verify that the service is running, run the following command in a terminal window:

shell
brew services info grafana-agent-flow

Restart Grafana Agent Flow

To restart Grafana Agent Flow, run the following command in a terminal window:

shell
brew services restart grafana-agent-flow

Stop Grafana Agent Flow

To stop Grafana Agent Flow, run the following command in a terminal window:

shell
brew services stop grafana-agent-flow

View Grafana Agent Flow logs on macOS

By default, logs are written to $(brew --prefix)/var/log/grafana-agent-flow.log and $(brew --prefix)/var/log/grafana-agent-flow.err.log.

If you followed Configure the Grafana Agent Flow service and changed the path where logs are written, refer to your current copy of the Grafana Agent Flow formula to locate your log files.

Windows

Grafana Agent Flow is installed as a Windows Service. The service is configured to automatically run on startup.

To verify that Grafana Agent Flow is running as a Windows Service:

  1. Open the Windows Services manager (services.msc):

    1. Right click on the Start Menu and select Run.

    2. Type: services.msc and click OK.

  2. Scroll down to find the Grafana Agent Flow service and verify that the Status is Running.

View Grafana Agent Flow logs

When running on Windows, Grafana Agent Flow writes its logs to Windows Event Logs with an event source name of Grafana Agent Flow.

To view the logs, perform the following steps:

  1. Open the Event Viewer:

    1. Right click on the Start Menu and select Run.

    2. Type eventvwr and click OK.

  2. In the Event Viewer, click on Windows Logs > Application.

  3. Search for events with the source Grafana Agent Flow.

Standalone binary

If you downloaded the standalone binary, you must run Grafana Agent Flow from a terminal or command window.

Start Grafana Agent Flow on Linux, macOS, or FreeBSD

To start Grafana Agent Flow on Linux, macOS, or FreeBSD, run the following command in a terminal window:

shell
AGENT_MODE=flow <BINARY_PATH> run <CONFIG_PATH>

Replace the following:

  • <BINARY_PATH>: The path to the Grafana Agent Flow binary file.
  • <CONFIG_PATH>: The path to the Grafana Agent Flow configuration file.

Start Grafana Agent Flow on Windows

To start Grafana Agent Flow on Windows, run the following commands in a command prompt:

cmd
set AGENT_MODE=flow
<BINARY_PATH> run <CONFIG_PATH>

Replace the following:

  • <BINARY_PATH>: The path to the Grafana Agent Flow binary file.
  • <CONFIG_PATH>: The path to the Grafana Agent Flow configuration file.

Set up Grafana Agent Flow as a Linux systemd service

You can set up and manage the standalone binary for Grafana Agent Flow as a Linux systemd service.

Note

These steps assume you have a default systemd and Grafana Agent Flow configuration.
  1. To create a new user called grafana-agent-flow run the following command in a terminal window:

    shell
    sudo useradd --no-create-home --shell /bin/false grafana-agent-flow
  2. Create a service file in /etc/systemd/system called grafana-agent-flow.service with the following contents:

    systemd
    [Unit]
    Description=Vendor-neutral programmable observability pipelines.
    Documentation=https://grafana.com/docs/agent/latest/flow/
    Wants=network-online.target
    After=network-online.target
    
    [Service]
    Restart=always
    User=grafana-agent-flow
    Environment=HOSTNAME=%H
    EnvironmentFile=/etc/default/grafana-agent-flow
    WorkingDirectory=<WORKING_DIRECTORY>
    ExecStart=<BINARY_PATH> run $CUSTOM_ARGS --storage.path=<WORKING_DIRECTORY> $CONFIG_FILE
    ExecReload=/usr/bin/env kill -HUP $MAINPID
    TimeoutStopSec=20s
    SendSIGKILL=no
    
    [Install]
    WantedBy=multi-user.target

    Replace the following:

    • <BINARY_PATH>: The path to the Grafana Agent Flow binary file.
    • <WORKING_DIRECTORY>: The path to a working directory, for example /var/lib/grafana-agent-flow.
  3. Create an environment file in /etc/default/ called grafana-agent-flow with the following contents:

    shell
    ## Path:
    ## Description: Grafana Agent Flow settings
    ## Type:        string
    ## Default:     ""
    ## ServiceRestart: grafana-agent-flow
    #
    # Command line options for grafana-agent
    #
    # The configuration file holding the Grafana Agent Flow configuration.
    CONFIG_FILE="<CONFIG_PATH>"
    
    # User-defined arguments to pass to the run command.
    CUSTOM_ARGS=""
    
    # Restart on system upgrade. Defaults to true.
    RESTART_ON_UPGRADE=true

    Replace the following:

    • <CONFIG_PATH>: The path to the Grafana Agent Flow configuration file.
  4. To reload the service files, run the following command in a terminal window:

    shell
    sudo systemctl daemon-reload
  5. Use the Linux systemd commands to manage your standalone Linux installation of Grafana Agent Flow.