services/sso: add tracing

This commit is contained in:
Max Headroom 2022-06-19 00:16:25 +02:00
parent 394533f76c
commit 303532b2fb

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, tools, ... }: { config, inputs, lib, pkgs, tools, ... }:
with tools.nginx; with tools.nginx;
let let
login = "login.${tools.meta.domain}"; login = "login.${tools.meta.domain}";
@ -40,4 +40,15 @@ in
http-relative-path = "/auth"; http-relative-path = "/auth";
}; };
}; };
systemd.services.keycloak.environment = {
JAVA_OPTS = builtins.concatStringsSep " " [
"-javaagent:${inputs.self.packages.${pkgs.system}.opentelemetry-java-agent-bin}"
"-Dotel.resource.attributes=service.name=keycloak"
"-Dotel.traces.exporter=otlp"
];
OTEL_EXPORTER_OTLP_PROTOCOL = "grpc";
OTEL_EXPORTER_OTLP_ENDPOINT = config.links.tempo-otlp-grpc.url;
OTEL_TRACES_SAMPLER = "parentbased_traceidratio";
OTEL_TRACES_SAMPLER_ARG = "0.01";
};
} }