Add grafana_alloy role: scrape log files to Loki

This commit is contained in:
2026-07-06 13:07:50 +03:00
parent 5322a48353
commit bafa282482
11 changed files with 264 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
# grafana_alloy
Install Grafana Alloy binary from GitHub.
Install Grafana Alloy from the release binary and configures it to scrape log files and push them to Loki. RHEL / CentOS / Rocky.
## Variables
```yaml
alloy_version: "1.17.1"
alloy_config_dir: "/etc/alloy"
alloy_data_dir: "/var/lib/alloy"
alloy_loki_url: "http://localhost:3100/loki/api/v1/push"
alloy_log_paths:
- "/var/log/*.log"
```
## Usage
```yaml
- hosts: log_shippers
become: true
roles:
- role: grafana_alloy
vars:
alloy_loki_url: "http://loki.example.com:3100/loki/api/v1/push"
alloy_log_paths:
- "/var/log/*.log"
- "/var/log/myapp/*.log"
```