Skip to content
Merged
2 changes: 0 additions & 2 deletions collector/generator/main_alloy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ func newAlloyCommand(params otelcol.CollectorSettings) *cobra.Command {
flowCmd := flowcmd.RootCommand()
flowCmd.AddCommand(otelCmd)

// TODO: Officially add this command to expose in a follow up PR
otelCmd.Hidden = true
return flowCmd
}
2 changes: 0 additions & 2 deletions collector/main_alloy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ func newAlloyCommand(params otelcol.CollectorSettings) *cobra.Command {
flowCmd := flowcmd.RootCommand()
flowCmd.AddCommand(otelCmd)

// TODO: Officially add this command to expose in a follow up PR
otelCmd.Hidden = true
return flowCmd
}
4 changes: 3 additions & 1 deletion docs/sources/reference/cli/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ Available commands:

* [`convert`][convert]: Convert an {{< param "PRODUCT_NAME" >}} configuration file.
* [`fmt`][fmt]: Format an {{< param "PRODUCT_NAME" >}} configuration file.
* [`run`][run]: Start {{< param "PRODUCT_NAME" >}}, given a configuration file.
* [`run`][run]: Start {{< param "PRODUCT_NAME" >}} with the Default Engine, given an Alloy syntax configuration file.
* [`otel`][otel]: Start {{< param "PRODUCT_NAME" >}} with the experimental OTel Engine, given an Open Telemetry Collector YAML configuration file.
* [`tools`][tools]: Read the WAL and provide statistical information.
* `completion`: Generate shell completion for the `alloy` CLI.
* `help`: Print help for supported commands.

[run]: ./run/
[fmt]: ./fmt/
[convert]: ./convert/
[otel]: ./otel/
[tools]: ./tools/
129 changes: 129 additions & 0 deletions docs/sources/reference/cli/otel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
canonical: https://grafana.com/docs/alloy/latest/reference/cli/otel/
description: Learn about the otel command
labels:
stage: experimental
products:
- oss
title: otel
weight: 350
---

# `otel`

The `otel` command runs Grafana Alloy using the OpenTelemetry (OTel) Collector engine. This command accepts OpenTelemetry Collector YAML configuration files.

The Alloy OTel distribution includes receivers, processors, exporters, extensions, and connectors from the OpenTelemetry Collector core and contrib repositories. This includes components for OTLP, Prometheus, Kafka, Zipkin, and other popular integrations.

As with the `run` command, this runs in the foreground until an interrupt is received.

{{< admonition type="warning" >}}
Please note that this is an *experimental* feature and can therefore be subject to breaking changes or removal in future releases.
{{< /admonition >}}

## Usage

```shell
alloy otel --config=<CONFIG_FILE> [<FLAGS> ...]
```

Replace the following:

* _`<CONFIG_FILE>`_: Path to an OpenTelemetry Collector configuration file.
* _`<FLAGS>`_: One or more flags that configure the OpenTelemetry Collector.

## Configuration

The `otel` command accepts standard OpenTelemetry Collector YAML configuration files. The configuration file defines receivers, processors, exporters, and other components that make up your telemetry pipeline.

For information about configuration options, refer to the [OpenTelemetry Collector documentation](https://opentelemetry.io/docs/collector/configuration/).

### Optionally Running the Default Engine

The Alloy Collector Distro includes the option to run pipelines using the Default Engine alongside the OTel Engine using the built in Alloy Engine extension. More information on how to run the extension can be found [here](https://github.com/grafana/alloy/blob/main/extension/alloyengine/README.md)

This will run a Default Engine pipeline _in parallel_ to the OTel Engine pipeline - the two pipelines cannot natively interact.

### Available Components

The included components are based off the upstream core distribution, in order to ensure that full end-to-end pipelines are accessible for most use cases. In addition to upstream components, we also integrate some of our own components that enable functionality to work well within the Alloy ecosystem.

To view the full list of components and their versioning, please refer to the [OCB manifest](https://github.com/grafana/alloy/blob/main/collector/builder-config.yaml)

## Examples

### Running with OTel Engine only

This example runs the OTel Engine without the Alloy Engine extension:

```shell
alloy otel --config=config.yaml
```

Example `config.yaml`:

```yaml
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317

processors:
batch:

exporters:
debug:

service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [debug]
```

### Running with OTel Engine and Alloy Engine extension

This example runs both the OTel Engine and the Alloy Engine extension in parallel:

```shell
alloy otel --config=config.yaml
```

Example `config.yaml`:

```yaml
extensions:
alloyengine:
config:
file: path/to/alloy-config.alloy
flags:
server.http.listen-addr: 0.0.0.0:12345
stability.level: experimental

receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317

processors:
batch:

exporters:
debug:

service:
extensions: [alloyengine]
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [debug]
```

## Related documentation
* [OpenTelemetry Collector documentation](https://opentelemetry.io/docs/collector/): Official OpenTelemetry Collector documentation.


2 changes: 1 addition & 1 deletion docs/sources/reference/cli/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ weight: 300

# `run`

The `run` command runs {{< param "PRODUCT_NAME" >}} in the foreground until an interrupt is received.
The `run` command runs the {{< param "PRODUCT_NAME" >}} Default Engine in the foreground until an interrupt is received.

## Usage

Expand Down
Loading