Derp by me - put the allow config call elsehwere it should be.
This commit is contained in:
parent
6bd1d4a231
commit
458e085964
1 changed files with 33 additions and 34 deletions
|
|
@ -13,38 +13,6 @@
|
|||
fsType = "ext4";
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc.alloy.config.alloy = {
|
||||
text = ''
|
||||
server:
|
||||
http_listen_port: 28183
|
||||
grpc_listen_port: 0
|
||||
|
||||
logs:
|
||||
# keep positions persistent on disk (don't use /tmp in production)
|
||||
positions:
|
||||
filename: /var/lib/grafana-agent/positions.yaml
|
||||
|
||||
configs:
|
||||
- name: journal
|
||||
journal:
|
||||
# keep similar rotation / lookback to your promtail config
|
||||
max_age: 12h
|
||||
labels:
|
||||
job: systemd-journal
|
||||
host: chrysalis
|
||||
|
||||
clients:
|
||||
- url: http://127.0.0.1:3100/loki/api/v1/push
|
||||
|
||||
relabel_configs:
|
||||
- source_labels: ["__journal__systemd_unit"]
|
||||
target_label: "unit"
|
||||
'';
|
||||
owner = "root";
|
||||
group = "root";
|
||||
mode = "0644";
|
||||
};
|
||||
in {
|
||||
options.local = {
|
||||
hostname = lib.mkOption {
|
||||
|
|
@ -196,7 +164,6 @@ in {
|
|||
allow_structured_metadata = false;
|
||||
};
|
||||
|
||||
|
||||
table_manager = {
|
||||
retention_deletes_enabled = false;
|
||||
retention_period = "0s";
|
||||
|
|
@ -208,6 +175,38 @@ in {
|
|||
enable = true;
|
||||
};
|
||||
|
||||
environment.etc.alloy.config.alloy = {
|
||||
text = ''
|
||||
server:
|
||||
http_listen_port: 28183
|
||||
grpc_listen_port: 0
|
||||
|
||||
logs:
|
||||
# keep positions persistent on disk (don't use /tmp in production)
|
||||
positions:
|
||||
filename: /var/lib/grafana-agent/positions.yaml
|
||||
|
||||
configs:
|
||||
- name: journal
|
||||
journal:
|
||||
# keep similar rotation / lookback to your promtail config
|
||||
max_age: 12h
|
||||
labels:
|
||||
job: systemd-journal
|
||||
host: chrysalis
|
||||
|
||||
clients:
|
||||
- url: http://127.0.0.1:3100/loki/api/v1/push
|
||||
|
||||
relabel_configs:
|
||||
- source_labels: ["__journal__systemd_unit"]
|
||||
target_label: "unit"
|
||||
'';
|
||||
owner = "root";
|
||||
group = "root";
|
||||
mode = "0644";
|
||||
};
|
||||
|
||||
# Add a simple systemd service to run the Grafana Agent (Alloy)
|
||||
systemd.services.grafana-agent = {
|
||||
description = "Grafana Alloy";
|
||||
|
|
@ -216,7 +215,7 @@ in {
|
|||
serviceConfig = {
|
||||
# The grafana-agent binary provided by nixpkgs
|
||||
ExecStart = ''
|
||||
${pkgs.grafana-alloy}/bin/alloy
|
||||
${pkgs.grafana-alloy}/bin/alloy run
|
||||
'';
|
||||
|
||||
Restart = "on-failure";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue