Skip to content

Commit

Permalink
Merge pull request #161 from serokell/rvem/promtail-scrape-container-…
Browse files Browse the repository at this point in the history
…logs

[Chore] Relabel '__journal_container_name' when docker is enabled
  • Loading branch information
rvem authored Apr 9, 2024
2 parents c07005c + f526c5d commit f026b01
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/wireguard-monitoring/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ in {
regex = "(.*);(.+)";
replacement = "$2";
}
];
}] ++ (if config.services.nginx.enable
then [{
] ++ lib.optional (config.virtualisation.docker.enable) {
source_labels = [ "__journal_container_name" ];
target_label = "container";
};
}] ++ (lib.optional (config.services.nginx.enable) {
job_name = "nginx-error-logs";
static_configs = [{
targets = [ "localhost" ];
Expand All @@ -91,7 +93,7 @@ in {
__path__ = "/var/log/nginx/*error.log";
};
}];
}] else [ ]);
});
};
};

Expand Down

0 comments on commit f026b01

Please sign in to comment.