Compare commits
5 Commits
master
...
6fccc69e03
| Author | SHA1 | Date | |
|---|---|---|---|
| 6fccc69e03 | |||
| 4db76ea7cc | |||
| afd27e2f17 | |||
| 71cd9946c1 | |||
| e5b9415209 |
@@ -7,11 +7,11 @@ Install Grafana Alloy from the release binary and configures it to scrape log fi
|
|||||||
## Variables
|
## Variables
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
alloy_version: "1.17.1"
|
grafana_alloy_version: "1.17.1"
|
||||||
alloy_config_dir: "/etc/alloy"
|
grafana_alloy_config_dir: "/etc/alloy"
|
||||||
alloy_data_dir: "/var/lib/alloy"
|
grafana_alloy_data_dir: "/var/lib/alloy"
|
||||||
alloy_loki_url: "http://localhost:3100/loki/api/v1/push"
|
grafana_alloy_loki_url: "http://localhost:3100/loki/api/v1/push"
|
||||||
alloy_log_paths:
|
grafana_alloy_log_paths:
|
||||||
- "/var/log/*.log"
|
- "/var/log/*.log"
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -23,8 +23,8 @@ alloy_log_paths:
|
|||||||
roles:
|
roles:
|
||||||
- role: grafana_alloy
|
- role: grafana_alloy
|
||||||
vars:
|
vars:
|
||||||
alloy_loki_url: "http://loki.example.com:3100/loki/api/v1/push"
|
grafana_alloy_loki_url: "http://loki.example.com:3100/loki/api/v1/push"
|
||||||
alloy_log_paths:
|
grafana_alloy_log_paths:
|
||||||
- "/var/log/*.log"
|
- "/var/log/*.log"
|
||||||
- "/var/log/myapp/*.log"
|
- "/var/log/myapp/*.log"
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
grafana_alloy_version: "1.17.1"
|
grafana_alloy_version: "1.17.1"
|
||||||
grafana_alloy_config_dir: "/etc/alloy"
|
grafana_alloy_config_dir: "/etc/alloy"
|
||||||
grafana_alloy_data_dir: "/var/lib/alloy"
|
grafana_alloy_data_dir: "/var/lib/alloy"
|
||||||
grafana_alloy_loki_url: "http://localhost:3100/loki/api/v1/push"
|
grafana_alloy_loki_port: 3100
|
||||||
|
grafana_alloy_loki_url: "http://localhost:{{ grafana_alloy_loki_port }}/loki/api/v1/push"
|
||||||
grafana_alloy_log_paths:
|
grafana_alloy_log_paths:
|
||||||
- "/var/log/*.log"
|
- "/var/log/*.log"
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
name: "alloy"
|
name: "alloy"
|
||||||
system: true
|
system: true
|
||||||
shell: "/sbin/nologin"
|
shell: "/sbin/nologin"
|
||||||
groups: "adm,systemd-journal"
|
groups: "adm"
|
||||||
append: true
|
|
||||||
create_home: false
|
create_home: false
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ ExecStart=/usr/bin/alloy run {{ grafana_alloy_config_dir }}/config.alloy \
|
|||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
|
||||||
# Security hardening
|
# Security hardening
|
||||||
ReadWritePaths={{ grafana_alloy_data_dir }}
|
ReadWritePaths={{ grafana_alloy_data_dir }} {{ grafana_alloy_config_dir }}
|
||||||
ProtectSystem=strict
|
ProtectSystem=strict
|
||||||
NoNewPrivileges=true
|
NoNewPrivileges=true
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
|
|||||||
Reference in New Issue
Block a user