Skip to content

Commit

Permalink
Edit and update Alloy content (#98)
Browse files Browse the repository at this point in the history
* Initial cleanup of Introduction topic

* Replace river sytnax highlighting with alloy syntax highlighting

* Remove a few instances of agent

* Restore BoringCrypto as it's tracked in another PR
  • Loading branch information
clayton-cornell authored Mar 28, 2024
1 parent ea77e2b commit e3ec7fb
Show file tree
Hide file tree
Showing 186 changed files with 560 additions and 623 deletions.
2 changes: 1 addition & 1 deletion docs/sources/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cascade:
PRODUCT_NAME: Alloy
---

# {{% param "PRODUCT_NAME" %}}
# {{% param "FULL_PRODUCT_NAME" %}}

{{< param "FULL_PRODUCT_NAME" >}} is a vendor-neutral distribution of the [OpenTelemetry][] (OTel) Collector.
{{< param "PRODUCT_NAME" >}} uniquely combines the very best OSS observability signals in the community.
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/_index.md.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cascade:
PRODUCT_NAME: Alloy
---

# {{% param "PRODUCT_NAME" %}}
# {{% param "FULL_PRODUCT_NAME" %}}

{{< param "FULL_PRODUCT_NAME" >}} is a vendor-neutral distribution of the [OpenTelemetry][] (OTel) Collector.
{{< param "PRODUCT_NAME" >}} uniquely combines the very best OSS observability signals in the community.
Expand Down
110 changes: 24 additions & 86 deletions docs/sources/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ title: Introduction to Alloy
weight: 10
---

# Introduction to {{% param "PRODUCT_NAME" %}}
# Introduction to {{% param "FULL_PRODUCT_NAME" %}}

{{< param "PRODUCT_NAME" >}} is a flexible, high performance, vendor-neutral telemetry collector. It's fully compatible with the most popular open source observability standards such as OpenTelemetry (OTel) and Prometheus.

{{< param "PRODUCT_NAME" >}} is a _component-based_ revision of {{< param "PRODUCT_NAME" >}} with a focus on ease-of-use,
debuggability, and ability to adapt to the needs of power users.
{{< param "PRODUCT_NAME" >}} focuses on ease-of-use, debuggability, and ability to adapt to the needs of power users.

Components allow for reusability, composability, and focus on a single task.

Expand All @@ -28,7 +27,7 @@ Components allow for reusability, composability, and focus on a single task.

## Example

```river
```alloy
// Discover Kubernetes pods to collect metrics from
discovery.kubernetes "pods" {
role = "pod"
Expand Down Expand Up @@ -76,118 +75,57 @@ This feature is experimental, and it doesn't support all {{< param "PRODUCT_NAME
* Consult the [Tasks][] instructions to accomplish common objectives with {{< param "PRODUCT_NAME" >}}.
* Check out the [Reference][] documentation to find specific information you might be looking for.

[configuration generator]: https://grafana.github.io/agent-configurator/
[configuration generator]: https://grafana.github.io/alloy-configurator/
[Install]: ../get-started/install/
[Concepts]: ../concepts/
[Tasks]: ../tasks/
[Tutorials]: ../tutorials/
[Reference]: ../reference/

<!--
## Choose which variant of {{% param "PRODUCT_NAME" %}} to run
### Compare distributions

> **NOTE**: You don't have to pick just one variant; it's possible to
> mix-and-match installations of Grafana Agent.
### Compare variants
Each variant of {{< param "PRODUCT_NAME" >}} provides a different level of functionality. The following tables compare {{< param "PRODUCT_NAME" >}} Flow mode with Static mode, Operator, OpenTelemetry, and Prometheus.
The following tables compare {{< param "PRODUCT_NAME" >}} with OpenTelemetry and Prometheus.

#### Core telemetry

| | Grafana Agent Flow mode | Grafana Agent Static mode | Grafana Agent Operator | OpenTelemetry Collector | Prometheus Agent mode |
|--------------|--------------------------|---------------------------|------------------------|-------------------------|-----------------------|
| **Metrics** | [Prometheus][], [OTel][] | Prometheus | Prometheus | OTel | Prometheus |
| **Logs** | [Loki][], [OTel][] | Loki | Loki | OTel | No |
| **Traces** | [OTel][] | OTel | OTel | OTel | No |
| **Profiles** | [Pyroscope][] | No | No | Planned | No |
| | Grafana Alloy | OpenTelemetry Collector | Prometheus Agent |
|--------------|--------------------------|-------------------------|------------------|
| **Metrics** | [Prometheus][], [OTel][] | OTel | Prometheus |
| **Logs** | [Loki][], [OTel][] | OTel | No |
| **Traces** | [OTel][] | OTel | No |
| **Profiles** | [Pyroscope][] | Planned | No |

#### **OSS features**

| | Grafana Agent Flow mode | Grafana Agent Static mode | Grafana Agent Operator | OpenTelemetry Collector | Prometheus Agent mode |
|--------------------------|-------------------------|---------------------------|------------------------|-------------------------|-----------------------|
| **Kubernetes native** | [Yes][helm chart] | No | Yes | Yes | No |
| **Clustering** | [Yes][clustering] | No | No | No | No |
| **Prometheus rules** | [Yes][rules] | No | No | No | No |
| **Native Vault support** | [Yes][vault] | No | No | No | No |
| | Grafana Alloy | OpenTelemetry Collector | Prometheus Agent |
|--------------------------|-------------------|-------------------------|------------------|
| **Kubernetes native** | [Yes][helm chart] | Yes | No |
| **Clustering** | [Yes][clustering] | No | No |
| **Prometheus rules** | [Yes][rules] | No | No |
| **Native Vault support** | [Yes][vault] | No | No |

#### Grafana Cloud solutions

| | Grafana Agent Flow mode | Grafana Agent Static mode | Grafana Agent Operator | OpenTelemetry Collector | Prometheus Agent mode |
|-------------------------------|-------------------------|---------------------------|------------------------|-------------------------|-----------------------|
| **Official vendor support** | [Yes][sla] | Yes | Yes | No | No |
| **Cloud integrations** | Some | Yes | Some | No | No |
| **Kubernetes monitoring** | [Yes][helm chart] | Yes, custom | Yes | No | Yes, custom |
| **Application observability** | [Yes][observability] | No | No | Yes | No |
### Static mode
[Static mode][] is the original variant of Grafana Agent, introduced on March 3, 2020.
Static mode is the most mature variant of Grafana Agent.
You should run Static mode when:
* **Maturity**: You need to use the most mature version of Grafana Agent.
* **Grafana Cloud integrations**: You need to use Grafana Agent with Grafana Cloud integrations.
### Static mode Kubernetes operator
{{< admonition type="note" >}}
Grafana Agent version 0.37 and newer provides Prometheus Operator compatibility in Flow mode.
You should use Grafana Agent Flow mode for all new Grafana Agent deployments.
{{< /admonition >}}
The [Static mode Kubernetes operator][] is a variant of Grafana Agent introduced on June 17, 2021. It's currently in beta.
The Static mode Kubernetes operator provides compatibility with Prometheus Operator,
allowing static mode to support resources from Prometheus Operator, such as ServiceMonitors, PodMonitors, and Probes.
You should run the Static mode Kubernetes operator when:
* **Prometheus Operator compatibility**: You need to be able to consume
ServiceMonitors, PodMonitors, and Probes from the Prometheus Operator project
for collecting Prometheus metrics.
### Flow mode
[Flow mode][] is a stable variant of Grafana Agent, introduced on September 29, 2022.
Grafana Agent Flow mode focuses on vendor neutrality, ease-of-use,
improved debugging, and ability to adapt to the needs of power users by adopting a configuration-as-code model.
You should run Flow mode when:
* You need functionality unique to Flow mode:
* **Improved debugging**: You need to more easily debug configuration issues using a UI.
* **Full OpenTelemetry support**: Support for collecting OpenTelemetry metrics, logs, and traces.
* **PrometheusRule support**: Support for the PrometheusRule resource from the Prometheus Operator project for configuring Grafana Mimir.
* **Ecosystem transformation**: You need to be able to convert Prometheus and Loki pipelines to and from OpenTelmetry Collector pipelines.
* **Grafana Pyroscope support**: Support for collecting profiles for Grafana Pyroscope.
| | Grafana Alloy | OpenTelemetry Collector | Prometheus Agent |
|-------------------------------|----------------------|-------------------------|------------------|
| **Official vendor support** | [Yes][sla] | No | No |
| **Cloud integrations** | Some | No | No |
| **Kubernetes monitoring** | [Yes][helm chart] | No | Yes, custom |
| **Application observability** | [Yes][observability] | Yes | No |

[Pyroscope]: https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/go_pull
[helm chart]: https://grafana.com/docs/grafana-cloud/monitor-infrastructure/kubernetes-monitoring/configuration/config-k8s-helmchart
[sla]: https://grafana.com/legal/grafana-cloud-sla
[observability]: https://grafana.com/docs/grafana-cloud/monitor-applications/application-observability/setup#send-telemetry

[integrations]: https://grafana.com/docs/agent/static/configuration/integrations/
[components]: ./reference/components
[Static mode]: https://grafana.com/docs/agent/static/
[Static mode Kubernetes operator]: https://grafana.com/docs/agent/operator/
[Flow mode]: https://grafana.com/docs/agent/flow/
[Prometheus]: ./tasks/collect-prometheus-metrics/
[OTel]: ./tasks/collect-opentelemetry-data/
[Loki]: ./tasks/migrate/from-promtail/
[clustering]: ./concepts/clustering/
[rules]: ./reference/components/mimir.rules.kubernetes/
[vault]: ./reference/components/remote.vault/

-->
### BoringCrypto

[BoringCrypto][] is an **EXPERIMENTAL** feature for building {{< param "PRODUCT_NAME" >}}
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/concepts/clustering.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Target auto-distribution requires that all {{< param "PRODUCT_NAME" >}} in the s

You must explicitly enable target auto-distribution on components by defining a `clustering` block.

```river
```alloy
prometheus.scrape "default" {
clustering {
enabled = true
Expand Down
6 changes: 3 additions & 3 deletions docs/sources/concepts/component_controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ which informs the component controller which references are valid and in what or

For a configuration file to be valid, components must not reference themselves or contain a cyclic reference.

```river
```alloy
// INVALID: local.file.some_file can not reference itself:
local.file "self_reference" {
filename = local.file.self_reference.content
}
```

```river
```alloy
// INVALID: cyclic reference between local.file.a and local.file.b:
local.file "a" {
filename = local.file.b.content
Expand Down Expand Up @@ -94,7 +94,7 @@ If your `local.file` component, which watches API keys, suddenly stops working,
Components that expose HTTP endpoints, such as [prometheus.exporter.unix][], can expose an internal address that completely bypasses the network and communicate in-memory.
Components within the same process can communicate with one another without needing to be aware of any network-level protections such as authentication or mutual TLS.

The internal address defaults to `agent.internal:12345`.
The internal address defaults to `alloy.internal:12345`.
If this address collides with a real target on your network, change it to something unique using the `--server.http.memory-addr` flag in the [run][] command.

Components must opt-in to using in-memory traffic.
Expand Down
6 changes: 3 additions & 3 deletions docs/sources/concepts/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For example, the `local.file` component is responsible for retrieving the conten
You specify components in the configuration file by first providing the component's name with a user-specified label,
and then by giving arguments to configure the component.

```river
```alloy
discovery.kubernetes "pods" {
role = "pod"
}
Expand All @@ -41,7 +41,7 @@ Combining component names with a label means you can define multiple instances o

Most arguments for a component in a configuration file are constant values, such as setting a `log_level` attribute to the quoted string `"debug"`.

```river
```alloy
log_level = "debug"
```

Expand All @@ -66,7 +66,7 @@ An example pipeline may look like this:

The following configuration file represents the pipeline.

```river
```alloy
// Get our API key from disk.
//
// This component has an exported field called "content", holding the content
Expand Down
11 changes: 5 additions & 6 deletions docs/sources/concepts/configuration-syntax/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ An {{< param "PRODUCT_NAME" >}} configuration file tells {{< param "PRODUCT_NAME

The {{< param "PRODUCT_NAME" >}} syntax uses blocks, attributes, and expressions.

```river
```alloy
// Create a local.file component labeled my_file.
// This can be referenced by other components as local.file.my_file.
local.file "my_file" {
Expand All @@ -37,7 +37,7 @@ BLOCK_NAME {
}
```

[{{< param "PRODUCT_NAME" >}} is designed][RFC] with the following requirements in mind:
{{< param "PRODUCT_NAME" >}} is designed with the following requirements in mind:

* _Fast_: The configuration language must be fast so the component controller can quickly evaluate changes.
* _Simple_: The configuration language must be easy to read and write to minimize the learning curve.
Expand All @@ -62,7 +62,7 @@ Attributes always take the form of `ATTRIBUTE_NAME = ATTRIBUTE_VALUE`.

The following example shows how to set the `log_level` attribute to `"debug"`.

```river
```alloy
log_level = "debug"
```

Expand Down Expand Up @@ -90,7 +90,7 @@ label (for example, `password_file`), and export name (for example, `content`),
You use _Blocks_ to configure components and groups of attributes.
Each block can contain any number of attributes or nested blocks.

```river
```alloy
prometheus.remote_write "default" {
endpoint {
url = "http://localhost:9009/api/prom/push"
Expand All @@ -113,7 +113,6 @@ You can use one or all of the following tools to help you write {{< param "PRODU
* Editor support for:
* [VSCode](https://github.com/grafana/vscode-alloy)
* [Vim/Neovim](https://github.com/grafana/vim-alloy)
* Code formatting using the [`agent fmt` command][fmt]
* Code formatting using the [`alloy fmt` command][fmt]

[RFC]: https://github.com/grafana/agent/blob/97a55d0d908b26dbb1126cc08b6dcc18f6e30087/docs/rfcs/0005-river.md
[fmt]: ../../reference/cli/fmt/
6 changes: 3 additions & 3 deletions docs/sources/concepts/configuration-syntax/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ The `filename` attribute is a _required_ argument.
You can also define a number of _optional_ arguments, in this case, `detector`, `poll_frequency`, and `is_secret`,
that configure how and how often the file should be polled and whether its contents are sensitive.

```river
```alloy
local.file "targets" {
// Required argument
filename = "/etc/agent/targets"
filename = "/etc/alloy/targets"
// Optional arguments: Components may have some optional arguments that
// do not need to be defined.
Expand All @@ -58,7 +58,7 @@ References can only appear in components.
For example, here's a component that scrapes Prometheus metrics.
The `targets` field is populated with two scrape targets, a constant target `localhost:9001` and an expression that ties the target to the value of `local.file.targets.content`.

```river
```alloy
prometheus.scrape "default" {
targets = [
{ "__address__" = local.file.targets.content }, // tada!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The {{< param "PRODUCT_NAME" >}} configuration syntax contains a [standard libra
Some functions enable interaction with the host system, for example, reading from an environment variable.
Some functions allow for more complex expressions, for example, concatenating arrays or decoding JSON strings into objects.

```river
```alloy
env("HOME")
json_decode(local.file.cfg.content)["namespace"]
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Brackets | Description

The following example uses curly braces and square brackets to define an object and an array.

```river
```alloy
obj = { app = "agent", namespace = "dev" }
arr = [1, true, 7 * (1+1), 3]
```
Expand All @@ -98,7 +98,7 @@ You can access arbitrarily nested values with {{< param "PRODUCT_NAME" >}}'s acc
You can use square brackets to access zero-indexed array indices and object fields by enclosing the field name in double quotes.
You can use the dot operator to access object fields without double quotes and component exports.

```river
```alloy
obj["app"]
arr[1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Similarly, a `prometheus.remote_write` component instance labeled `onprem` expos

The following example shows some references.

```river
```alloy
local.file "target" {
filename = "/etc/agent/target"
}
Expand Down
Loading

0 comments on commit e3ec7fb

Please sign in to comment.