From 88c735622df426c99caf028551ea2a25a8d16c44 Mon Sep 17 00:00:00 2001 From: Clayton Cornell Date: Fri, 15 Mar 2024 06:31:50 -0700 Subject: [PATCH] Replace agent with alloy in cli and tasks --- docs/sources/reference/cli/convert.md | 1 + .../tasks/collect-prometheus-metrics.md | 4 ++-- ...tering.md => configure-alloy-clustering.md} | 6 +++--- docs/sources/tasks/configure/_index.md | 6 +++--- .../sources/tasks/configure/configure-linux.md | 18 +++++++++--------- .../sources/tasks/configure/configure-macos.md | 12 ++++++------ .../tasks/configure/configure-windows.md | 8 ++++---- docs/sources/tasks/debug.md | 4 ++-- .../tasks/distribute-prometheus-scrape-load.md | 2 +- docs/sources/tasks/migrate/from-operator.md | 10 +++++----- docs/sources/tasks/migrate/from-prometheus.md | 8 ++++++-- .../sources/tasks/monitor/component_metrics.md | 4 ++-- .../tasks/monitor/controller_metrics.md | 14 +++++++------- .../tasks/opentelemetry-to-lgtm-stack.md | 8 ++++---- 14 files changed, 55 insertions(+), 50 deletions(-) rename docs/sources/tasks/{configure-agent-clustering.md => configure-alloy-clustering.md} (96%) diff --git a/docs/sources/reference/cli/convert.md b/docs/sources/reference/cli/convert.md index 8ca10d4266..a0bbe89cf7 100644 --- a/docs/sources/reference/cli/convert.md +++ b/docs/sources/reference/cli/convert.md @@ -20,6 +20,7 @@ Usage: * `AGENT_MODE=flow grafana-agent convert [ ...] ` * `grafana-agent-flow convert [ ...] ` +* `grafana-alloy convert [ ...] ` Replace the following: diff --git a/docs/sources/tasks/collect-prometheus-metrics.md b/docs/sources/tasks/collect-prometheus-metrics.md index a317f57780..897856b7f2 100644 --- a/docs/sources/tasks/collect-prometheus-metrics.md +++ b/docs/sources/tasks/collect-prometheus-metrics.md @@ -403,8 +403,8 @@ prometheus.scrape "custom_targets" { __metrics_path__ = "/custom-metrics–path", }, { - __address__ = "grafana-agent:12345", - application = "grafana-agent", + __address__ = "grafana-alloy:12345", + application = "grafana-alloy", environment = "production", }, ] diff --git a/docs/sources/tasks/configure-agent-clustering.md b/docs/sources/tasks/configure-alloy-clustering.md similarity index 96% rename from docs/sources/tasks/configure-agent-clustering.md rename to docs/sources/tasks/configure-alloy-clustering.md index 48814033f9..1c2e72bf12 100644 --- a/docs/sources/tasks/configure-agent-clustering.md +++ b/docs/sources/tasks/configure-alloy-clustering.md @@ -1,5 +1,5 @@ --- -canonical: https://grafana.com/docs/alloy/latest/tasks/configure-agent-clustering/ +canonical: https://grafana.com/docs/alloy/latest/tasks/configure-alloy-clustering/ description: Learn how to configure Grafana Alloy clustering in an existing installation menuTitle: Configure clustering title: Configure Grafana Alloy clustering in an existing installation @@ -24,10 +24,10 @@ This section guides you through enabling clustering when {{< param "PRODUCT_NAME To configure clustering: -1. Amend your existing `values.yaml` file to add `clustering.enabled=true` inside the `agent` block. +1. Amend your existing `values.yaml` file to add `clustering.enabled=true` inside the `alloy` block. ```yaml - agent: + alloy: clustering: enabled: true ``` diff --git a/docs/sources/tasks/configure/_index.md b/docs/sources/tasks/configure/_index.md index b8bff7751a..b0d3138242 100644 --- a/docs/sources/tasks/configure/_index.md +++ b/docs/sources/tasks/configure/_index.md @@ -11,9 +11,9 @@ weight: 90 You can configure {{< param "PRODUCT_NAME" >}} after it is [installed][Install]. The default River configuration file for {{< param "PRODUCT_NAME" >}} is located at: -* Linux: `/etc/grafana-agent-flow.river` -* macOS: `$(brew --prefix)/etc/grafana-agent-flow/config.river` -* Windows: `C:\Program Files\Grafana Agent Flow\config.river` +* Linux: `/etc/grafana-alloy.river` +* macOS: `$(brew --prefix)/etc/grafana-alloy/config.river` +* Windows: `C:\Program Files\Grafana Alloy\config.river` This section includes information that helps you configure {{< param "PRODUCT_NAME" >}}. diff --git a/docs/sources/tasks/configure/configure-linux.md b/docs/sources/tasks/configure/configure-linux.md index b0757e9338..090889dd3c 100644 --- a/docs/sources/tasks/configure/configure-linux.md +++ b/docs/sources/tasks/configure/configure-linux.md @@ -10,41 +10,41 @@ weight: 300 To configure {{< param "PRODUCT_NAME" >}} on Linux, perform the following steps: -1. Edit the default configuration file at `/etc/grafana-agent-flow.river`. +1. Edit the default configuration file at `/etc/grafana-alloy.river`. 1. Run the following command in a terminal to reload the configuration file: ```shell - sudo systemctl reload grafana-agent-flow + sudo systemctl reload grafana-alloy ``` To change the configuration file used by the service, perform the following steps: 1. Edit the environment file for the service: - * Debian or Ubuntu: edit `/etc/default/grafana-agent-flow` - * RHEL/Fedora or SUSE/openSUSE: edit `/etc/sysconfig/grafana-agent-flow` + * Debian or Ubuntu: edit `/etc/default/grafana-alloy` + * RHEL/Fedora or SUSE/openSUSE: edit `/etc/sysconfig/grafana-alloy` 1. Change the contents of the `CONFIG_FILE` environment variable to point at the new configuration file to use. 1. Restart the {{< param "PRODUCT_NAME" >}} service: ```shell - sudo systemctl restart grafana-agent-flow + sudo systemctl restart grafana-alloy ``` ## Pass additional command-line flags By default, the {{< param "PRODUCT_NAME" >}} service launches with the [run][] command, passing the following flags: -* `--storage.path=/var/lib/grafana-agent-flow` +* `--storage.path=/var/lib/grafana-alloy` To pass additional command-line flags to the {{< param "PRODUCT_NAME" >}} binary, perform the following steps: 1. Edit the environment file for the service: - * Debian-based systems: edit `/etc/default/grafana-agent-flow` - * RedHat or SUSE-based systems: edit `/etc/sysconfig/grafana-agent-flow` + * Debian-based systems: edit `/etc/default/grafana-alloy` + * RedHat or SUSE-based systems: edit `/etc/sysconfig/grafana-alloy` 1. Change the contents of the `CUSTOM_ARGS` environment variable to specify command-line flags to pass. @@ -52,7 +52,7 @@ To pass additional command-line flags to the {{< param "PRODUCT_NAME" >}} binary 1. Restart the {{< param "PRODUCT_NAME" >}} service: ```shell - sudo systemctl restart grafana-agent-flow + sudo systemctl restart grafana-alloy ``` To see the list of valid command-line flags that can be passed to the service, refer to the documentation for the [run][] command. diff --git a/docs/sources/tasks/configure/configure-macos.md b/docs/sources/tasks/configure/configure-macos.md index d57885617e..a117dff57d 100644 --- a/docs/sources/tasks/configure/configure-macos.md +++ b/docs/sources/tasks/configure/configure-macos.md @@ -10,12 +10,12 @@ weight: 400 To configure {{< param "PRODUCT_NAME" >}} on macOS, perform the following steps: -1. Edit the default configuration file at `$(brew --prefix)/etc/grafana-agent-flow/config.river`. +1. Edit the default configuration file at `$(brew --prefix)/etc/grafana-alloy/config.river`. 1. Run the following command in a terminal to restart the {{< param "PRODUCT_NAME" >}} service: ```shell - brew services restart grafana-agent-flow + brew services restart grafana-alloy ``` ## Configure the {{% param "PRODUCT_NAME" %}} service @@ -29,7 +29,7 @@ To customize the {{< param "PRODUCT_NAME" >}} service on macOS, perform the foll 1. Run the following command in a terminal: ```shell - brew edit grafana-agent-flow + brew edit grafana-alloy ``` This will open the {{< param "PRODUCT_NAME" >}} Homebrew Formula in an editor. @@ -45,13 +45,13 @@ To customize the {{< param "PRODUCT_NAME" >}} service on macOS, perform the foll 1. Reinstall the {{< param "PRODUCT_NAME" >}} Formula by running the following command in a terminal: ```shell - brew reinstall grafana-agent-flow + brew reinstall grafana-alloy ``` 1. Restart the {{< param "PRODUCT_NAME" >}} service by running the command in a terminal: ```shell - brew services restart grafana-agent-flow + brew services restart grafana-aalloy ``` ## Expose the UI to other machines @@ -61,7 +61,7 @@ This prevents other machines on the network from being able to access the [UI fo To expose the UI to other machines, complete the following steps: -1. Follow [Configure the {{< param "PRODUCT_NAME" >}} service](#configure-the-grafana-agent-flow-service) +1. Follow [Configure the {{< param "PRODUCT_NAME" >}} service](#configure-the-grafana-alloy-service) to edit command line flags passed to {{< param "PRODUCT_NAME" >}}, including the following customizations: diff --git a/docs/sources/tasks/configure/configure-windows.md b/docs/sources/tasks/configure/configure-windows.md index 93fc1a4f1a..68e5f61f4a 100644 --- a/docs/sources/tasks/configure/configure-windows.md +++ b/docs/sources/tasks/configure/configure-windows.md @@ -10,7 +10,7 @@ weight: 500 To configure {{< param "PRODUCT_NAME" >}} on Windows, perform the following steps: -1. Edit the default configuration file at `C:\Program Files\Grafana Agent Flow\config.river`. +1. Edit the default configuration file at `C:\Program Files\Grafana Alloy\config.river`. 1. Restart the {{< param "PRODUCT_NAME" >}} service: @@ -30,8 +30,8 @@ By default, the {{< param "PRODUCT_NAME" >}} service will launch and pass the following arguments to the {{< param "PRODUCT_NAME" >}} binary: * `run` -* `C:\Program Files\Grafana Agent Flow\config.river` -* `--storage.path=C:\ProgramData\Grafana Agent Flow\data` +* `C:\Program Files\Grafana Alloy\config.river` +* `--storage.path=C:\ProgramData\Grafana Alloy\data` To change the set of command-line arguments passed to the {{< param "PRODUCT_ROOT_NAME" >}} binary, perform the following steps: @@ -42,7 +42,7 @@ binary, perform the following steps: 1. Type `regedit` and click **OK**. -1. Navigate to the key at the path `HKEY_LOCAL_MACHINE\SOFTWARE\Grafana\Grafana Agent Flow`. +1. Navigate to the key at the path `HKEY_LOCAL_MACHINE\SOFTWARE\Grafana\Grafana Alloy`. 1. Double-click on the value called **Arguments***. diff --git a/docs/sources/tasks/debug.md b/docs/sources/tasks/debug.md index 4f2615dc5c..5b2a25146e 100644 --- a/docs/sources/tasks/debug.md +++ b/docs/sources/tasks/debug.md @@ -23,10 +23,10 @@ This default prevents other machines on the network from being able to view the To expose the UI to other machines on the network on non-containerized platforms, refer to the documentation for how you [installed][install] {{< param "PRODUCT_NAME" >}}. -If you are running a custom installation of {{< param "PRODUCT_NAME" >}}, refer to the documentation for the [`grafana-agent run` command][grafana-agent run] to learn how to change the HTTP listen address, > and pass the appropriate flag when running {{< param "PRODUCT_NAME" >}}. +If you are running a custom installation of {{< param "PRODUCT_NAME" >}}, refer to the documentation for the [`grafana-alloy run` command][grafana-alloy run] to learn how to change the HTTP listen address, > and pass the appropriate flag when running {{< param "PRODUCT_NAME" >}}. [install]: ../../get-started/install/ -[grafana-agent run]: ../../reference/cli/run/ +[grafana-alloy run]: ../../reference/cli/run/ {{< /admonition >}} ### Home page diff --git a/docs/sources/tasks/distribute-prometheus-scrape-load.md b/docs/sources/tasks/distribute-prometheus-scrape-load.md index 8b74ad60ed..b440c20ef7 100644 --- a/docs/sources/tasks/distribute-prometheus-scrape-load.md +++ b/docs/sources/tasks/distribute-prometheus-scrape-load.md @@ -41,5 +41,5 @@ To distribute Prometheus metrics scrape load with clustering: [Clustering]: ../../concepts/clustering/ [configure]: ../configure/ [Configure Prometheus metrics collection]: ../collect-prometheus-metrics/ -[Configure clustering]: ../configure-agent-clustering/ +[Configure clustering]: ../configure-alloy-clustering/ [UI]: ../debug/#component-detail-page diff --git a/docs/sources/tasks/migrate/from-operator.md b/docs/sources/tasks/migrate/from-operator.md index c01edd7c03..e3aaacf14d 100644 --- a/docs/sources/tasks/migrate/from-operator.md +++ b/docs/sources/tasks/migrate/from-operator.md @@ -42,7 +42,7 @@ This guide provides some steps to get started with {{< param "PRODUCT_NAME" >}} This is one of many deployment possible modes. For example, you may want to use a `DaemonSet` to collect host-level logs or metrics. See the {{< param "PRODUCT_NAME" >}} [deployment guide][] for more details about different topologies. -1. Create a {{< param "PRODUCT_ROOT_NAME" >}} configuration file, `agent.river`. +1. Create a {{< param "PRODUCT_ROOT_NAME" >}} configuration file, `alloy.river`. In the next step, you add to this configuration as you convert `MetricsInstances`. You can add any additional configuration to this file as you need. @@ -53,10 +53,10 @@ This guide provides some steps to get started with {{< param "PRODUCT_NAME" >}} helm repo update ``` -1. Create a Helm release. You can name the release anything you like. The following command installs a release called `grafana-agent-metrics` in the `monitoring` namespace. +1. Create a Helm release. You can name the release anything you like. The following command installs a release called `grafana-alloy-metrics` in the `monitoring` namespace. ```shell - helm upgrade grafana-agent-metrics grafana/grafana-agent -i -n monitoring -f values.yaml --set-file agent.configMap.content=agent.river + helm upgrade grafana-alloy-metrics grafana/grafana-alloy -i -n monitoring -f values.yaml --set-file alloy.configMap.content=alloy.river ``` This command uses the `--set-file` flag to pass the configuration file as a Helm value so that you can continue to edit it as a regular River file. @@ -149,13 +149,13 @@ agent: varlog: true ``` -This command will install a release named `grafana-agent-logs` in the `monitoring` namespace: +This command installs a release named `grafana-agent-logs` in the `monitoring` namespace: ``` helm upgrade grafana-agent-logs grafana/grafana-agent -i -n monitoring -f values-logs.yaml --set-file agent.configMap.content=agent-logs.river ``` -This simple configuration will scrape logs for every pod on each node: +This simple configuration scrapes logs for every Pod on each node: ```river // read the credentials secret for remote_write authorization diff --git a/docs/sources/tasks/migrate/from-prometheus.md b/docs/sources/tasks/migrate/from-prometheus.md index d5bdc6bd82..68961704fc 100644 --- a/docs/sources/tasks/migrate/from-prometheus.md +++ b/docs/sources/tasks/migrate/from-prometheus.md @@ -38,14 +38,18 @@ This conversion will enable you to take full advantage of the many additional fe {{< code >}} - ```static-binary + ```agent-static-binary AGENT_MODE=flow grafana-agent convert --source-format=prometheus --output= ``` - ```flow-binary + ```agent-flow-binary grafana-agent-flow convert --source-format=prometheus --output= ``` +```alloy-binary + grafana-alloy convert --source-format=prometheus --output= + ``` + {{< /code >}} Replace the following: diff --git a/docs/sources/tasks/monitor/component_metrics.md b/docs/sources/tasks/monitor/component_metrics.md index 65cdf81261..a684fa5e45 100644 --- a/docs/sources/tasks/monitor/component_metrics.md +++ b/docs/sources/tasks/monitor/component_metrics.md @@ -15,7 +15,7 @@ These component-specific metrics are only generated when an instance of that com Component-specific metrics are exposed at the `/metrics` HTTP endpoint of the {{< param "PRODUCT_NAME" >}} HTTP server, which defaults to listening on `http://localhost:12345`. -> The documentation for the [`grafana-agent run`][grafana-agent run] command describes how to modify the address {{< param "PRODUCT_NAME" >}} listens on for HTTP traffic. +> The documentation for the [`grafana-alloy run`][grafana-alloy run] command describes how to modify the address {{< param "PRODUCT_NAME" >}} listens on for HTTP traffic. Component-specific metrics have a `component_id` label matching the component ID generating those metrics. For example, component-specific metrics for a `prometheus.remote_write` component labeled `production` will have a `component_id` label with the value `prometheus.remote_write.production`. @@ -24,5 +24,5 @@ The [reference documentation][] for each component described the list of compone Not all components expose metrics. [components]: ../../../concepts/components/ -[grafana-agent run]: ../../../reference/cli/run/ +[grafana-alloy run]: ../../../reference/cli/run/ [reference documentation]: ../../../reference/components/ diff --git a/docs/sources/tasks/monitor/controller_metrics.md b/docs/sources/tasks/monitor/controller_metrics.md index 6ce2bf5010..7eb76deee4 100644 --- a/docs/sources/tasks/monitor/controller_metrics.md +++ b/docs/sources/tasks/monitor/controller_metrics.md @@ -11,17 +11,17 @@ The {{< param "PRODUCT_NAME" >}} [component controller][] exposes Prometheus met Metrics for the controller are exposed at the `/metrics` HTTP endpoint of the {{< param "PRODUCT_NAME" >}} HTTP server, which defaults to listening on `http://localhost:12345`. -> The documentation for the [`grafana-agent run`][grafana-agent run] command describes how to modify the address {{< param "PRODUCT_NAME" >}} listens on for HTTP traffic. +> The documentation for the [`grafana-alloy run`][grafana-alloy run] command describes how to modify the address {{< param "PRODUCT_NAME" >}} listens on for HTTP traffic. The controller exposes the following metrics: -* `agent_component_controller_evaluating` (Gauge): Set to `1` whenever the component controller is currently evaluating components. +* `alloy_component_controller_evaluating` (Gauge): Set to `1` whenever the component controller is currently evaluating components. This value may be misrepresented depending on how fast evaluations complete or how often evaluations occur. -* `agent_component_controller_running_components` (Gauge): The current number of running components by health. +* `alloy_component_controller_running_components` (Gauge): The current number of running components by health. The health is represented in the `health_type` label. -* `agent_component_evaluation_seconds` (Histogram): The time it takes to evaluate components after one of their dependencies is updated. -* `agent_component_dependencies_wait_seconds` (Histogram): Time spent by components waiting to be evaluated after one of their dependencies is updated. -* `agent_component_evaluation_queue_size` (Gauge): The current number of component evaluations waiting to be performed. +* `alloy_component_evaluation_seconds` (Histogram): The time it takes to evaluate components after one of their dependencies is updated. +* `alloy_component_dependencies_wait_seconds` (Histogram): Time spent by components waiting to be evaluated after one of their dependencies is updated. +* `alloy_component_evaluation_queue_size` (Gauge): The current number of component evaluations waiting to be performed. [component controller]: ../../../concepts/component_controller/ -[grafana-agent run]: ../../../reference/cli/run/ +[grafana-alloy run]: ../../../reference/cli/run/ diff --git a/docs/sources/tasks/opentelemetry-to-lgtm-stack.md b/docs/sources/tasks/opentelemetry-to-lgtm-stack.md index 7d78626a36..3eb3f14df3 100644 --- a/docs/sources/tasks/opentelemetry-to-lgtm-stack.md +++ b/docs/sources/tasks/opentelemetry-to-lgtm-stack.md @@ -270,14 +270,14 @@ loki.write "grafana_cloud_loki" { Running {{< param "PRODUCT_NAME" >}} now will give you the following: ``` -AGENT_MODE=flow ./grafana-agent run agent-config.river -AGENT_MODE=flow ./grafana-agent run agent-config.river +./grafana-alloy run alloy-config.river +./grafana-alloy run alloy-config.river ts=2023-05-09T09:37:15.300959Z level=info msg="running usage stats reporter" ts=2023-05-09T09:37:15.300958Z level=info msg="now listening for http traffic" addr=127.0.0.1:12345 ts=2023-05-09T09:37:15.301104Z level=info trace_id=6466516c9e1a556422df7a84c0ade6b0 msg="starting complete graph evaluation" ts=2023-05-09T09:37:15.301307Z level=info trace_id=6466516c9e1a556422df7a84c0ade6b0 msg="finished node evaluation" node_id=loki.write.grafana_cloud_loki duration=188.209µs ts=2023-05-09T09:37:15.301334Z level=info trace_id=6466516c9e1a556422df7a84c0ade6b0 msg="finished node evaluation" node_id=otelcol.exporter.loki.grafana_cloud_loki duration=18.791µs -ts=2023-05-09T09:37:15.303138Z component=prometheus.remote_write.grafana_cloud_prometheus level=info subcomponent=wal msg="replaying WAL, this may take a while" dir=data-agent/prometheus.remote_write.grafana_cloud_prometheus/wal +ts=2023-05-09T09:37:15.303138Z component=prometheus.remote_write.grafana_cloud_prometheus level=info subcomponent=wal msg="replaying WAL, this may take a while" dir=data-alloy/prometheus.remote_write.grafana_cloud_prometheus/wal ts=2023-05-09T09:37:15.303257Z component=prometheus.remote_write.grafana_cloud_prometheus level=info subcomponent=wal msg="WAL segment loaded" segment=0 maxSegment=1 ts=2023-05-09T09:37:15.303302Z component=prometheus.remote_write.grafana_cloud_prometheus level=info subcomponent=wal msg="WAL segment loaded" segment=1 maxSegment=1 ts=2023-05-09T09:37:15.303507Z component=prometheus.remote_write.grafana_cloud_prometheus subcomponent=rw level=info remote_name=7f623a url=https://prometheus-us-central1.grafana.net/api/prom/push msg="Starting WAL watcher" queue=7f623a @@ -299,7 +299,7 @@ ts=2023-05-09T09:37:15.304109Z component=otelcol.receiver.otlp.default level=inf ts=2023-05-09T09:37:15.304234Z component=otelcol.receiver.otlp.default level=info msg="Starting HTTP server" endpoint=0.0.0.0:4318 ``` -You can now check the pipeline graphically by visiting [http://localhost:12345/graph][] +You can check the pipeline graphically by visiting [http://localhost:12345/graph][] ![](../../../assets/tasks/otlp-lgtm-graph.png)