From 6201a63159333597b1f1ad210b130447a69a981d Mon Sep 17 00:00:00 2001 From: Sam Calder-Mason Date: Fri, 20 Sep 2024 13:22:18 +1000 Subject: [PATCH] fix: Xatu Keepalive False (#379) * feat(output): Allow keepalive config * fix: Fix pointer dereference in config.KeepAlive.Enabled --- pkg/output/xatu/config.go | 2 +- pkg/output/xatu/exporter.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/output/xatu/config.go b/pkg/output/xatu/config.go index 31f5bb5c..cf90b4ca 100644 --- a/pkg/output/xatu/config.go +++ b/pkg/output/xatu/config.go @@ -20,7 +20,7 @@ type Config struct { } type KeepAliveConfig struct { - Enabled bool `yaml:"enabled" default:"true"` + Enabled *bool `yaml:"enabled" default:"true"` Time time.Duration `yaml:"time" default:"10s"` Timeout time.Duration `yaml:"timeout" default:"30s"` } diff --git a/pkg/output/xatu/exporter.go b/pkg/output/xatu/exporter.go index c621d762..c3be256e 100644 --- a/pkg/output/xatu/exporter.go +++ b/pkg/output/xatu/exporter.go @@ -39,7 +39,7 @@ func NewItemExporter(name string, config *Config, log logrus.FieldLogger) (ItemE grpc.WithChainStreamInterceptor(grpc_prometheus.StreamClientInterceptor, retry.StreamClientInterceptor()), } - if config.KeepAlive.Enabled { + if config.KeepAlive.Enabled != nil && *config.KeepAlive.Enabled { log. WithField("keepalive_time", config.KeepAlive.Time). WithField("keepalive_timeout", config.KeepAlive.Timeout).