diff --git a/docs/sources/flow/getting-started/_index.md b/docs/sources/flow/getting-started/_index.md index 3c18747818eb..db309f09e262 100644 --- a/docs/sources/flow/getting-started/_index.md +++ b/docs/sources/flow/getting-started/_index.md @@ -1,12 +1,13 @@ --- -title: Getting started +title: Get started with Grafana Agent in flow mode +menuTitle: Get started weight: 200 aliases: - getting_started/ --- -# Getting started +# Get started with Grafana Agent in flow mode -This section details guides for getting started with Grafana Agent Flow. +This section details guides for getting started with Grafana Agent in flow mode. {{< section >}} diff --git a/docs/sources/flow/setup/configure/_index.md b/docs/sources/flow/setup/configure/_index.md index 49442f779346..c97640d73cda 100644 --- a/docs/sources/flow/setup/configure/_index.md +++ b/docs/sources/flow/setup/configure/_index.md @@ -5,7 +5,7 @@ menuTitle: Configure flow mode weight: 150 --- -# Configure Grafana Agent +# Configure Grafana Agent in flow mode You can configure Grafana Agent in flow mode after it is installed. The default River configuration file for flow mode is located at: diff --git a/docs/sources/flow/setup/configure/configure-kubernetes.md b/docs/sources/flow/setup/configure/configure-kubernetes.md index 131203383c95..6bd2771e66e2 100644 --- a/docs/sources/flow/setup/configure/configure-kubernetes.md +++ b/docs/sources/flow/setup/configure/configure-kubernetes.md @@ -5,7 +5,7 @@ menuTitle: Kubernetes weight: 200 --- -# Configure Grafana Agent on Kubernetes +# Configure Grafana Agent in flow mode on Kubernetes To configure Grafana Agent in flow mode on Kubernetes, perform the following steps: diff --git a/docs/sources/flow/setup/configure/configure-linux.md b/docs/sources/flow/setup/configure/configure-linux.md index 3f03ed135705..737a7a702ea5 100644 --- a/docs/sources/flow/setup/configure/configure-linux.md +++ b/docs/sources/flow/setup/configure/configure-linux.md @@ -50,7 +50,7 @@ the following steps: 1. Change the contents of the `CUSTOM_ARGS` environment variable to specify command-line flags to pass. - + 1. Restart the Grafana Agent service: ```shell diff --git a/docs/sources/flow/setup/configure/configure-macos.md b/docs/sources/flow/setup/configure/configure-macos.md index 42f7848d1c5f..51d0f53e3d69 100644 --- a/docs/sources/flow/setup/configure/configure-macos.md +++ b/docs/sources/flow/setup/configure/configure-macos.md @@ -5,7 +5,7 @@ menuTitle: macOS weight: 400 --- -# Configure Grafana Agent on macOS +# Configure Grafana Agent in flow mode on macOS To configure Grafana Agent in flow mode on macOS, perform the following steps: diff --git a/docs/sources/flow/setup/configure/configure-windows.md b/docs/sources/flow/setup/configure/configure-windows.md index 650768352fef..2a66390235b4 100644 --- a/docs/sources/flow/setup/configure/configure-windows.md +++ b/docs/sources/flow/setup/configure/configure-windows.md @@ -5,7 +5,7 @@ menuTitle: Windows weight: 500 --- -# Configure Grafana Agent on Windows +# Configure Grafana Agent in flow mode on Windows To configure Grafana Agent in flow mode on Windows, perform the following steps: diff --git a/docs/sources/flow/setup/install/_index.md b/docs/sources/flow/setup/install/_index.md index 07b12f34998c..efbd7eec7943 100644 --- a/docs/sources/flow/setup/install/_index.md +++ b/docs/sources/flow/setup/install/_index.md @@ -10,6 +10,13 @@ aliases: You can install Grafana Agent in flow mode on Docker, Kubernetes, Linux, macOS, or Windows. +The following architectures are supported: + +- Linux: AMD64, ARM64, ARMv6, ARMv7 +- Windows: AMD64 +- macOS: AMD64 (Intel), ARM64 (Apple Silicon) +- FreeBSD: AMD64 + {{% admonition type="note" %}} Installing Grafana Agent on other operating systems is possible, but is not recommended or supported. {{% /admonition %}} diff --git a/docs/sources/flow/setup/install/binary.md b/docs/sources/flow/setup/install/binary.md index 088d5567dcd5..df5624b98e6b 100644 --- a/docs/sources/flow/setup/install/binary.md +++ b/docs/sources/flow/setup/install/binary.md @@ -7,9 +7,9 @@ aliases: - ../../install/binary/ --- -# Install Grafana Agent in flow mode +# Install Grafana Agent in flow mode as a standalone binary -Grafana Agent is distributed as a standalone binarie for various operating systems and architectures: +Grafana Agent is distributed as a standalone binary for the following operating systems and architectures: * Linux: AMD64, ARM64, ARMv6, ARMv7 * Windows: AMD64 @@ -20,7 +20,7 @@ Grafana Agent is distributed as a standalone binarie for various operating syste To download the Grafana Agent as a standalone binary, perform the following steps. -1. Navigate to the current Grafana Agent [release][] page. +1. Navigate to the current Grafana Agent [release](https://github.com/grafana/agent/releases) page. 1. Scroll down to the **Assets** section. @@ -38,5 +38,5 @@ To download the Grafana Agent as a standalone binary, perform the following step ## Next steps -- [Start Grafana Agent]({{< relref "../start-agent#standalone-binary" >}}) -- [Configure Grafana Agent]({{< relref "../configure/" >}}) +* [Start Grafana Agent]({{< relref "../start-agent#standalone-binary" >}}) +* [Configure Grafana Agent]({{< relref "../configure/" >}}) diff --git a/docs/sources/flow/setup/install/docker.md b/docs/sources/flow/setup/install/docker.md index fb751e261e06..87342ac84fb9 100644 --- a/docs/sources/flow/setup/install/docker.md +++ b/docs/sources/flow/setup/install/docker.md @@ -1,18 +1,18 @@ --- description: Learn how to install Grafana Agent in flow mode on Docker -title: Install Grafana Agent in flow mode on Docker +title: Run Grafana Agent in flow mode in a Docker container menuTitle: Docker weight: 100 aliases: - ../../install/docker/ --- -# Install Grafana Agent in flow mode on Docker +# Run Grafana Agent in flow mode in a Docker container -Grafana Agent is available as Docker images on the following platforms: +Grafana Agent is available as a Docker container image on the following platforms: -* [Linux containers][] for AMD64 and ARM64 machines. -* [Windows containers][] for AMD64 machines. +* [Linux containers][] for AMD64 and ARM64. +* [Windows containers][] for AMD64. [Linux containers]: #run-a-linux-docker-container [Windows containers]: #run-a-windows-docker-container @@ -33,71 +33,56 @@ Grafana Agent is available as Docker images on the following platforms: ## Run a Linux Docker container -To run Grafana Agent in flow mode as a Linux Docker container, perform the following steps: +To run Grafana Agent in flow mode as a Linux Docker container, run the following command in a terminal window: -1. Run the following command in a terminal window: +```shell +docker run \ + -e AGENT_MODE=flow \ + -v CONFIG_FILE_PATH:/etc/agent/config.river \ + -p 12345:12345 \ + grafana/agent:latest \ + run --server.http.listen-addr=0.0.0.0:12345 /etc/agent/config.river +``` - ```shell - docker run \ - -e AGENT_MODE=flow \ - -v CONFIG_FILE_PATH:/etc/agent/config.river \ - -p 12345:12345 \ - grafana/agent:latest \ - run --server.http.listen-addr=0.0.0.0:12345 /etc/agent/config.river - ``` +Replace `CONFIG_FILE_PATH` with the path of the configuration file on your host system. - Replace `CONFIG_FILE_PATH` with the path of the configuration file on - your host system. - -The last line may be modified to change the arguments passed to the Grafana -Agent binary. To see the set of options available to the `run` command, -refer to the documentation for [run][]. +You can modify the last line to change the arguments passed to the Grafana Agent binary. +Refer to the documentation for [run][] for more information about the options available to the `run` command. {{% admonition type="note" %}} -Make sure you pass `--server.http.listen-addr=0.0.0.0:12345` as an -argument as shown in the example above. If you don't pass this argument, the [debugging UI][] won't be -available outside of the Docker container. +Make sure you pass `--server.http.listen-addr=0.0.0.0:12345` as an argument as shown in the example above. +If you don't pass this argument, the [debugging UI](../../monitoring/debugging.md#grafana-agent-flow-ui) won't be available outside of the Docker container. {{% /admonition %}} -[debugging UI]: {{< relref "../../monitoring/debugging.md#grafana-agent-flow-ui" >}} [run]: {{< relref "../../reference/cli/run.md" >}} ## Run a Windows Docker container -To run Grafana Agent in flow mode as a Windows Docker container, perform the following -steps: - -1. Run the following command in a terminal window: +To run Grafana Agent in flow mode as a Windows Docker container, run the following command in a terminal window: - ```shell - docker run \ - -e AGENT_MODE=flow \ - -v CONFIG_FILE_PATH:C:\etc\grafana-agent\config.river \ - -p 12345:12345 \ - grafana/agent:latest-windows \ - run --server.http.listen-addr=0.0.0.0:12345 C:\etc\grafana-agent\config.river - ``` +```shell +docker run \ + -e AGENT_MODE=flow \ + -v CONFIG_FILE_PATH:C:\etc\grafana-agent\config.river \ + -p 12345:12345 \ + grafana/agent:latest-windows \ + run --server.http.listen-addr=0.0.0.0:12345 C:\etc\grafana-agent\config.river +``` - Replace `CONFIG_FILE_PATH` with the path of the configuration file on - your host system. +Replace `CONFIG_FILE_PATH` with the path of the configuration file on your host system. -The last line may be modified to change the arguments passed to the Grafana -Agent binary. To see the set of options available to the `run` command, -refer to the documentation for [run][]. +You can modify the last line to change the arguments passed to the Grafana Agent binary. +Refer to the documentation for [run][] for more information about the options available to the `run` command. {{% admonition type="note" %}} -Make sure you pass `--server.http.listen-addr=0.0.0.0:12345` as an -argument as shown in the example above. If you don't pass this argument, the [debugging UI][] won't be -available outside of the Docker container. +Make sure you pass `--server.http.listen-addr=0.0.0.0:12345` as an argument as shown in the example above. +If you don't pass this argument, the [debugging UI](../../monitoring/debugging.md#grafana-agent-flow-ui) won't be available outside of the Docker container. {{% /admonition %}} -[debugging UI]: {{< relref "../../monitoring/debugging.md#grafana-agent-flow-ui" >}} [run]: {{< relref "../../reference/cli/run.md" >}} ## Verify -To verify that Grafana Agent is running successfully, navigate to - and make sure the Grafana Agent [UI][] loads -without error. +To verify that Grafana Agent is running successfully, navigate to and make sure the Grafana Agent [UI][] loads without error. [UI]: {{< relref "../../monitoring/debugging.md#grafana-agent-flow-ui" >}} diff --git a/docs/sources/flow/setup/install/kubernetes.md b/docs/sources/flow/setup/install/kubernetes.md index e5c26fd02a42..238d48e2f92a 100644 --- a/docs/sources/flow/setup/install/kubernetes.md +++ b/docs/sources/flow/setup/install/kubernetes.md @@ -1,15 +1,15 @@ --- -description: Learn how to install Grafana Agent in flow mode on Kubernetes -title: Install Grafana Agent in flow mode on Kubernetes +description: Learn how to deploy Grafana Agent in flow mode on Kubernetes +title: Deploy Grafana Agent in flow mode on Kubernetes menuTitle: Kubernetes weight: 200 aliases: - ../../install/kubernetes/ --- -# Install Grafana Agent in flow mode on Kubernetes +# Deploy Grafana Agent in flow mode on Kubernetes -Grafana Agent can be installed on Kubernetes by using the Helm chart for Grafana Agent. +Grafana Agent can be deployed on Kubernetes by using the Helm chart for Grafana Agent. ## Before you begin @@ -19,14 +19,14 @@ Grafana Agent can be installed on Kubernetes by using the Helm chart for Grafana [Helm]: https://helm.sh -## Install +## Deploy {{% admonition type="note" %}} These instructions show you how to install the generic [Helm chart](https://github.com/grafana/agent/tree/main/operations/helm/charts/grafana-agent) for Grafana Agent. You can deploy Grafana Agent either in static mode or flow mode. The Helm chart deploys Grafana Agent in flow mode by default. {{% /admonition %}} -To install Grafana Agent on Kubernetes using Helm, run the following commands in a terminal window: +To deploy Grafana Agent on Kubernetes using Helm, run the following commands in a terminal window: 1. Add the Grafana Helm chart repository: @@ -40,7 +40,7 @@ To install Grafana Agent on Kubernetes using Helm, run the following commands in helm repo update ``` -1. Install the Grafana Agent Helm chart: +1. Install Grafana Agent: ```shell helm install RELEASE_NAME grafana/grafana-agent diff --git a/docs/sources/flow/setup/install/macos.md b/docs/sources/flow/setup/install/macos.md index f8f1975a83b9..fce1c8cfc5ea 100644 --- a/docs/sources/flow/setup/install/macos.md +++ b/docs/sources/flow/setup/install/macos.md @@ -9,10 +9,10 @@ aliases: # Install Grafana Agent in flow mode on macOS -You can install Grafana Agent in flow mode with Homebrew on macOS. +You can install Grafana Agent in flow mode on macOS with Homebrew . {{% admonition type="note" %}} -The default prefix for Homebrew on Intel is `/usr/local`. The default prefix for Homebrew on Apple Silicon is `/opt/Homebrew`. You can verify the default prefix for Homebrew on your computer by opening a terminal and typing `brew --prefix`. +The default prefix for Homebrew on Intel is `/usr/local`. The default prefix for Homebrew on Apple Silicon is `/opt/Homebrew`. To verify the default prefix for Homebrew on your computer, open a terminal window and type `brew --prefix`. {{% /admonition %}} ## Before you begin @@ -37,9 +37,25 @@ To install Grafana Agent on macOS, run the following commands in a terminal wind brew install grafana-agent-flow ``` +## Upgrade + +To upgrade Grafana Agent on macOS, run the following commands in a terminal window. + +1. Upgrade Grafana Agent: + + ```shell + brew upgrade grafana-agent + ``` + +1. Restart Grafana Agent: + + ```shell + brew services restart grafana-agent + ``` + ## Uninstall -To install Grafana Agent on macOS, run the following command in a terminal window: +To uninstall Grafana Agent on macOS, run the following command in a terminal window: ```shell brew uninstall grafana-agent-flow diff --git a/docs/sources/flow/setup/install/windows.md b/docs/sources/flow/setup/install/windows.md index 04551d1181ec..2c351c726c7a 100644 --- a/docs/sources/flow/setup/install/windows.md +++ b/docs/sources/flow/setup/install/windows.md @@ -9,13 +9,13 @@ aliases: # Install Grafana Agent in flow mode on Windows -You can install Grafana Agent in flow mode on Windows with the standard graphical installer, or as a silent install. +You can install Grafana Agent in flow mode on Windows as a standard graphical install, or as a silent install. -## Graphical install +## Standard graphical install To do a standard graphical install of Grafana Agent on Windows, perform the following steps. -1. Navigate to the [latest release][latest]. +1. Navigate to the [latest release][latest] on GitHub. 1. Scroll down to the **Assets** section. @@ -23,7 +23,9 @@ To do a standard graphical install of Grafana Agent on Windows, perform the foll 1. Unzip the downloaded file. -1. Double-click on the unzipped installer to run it. +1. Double-click on `grafana-agent-installer.exe` to install Grafana Agent. + +Grafana Agent is installed into the default directory `C:\Program Files\Grafana Agent Flow`. [latest]: https://github.com/grafana/agent/releases/latest @@ -31,7 +33,7 @@ To do a standard graphical install of Grafana Agent on Windows, perform the foll To do a silent install of Grafana Agent on Windows, perform the following steps. -1. Navigate to the [latest release][latest]. +1. Navigate to the [latest release][latest] on GitHub. 1. Scroll down to the **Assets** section. @@ -45,9 +47,7 @@ To do a silent install of Grafana Agent on Windows, perform the following steps. PATH_TO_INSTALLER /S ``` - Replace `PATH_TO_INSTALLER` with the path where the unzipped installer - executable is located, for example - `C:\Users\Alexis\Downloads\grafana-agent-flow-installer.exe`. + Replace `PATH_TO_INSTALLER` with the path where the unzipped installer executable is located. [latest]: https://github.com/grafana/agent/releases/latest diff --git a/docs/sources/flow/setup/start-agent.md b/docs/sources/flow/setup/start-agent.md index f7aa301131d6..7a32ee4f6b6b 100644 --- a/docs/sources/flow/setup/start-agent.md +++ b/docs/sources/flow/setup/start-agent.md @@ -5,13 +5,13 @@ menuTitle: Start flow mode weight: 800 --- -# Start Grafana Agent +# Start Grafana Agent in flow mode You can start, restart, and stop Grafana Agent after it is installed. ## Linux -Grafana Agent in flow mode is installed as a [systemd][] service on Linux. +Grafana Agent is installed as a [systemd][] service on Linux. [systemd]: https://systemd.io/ @@ -103,8 +103,7 @@ By default, logs are written to `$(brew --prefix)/var/log/grafana-agent-flow.log `$(brew --prefix)/var/log/grafana-agent-flow.err.log`. If you followed [Configure the Grafana Agent service](../setup/configure/configure-macos.md#configure-the-grafana-agent-service) -and changed the path where logs are written, refer to your current copy of the -Grafana Agent formula to locate log files. +and changed the path where logs are written, refer to your current copy of the Grafana Agent formula to locate your log files. ## Windows @@ -151,12 +150,12 @@ AGENT_MODE=flow BINARY_PATH run CONFIG_FILE Replace the following: -* `BINARY_PATH`: The path to the extracted binary. -* `CONFIG_FILE`: The path to a Grafana Agent configuration file. +* `BINARY_PATH`: The path to the Grafana Agent binary file +* `CONFIG_FILE`: The path to the Grafana Agent configuration file. ### Start Grafana Agent on Windows -To start Grafana Agent on Windows, run the following in a command prompt: +To start Grafana Agent on Windows, run the following commands in a command prompt: ```cmd set AGENT_MODE=flow @@ -165,7 +164,7 @@ BINARY_PATH run CONFIG_FILE Replace the following: -* `BINARY_PATH`: The path to the extracted binary. -* `CONFIG_FILE`: The path to a Grafana Agent configuration file. +* `BINARY_PATH`: The path to the Grafana Agent binary file +* `CONFIG_FILE`: The path to the Grafana Agent configuration file. [release]: https://github.com/grafana/agent/releases/latest diff --git a/docs/sources/static/configuration/create-config-file.md b/docs/sources/static/configuration/create-config-file.md index e4009d766f1f..ed4589aa3721 100644 --- a/docs/sources/static/configuration/create-config-file.md +++ b/docs/sources/static/configuration/create-config-file.md @@ -42,7 +42,7 @@ integrations: ``` In this example, we first must configure the `wal_directory` which is used to -store metrics in a Write-Ahead Log. This is required, but ensures that samples +store metrics in a Write-Ahead Log (WAL). The WAL is required and ensures that samples will be redelivered in case of failure (e.g., network issues, machine reboot). We also configure `remote_write`, which is where all metrics should be sent by default. diff --git a/docs/sources/static/set-up/_index.md b/docs/sources/static/set-up/_index.md index d1070fa05284..17b989b8ec06 100644 --- a/docs/sources/static/set-up/_index.md +++ b/docs/sources/static/set-up/_index.md @@ -1,69 +1,12 @@ --- -title: Install static mode +description: Install and configure Grafana Agent in static mode +title: Set up Grafana Agent in static mode +menuTitle: Set up static mode weight: 100 -aliases: -- ../set-up/ --- -# Install Grafana Agent in static mode +# Set up Grafana Agent in static mode -## Overview +This section includes information that helps you get Grafana Agent in static mode installed and configured. -If this is your first time using Grafana Agent, use one of the installation options to install Grafana Agent based on the platform you are using. Alternatively, use the quick start guides to help you with the specifics of sending metrics, logs, and traces to the Grafana Stack or Grafana Cloud. - -If you have already installed Grafana Agent on your machine, you can jump to the [Configure Grafana Agent]({{< relref "../configuration/_index.md" >}}) section. - -To get started with Grafana Agent Operator, refer to the Operator-specific -[documentation](../../operator/_index.md). - -## Installation options - -Grafana Agent is currently distributed in plain binary form, Docker container images, a Windows installer, a Homebrew package, and a Kubernetes install script. - -The following architectures receive active support. - - - macOS: Intel Mac or Apple Silicon - - Windows: A x64 machine - - Linux: AMD64 or ARM64 machines - - FreeBSD: A AMD64 machine - -In addition, best-effort support is provided for Linux: ppc64le. - -Choose from the following platforms and installation options according to which suits your use case best. - -### Kubernetes - -Deploy Kubernetes manifests from the [`kubernetes` directory](https://github.com/grafana/agent/tree/main/production/kubernetes). -You can manually modify the Kubernetes manifests by downloading them. These manifests do not include Grafana Agent configuration files. - -For sample configuration files, refer to the Grafana Cloud Kubernetes quick start guide: https://grafana.com/docs/grafana-cloud/kubernetes/agent-k8s/. - -Advanced users can use the Grafana Agent Operator to deploy the Grafana Agent on Kubernetes. - -### Docker - -Refer to [Install Grafana Agent on Docker]({{< relref "./install-agent-docker.md" >}}). - -### Linux - -Refer to [Install Grafana Agent on Linux]({{< relref "./install-agent-linux.md" >}}). - -### Windows - -Refer to [Install Grafana Agent on Windows]({{< relref "./install-agent-on-windows.md" >}}). - -### Binary - -Refer to [Install the Grafana Agent binary]({{< relref "./install-agent-binary.md" >}}). - -### macOS - -Refer to [Install Grafana Agent on macOS]({{< relref "./install-agent-macos.md" >}}). - -### Grafana Cloud - -Use the Grafana Agent [Kubernetes quickstarts](https://grafana.com/docs/grafana-cloud/kubernetes/agent-k8s/) or follow instructions for installing the Grafana Agent in the [Walkthrough](https://grafana.com/docs/grafana-cloud/quickstart/agent_linuxnode/). - -### Tanka - -For more information, refer to the [Tanka](https://tanka.dev) configurations in our [`production/`](https://github.com/grafana/agent/tree/main/production/tanka/grafana-agent) directory. +{{< section >}} diff --git a/docs/sources/static/set-up/install-agent-binary.md b/docs/sources/static/set-up/install-agent-binary.md deleted file mode 100644 index c9e6ab6a8cab..000000000000 --- a/docs/sources/static/set-up/install-agent-binary.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Other systems -weight: 140 -aliases: -- ../../set-up/install-agent-binary/ ---- - -# Install static mode on other systems - -You can use the standalone binary to install Grafana Agent in static mode on the following systems: - -* Linux: AMD64, ARM64, PPC64, S390X -* Windows: AMD64 -* macOS: AMD64, ARM64 - -## Overview - -Binary executables are available for the most common operating systems. Choose the binary from the Assets list on the Releases page that matches your operating system. The binary executable will run Grafana Agent in standalone mode. If you want to run Grafana Agent as a service, refer to the installation instructions for: - -* [Linux]({{< relref "./install-agent-linux.md" >}}) -* [macOS]({{< relref "./install-agent-macos.md" >}}) -* [Windows]({{< relref "./install-agent-on-windows.md" >}}) - -ppc64le builds are considered secondary release targets and do not have the same level of support and testing as other platforms. - -## Download Grafana Agent - -1. Navigate to the current Grafana Agent [releases](https://github.com/grafana/agent/releases). -1. Scroll down to the **Assets** section. -1. Download the version that matches your operating system and machine’s architecture. -1. Extract the package contents into a directory. -1. If you are running Linux or macOS, run the following command in a terminal to make the extracted file executable: - - ```shell - chmod +x EXTRACTED_BINARY - ``` - -## Configure Grafana Agent - -Refer to [Create a configuration file]({{< relref "../configuration/create-config-file/" >}}) for information about editing or creating a configuration file. - -## Run Grafana Agent - -1. Open a terminal on Linux or macOS, or open a command prompt on Windows. -1. Run the following command to start Grafana Agent in static mode: - - ```shell - EXTRACTED_BINARY -config.file CONFIG_FILE - ``` diff --git a/docs/sources/static/set-up/install-agent-docker.md b/docs/sources/static/set-up/install-agent-docker.md deleted file mode 100644 index 347b6e3c36bd..000000000000 --- a/docs/sources/static/set-up/install-agent-docker.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: Docker -weight: 110 -aliases: -- ../../set-up/install-agent-docker/ ---- - -# Run Grafana Agent in a Docker container - -Grafana Agent is available as a Docker container image on the following platforms: - -* [Linux][] -* [Windows][] - -[Linux]: #run-a-linux-docker-container -[Windows]: #run-a-windows-docker-container - -## Before you begin - - - Ensure that [Docker][] is installed and running on your machine. - - Ensure that you have created a Grafana Agent [configuration file]({{< relref "../configuration/create-config-file/" >}}). - -[Docker]: https://docker.io -## Run a Linux Docker container - -1. To run a Grafana Agent Docker container on Linux, run the following command in a terminal: - - ``` - docker run \ - -v WAL_DATA_DIRECTORY:/etc/agent/data \ - -v CONFIG_FILE_PATH:/etc/agent/agent.yaml \ - grafana/agent:v0.34.3 - ``` - - - Replace `CONFIG_FILE_PATH` with the configuration file path on your Linux host system. - - Replace `WAL_DATA_DIRECTORY` with the directory used to store your metrics before sending them to Prometheus. Old WAL data is cleaned up every hour and is used for recovery if the process crashes. - - {{% admonition type="note" %}} - For the flags to work correctly, you must expose the paths on your Linux host to the Docker container through a bind mount. - {{%/admonition %}} - -## Run a Windows Docker container - -1. To run a Grafana Agent Docker container on Windows, run the following command in a Windows command prompt: - - ``` - docker run ^ - -v WAL_DATA_DIRECTORY:c:\etc\grafana-agent\data ^ - -v CONFIG_FILE_PATH:c:\etc\grafana-agent ^ - grafana/agent:v0.34.3-windows - ``` - - - Replace `CONFIG_FILE_PATH` with the configuration file path on your Windows host system. - - Replace `WAL_DATA_DIRECTORY` with the directory used to store your metrics before sending them to Prometheus. Old WAL data is cleaned up every hour and is used for recovery if the process crashes. - - {{% admonition type="note" %}} - For the flags to work correctly, you must expose the paths on your Windows host to the Docker container through a bind mount. - {{%/admonition %}} - -## Result - -Docker containers run the Grafana Agent using this configuration file. diff --git a/docs/sources/static/set-up/install-agent-macos.md b/docs/sources/static/set-up/install-agent-macos.md deleted file mode 100644 index b0cf21532e37..000000000000 --- a/docs/sources/static/set-up/install-agent-macos.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: macOS -weight: 130 -aliases: -- ../../set-up/install-agent-macos/ ---- - -# Install static mode on macOS - -You can install Grafana Agent in static mode on macOS. - -## Before you begin - -Ensure that [Homebrew][] is installed. - -{{% admonition type="note" %}} -The default prefix for Homebrew on Intel is `/usr/local`. The default prefix for Homebrew on Apple Silicon is `/opt/Homebrew`. You can verify the default prefix for Homebrew on your computer by opening a terminal and typing `brew --prefix`. -{{% /admonition %}} - -[Homebrew]: https://brew.sh - -## Installing Grafana Agent with Homebrew - -Open a terminal and run the following commands: - -```shell -brew update -brew install grafana-agent -``` - - Grafana Agent is installed by default at `$(brew --prefix)/Cellar/grafana-agent/VERSION`. - -## Configuring Grafana Agent - -1. To create the Agent `config.yml` file, open a terminal and run the following command: - - ```shell - touch $(brew --prefix)/etc/grafana-agent/config.yml - ``` - -1. Edit `$(brew --prefix)/etc/grafana-agent/config.yml` and add the configuration blocks for your specific telemetry needs. Refer to [Configure Grafana Agent]({{< relref "../configuration/" >}}) for more information. - -{{% admonition type="note" %}} -To send your data to Grafana Cloud, set up Grafana Agent using the Grafana Cloud integration. Refer to [how to install an integration](/docs/grafana-cloud/data-configuration/integrations/install-and-manage-integrations/) and [macOS integration](/docs/grafana-cloud/data-configuration/integrations/integration-reference/integration-macos-node/). -{{%/admonition %}} - -## Starting Grafana Agent - -Open a terminal and run the following command to start Grafana Agent: - -```shell -brew services start grafana-agent -``` - -## Viewing Grafana Agent Logs - -By default, logs are written to the following locations: - -* `$(brew --prefix)/var/log/grafana-agent.log` -* `$(brew --prefix)/var/log/grafana-agent.err.log` - -## Upgrading Grafana Agent - -Open a terminal and run the following commands to upgrade and restart Grafana Agent: - -```shell -brew upgrade grafana-agent -brew services restart grafana-agent - ``` diff --git a/docs/sources/static/set-up/install/_index.md b/docs/sources/static/set-up/install/_index.md new file mode 100644 index 000000000000..9740ec76c469 --- /dev/null +++ b/docs/sources/static/set-up/install/_index.md @@ -0,0 +1,37 @@ +--- +title: Install Grafana Agent in static mode +menuTitle: Install static mode +weight: 100 +aliases: +- ../set-up/ +- ../ +--- + +# Install Grafana Agent in static mode + +You can install Grafana Agent in static mode on Docker, Kubernetes, Linux, macOS, or Windows. + +The following architectures are supported: + +- Linux: AMD64, ARM64, ARMv6, ARMv7 +- Windows: AMD64 +- macOS: AMD64 (Intel), ARM64 (Apple Silicon) +- FreeBSD: AMD64 + +{{% admonition type="note" %}} +ppc64le builds are considered secondary release targets and do not have the same level of support and testing as other platforms. +{{% /admonition %}} + +{{< section >}} + +{{% admonition type="note" %}} +Installing Grafana Agent on other operating systems is possible, but is not recommended or supported. +{{% /admonition %}} + +## Grafana Cloud + +Use the Grafana Agent [Kubernetes quickstarts](https://grafana.com/docs/grafana-cloud/kubernetes/agent-k8s/) or follow instructions for installing the Grafana Agent in the [Walkthrough](https://grafana.com/docs/grafana-cloud/quickstart/agent_linuxnode/). + +## Tanka + +For more information, refer to the [Tanka](https://tanka.dev) configurations in the Grafana Agent [production](https://github.com/grafana/agent/tree/main/production/tanka/grafana-agent) directory on GitHub. diff --git a/docs/sources/static/set-up/install/install-agent-binary.md b/docs/sources/static/set-up/install/install-agent-binary.md new file mode 100644 index 000000000000..e13fe3f8357b --- /dev/null +++ b/docs/sources/static/set-up/install/install-agent-binary.md @@ -0,0 +1,49 @@ +--- +title: Install Grafana Agent in static mode as a standalone binary +menuTitle: Standalone +weight: 700 +aliases: +- ../../set-up/install-agent-binary/ +- ../set-up/install-agent-binary/ +--- + +# Install Grafana Agent in static mode as a standalone binary + +Grafana Agent is distributed as a standalone binary for the following operating systems and architectures: + +* Linux: AMD64, ARM64, PPC64, S390X +* macOS: AMD64, (Intel), ARM64 (Apple Silicon) +* Windows: AMD64 + +{{% admonition type="note" %}} +ppc64le builds are considered secondary release targets and do not have the same level of support and testing as other platforms. +{{% /admonition %}} + +The binary executable will run Grafana Agent in standalone mode. If you want to run Grafana Agent as a service, refer to the installation instructions for: + +* [Linux]({{< relref "./install-agent-linux.md" >}}) +* [macOS]({{< relref "./install-agent-macos.md" >}}) +* [Windows]({{< relref "./install-agent-on-windows.md" >}}) + +## Download Grafana Agent + +To download the Grafana Agent as a standalone binary, perform the following steps. + +1. Navigate to the current Grafana Agent [release](https://github.com/grafana/agent/releases) page. + +1. Scroll down to the **Assets** section. + +1. Download the `grafana-agent` zip file that matches your operating system and machine’s architecture. + +1. Extract the package contents into a directory. + +1. If you are installing Grafana Agent on Linux, macOS, or FreeBSD, run the following command in a terminal: + + ```shell + chmod +x EXTRACTED_BINARY + ``` + +## Next steps + +- [Start Grafana Agent]({{< relref "../start-agent/" >}}) +- [Configure Grafana Agent]({{< relref "../../configuration/create-config-file/" >}}) diff --git a/docs/sources/static/set-up/install/install-agent-docker.md b/docs/sources/static/set-up/install/install-agent-docker.md new file mode 100644 index 000000000000..ad42d14525c2 --- /dev/null +++ b/docs/sources/static/set-up/install/install-agent-docker.md @@ -0,0 +1,67 @@ +--- +title: Run Grafana Agent in static mode in a Docker container +menuTitle: Docker +weight: 200 +aliases: +- ../../set-up/install-agent-docker/ +- ../set-up/install-agent-docker/ +--- + +# Run Grafana Agent in static mode in a Docker container + +Grafana Agent is available as a Docker container image on the following platforms: + +* [Linux containers][] for AMD64 and ARM64. +* [Windows containers][] for AMD64. + +[Linux containers]: #run-a-linux-docker-container +[Windows containers]: #run-a-windows-docker-container + +## Before you begin + +* Install [Docker][] on your computer. +* Create and save a Grafana Agent YAML [configuration file]({{< relref "../../configuration/create-config-file/" >}}) on youur computer. + +[Docker]: https://docker.io + +## Run a Linux Docker container + +To run a Grafana Agent Docker container on Linux, run the following command in a terminal window: + +```shell +docker run \ + -v WAL_DATA_DIRECTORY:/etc/agent/data \ + -v CONFIG_FILE_PATH:/etc/agent/agent.yaml \ + grafana/agent:v0.34.3 +``` + +Replace `CONFIG_FILE_PATH` with the configuration file path on your Linux host system. + +{{% admonition type="note" %}} +For the flags to work correctly, you must expose the paths on your Linux host to the Docker container through a bind mount. +{{%/admonition %}} + +## Run a Windows Docker container + +To run a Grafana Agent Docker container on Windows, run the following command in a Windows command prompt: + +```shell +docker run ^ + -v WAL_DATA_DIRECTORY:C:\etc\grafana-agent\data ^ + -v CONFIG_FILE_PATH:C:\etc\grafana-agent ^ + grafana/agent:v0.34.3-windows +``` + +Replace the following: + +* `CONFIG_FILE_PATH`: The configuration file path on your Windows host system. +* `WAL_DATA_DIRECTORY`: the directory used to store your metrics before sending them to Prometheus. Old WAL data is cleaned up every hour and is used for recovery if the process crashes. + +{{% admonition type="note" %}} +For the flags to work correctly, you must expose the paths on your Windows host to the Docker container through a bind mount. +{{%/admonition %}} + +## Next steps + +- [Start Grafana Agent]({{< relref "../start-agent/" >}}) +- [Configure Grafana Agent]({{< relref "../../configuration/" >}}) diff --git a/docs/sources/static/set-up/install/install-agent-kubernetes.md b/docs/sources/static/set-up/install/install-agent-kubernetes.md new file mode 100644 index 000000000000..5a3047e41ad5 --- /dev/null +++ b/docs/sources/static/set-up/install/install-agent-kubernetes.md @@ -0,0 +1,48 @@ +--- +title: Deploy Grafana Agent in static mode on Kubernetes +menuTitle: Kubernetes +weight: 300 +--- + +# Deploy Grafana Agent in static mode on Kubernetes + +You can deploy Grafana Agent in static mode on Kubernetes. + +## Deploy + +To deploy Grafana Agent in static mode on Kubernetes, perform the following steps. + +1. Download one of the following manifests from GitHub and save it as `manifest.yaml`: + + - Metric collection (StatefulSet): [agent-bare.yaml](https://github.com/grafana/agent/blob/main/production/kubernetes/agent-bare.yaml) + - Log collection (DaemonSet): [agent-loki.yaml](https://github.com/grafana/agent/blob/main/production/kubernetes/agent-loki.yaml) + - Trace collection (Deployment): [agent-traces.yaml](https://github.com/grafana/agent/blob/main/production/kubernetes/agent-traces.yaml) + +1. Edit the downloaded `manifest.yaml` and replace the placeholders with information relevant to your Kubernetes deployment. + +1. Apply the modified manifest file: + + ```shell + kubectl -n default apply -f manifest.yaml + ``` + +{{% admonition type="note" %}} +The manifests do not include the `ConfigMaps` which are necessary to run Grafana Agent. +{{% /admonition %}} + +For sample configuration files and detailed instructions, refer to the Grafana Cloud Kubernetes quick start guides: + +- [Grafana Agent Metrics Kubernetes Quickstart](https://grafana.com/docs/grafana-cloud/quickstart/agent-k8s/k8s_agent_metrics/) +- [Grafana Agent Logs Kubernetes Quickstart](https://grafana.com/docs/grafana-cloud/quickstart/agent-k8s/k8s_agent_logs/) +- [Grafana Agent Traces Kubernetes Quickstart](https://grafana.com/docs/grafana-cloud/quickstart/agent-k8s/k8s_agent_traces/) + +## Rebuild the Kubernetes manifests + +The manifests provided are created using Grafana Labs' production Tanka configs with some default values. If you want to build the YAML file with some custom values, you must install the following applications: + +- [Tanka](https://github.com/grafana/tanka) version 0.8 or higher +- [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler) version 0.2.1 or higher + +Refer to the [`template` Tanka environment](https://github.com/grafana/agent/blob/main/production/kubernetes/build/templates) for the current settings that initialize the Grafana Agent Tanka configurations. + +To build the YAML files, run the `/build/build.sh` script, or run `make example-kubernetes` from the project's root directory. diff --git a/docs/sources/static/set-up/install-agent-linux.md b/docs/sources/static/set-up/install/install-agent-linux.md similarity index 50% rename from docs/sources/static/set-up/install-agent-linux.md rename to docs/sources/static/set-up/install/install-agent-linux.md index b0f92291dc4f..4036cb7e91a6 100644 --- a/docs/sources/static/set-up/install-agent-linux.md +++ b/docs/sources/static/set-up/install/install-agent-linux.md @@ -1,8 +1,10 @@ --- -title: Linux -weight: 115 +title: Install Grafana Agent in static mode on Linux +menuTitle: Linux +weight: 400 aliases: - ../../set-up/install-agent-linux/ +- ../set-up/install-agent-linux/ --- # Install static mode on Linux @@ -11,7 +13,9 @@ You can install Grafana Agent in static mode on Linux. ## Install on Debian or Ubuntu -1. Open a terminal and run the following command to install Grafana’s package repository: +To install Grafana Agent in static mode on Debian or Ubuntu, run the following commands in a terminal window. + +1. Import the GPG key and add the Grafana package repository: ```shell sudo mkdir -p /etc/apt/keyrings/ @@ -31,7 +35,38 @@ You can install Grafana Agent in static mode on Linux. sudo apt-get install grafana-agent ``` -## Install on RedHat, RHEL, or Fedora +### Uninstall on Debian or Ubuntu + +To uninstall Grafana Agent on Debian or Ubuntu, run the following commands in a terminal window. + +1. Stop the systemd service for Grafana Agent: + + ```shell + sudo systemctl stop grafana-agent + ``` + +1. Uninstall Grafana Agent: + + ```shell + sudo apt-get remove grafana-agent-flow + ``` + +1. Optional: Remove the Grafana repository: + + ```shell + sudo rm -i /etc/apt/sources.list.d/grafana.list + ``` + +## Install on RHEL or Fedora + +To install Grafana Agent in flow mode on RHEL or Fedora, run the following commands in a terminal window. + +1. Import the GPG key: + + ```shell + wget -q -O gpg.key https://rpm.grafana.com/gpg.key + sudo rpm --import gpg.key + ``` 1. Create `/etc/yum.repos.d/grafana.repo` with the following content: @@ -48,21 +83,45 @@ You can install Grafana Agent in static mode on Linux. sslcacert=/etc/pki/tls/certs/ca-bundle.crt ``` -1. Verify that the repository is properly configured using `yum-config-manager`: +1. Optional: Verify the Grafana repository configuration: ```shell - yum-config-manager grafana + cat /etc/yum.repos.d/grafana.repo ``` 1. Install Grafana Agent: ```shell - sudo yum install grafana-agent + sudo dnf install grafana-agent + ``` + +### Uninstall on RHEL or Fedora + +To uninstall Grafana Agent on RHEL or Fedora, run the following commands in a terminal window: + +1. Stop the systemd service for Grafana Agent: + + ```shell + sudo systemctl stop grafana-agent-flow + ``` + +1. Uninstall Grafana Agent: + + ```shell + sudo dnf remove grafana-agent-flow + ``` + +1. Optional: Remove the Grafana repository: + + ```shell + sudo rm -i /etc/yum.repos.d/rpm.grafana.repo ``` ## Install on SUSE or openSUSE -1. Open a terminal and run the following to install Grafana's package repository: +To install Grafana Agent in flow mode on SUSE or openSUSE, run the following commands in a terminal window. + +1. Import the GPG key and add the Grafana package repository: ```shell wget -q -O gpg.key https://apt.grafana.com/gpg.key @@ -70,13 +129,40 @@ You can install Grafana Agent in static mode on Linux. sudo zypper addrepo https://rpm.grafana.com grafana ``` -1. Update the repository and install Grafana Agent: +1. Update the repositories: ```shell sudo zypper update + ``` + +1. Install Grafana Agent: + + ```shell sudo zypper install grafana-agent ``` +### Uninstall on SUSE or openSUSE + +To uninstall Grafana Agent on SUSE or openSUSE, run the following commands in a terminal: + +1. Stop the systemd service for Grafana Agent: + + ```shell + sudo systemctl stop grafana-agent-flow + ```` + +1. Uninstall Grafana Agent: + + ```shell + sudo zypper remove grafana-agent-flow + ``` + +1. Optional: Remove the Grafana repository: + + ```shell + sudo zypper removerepo grafana + ``` + ## Operation guide The Grafana Agent is configured as a [systemd](https://systemd.io/) service. @@ -122,3 +208,8 @@ Logs of Grafana Agent can be found by running the following command in a termina ```shell sudo journalctl -u grafana-agent ``` + +## Next steps + +- [Start Grafana Agent]({{< relref "../start-agent/" >}}) +- [Configure Grafana Agent]({{< relref "../../configuration/" >}}) diff --git a/docs/sources/static/set-up/install/install-agent-macos.md b/docs/sources/static/set-up/install/install-agent-macos.md new file mode 100644 index 000000000000..d6c4032915ca --- /dev/null +++ b/docs/sources/static/set-up/install/install-agent-macos.md @@ -0,0 +1,82 @@ +--- +title: Install Grafana Agent in static mode on macOS +menuTitle: macOS +weight: 500 +aliases: +- ../../set-up/install-agent-macos/ +- ../set-up/install-agent-macos/ +--- + +# Install Grafana Agent in static mode on macOS + +You can install Grafana Agent in static mode on macOS with Homebrew. + +## Before you begin + +Install [Homebrew][] on your computer. + +{{% admonition type="note" %}} +The default prefix for Homebrew on Intel is `/usr/local`. The default prefix for Homebrew on Apple Silicon is `/opt/Homebrew`. To verify the default prefix for Homebrew on your computer, open a terminal window and type `brew --prefix`. +{{% /admonition %}} + +[Homebrew]: https://brew.sh + +## Install + +To install Grafana Agent on macOS, run the following commands in a terminal window. + +1. Update Homebrew: + + ```shell + brew update + ``` + +1. Install Grafana Agent: + + ```shell + brew install grafana-agent + ``` + +Grafana Agent is installed by default at `$(brew --prefix)/Cellar/grafana-agent/VERSION`. + +## Upgrade + +To upgrade Grafana Agent on macOS, run the following commands in a terminal window. + +1. Upgrade Grafana Agent: + + ```shell + brew upgrade grafana-agent + ``` + +1. Restart Grafana Agent: + + ```shell + brew services restart grafana-agent + +## Uninstall + +To uninstall Grafana Agent on macOS, run the following command in a terminal window: + +```shell +brew uninstall grafana-agent +``` + +## Configure + +1. To create the Agent `config.yml` file, open a terminal and run the following command: + + ```shell + touch $(brew --prefix)/etc/grafana-agent/config.yml + ``` + +1. Edit `$(brew --prefix)/etc/grafana-agent/config.yml` and add the configuration blocks for your specific telemetry needs. Refer to [Configure Grafana Agent]({{< relref "../../configuration/" >}}) for more information. + +{{% admonition type="note" %}} +To send your data to Grafana Cloud, set up Grafana Agent using the Grafana Cloud integration. Refer to [how to install an integration](/docs/grafana-cloud/data-configuration/integrations/install-and-manage-integrations/) and [macOS integration](/docs/grafana-cloud/data-configuration/integrations/integration-reference/integration-macos-node/). +{{%/admonition %}} + +## Next steps + +- [Start Grafana Agent]({{< relref "../start-agent/" >}}) +- [Configure Grafana Agent]({{< relref "../../configuration/" >}}) diff --git a/docs/sources/static/set-up/install-agent-on-windows.md b/docs/sources/static/set-up/install/install-agent-on-windows.md similarity index 55% rename from docs/sources/static/set-up/install-agent-on-windows.md rename to docs/sources/static/set-up/install/install-agent-on-windows.md index 3dc880c122db..ab05fcebdbee 100644 --- a/docs/sources/static/set-up/install-agent-on-windows.md +++ b/docs/sources/static/set-up/install/install-agent-on-windows.md @@ -1,82 +1,111 @@ --- -title: Windows -weight: 120 +title: Install Grafana Agent in static mode on Windows +menuTitle: Windows +weight: 600 aliases: - ../../set-up/install-agent-on-windows/ +- ../set-up/install-agent-on-windows/ --- -# Install static mode on Windows +# Install Grafana Agent in static mode on Windows -You can install Grafana Agent in static mode on Microsoft Windows. +You can install Grafana Agent in static mode on Windows as a standard graphical install, or as a silent install. -## Download Grafana Agent for Windows +## Standard install -1. Navigate to the [latest release](https://github.com/grafana/agent/releases). -1. Scroll down to the **Assets** section. -1. Download the file called `grafana-agent-installer.exe.zip`. +To do a standard graphical install of Grafana Agent on Windows, perform the following steps. - You can also download the `grafana-agent-installer.exe.zip` asset directly from https://github.com/grafana/agent/releases/latest/download/grafana-agent-installer.exe.zip +1. Navigate to the [latest release](https://github.com/grafana/agent/releases) on GitHub. + +1. Scroll down to the **Assets** section. -## Standard installation +1. Download the file called `grafana-agent-installer.exe.zip`. 1. Unzip the downloaded file. + 1. Double-click on `grafana-agent-installer.exe` to install Grafana Agent. Grafana Agent is installed into the default directory `C:\Program Files\Grafana Agent`. The [windows_exporter integration](https://grafana.com/docs/agent/latest/static/configuration/integrations/windows-exporter-config) can be enabled with all default windows_exporter options. -## Silent installation +## Silent install + +To do a silent install of Grafana Agent on Windows, perform the following steps. + +1. Navigate to the [latest release](https://github.com/grafana/agent/releases) on GitHub. + +1. Scroll down to the **Assets** section. + +1. Download the file called `grafana-agent-installer.exe.zip`. 1. Unzip the downloaded file. + 1. Run the following command in PowerShell or Command Prompt: ```shell PATH_TO_INSTALLER/grafana-agent-installer.exe /S ``` -## Silent installation with `remote_write` -If you are using `remote_write` you must enable Windows Exporter and set the global remote_write configuration. + Replace `PATH_TO_INSTALLER` with the path where the unzipped installer executable is located. + +## Silent install with `remote_write` + +If you are using `remote_write` you must enable Windows Exporter and set the global remote_write configuration. + +1. Navigate to the [latest release](https://github.com/grafana/agent/releases) on GitHub. + +1. Scroll down to the **Assets** section. + +1. Download the file called `grafana-agent-installer.exe.zip`. 1. Unzip the downloaded file. + 1. Run the following command in PowerShell or Command Prompt: ```shell - PATH_TO_INSTALLER/grafana-agent-installer.exe /S /EnableExporter true /Username /Password /Url "http://example.com" + PATH_TO_INSTALLER/grafana-agent-installer.exe /S /EnableExporter true /Username USERNAME /Password PASSWORD /Url "http://example.com" ``` + Replace the following: + + - `PATH_TO_INSTALLER`: The path where the unzipped installer executable is located. + - `USERNAME`: Your username + - `PASSWORD`: Your password + If you are using Powershell, make sure you use triple quotes `"""http://example.com"""` around the URL parameter. ## Verify the installation 1. Make sure you can access `http://localhost:12345/-/healthy` and `http://localhost:12345/agent/api/v1/metrics/targets`. + 1. Optional: You can adjust `C:\Program Files\Grafana Agent\agent-config.yaml` to meet your specific needs. After changing the configuration file, restart the Grafana Agent service to load changes to the configuration. Existing configuration files are kept when re-installing or upgrading the Grafana Agent. ## Security -A configuration file for the Grafana Agent is provided by default at `C:\Program Files\Grafana Agent`. Depending on your configuration, you can modify the default permissions of the file or move it to another directory. +A configuration file for Grafana Agent is provided by default at `C:\Program Files\Grafana Agent`. Depending on your configuration, you can modify the default permissions of the file or move it to another directory. -If you change the location of the configuration file, ensure you complete the following steps. +If you change the location of the configuration file, do the following step. 1. Update the Grafana Agent service to load the new path. -1. Run the following in an elevated prompt, replacing `` with the full path holding `agent-config.yaml`: -```shell -sc config "Grafana Agent" binpath= "INSTALLED_DIRECTORY\agent-windows-amd64.exe -config.file=\"\agent-config.yaml\"" -``` +1. Run the following with Administrator privileges in PowerShell or Command Prompt: + + ```shell + sc config "Grafana Agent" binpath= "INSTALLED_DIRECTORY\agent-windows-amd64.exe -config.file=\"PATH_TO_CONFIG\agent-config.yaml\"" + ``` + + Replace `PATH_TO_CONFIG` with the full path to your Grafana Agent configuratiuon file. ## Uninstall Grafana Agent -If you installed Grafana Agent using the Windows installer, you can uninstall it using Windows' Remove Programs or `C:\Program Files\Grafana Agent\uninstaller.exe`. +You can uninstall Grafana Agent with Windows Remove Programs or `C:\Program Files\Grafana Agent\uninstaller.exe`. Uninstalling Grafana Agent will stop the service and remove it from disk. This includes any configuration files in the installation directory. -Grafana Agent can also be silently uninstalled by executing `uninstall.exe /S` as Administrator. - -## Logs -When Grafana Agent runs as a Windows Service, it writes logs to Windows Event Logs. When running as executable, Grafana Agent will write to standard out. The logs will be written with the event source name of `Grafana Agent`. +Grafana Agent can also be silently uninstalled by running `uninstall.exe /S` as Administrator. -## Pushing Windows logs to Grafana Loki +## Push Windows logs to Grafana Loki Grafana Agent can use the embedded [promtail](https://grafana.com/docs/loki/latest/clients/promtail/) to push Windows Event Logs to [Grafana Loki](https://github.com/grafana/loki). Example configuration below: @@ -106,3 +135,8 @@ logs: ``` Refer to [windows_events](https://grafana.com/docs/loki/latest/clients/promtail/configuration/#windows_events) for additional configuration details. + +## Next steps + +- [Start Grafana Agent]({{< relref "../start-agent/" >}}) +- [Configure Grafana Agent]({{< relref "../../configuration/" >}}) diff --git a/docs/sources/static/set-up/quick-starts.md b/docs/sources/static/set-up/quick-starts.md index ee6139cb5d90..fb9ff62b8e68 100644 --- a/docs/sources/static/set-up/quick-starts.md +++ b/docs/sources/static/set-up/quick-starts.md @@ -1,26 +1,26 @@ --- -title: Static mode quick starts -weight: 150 +title: Get started with Grafana Agent in static mode +menuTitle: Get started +weight: 300 aliases: - ../../set-up/quick-starts/ --- -## Grafana Agent quick starts +# Grafana Agent quick starts The following quick starts help you get up and running with Grafana Agent. You’ll learn how to send your metrics, logs, and traces to the Grafana Stack or Grafana Cloud. -### Grafana Stack quick starts +## Grafana Stack quick starts - - [Send metrics to Mimir](https://grafana.com/docs/mimir/latest/get-started/) using Grafana Agent. +- [Send metrics to Mimir](https://grafana.com/docs/mimir/latest/get-started/) using Grafana Agent. - - [Send traces to Tempo](https://grafana.com/docs/tempo/latest/getting-started/#2-pipeline-grafana-agent) using Grafana Agent. +- [Send traces to Tempo](https://grafana.com/docs/tempo/latest/getting-started/#2-pipeline-grafana-agent) using Grafana Agent. - - [Send logs to Loki](https://grafana.com/docs/grafana-cloud/logs/collect-logs-with-agent/?pg=hp&plcmt=lt-box-traces) using Grafana Agent. +- [Send logs to Loki](https://grafana.com/docs/grafana-cloud/logs/collect-logs-with-agent/?pg=hp&plcmt=lt-box-traces) using Grafana Agent. -### Grafana Cloud quick starts +## Grafana Cloud quick starts - - [Grafana Agent for Grafana Cloud](https://grafana.com/docs/grafana-cloud/agent/). +- [Grafana Agent for Grafana Cloud](https://grafana.com/docs/grafana-cloud/agent/). - [Monitoring a Linux host](https://grafana.com/docs/grafana-cloud/quickstart/agent_linuxnode/) using the Linux Node integration. - - [Grafana Agent Kubernetes quickstarts](https://grafana.com/docs/grafana-cloud/kubernetes/agent-k8s/). - +- [Grafana Agent Kubernetes quickstarts](https://grafana.com/docs/grafana-cloud/kubernetes/agent-k8s/). diff --git a/docs/sources/static/set-up/start-agent.md b/docs/sources/static/set-up/start-agent.md new file mode 100644 index 000000000000..29fb8ec0df6a --- /dev/null +++ b/docs/sources/static/set-up/start-agent.md @@ -0,0 +1,154 @@ +--- +description: Learn how to start, restart, and stop Grafana Agent after it is installed +title: Start, restart, and stop Grafana Agent in static mode +menuTitle: Start static mode +weight: 200 +--- + +# Start Grafana Agent in static mode + +You can start, restart, and stop Grafana Agent after it is installed. + +## Linux + +Grafana Agent is installed as a [systemd][] service on Linux. + +[systemd]: https://systemd.io/ + +### Start Grafana Agent + +To start Grafana Agent, run the following command in a terminal window: + +```shell +sudo systemctl start grafana-agent +``` + +(Optional) Verify that the service is running: + +```shell +sudo systemctl status grafana-agent +``` + +### Configure Grafana Agent to start at boot + +To automatically run Grafana Agent when the system starts, run the following command in a terminal window: + +```shell +sudo systemctl enable grafana-agent.service +``` + +### Restart Grafana Agent + +To restart Grafana Agent, run the following command in a terminal window: + +```shell +sudo systemctl restart grafana-agent +``` + +### Stop Grafana Agent + +To stop Grafana Agent, run the following command in a terminal window: + +```shell +sudo systemctl stop grafana-agent +``` + +### View Grafana Agent logs on Linux + +To view the Grafana Agent log files, run the following command in a terminal window: + +```shell +sudo journalctl -u grafana-agent +``` + +## macOS + +Grafana Agent is installed as a launchd service on macOS. + +### Start Grafana Agent + +To start Grafana Agent, run the following command in a terminal window: + +```shell +brew services start grafana-agent +``` + +Grafana Agent automatically runs when the system starts. + +Optional: Verify that the service is running: + +```shell +brew services info grafana-agent +``` + +### Restart Grafana Agent + +To restart Grafana Agent, run the following command in a terminal window: + +```shell +brew services restart grafana-agent +``` + +### Stop Grafana Agent + +To stop Grafana Agent, run the following command in a terminal window: + +```shell +brew services stop grafana-agent +``` + +### View Grafana Agent logs on macOS + +By default, logs are written to `$(brew --prefix)/var/log/grafana-agent.log` and +`$(brew --prefix)/var/log/grafana-agent.err.log`. + +If you followed [Configure the Grafana Agent service](../setup/configure/configure-macos.md#configure-the-grafana-agent-service) +and changed the path where logs are written, refer to your current copy of the Grafana Agent formula to locate your log files. + +## Windows + +Grafana Agent is installed as a Windows Service. The service is configured to automatically run on startup. + +To verify that Grafana Agent is running as a Windows Service: + +1. Open the Windows Services manager (services.msc): + + 1. Right click on the Start Menu and select **Run**. + + 1. Type: `services.msc` and click **OK**. + +1. Scroll down to find the **Grafana Agent** service and verify that the **Status** is **Running**. + +### View Grafana Agent logs + +When running on Windows, Grafana Agent writes its logs to Windows Event +Logs with an event source name of **Grafana Agent**. + +To view the logs, perform the following steps: + +1. Open the Event Viewer: + + 1. Right click on the Start Menu and select **Run**. + + 1. Type `eventvwr` and click **OK**. + +1. In the Event Viewer, click on **Windows Logs > Application**. + +1. Search for events with the source **Grafana Agent**. + +## Standalone binary + +If you downloaded the standalone binary, you must run the agent from a terminal or command window. + +### Start Grafana Agent on Linux, macOS, FreeBSD, or Windows + +To start Grafana Agent on Linux, macOS, FreeBSD, or Windows run the following command in a terminal window or command prompt: + +```shell +BINARY_PATH -config.file CONFIG_FILE +``` + +Replace the following: + +* `BINARY_PATH`: The path to the Grafana Agent binary file +* `CONFIG_FILE`: The path to the Grafana Agent configuration file.