Add OpenTelemetry observability to Arrtrix

- Add OTLP/gRPC observability config and resource attributes
- Instrument webhook and onboarding handlers with tracing and metrics
- Add OpenTelemetry dependencies to go.mod/go.sum
- Update NixOS modules to configure observability settings
This commit is contained in:
Chris Kruining 2026-04-16 10:13:51 +02:00
parent bbfe6867c8
commit 81f34676c4
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
11 changed files with 307 additions and 29 deletions

View file

@ -112,10 +112,9 @@ in {
(mkMautrix "mautrix-telegram" 2 {})
(mkMautrix "mautrix-whatsapp" 3 {})
(mkMautrix "arrtrix" 4 {
settings.network.webhooks.radarr = {
enabled = true;
path = "/_arrtrix/webhooks/radarr";
secret = "";
settings.observability = {
otlp_grpc_endpoint = "http://[::1]:1000";
service_name = "arrtrix";
};
})
{

View file

@ -212,6 +212,18 @@ in {
resource =
{
"${service}_notification_webhook" = mkIf (lib.elem service ["radarr" "sonarr" "whisparr" "lidarr" "readarr"]) {
"arrtrix" =
{
method = 1; # HTTP METHOD 1=POST, 2=PUT
name = "Arrtrix";
url = "http://[::1]${config'.services.arrtrix.settings.appservice.port}";
}
// (lib.optionalAttrs (lib.elem service ["radarr" "whisparr"]) {
onMovieDelete = true;
});
};
"${service}_root_folder" = mkIf (lib.elem service ["radarr" "sonarr" "whisparr"]) (
rootFolders
|> lib.imap (i: f: lib.nameValuePair "local${toString i}" {path = f;})

View file

@ -48,6 +48,11 @@
time_format = " ";
};
};
observability = {
otlp_grpc_endpoint = "";
service_name = "arrtrix";
resource_attributes = {};
};
};
in {
options.services.arrtrix = {