update alloy docs

Signed-off-by: Basil Bruhn <basil.bruhn@psi.ch>
This commit is contained in:
bruhn_b committed 2026-08-20 11:31:10 +02:00
1 parent 2dc080e297
commit ab39877f88
1 file changed
+48 -32
@@ -9,7 +9,11 @@ Alloy sends telemetry to the central production observability platform
- host metrics to Mimir;
- the complete local system journal to Loki;
- optional traces to Tempo;
- optional application, Redis, Blackbox, SNMP, and Docker telemetry.
- optional application and Docker telemetry.
Redis, Blackbox, and SNMP telemetry are still work in progress. Their
configuration is documented below for testing and development, but is not yet
available in the production Puppet environment.
Host metrics and journal logs are always enabled when Alloy is enabled. Obtain
approval from the environment owner before enrolling a host because journal
@@ -136,8 +140,8 @@ The code-owned baseline host collector selection is:
```text
cpu, diskstats, filefd, filesystem, loadavg, meminfo, netclass,
netdev, netstat, os, selinux, sockstat, softnet, stat, time, timex,
uname, vmstat, xfs
netdev, netstat, os, pressure, selinux, sockstat, softnet, stat, time,
timex, uname, vmstat, xfs
```
Alloy's own internal metrics are not forwarded.
@@ -193,7 +197,6 @@ Journal collection cannot be disabled while Alloy is enabled.
| `alloy::journal::max_age` | duration string | `'1h'` | Do not read journal entries older than this limit. |
| `alloy::journal::format_as_json` | Boolean | `false` | Send the journal entry as JSON instead of only its message. |
| `alloy::journal::labels` | string map | `{}` | Add static labels to journal entries. |
| `alloy::journal::unit_labels` | Boolean map | central defaults | Promote selected systemd units to a Loki label. |
Example:
@@ -203,21 +206,17 @@ alloy::journal::format_as_json: false
alloy::journal::labels:
application_area: 'controls'
alloy::journal::unit_labels:
'my-application.service': true
'docker.service': false
```
`unit_labels` does not select or filter logs. All journal entries are still
sent. A `true` entry only promotes that stable unit name to the
`systemd_unit` Loki label. A `false` entry removes an inherited promotion.
All service units receive a `systemd_unit` label. Instances of templated units
are collapsed to their template name, for example `worker@123.service` becomes
`worker@.service`. Transient `run-*.service` units are grouped as
`systemd-run.service`. The exact unit name and the syslog identifier are stored
as structured metadata named `systemd_unit_exact` and `syslog_identifier`.
Use unit labels only for stable service names. Do not promote sessions,
transient scopes, generated instance names, or other high-cardinality values.
The code-owned defaults promote Chrony, NetworkManager, SSH, and SSSD service
units.
These fields are managed centrally and cannot be configured through Hiera.
Static journal labels named `systemd_unit`, `systemd_unit_exact`, or
`syslog_identifier` are discarded.
## Additional Prometheus endpoints
@@ -263,8 +262,7 @@ alloy::components:
| `labels` | no | `{}` | Static labels for this endpoint's metrics. |
The endpoint name becomes its `job` and `target` label. Use a unique name and
do not use the managed names `psi_host`, `psi_redis`, `blackbox`, `psi_snmp`,
or `psi_docker`.
do not use the managed names `psi_host` or `psi_docker`.
Disable an endpoint inherited from a broader Hiera level with:
@@ -281,6 +279,11 @@ application supports it.
## Redis metrics
!!! warning "Work in progress"
Redis telemetry is not available in the production Puppet environment yet.
The configuration in this section is intended only for development and
testing.
Redis metrics are disabled by default. The component connects to Redis on the
same host at `localhost:6379`.
@@ -302,6 +305,11 @@ Set `enable: false` at a more specific Hiera level to disable an inherited
## Blackbox probes
!!! warning "Work in progress"
Blackbox probing is not available in the production Puppet environment
yet. The configuration in this section is intended only for development
and testing.
Blackbox probing is disabled by default. Both the component and every target
must be explicitly enabled.
@@ -360,6 +368,11 @@ Never commit plaintext secrets.
## SNMP metrics
!!! warning "Work in progress"
SNMP telemetry is not available in the production Puppet environment yet.
The configuration in this section is intended only for development and
testing.
SNMP collection is disabled by default. Alloy includes the standard SNMP
exporter modules and allows Hiera to define authentication profiles and named
targets. Both the component and every target must be explicitly enabled.
@@ -432,9 +445,10 @@ This single switch enables both:
- logs from all local containers through the Docker socket.
Metrics and logs cannot currently be enabled separately. The host must have a
working Docker socket and `docker` group. The managed systemd service receives
`SupplementaryGroups=docker` while this component is enabled; Puppet does not
revoke any Unix group membership configured elsewhere.
working Docker socket. The managed Alloy service runs as `root` while this
component is enabled so that cAdvisor can read Docker layer metadata and Alloy
can access the Docker socket. Without Docker telemetry, Alloy runs as the
unprivileged `alloy` user.
Access to the Docker socket is effectively privileged. Enable this component
only on approved Docker hosts. Runtime access can also depend on the storage
@@ -479,15 +493,17 @@ alloy::labels:
lifecycle: 'production'
```
These labels apply to host, Redis, Blackbox, SNMP, and additional Prometheus
metrics as well as journal and Docker logs. They do not apply to traces.
These labels apply to host and additional Prometheus metrics as well as journal
and Docker logs. They do not apply to traces. Once the WIP Redis, Blackbox, and
SNMP components become available, the labels will apply to their metrics too.
Use labels only for stable, low-cardinality values. Do not use usernames,
request IDs, timestamps, container IDs, or other values that continually
change.
More specific label options are available for journal logs, individual
Prometheus endpoints, Blackbox targets, and SNMP targets:
More specific label options are available for journal logs and individual
Prometheus endpoints. The WIP Blackbox and SNMP components also provide
target-specific labels:
```yaml
alloy::journal::labels:
@@ -503,8 +519,8 @@ alloy::components:
```
The centrally derived Puppet/SysDB identity and fixed component labels take
precedence over conflicting admin-provided labels. A static `systemd_unit`
journal label is discarded; use `alloy::journal::unit_labels` instead.
precedence over conflicting admin-provided labels. Static journal labels named
`systemd_unit`, `systemd_unit_exact`, or `syslog_identifier` are discarded.
## Hiera priority and merging
@@ -524,11 +540,10 @@ The following maps deep-merge across the hierarchy:
- `alloy::components`;
- `alloy::labels`;
- `alloy::journal::labels`;
- `alloy::journal::unit_labels`.
- `alloy::journal::labels`.
This makes it possible to define common environment settings and modify one
component, label, or systemd unit for a group or host.
component or label for a group or host.
Use the option names exactly as shown in this guide. Puppet intentionally does
not validate unknown component or field names. Some mistakes fail while
@@ -551,8 +566,9 @@ The following are owned by the Puppet code:
- mandatory host metric and journal collection;
- the local Alloy HTTP listener and service hardening;
- OTLP listener addresses and batching;
- the Redis address, namespace pattern, and scrape settings;
- Blackbox and SNMP scrape settings and the embedded SNMP module set;
- once available, the WIP Redis address, namespace pattern, and scrape settings;
- once available, the WIP Blackbox and SNMP scrape settings and embedded SNMP
module set;
- Docker component internals;
- raw or custom Alloy configuration.