Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exporter/datadogexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ func (f *factory) createMetricsExporter(
Metrics: cfg.Metrics,
},
TimeoutConfig: exporterhelper.TimeoutConfig{
Timeout: cfg.Timeout,
Timeout: cfg.ClientConfig.Timeout,
},
ClientConfig: cfg.TLS,
ClientConfig: cfg.ClientConfig.TLS,
QueueBatchConfig: cfg.QueueSettings,
RetryConfig: cfg.BackOffConfig,
API: cfg.API,
Expand Down
2 changes: 1 addition & 1 deletion exporter/datadogexporter/hostmetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func newMetadataConfigfromConfig(cfg *datadogconfig.Config) hostmetadata.PusherC
MetricsEndpoint: cfg.Metrics.Endpoint,
APIKey: string(cfg.API.Key),
UseResourceMetadata: cfg.HostMetadata.HostnameSource == datadogconfig.HostnameSourceFirstResource,
InsecureSkipVerify: cfg.TLS.InsecureSkipVerify,
InsecureSkipVerify: cfg.ClientConfig.TLS.InsecureSkipVerify,
ClientConfig: cfg.ClientConfig,
RetrySettings: cfg.BackOffConfig,
ReporterPeriod: cfg.HostMetadata.ReporterPeriod,
Expand Down
2 changes: 1 addition & 1 deletion exporter/datadogexporter/traces_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func newTraceAgentConfig(ctx context.Context, params exporter.Settings, cfg *dat
acfg.Ignore["resource"] = cfg.Traces.IgnoreResources
acfg.ReceiverEnabled = false // disable HTTP receiver
acfg.AgentVersion = fmt.Sprintf("datadogexporter-%s-%s", params.BuildInfo.Command, params.BuildInfo.Version)
acfg.SkipSSLValidation = cfg.TLS.InsecureSkipVerify
acfg.SkipSSLValidation = cfg.ClientConfig.TLS.InsecureSkipVerify
acfg.ComputeStatsBySpanKind = cfg.Traces.ComputeStatsBySpanKind
acfg.PeerTagsAggregation = cfg.Traces.PeerTagsAggregation
acfg.PeerTags = cfg.Traces.PeerTags
Expand Down
10 changes: 5 additions & 5 deletions pkg/datadog/agentcomponents/agentcomponents.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ func setProxy(cfg *datadogconfig.Config, pkgconfig pkgconfigmodel.Config) {
}

// proxy_url takes precedence over proxy environment variables if set
if cfg.ProxyURL != "" {
pkgconfig.Set("proxy.http", cfg.ProxyURL, pkgconfigmodel.SourceFile)
pkgconfig.Set("proxy.https", cfg.ProxyURL, pkgconfigmodel.SourceFile)
if cfg.ClientConfig.ProxyURL != "" {
pkgconfig.Set("proxy.http", cfg.ClientConfig.ProxyURL, pkgconfigmodel.SourceFile)
pkgconfig.Set("proxy.https", cfg.ClientConfig.ProxyURL, pkgconfigmodel.SourceFile)
}

// If this is set to an empty []string, viper will have a type conflict when merging
Expand All @@ -294,8 +294,8 @@ func setProxy(cfg *datadogconfig.Config, pkgconfig pkgconfigmodel.Config) {
}

func setTLSSetting(cfg *datadogconfig.Config, pkgconfig pkgconfigmodel.Config) {
if cfg.TLS.InsecureSkipVerify {
pkgconfig.Set("skip_ssl_validation", cfg.TLS.InsecureSkipVerify, pkgconfigmodel.SourceFile)
if cfg.ClientConfig.TLS.InsecureSkipVerify {
pkgconfig.Set("skip_ssl_validation", cfg.ClientConfig.TLS.InsecureSkipVerify, pkgconfigmodel.SourceFile)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/datadog/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type TagsConfig struct {

// Config defines configuration for the Datadog exporter.
type Config struct {
confighttp.ClientConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
ClientConfig confighttp.ClientConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
QueueSettings configoptional.Optional[exporterhelper.QueueBatchConfig] `mapstructure:"sending_queue"`
configretry.BackOffConfig `mapstructure:"retry_on_failure"`

Expand Down
18 changes: 9 additions & 9 deletions pkg/datadog/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,15 @@ func TestUnmarshal(t *testing.T) {
maxIdleConn := 300
maxIdleConnPerHost := 150
maxConnPerHost := 250
cfgWithHTTPConfigs.ReadBufferSize = 100
cfgWithHTTPConfigs.WriteBufferSize = 200
cfgWithHTTPConfigs.Timeout = 10 * time.Second
cfgWithHTTPConfigs.MaxIdleConns = maxIdleConn
cfgWithHTTPConfigs.MaxIdleConnsPerHost = maxIdleConnPerHost
cfgWithHTTPConfigs.MaxConnsPerHost = maxConnPerHost
cfgWithHTTPConfigs.IdleConnTimeout = idleConnTimeout
cfgWithHTTPConfigs.DisableKeepAlives = true
cfgWithHTTPConfigs.TLS.InsecureSkipVerify = true
cfgWithHTTPConfigs.ClientConfig.ReadBufferSize = 100
cfgWithHTTPConfigs.ClientConfig.WriteBufferSize = 200
cfgWithHTTPConfigs.ClientConfig.Timeout = 10 * time.Second
cfgWithHTTPConfigs.ClientConfig.MaxIdleConns = maxIdleConn
cfgWithHTTPConfigs.ClientConfig.MaxIdleConnsPerHost = maxIdleConnPerHost
cfgWithHTTPConfigs.ClientConfig.MaxConnsPerHost = maxConnPerHost
cfgWithHTTPConfigs.ClientConfig.IdleConnTimeout = idleConnTimeout
cfgWithHTTPConfigs.ClientConfig.DisableKeepAlives = true
cfgWithHTTPConfigs.ClientConfig.TLS.InsecureSkipVerify = true
cfgWithHTTPConfigs.warnings = nil

tests := []struct {
Expand Down
Loading