telemetry: removed promtail in favor of Alloy
This commit is contained in:
parent
4da42e98a0
commit
0f45241285
|
@ -94,7 +94,40 @@ in
|
|||
|
||||
loki.write "default" {
|
||||
endpoint {
|
||||
url = "http://${lokiConfig.server.http_listen_address}:${toString lokiConfig.server.http_listen_port}"
|
||||
url = "http://${lokiConfig.server.http_listen_address}:${toString lokiConfig.server.http_listen_port}/loki/api/v1/push"
|
||||
}
|
||||
}
|
||||
|
||||
loki.relabel "journal" {
|
||||
forward_to = []
|
||||
rule {
|
||||
source_labels = ["__journal__systemd_unit"]
|
||||
target_label = "unit"
|
||||
}
|
||||
rule {
|
||||
source_labels = ["__journal__hostname"]
|
||||
target_label = "host"
|
||||
}
|
||||
rule {
|
||||
source_labels = [ "__journal__systemd_user_unit" ]
|
||||
target_label = "user_unit"
|
||||
}
|
||||
rule {
|
||||
source_labels = [ "__journal__transport" ]
|
||||
target_label = "transport"
|
||||
}
|
||||
rule {
|
||||
source_labels = [ "__journal_priority_keyword" ]
|
||||
target_label = "severity"
|
||||
}
|
||||
}
|
||||
|
||||
loki.source.journal "read" {
|
||||
forward_to = [loki.write.default.receiver]
|
||||
relabel_rules = loki.relabel.journal.rules
|
||||
labels = {
|
||||
job = "systemd-journal",
|
||||
component = "loki.source.journal",
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,9 +137,16 @@ in
|
|||
}
|
||||
}
|
||||
|
||||
prometheus.exporter.unix "system" {}
|
||||
|
||||
prometheus.scrape "system" {
|
||||
targets = prometheus.exporter.unix.system.targets
|
||||
forward_to = [prometheus.remote_write.mimir.receiver]
|
||||
}
|
||||
|
||||
prometheus.remote_write "mimir" {
|
||||
endpoint {
|
||||
url = "http://${mimirServer.http_listen_address}:${toString mimirServer.http_listen_port}"
|
||||
url = "http://${mimirServer.http_listen_address}:${toString mimirServer.http_listen_port}/api/v1/push"
|
||||
}
|
||||
}
|
||||
'';
|
||||
|
|
|
@ -39,74 +39,6 @@ in
|
|||
reverse_proxy ${server.http_listen_address}:${toString server.http_listen_port}
|
||||
'';
|
||||
|
||||
|
||||
systemd.tmpfiles.settings = {
|
||||
"promtail-dir" = {
|
||||
"/var/lib/promtail" = {
|
||||
d = {
|
||||
group = "promtail";
|
||||
mode = "0755";
|
||||
user = "promtail";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.promtail = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
server = {
|
||||
http_listen_port = 3031;
|
||||
grpc_listen_port = 0;
|
||||
};
|
||||
clients = [
|
||||
{
|
||||
url = "http://${server.http_listen_address}:${toString server.http_listen_port}/loki/api/v1/push";
|
||||
}
|
||||
];
|
||||
positions = {
|
||||
filename = "/var/lib/promtail/positions.yaml";
|
||||
};
|
||||
scrape_configs = [
|
||||
{
|
||||
job_name = "systemd-journal";
|
||||
relabel_configs = [
|
||||
{
|
||||
source_labels = [ "__journal__hostname" ];
|
||||
target_label = "host";
|
||||
}
|
||||
{
|
||||
source_labels = [ "__journal__systemd_unit" ];
|
||||
target_label = "systemd_unit";
|
||||
regex = ''(.+)'';
|
||||
}
|
||||
{
|
||||
source_labels = [ "__journal__systemd_user_unit" ];
|
||||
target_label = "systemd_user_unit";
|
||||
regex = ''(.+)'';
|
||||
}
|
||||
{
|
||||
source_labels = [ "__journal__transport" ];
|
||||
target_label = "transport";
|
||||
regex = ''(.+)'';
|
||||
}
|
||||
{
|
||||
source_labels = [ "__journal_priority_keyword" ];
|
||||
target_label = "severity";
|
||||
regex = ''(.+)'';
|
||||
}
|
||||
];
|
||||
journal = {
|
||||
labels = {
|
||||
job = "systemd-journal";
|
||||
};
|
||||
path = "/var/log/journal";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
services.loki =
|
||||
let
|
||||
dataDir = config.services.loki.dataDir;
|
||||
|
|
Loading…
Reference in a new issue