diff --git a/nixos/components/monitor/opentelemetry.nix b/nixos/components/monitor/opentelemetry.nix index 0cc32ac..0878fa1 100644 --- a/nixos/components/monitor/opentelemetry.nix +++ b/nixos/components/monitor/opentelemetry.nix @@ -16,6 +16,11 @@ in default = null; description = "endpoint to ship opentelementry data too"; }; + exporter.debug = mkOption { + type = nullOr (enum [ "logs" "metrics" ]); + default = null; + description = "enable debug exporter."; + }; metrics.endpoint = mkOption { type = str; default = "127.0.0.1:8100"; @@ -64,6 +69,20 @@ in }; }) + (mkIf (config.components.monitor.opentelemetry.exporter.debug != null) { + services.opentelemetry-collector.settings = { + exporters.debug = { + verbosity = "detailed"; + sampling_initial = 5; + sampling_thereafter = 200; + }; + service.pipelines.${config.components.monitor.opentelemetry.exporter.debug} = { + exporters = [ "debug" ]; + }; + + }; + }) + # ship to next instance (mkIf (config.components.monitor.opentelemetry.exporter.endpoint != null) { services.opentelemetry-collector.settings = { diff --git a/nixos/machines/cherry/configuration.nix b/nixos/machines/cherry/configuration.nix index d46806c..4e16fa5 100644 --- a/nixos/machines/cherry/configuration.nix +++ b/nixos/machines/cherry/configuration.nix @@ -33,6 +33,7 @@ components.monitor.enable = true; components.monitor.opentelemetry.exporter.endpoint = "10.100.0.1:4317"; # orbi + #components.monitor.opentelemetry.exporter.debug = "logs"; home-manager.users.mainUser.home.sessionPath = [ "$HOME/.timewarrior/scripts" ];