Skip to content

Commit

Permalink
fix: Xatu Keepalive False (#379)
Browse files Browse the repository at this point in the history
* feat(output): Allow keepalive config

* fix: Fix pointer dereference in config.KeepAlive.Enabled
  • Loading branch information
samcm authored Sep 20, 2024
1 parent ab67593 commit 6201a63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/output/xatu/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/output/xatu/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 6201a63

Please sign in to comment.