nixos-config/config/services/otel.nix

58 lines
1.3 KiB
Nix
Raw Normal View History

2023-12-10 20:27:33 +00:00
{
config,
pkgs,
...
}: {
2023-12-10 10:27:30 +00:00
services.opentelemetry-collector = {
enable = true;
2023-12-10 20:00:22 +00:00
package = pkgs.opentelemetry-collector-contrib;
2023-12-10 10:27:30 +00:00
settings = {
receivers = {
otlp.protocols = {
grpc = {};
http = {};
};
};
processors.batch = {};
exporters = {
"otlp".endpoint = "nas.int.chir.rs:4317";
2023-12-10 12:57:47 +00:00
otlp.tls.insecure = true;
2023-12-10 20:00:22 +00:00
loki = {
2023-12-10 20:27:33 +00:00
endpoint = "https://nas.int.chir.rs:3100/loki/api/v1/push";
2023-12-10 20:00:22 +00:00
};
2023-12-10 12:57:47 +00:00
};
extensions = {
zpages = {};
};
service = {
extensions = ["zpages"];
pipelines = {
traces = {
receivers = ["otlp"];
processors = ["batch"];
exporters = ["otlp"];
};
metrics = {
receivers = ["otlp"];
processors = ["batch"];
exporters = ["otlp"];
};
logs = {
receivers = ["otlp"];
processors = ["batch"];
2023-12-10 20:00:22 +00:00
exporters = ["loki"];
2023-12-10 12:57:47 +00:00
};
};
telemetry = {
logs.level = "DEBUG";
logs.initial_fields.service = config.networking.hostName;
metrics = {
level = "detailed";
address = "127.0.0.1:63174";
};
};
2023-12-10 10:27:30 +00:00
};
};
};
}