arillso.agent.alloy role – Install and configure Grafana Alloy for monitoring and observability
Note
This role is part of the arillso.agent collection (version 1.0.1).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it use: ansible-galaxy collection install arillso.agent.
To use it in a playbook, specify: arillso.agent.alloy.
Entry point configure – Configure Grafana Alloy with templates and settings
Synopsis
This entry point handles the configuration of Grafana Alloy using templates and variable settings.
Parameters
Parameter |
Comments |
|---|---|
Advertise address for cluster communication Default: |
|
Port for cluster advertisement Default: |
|
Peer discovery configuration Default: |
|
List of peer addresses to join cluster Default: |
|
Name of the Grafana Alloy cluster Default: |
|
Interval for cluster rejoin attempts Default: |
|
Enables clustering for high availability Choices:
|
|
Configuration file path for Grafana Alloy Default: |
|
Template path for Grafana Alloy configuration Default: |
|
Custom Prometheus exporters (including Tailscale) Default: |
|
Basic authentication |
|
Password |
|
Username |
|
Bearer token |
|
Path to bearer token file |
|
Enable HTTP/2 Choices:
|
|
Follow HTTP redirects Choices:
|
|
Job name for Prometheus |
|
Metric relabel configurations |
|
Path to metrics Default: |
|
Name of the exporter |
|
URL parameters for scrape requests |
|
Remote write endpoint for this exporter Default: |
|
Scheme for the exporter Choices:
|
|
Scrape interval (e.g. ’30s’) |
|
Scrape timeout (e.g. ’10s’) |
|
List of target addresses |
|
Address of the exporter (host:port) |
|
Additional labels for the target |
|
TLS configuration |
|
CA certificate file |
|
Client certificate file |
|
Skip TLS certificate verification Choices:
|
|
Private key file |
|
Server name for TLS verification |
|
Enable gRPC server for Alloy clustering and remote calls Choices:
|
|
Enables Loki log collection Choices:
|
|
Enables OpenTelemetry support Choices:
|
|
Enables OpenTelemetry processors Choices:
|
|
Enables Prometheus metrics collection Choices:
|
|
Enable Grafana remote configuration management via remotecfg block Choices:
|
|
Enable HTTP web server for Alloy UI and API Choices:
|
|
Environment file path for Grafana Alloy service Default: |
|
Template path for Grafana Alloy environment file Default: |
|
External labels added to all metrics and logs Default: |
|
System group for Grafana Alloy service Default: |
|
Log format for Grafana Alloy Choices:
|
|
Log level for Grafana Alloy Choices:
|
|
List of Loki client configurations Default: |
|
Basic authentication configuration |
|
Password for basic auth |
|
Username for basic auth |
|
Bearer token for authentication |
|
Path to bearer token file |
|
External labels for all logs |
|
Additional HTTP headers |
|
Name of the Loki client |
|
Queue configuration for Loki client |
|
Number of logs to buffer (as string with units, e.g. ‘2500MiB’) |
|
Maximum amount of time to wait for the queue to be drained on shutdown (e.g. ’30s’) |
|
Tenant ID for multi-tenant Loki instances |
|
TLS configuration |
|
URL of the Loki endpoint |
|
Loki file source configurations Default: |
|
Enables systemd journal log collection Choices:
|
|
Journal matches for filtering Default: |
|
Maximum age for journal entries Default: |
|
Relabel rules for journal entries Default: |
|
Write target for journal entries Default: |
|
Loki process pipeline configurations Default: |
|
Maximum CPU limit for Alloy service (e.g., ‘500m’, ‘1.0’) Default: |
|
Maximum memory limit for Alloy service (e.g., ‘256Mi’, ‘1Gi’) Default: |
|
List of OpenTelemetry exporters Default: |
|
Endpoint URL of the exporter |
|
HTTP headers |
|
Name of the exporter |
|
Timeout for exporter requests |
|
TLS configuration |
|
Type of the exporter Choices:
|
|
gRPC endpoint for OpenTelemetry receiver Default: |
|
TLS configuration for gRPC endpoint Default: |
|
HTTP endpoint for OpenTelemetry receiver Default: |
|
TLS configuration for HTTP endpoint Default: |
|
Attributes processor configuration Default: |
|
Batch processor configuration Default: |
|
Resource processor configuration Default: |
|
Output target for OpenTelemetry traces Default: |
|
Additional Prometheus scrape configurations Default: |
|
Honor labels from targets Choices:
|
|
Honor timestamps from targets Choices:
|
|
Default metrics path for Prometheus Default: |
|
List of Prometheus relabeling configurations for advanced label manipulation Default: |
|
The receiver to forward metrics to, typically a prometheus.remote_write component |
|
Maximum number of entries to keep in the cache for relabeling operations Default: |
|
Unique name for the relabeling component |
|
List of relabeling rules to apply |
|
Action to perform on the label Choices:
|
|
Whether regex matching should be case sensitive Choices:
|
|
For replace actions whether to keep the source value if the target and source are equal Choices:
|
|
Modulus for hashmod action |
|
Regular expression to extract value from source labels |
|
Replacement for regex matches |
|
Separator to join source_label values |
|
List of source labels to use as input |
|
Label to modify with the extracted value |
|
Prometheus remote write configuration Default: |
|
Basic authentication configuration |
|
Password for basic auth |
|
Username for basic auth |
|
Bearer token for authentication |
|
Path to bearer token file |
|
Additional HTTP headers |
|
Metadata configuration |
|
Name of the remote write target |
|
Queue configuration for remote write |
|
Factor to increase backoff for subsequent retries |
|
Maximum time samples will wait in buffer (e.g. ‘5s’) |
|
Number of samples to buffer per shard |
|
Maximum retry delay (e.g. ‘1m’) |
|
Maximum number of samples per send |
|
Maximum number of shards, i.e. amount of concurrency |
|
Initial retry delay (e.g. ‘1s’) |
|
Minimum number of shards to keep running |
|
Retry when an HTTP 429 status code is received Choices:
|
|
Maximum age of samples to send (e.g. ‘2m’) Default: |
|
Timeout for remote write requests |
|
TLS configuration |
|
URL of the remote write endpoint |
|
Default scrape interval for Prometheus Default: |
|
Default scrape timeout for Prometheus Default: |
|
Remote configuration using the remotecfg block (only one per config file) Default: |
|
A set of self-reported attributes (excludes collector.* prefix) Default: |
|
Configure basic_auth for authenticating to the endpoint |
|
Basic auth password |
|
File containing the basic auth password |
|
Basic auth username |
|
Bearer token to authenticate with |
|
File containing a bearer token to authenticate with |
|
Whether HTTP2 is supported for requests Choices:
|
|
Whether redirects returned by the server should be followed Choices:
|
|
A self-reported ID (defaults to random UUID if not set) |
|
A human-readable name for the collector Default: |
|
How often to poll the API for new configuration (minimum 10s) Default: |
|
Configure TLS settings for connecting to the endpoint |
|
CA certificate to validate the server with |
|
Disables validation of the server certificate Choices:
|
|
The address of the API to poll for configuration |
|
gRPC listen address for Grafana Alloy server Default: |
|
Maximum receive message size for gRPC server Default: |
|
Maximum send message size for gRPC server Default: |
|
Enables pprof performance profiling Choices:
|
|
HTTP listen address for Grafana Alloy server Default: |
|
Log level for server component Default: |
|
Logs source IP addresses in server logs Choices:
|
|
Name of the systemd service Default: |
|
Directory for systemd service overrides Default: |
|
File path for systemd service override Default: |
|
Template path for systemd service override Default: |
|
System user for Grafana Alloy service Default: |
Entry point install – Install Grafana Alloy package and dependencies
Synopsis
This entry point only handles the installation of Grafana Alloy package and required dependencies without configuration.
Parameters
Parameter |
Comments |
|---|---|
Configuration file path for Grafana Alloy Default: |
|
URL for Grafana GPG key (OS-specific) |
|
Path for Grafana GPG keyring (Debian/Ubuntu only) |
|
Grafana repository configuration (APT for Debian/Ubuntu, RPM for RedHat/CentOS) |
|
System group for Grafana Alloy service Default: |
|
Log file for Grafana Alloy (empty for stdout) Default: |
|
OS-specific package dependencies for Grafana Alloy installation |
|
Name of the Grafana Alloy package Default: |
|
Install only the package without repository setup (for distributions with Alloy in default repos) Choices:
|
|
State of the Grafana Alloy package Choices:
|
|
Name of the systemd service Default: |
|
Storage path for Grafana Alloy data Default: |
|
System user for Grafana Alloy service Default: |
Authors
Simon Bärlocher
Entry point main – Install and configure Grafana Alloy for monitoring and observability
Synopsis
This role installs and configures Grafana Alloy via official package sources for collecting, transforming, and forwarding telemetry data.
Parameters
Parameter |
Comments |
|---|---|
Advertise address for cluster communication Default: |
|
Port for cluster advertisement Default: |
|
Peer discovery configuration Default: |
|
List of peer addresses to join cluster Default: |
|
Name of the Grafana Alloy cluster Default: |
|
Interval for cluster rejoin attempts Default: |
|
Enables clustering for high availability Choices:
|
|
Configuration file path for Grafana Alloy Default: |
|
Template path for Grafana Alloy configuration Default: |
|
Custom Prometheus exporters (including Tailscale) Default: |
|
Basic authentication |
|
Password |
|
Username |
|
Bearer token |
|
Path to bearer token file |
|
Enable HTTP/2 Choices:
|
|
Follow HTTP redirects Choices:
|
|
Job name for Prometheus |
|
Metric relabel configurations |
|
Path to metrics Default: |
|
Name of the exporter |
|
URL parameters for scrape requests |
|
Remote write endpoint for this exporter Default: |
|
Scheme for the exporter Choices:
|
|
Scrape interval (e.g. ’30s’) |
|
Scrape timeout (e.g. ’10s’) |
|
List of target addresses |
|
Address of the exporter (host:port) |
|
Additional labels for the target |
|
TLS configuration |
|
CA certificate file |
|
Client certificate file |
|
Skip TLS certificate verification Choices:
|
|
Private key file |
|
Server name for TLS verification |
|
Enable advanced Node Exporter integration with customized configuration Choices:
|
|
Enable gRPC server for Alloy clustering and remote calls Choices:
|
|
Enables Loki log collection Choices:
|
|
Enables OpenTelemetry support Choices:
|
|
Enables OpenTelemetry processors Choices:
|
|
Enables Prometheus metrics collection Choices:
|
|
Enable Grafana remote configuration management via remotecfg block Choices:
|
|
Enable HTTP web server for Alloy UI and API Choices:
|
|
Environment file path for Grafana Alloy service Default: |
|
Template path for Grafana Alloy environment file Default: |
|
External labels added to all metrics and logs Default: |
|
URL for Grafana GPG key (OS-specific) |
|
Path for Grafana GPG keyring (Debian/Ubuntu only) |
|
Grafana repository configuration (APT for Debian/Ubuntu, RPM for RedHat/CentOS) |
|
System group for Grafana Alloy service Default: |
|
gRPC port for Grafana Alloy server Default: |
|
Enables health check after installation Choices:
|
|
Log file for Grafana Alloy (empty for stdout) Default: |
|
Log format for Grafana Alloy Choices:
|
|
Log level for Grafana Alloy Choices:
|
|
List of Loki client configurations Default: |
|
Basic authentication configuration |
|
Password for basic auth |
|
Username for basic auth |
|
Bearer token for authentication |
|
Path to bearer token file |
|
External labels for all logs |
|
Additional HTTP headers |
|
Name of the Loki client |
|
Queue configuration for Loki client |
|
Number of logs to buffer (as string with units, e.g. ‘2500MiB’) |
|
Maximum amount of time to wait for the queue to be drained on shutdown (e.g. ’30s’) |
|
Tenant ID for multi-tenant Loki instances |
|
TLS configuration |
|
URL of the Loki endpoint |
|
Loki file source configurations Default: |
|
Enables systemd journal log collection Choices:
|
|
Journal matches for filtering Default: |
|
Maximum age for journal entries Default: |
|
Relabel rules for journal entries Default: |
|
Write target for journal entries Default: |
|
Loki process pipeline configurations Default: |
|
Maximum CPU limit for Alloy service (e.g., ‘500m’, ‘1.0’) Default: |
|
Maximum memory limit for Alloy service (e.g., ‘256Mi’, ‘1Gi’) Default: |
|
Advanced configuration for the integrated Node Exporter Default: |
|
List of Node Exporter collectors to disable |
|
Environment tag for node metrics (e.g. production, staging) |
|
Configuration for filesystem collector |
|
Regexp of filesystem types to exclude from collection |
|
Regexp of mount points to exclude from collection |
|
Timeout for collecting filesystem metrics |
|
Instance identifier override (defaults to ansible_hostname) |
|
Configuration for netclass collector |
|
Regexp of net devices to ignore for netclass collector |
|
Configuration for netdev collector |
|
Regexp of net devices to exclude from collection |
|
Node type tag for categorizing server roles (e.g. gateway, controller) |
|
Path to procfs filesystem (used in container environments) |
|
Region tag for geographic location of the node |
|
Path to sysfs filesystem (used in container environments) |
|
Configuration for systemd collector |
|
Enable restart metrics for systemd units Choices:
|
|
Enable start time metrics for systemd units Choices:
|
|
Enable task metrics for systemd units Choices:
|
|
List of systemd units to exclude from metrics collection |
|
List of systemd units to include in metrics collection |
|
Directory to read custom metrics files from |
|
Pattern of files to be read from textfile directory |
|
List of metrics to keep, filtering out all others to reduce network and storage usage |
|
List of OpenTelemetry exporters Default: |
|
Endpoint URL of the exporter |
|
HTTP headers |
|
Name of the exporter |
|
Timeout for exporter requests |
|
TLS configuration |
|
Type of the exporter Choices:
|
|
gRPC endpoint for OpenTelemetry receiver Default: |
|
TLS configuration for gRPC endpoint Default: |
|
HTTP endpoint for OpenTelemetry receiver Default: |
|
TLS configuration for HTTP endpoint Default: |
|
Attributes processor configuration Default: |
|
Batch processor configuration Default: |
|
Resource processor configuration Default: |
|
Output target for OpenTelemetry traces Default: |
|
OS-specific package dependencies for Grafana Alloy installation |
|
Name of the Grafana Alloy package Default: |
|
Install only the package without repository setup (for distributions with Alloy in default repos) Choices:
|
|
State of the Grafana Alloy package Choices:
|
|
HTTP port for Grafana Alloy server Default: |
|
Additional Prometheus scrape configurations Default: |
|
Honor labels from targets Choices:
|
|
Honor timestamps from targets Choices:
|
|
Default metrics path for Prometheus Default: |
|
List of Prometheus relabeling configurations for advanced label manipulation Default: |
|
The receiver to forward metrics to, typically a prometheus.remote_write component |
|
Maximum number of entries to keep in the cache for relabeling operations Default: |
|
Unique name for the relabeling component |
|
List of relabeling rules to apply |
|
Action to perform on the label Choices:
|
|
Whether regex matching should be case sensitive Choices:
|
|
For replace actions whether to keep the source value if the target and source are equal Choices:
|
|
Modulus for hashmod action |
|
Regular expression to extract value from source labels |
|
Replacement for regex matches |
|
Separator to join source_label values |
|
List of source labels to use as input |
|
Label to modify with the extracted value |
|
Prometheus remote write configuration Default: |
|
Basic authentication configuration |
|
Password for basic auth |
|
Username for basic auth |
|
Bearer token for authentication |
|
Path to bearer token file |
|
Additional HTTP headers |
|
Metadata configuration |
|
Name of the remote write target |
|
Queue configuration for remote write |
|
Factor to increase backoff for subsequent retries |
|
Maximum time samples will wait in buffer (e.g. ‘5s’) |
|
Number of samples to buffer per shard |
|
Maximum retry delay (e.g. ‘1m’) |
|
Maximum number of samples per send |
|
Maximum number of shards, i.e. amount of concurrency |
|
Initial retry delay (e.g. ‘1s’) |
|
Minimum number of shards to keep running |
|
Retry when an HTTP 429 status code is received Choices:
|
|
Maximum age of samples to send (e.g. ‘2m’) Default: |
|
Timeout for remote write requests |
|
TLS configuration |
|
URL of the remote write endpoint |
|
Default scrape interval for Prometheus Default: |
|
Default scrape timeout for Prometheus Default: |
|
Remote configuration using the remotecfg block (only one per config file) Default: |
|
A set of self-reported attributes (excludes collector.* prefix) Default: |
|
Configure basic_auth for authenticating to the endpoint |
|
Basic auth password |
|
File containing the basic auth password |
|
Basic auth username |
|
Bearer token to authenticate with |
|
File containing a bearer token to authenticate with |
|
Whether HTTP2 is supported for requests Choices:
|
|
Whether redirects returned by the server should be followed Choices:
|
|
A self-reported ID (defaults to random UUID if not set) |
|
A human-readable name for the collector Default: |
|
How often to poll the API for new configuration (minimum 10s) Default: |
|
Configure TLS settings for connecting to the endpoint |
|
CA certificate to validate the server with |
|
Disables validation of the server certificate Choices:
|
|
The address of the API to poll for configuration |
|
gRPC listen address for Grafana Alloy server Default: |
|
Maximum receive message size for gRPC server Default: |
|
Maximum send message size for gRPC server Default: |
|
Enables pprof performance profiling Choices:
|
|
HTTP listen address for Grafana Alloy server Default: |
|
Log level for server component Default: |
|
Logs source IP addresses in server logs Choices:
|
|
Name of the systemd service Default: |
|
Directory for systemd service overrides Default: |
|
File path for systemd service override Default: |
|
Template path for systemd service override Default: |
|
Storage path for Grafana Alloy data Default: |
|
System user for Grafana Alloy service Default: |
|
Version of the Grafana Alloy package (latest for newest version) Default: |
Authors
Simon Bärlocher
Entry point service – Manage Grafana Alloy systemd service
Synopsis
This entry point manages the systemd service for Grafana Alloy, including starting, stopping, and health checks.
Parameters
Parameter |
Comments |
|---|---|
Configuration file path for Grafana Alloy Default: |
|
System group for Grafana Alloy service Default: |
|
gRPC port for Grafana Alloy server Default: |
|
Enables health check after installation Choices:
|
|
HTTP port for Grafana Alloy server Default: |
|
Name of the systemd service Default: |
|
System user for Grafana Alloy service Default: |
|
Version of the Grafana Alloy package (latest for newest version) Default: |
Authors
Simon Bärlocher