Add debug flag to opentelemetry.nix

This commit is contained in:
Ingolf Wagner 2024-05-17 22:21:14 +02:00
parent 1b37948192
commit 09138dc3a4
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
2 changed files with 20 additions and 0 deletions

View file

@ -16,6 +16,11 @@ in
default = null; default = null;
description = "endpoint to ship opentelementry data too"; description = "endpoint to ship opentelementry data too";
}; };
exporter.debug = mkOption {
type = nullOr (enum [ "logs" "metrics" ]);
default = null;
description = "enable debug exporter.";
};
metrics.endpoint = mkOption { metrics.endpoint = mkOption {
type = str; type = str;
default = "127.0.0.1:8100"; 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 # ship to next instance
(mkIf (config.components.monitor.opentelemetry.exporter.endpoint != null) { (mkIf (config.components.monitor.opentelemetry.exporter.endpoint != null) {
services.opentelemetry-collector.settings = { services.opentelemetry-collector.settings = {

View file

@ -33,6 +33,7 @@
components.monitor.enable = true; components.monitor.enable = true;
components.monitor.opentelemetry.exporter.endpoint = "10.100.0.1:4317"; # orbi 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" ]; home-manager.users.mainUser.home.sessionPath = [ "$HOME/.timewarrior/scripts" ];