Skip to content

Commit

Permalink
Replace agent with alloy in cli and tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
clayton-cornell committed Mar 15, 2024
1 parent 8e88ba3 commit 88c7356
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 50 deletions.
1 change: 1 addition & 0 deletions docs/sources/reference/cli/convert.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Usage:

* `AGENT_MODE=flow grafana-agent convert [<FLAG> ...] <FILE_NAME>`
* `grafana-agent-flow convert [<FLAG> ...] <FILE_NAME>`
* `grafana-alloy convert [<FLAG> ...] <FILE_NAME>`

Replace the following:

Expand Down
4 changes: 2 additions & 2 deletions docs/sources/tasks/collect-prometheus-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
]
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
```
Expand Down
6 changes: 3 additions & 3 deletions docs/sources/tasks/configure/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" >}}.

Expand Down
18 changes: 9 additions & 9 deletions docs/sources/tasks/configure/configure-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,49 @@ 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.

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.
Expand Down
12 changes: 6 additions & 6 deletions docs/sources/tasks/configure/configure-macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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:

Expand Down
8 changes: 4 additions & 4 deletions docs/sources/tasks/configure/configure-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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:
Expand All @@ -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***.

Expand Down
4 changes: 2 additions & 2 deletions docs/sources/tasks/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/tasks/distribute-prometheus-scrape-load.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions docs/sources/tasks/migrate/from-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions docs/sources/tasks/migrate/from-prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<OUTPUT_CONFIG_PATH> <INPUT_CONFIG_PATH>
```

```flow-binary
```agent-flow-binary
grafana-agent-flow convert --source-format=prometheus --output=<OUTPUT_CONFIG_PATH> <INPUT_CONFIG_PATH>
```

```alloy-binary
grafana-alloy convert --source-format=prometheus --output=<OUTPUT_CONFIG_PATH> <INPUT_CONFIG_PATH>
```

{{< /code >}}

Replace the following:
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/tasks/monitor/component_metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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/
14 changes: 7 additions & 7 deletions docs/sources/tasks/monitor/controller_metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
8 changes: 4 additions & 4 deletions docs/sources/tasks/opentelemetry-to-lgtm-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit 88c7356

Please sign in to comment.