Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/send-data/alloy/set-up/otel_engine/service-installations.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/send-data/alloy/set-up/otel_engine/service-installations/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Run the Alloy OpenTelemetry Engine with service installations
The Alloy service installations for Linux, macOS, and Windows can run the OTel Engine instead of the Default Engine.
Set ALLOY_OTEL_MODE to 1, true, yes, or on to run the OTel Engine.
Matching is case-insensitive.
If you don’t set ALLOY_OTEL_MODE, or you set it to any other value, Alloy runs the Default Engine.
No service installer exposes an install-time flag for this setting. Set it with the platform-specific mechanism below, then restart the service.
EXPERIMENTAL: OTel Engine is an experimental feature. Experimental features are subject to frequent breaking changes, and may be removed with no equivalent replacement.
To maintain full compatibility of the OTel Engine with the upstream OpenTelemetry Collector and expose a compatible command line interface, the OTel Engine isn’t hidden behind a stability flag.
Make sure that you understand the risks involved before using an experimental feature in your production environments.
Before you begin
Make sure you have the following:
- Alloy installed as a service. Refer to Install Grafana Alloy for more information.
- An OpenTelemetry Collector configuration. To create one, refer to Run the OTel Engine with the CLI.
Linux
Alloy is installed as a systemd service on Linux.
It reads ALLOY_OTEL_MODE from the systemd environment file.
To run the OTel Engine on Linux:
Edit the environment file for the service:
- Debian or Ubuntu: Edit
/etc/default/alloy - RHEL/Fedora or SUSE/openSUSE: Edit
/etc/sysconfig/alloy
- Debian or Ubuntu: Edit
Set
ALLOY_OTEL_MODE=1.Edit the sample OpenTelemetry Collector configuration the package installs at
/etc/alloy/config.yaml. The sample receives OTLP data and sends it to thedebugexporter, which only writes to the console. Replace thedebugexporter with a real backend. To use a different file, setOTEL_CONFIG_FILEto its path.Optional: Set
OTEL_CUSTOM_ARGSto pass additional command-line flags to the OTel Engine. This setting works the same way asCUSTOM_ARGSdoes for the Default Engine.Check the configuration, and replace
<OTEL_CONFIG_FILE>with the path configured above:shellalloy otel validate --config=<OTEL_CONFIG_FILE>Restart the service:
shellsudo systemctl restart alloyVerify that the OTel Engine runs:
shellcurl http://localhost:8888/metrics
Refer to Pass additional command-line flags for more information about the environment file.
macOS
Alloy is installed as a launchd service on macOS.
It reads ALLOY_OTEL_MODE from the Homebrew environment file.
To run the OTel Engine on macOS:
Edit the file at
$(brew --prefix)/etc/alloy/config.env.Set
ALLOY_OTEL_MODE=1.Create your OpenTelemetry Collector configuration at
$(brew --prefix)/etc/alloy/config.yaml. The Homebrew formula doesn’t create this file, and the service always loads it.To load an additional file, add
--config=<PATH>to$(brew --prefix)/etc/alloy/otel-extra-args.txt. Alloy applies this flag after the default, so its values override the installer’s default where they overlap. Createconfig.yamleven when you use this option.Optional: Add command-line flags for the OTel Engine to
$(brew --prefix)/etc/alloy/otel-extra-args.txt. This file works the same way asextra-args.txtdoes for the Default Engine.Check the configuration:
shellalloy otel validate --config=$(brew --prefix)/etc/alloy/config.yamlRestart the service:
shellbrew services restart grafana/grafana/alloyVerify that the OTel Engine runs:
shellcurl http://localhost:8888/metrics
Refer to Configure environment variables for more information about the environment file.
Windows
Alloy is installed as a Windows Service.
It reads ALLOY_OTEL_MODE from the Windows registry at HKLM\Software\GrafanaLabs\Alloy.
To run the OTel Engine on Windows:
Open the Registry Editor and navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\GrafanaLabs\Alloy.Set the string value
ALLOY_OTEL_MODEto1.Edit the sample OpenTelemetry Collector configuration the installer creates at
%PROGRAMFILES%\GrafanaLabs\Alloy\config.yaml. The sample receives OTLP data and sends it to thedebugexporter, which only writes to the log. Replace thedebugexporter with a real backend. To use a different file, add--config=<PATH>to the multi-string valueOTelArguments. Alloy applies this flag after the default, so its values override the installer’s default where they overlap.Optional: Add command-line flags for the OTel Engine to the multi-string value
OTelArguments. This value works the same way asArgumentsdoes for the Default Engine.Check the configuration:
powershell& "$env:PROGRAMFILES\GrafanaLabs\Alloy\alloy-windows-amd64.exe" otel validate --config="$env:PROGRAMFILES\GrafanaLabs\Alloy\config.yaml"Restart the Alloy service from the Windows Services manager.
Verify that the OTel Engine runs:
powershellInvoke-WebRequest http://localhost:8888/metrics -UseBasicParsing
Refer to Service configuration for more information about the registry values Alloy uses.
Was this page helpful?
Related resources from Grafana Labs


